changeset 16733:2723d1144f11

added test for qscintilla version 2.6.0 * configure.ac: rename test OCTAVE_CHECK_FUNC_FINDFIRST_MODERN into OCTAVE_CHECK_VERSION_2_6_0 * m4/acinclude.m4: rename test accordingly, rename the defined flag into HAVE_QSCI_VERSION_2_6_0 * octave-qscintilla.cc/.h: disable contextMenuEvent for qsci version < 2.6.0
author Torsten <ttl@justmail.de>
date Sat, 08 Jun 2013 16:16:52 +0200
parents 3806afcf974a
children 67b67fc0969a
files configure.ac libgui/src/m-editor/octave-qscintilla.cc libgui/src/m-editor/octave-qscintilla.h m4/acinclude.m4
diffstat 4 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Sat Jun 08 11:22:10 2013 +0800
+++ b/configure.ac	Sat Jun 08 16:16:52 2013 +0200
@@ -2645,7 +2645,7 @@
       ## Let's assume Qscintilla library is at the same location as
       ## other regular Qt libraries.
       QT_LIBS="$QT_LIBS -lqscintilla2"
-      OCTAVE_CHECK_FUNC_FINDFIRST_MODERN
+      OCTAVE_CHECK_VERSION_2_6_0
       AC_DEFINE(HAVE_QSCINTILLA, 1, 
         [Define to 1 if the QScintilla library and header files are available])
 
--- a/libgui/src/m-editor/octave-qscintilla.cc	Sat Jun 08 11:22:10 2013 +0800
+++ b/libgui/src/m-editor/octave-qscintilla.cc	Sat Jun 08 16:16:52 2013 +0200
@@ -37,6 +37,7 @@
 { }
 
 
+#ifdef HAVE_QSCI_VERSION_2_6_0
 // context menu requested
 void
 octave_qscintilla::contextMenuEvent (QContextMenuEvent *e)
@@ -74,6 +75,7 @@
 
   context_menu->exec (global_pos);
 }
+#endif
 
 
 // handle the menu entry for calling help
--- a/libgui/src/m-editor/octave-qscintilla.h	Sat Jun 08 11:22:10 2013 +0800
+++ b/libgui/src/m-editor/octave-qscintilla.h	Sat Jun 08 16:16:52 2013 +0200
@@ -36,7 +36,9 @@
   octave_qscintilla (QWidget *p);
   ~octave_qscintilla ();
 
+#ifdef HAVE_QSCI_VERSION_2_6_0
   virtual void contextMenuEvent (QContextMenuEvent *e);
+#endif
 
 signals:
 
--- a/m4/acinclude.m4	Sat Jun 08 11:22:10 2013 +0800
+++ b/m4/acinclude.m4	Sat Jun 08 16:16:52 2013 +0200
@@ -194,14 +194,13 @@
   fi
 ])
 dnl
-dnl Check whether Qscintilla FindFirst function is old (16 inputs) or
-dnl new (17 inputs).
+dnl Check whether Qscintilla has version 2.6.0 or later
 dnl FIXME: This test uses a version number.  It potentially could
 dnl        be re-written to actually call the function, but is it worth it?
 dnl
-AC_DEFUN([OCTAVE_CHECK_FUNC_FINDFIRST_MODERN], [
-  AC_CACHE_CHECK([whether Qscintilla FindFirst uses 17 input arguments],
-    [octave_cv_func_findfirst_modern],
+AC_DEFUN([OCTAVE_CHECK_VERSION_2_6_0], [
+  AC_CACHE_CHECK([whether Qscintilla has version 2.6.0 or later],
+    [octave_cv_version_2_6_0],
     [AC_LANG_PUSH(C++)
     ac_octave_save_CPPFLAGS="$CPPFLAGS"
     CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS"
@@ -212,14 +211,14 @@
         #error Old FindFirst function found.
         #endif
         ]])],
-      octave_cv_func_findfirst_modern=yes,
-      octave_cv_func_findfirst_modern=no)
+      octave_cv_version_2_6_0=yes,
+      octave_cv_version_2_6_0=no)
     CPPFLAGS="$ac_octave_save_CPPFLAGS"
     AC_LANG_POP(C++)
   ])
-  if test $octave_cv_func_findfirst_modern = yes; then
-    AC_DEFINE(HAVE_FINDFIRST_MODERN, 1, 
-      [Define to 1 if Qscintilla FindFirst uses modern form with 17 inputs.])
+  if test $octave_cv_version_2_6_0 = yes; then
+    AC_DEFINE(HAVE_QSCI_VERSION_2_6_0, 1,
+      [Define to 1 if Qscintilla is of Version 2.6.0 or later.])
   fi
 ])
 dnl