]> https://gitweb.dealii.org/ - parameter_gui.git/commitdiff
Address comments 9/head
authorRene Gassmoeller <rene.gassmoeller@mailbox.org>
Fri, 7 Apr 2017 21:55:28 +0000 (15:55 -0600)
committerRene Gassmoeller <rene.gassmoeller@mailbox.org>
Fri, 7 Apr 2017 21:55:28 +0000 (15:55 -0600)
mainwindow.cpp
mainwindow.h

index 3e2674700f14d1dd071121d078d32a3c9306adca..b129089e2d43ee5b0c294803db10f027f1ad4053 100644 (file)
@@ -119,8 +119,8 @@ namespace dealii
           font.setWeight(QFont::Normal);
           item->setFont(1,font);
 
-          const bool hide_default_items = gui_settings->value("Settings/hideDefault", false).toBool();
-          if (hide_default_items)
+          const bool hide_items_with_default_value = gui_settings->value("Settings/hideDefault", false).toBool();
+          if (hide_items_with_default_value)
             item->setHidden(true);
         }
       else
@@ -311,7 +311,7 @@ namespace dealii
       if (hide_default_values)
         {
         for (int i = 0; i < tree_widget->topLevelItemCount(); ++i)
-            hide_default_item(tree_widget->topLevelItem(i));
+            hide_item_with_default_value(tree_widget->topLevelItem(i));
         hide_default->setChecked(true);
         }
       else
@@ -328,7 +328,7 @@ namespace dealii
 
 
 
-    bool MainWindow::hide_default_item(QTreeWidgetItem *item)
+    bool MainWindow::hide_item_with_default_value(QTreeWidgetItem *item)
     {
       bool has_default_value = true;
 
@@ -341,9 +341,10 @@ namespace dealii
         }
       else
         {
+          // If this element has children recurse into them and check for default values
           for (int i = 0; i < item->childCount(); ++i)
             {
-              const bool child_has_default_value = hide_default_item(item->child(i));
+              const bool child_has_default_value = hide_item_with_default_value(item->child(i));
               has_default_value = has_default_value & child_has_default_value;
             }
         }
index 1f48dafaa4864fe45d69f7b13e1b39877721ab98..7008af3308a0ec7571cdd4cc8d23bb630fab17e9 100644 (file)
@@ -193,7 +193,7 @@ namespace dealii
          * and hide all default items. Returns true if the item and all of its
          * children have default values.
          */
-        bool hide_default_item(QTreeWidgetItem *item);
+        bool hide_item_with_default_value(QTreeWidgetItem *item);
 
                                     /**
                                      * This is the tree structure in which we store all parameters.

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.