Mercurial > octave
changeset 21371:dc3252099232
Allow GUI build with QScintilla 2.4 (bug #47226).
* octave-qscintilla.cc (contextmenu_break_condition, contextmenu_break_once):
Move #ifdef HAVE_QSCI_VERSON_2_6_0 inside function definition.
* octave-qscintilla.cc (contextMenuEvent): Remove separate context menu
for right-mouse-button in left margin, if ! HAVE_QSCI_VERSION_2_6_0.
author | Lachlan Andrew <lachlanbis@gmail.com> |
---|---|
date | Wed, 24 Feb 2016 20:16:20 +1100 |
parents | df5922f77193 |
children | a1aa52bff079 |
files | libgui/src/m-editor/octave-qscintilla.cc |
diffstat | 1 files changed, 8 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/m-editor/octave-qscintilla.cc Sat Feb 27 20:08:39 2016 -0500 +++ b/libgui/src/m-editor/octave-qscintilla.cc Wed Feb 24 20:16:20 2016 +1100 @@ -216,7 +216,9 @@ global_pos = editor_rect.topLeft (); // yes, take top left corner } +#ifdef HAVE_QSCI_VERSION_2_6_0 if (! in_left_margin) +#endif { // fill context menu with editor's standard actions emit create_context_menu_signal (context_menu); @@ -242,6 +244,7 @@ } } } +#ifdef HAVE_QSCI_VERSION_2_6_0 else { // remove all standard actions from scintilla @@ -255,6 +258,7 @@ SLOT (contextmenu_break_condition (bool))); a->setData (local_pos); } +#endif // finaly show the menu context_menu->exec (global_pos); @@ -301,11 +305,11 @@ // wrappers for dbstop related context menu items -#ifdef HAVE_QSCI_VERSION_2_6_0 // FIXME Why can't the data be sent as the argument to the function??? void octave_qscintilla::contextmenu_break_condition (bool) { +#ifdef HAVE_QSCI_VERSION_2_6_0 QAction *action = qobject_cast<QAction *>(sender()); QPoint local_pos = action->data ().value<QPoint> (); @@ -314,23 +318,17 @@ local_pos = QPoint (margins + 1, local_pos.y ()); emit context_menu_break_condition_signal (lineAt (local_pos)); +#endif } void octave_qscintilla::contextmenu_break_once (const QPoint& local_pos) { +#ifdef HAVE_QSCI_VERSION_2_6_0 emit context_menu_break_once (lineAt (local_pos)); +#endif } -/* -void -octave_qscintilla::contextmenu_break_if_caught (bool) -{ - emit context_menu_break_if_caught -} -*/ -#endif // HAVE_QSCI_VERSION_2_6_0 - void octave_qscintilla::text_changed () {