Mercurial > octave
diff libgui/src/qt-interpreter-events.cc @ 27914:a044e50c8dcb
Streamline QRegExp instances in libgu.
* file-editor-tab.cc (do_comment_selected_text): Use non-capturing grouping.
* octave-qscintilla.cc (smart_indent): Use non-capturing grouping for ekey,
mkey, case_key, and stand-alone QRegExp.
* octave-qscintilla.cc (smart_indent_line_or_selected_text): Use non-capturing
grouping for end_word_regexp, begin_block_regexp, mid_block_regexp,
end_block_regexp, case_block_regexp.
* qt-interpreter-events.cc (make_filter_list): Use C++ Raw string to
define QRegExp with lots of backslashes.
* variable-editor.cc (variable_editor_stack::levulUp): Rewrite QRegExp
to use character classes to get rid of excessive backslashes.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 06 Jan 2020 10:18:00 -0800 |
parents | 28d7ec92bae6 |
children | b442ec6dda5c |
line wrap: on
line diff
--- a/libgui/src/qt-interpreter-events.cc Sat Jan 04 17:16:59 2020 -0800 +++ b/libgui/src/qt-interpreter-events.cc Mon Jan 06 10:18:00 2020 -0800 @@ -84,10 +84,9 @@ QString ext = QString::fromStdString (ext_name.first); QString name = QString::fromStdString (ext_name.second); - // Strip out extensions from name and replace ';' with spaces in - // list. + // Strip out extensions from name and replace ';' with spaces in list. - name.replace (QRegExp ("\\(.*\\)"), ""); + name.replace (QRegExp (R"(\(.*\))"), ""); ext.replace (";", " "); if (name.isEmpty ())