Mercurial > octave
diff libgui/src/m-editor/octave-qscintilla.cc @ 25617:44d638d5eea5
reorganize constants for preferences keys and default values
* editor-settings.h: rename into gui-preferences.h
* gui-preferences.h: define a structure for key string and default value,
reorganize existing constants using the new structure, renaming constants
reflecting the main widget they are used in
* file-editor-tab.cc: include gui-preferences.h;
(do_comment_selected_text): use const structure with new names for
preferences keys and default values
file-editor-tab.cc Wed Jul 11 07:56:05 2018 +0200
* octave-qscintilla.cc: include gui-preferences.h;
(comment_string): use const structure with new names for preferences
keys and default values
* module.mk: rename editor-settings.h into gui-preferences.h
* settings-dialog.cc: include gui-preferences.h;
(settings_dialog, write_changed_settings): use const structure with new
names for preferences keys and default values
* settings-dialog.h: include gui-preferences.h, use const structure with new
names for preferences keys and default values
author | Torsten <mttl@mailbox.org> |
---|---|
date | Fri, 13 Jul 2018 22:58:56 +0200 |
parents | d7aafcb1dc1a |
children | 94b8dc8292af |
line wrap: on
line diff
--- a/libgui/src/m-editor/octave-qscintilla.cc Fri Jul 13 22:58:45 2018 +0200 +++ b/libgui/src/m-editor/octave-qscintilla.cc Fri Jul 13 22:58:56 2018 +0200 @@ -50,7 +50,7 @@ #include <QToolTip> #include <QVBoxLayout> -#include "editor-settings.h" +#include "gui-preferences.h" #include "resource-manager.h" #include "shortcut-manager.h" @@ -392,29 +392,29 @@ if (comment) { // The commenting string is requested - if (settings->contains (oct_comment_str)) + if (settings->contains (ed_comment_str.key)) // new version (radio buttons) - comment_string = settings->value (oct_comment_str, - oct_comment_str_d).toInt (); + comment_string = settings->value (ed_comment_str.key, + ed_comment_str.def).toInt (); else // old version (combo box) - comment_string = settings->value (oct_comment_str_old, - oct_comment_str_d).toInt (); + comment_string = settings->value (ed_comment_str_old.key, + ed_comment_str.def).toInt (); - return (QStringList (oct_comment_strings.at (comment_string))); + return (QStringList (ed_comment_strings.at (comment_string))); } else { QStringList c_str; // The possible uncommenting string(s) are requested - comment_string = settings->value (oct_uncomment_str, - oct_uncomment_str_d).toInt (); + comment_string = settings->value (ed_uncomment_str.key, + ed_uncomment_str.def).toInt (); - for (int i = 0; i < oct_comment_strings_count; i++) + for (int i = 0; i < ed_comment_strings_count; i++) { if (1 << i & comment_string) - c_str.append (oct_comment_strings.at (i)); + c_str.append (ed_comment_strings.at (i)); } return c_str;