changeset 24639:1c90b6d357ec

more style fixes for variable editor * variable-editor.cc (variable_editor::notice_settings): Omit unnecessary explicit uses of QVariant constructor. Use integer values directly instead of strings.
author John W. Eaton <jwe@octave.org>
date Thu, 25 Jan 2018 23:44:54 -0500
parents a3031d4967ce
children 534436fd5607
files libgui/src/variable-editor.cc
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/variable-editor.cc	Tue Jan 23 19:22:44 2018 -0600
+++ b/libgui/src/variable-editor.cc	Thu Jan 25 23:44:54 2018 -0500
@@ -339,10 +339,10 @@
   // FIXME: Why use object->tostring->toint?  Why not just 100?
 
   m_default_width = settings->value ("variable_editor/column_width",
-                                     QVariant ("100")).toString ().toInt ();
+                                     100).toInt ();
 
   m_autofit = settings->value ("variable_editor/autofit_column_width",
-                               QVariant (false)).toBool ();
+                               false).toBool ();
 
   // FIXME: Magic Number 1 here, why not use enum?
 
@@ -353,10 +353,10 @@
     }
 
   m_default_height = settings->value ("variable_editor/row_height",
-                                      QVariant ("10")).toString ().toInt ();
+                                      10).toInt ();
 
   m_alternate_rows = settings->value ("variable_editor/alternate_rows",
-                                      QVariant (false)).toBool ();
+                                      false).toBool ();
 
   QList<QColor> _default_colors = resource_manager::varedit_default_colors ();
 
@@ -375,7 +375,10 @@
     }
   else
     {
-      font_name = settings->value ("variable_editor/font_name", settings->value ("terminal/fontName", "Courier New")).toString ();
+      font_name = settings->value ("variable_editor/font_name",
+                                   settings->value ("terminal/fontName",
+                                                    "Courier New")).toString ();
+
       font_size = settings->value ("variable_editor/font_size", 10).toInt ();
     }
 
@@ -393,6 +396,7 @@
   for (int i = 0; i < class_chars.length (); i++)
     {
       QVariant default_var = _default_colors.at (i);
+
       QColor setting_color = settings->value ("variable_editor/color_"
                                               + class_chars.mid (i, 1),
                                               default_var).value<QColor> ();