diff src/mainwindow.cpp @ 484:896b7903e8f2

Make "Show all files" persistent (fixing #203), and rationalise some config group names (noting that "General" is actually the default group "" as it appears in the config file, not the name of a group called "General": that appears as "%General")
author Chris Cannam
date Wed, 17 Aug 2011 16:09:04 +0100
parents a582c6417004
children 86cdaa346e59
line wrap: on
line diff
--- a/src/mainwindow.cpp	Wed Aug 17 15:53:17 2011 +0100
+++ b/src/mainwindow.cpp	Wed Aug 17 16:09:04 2011 +0100
@@ -111,8 +111,8 @@
 
     connect(m_hgTabs, SIGNAL(selectionChanged()),
             this, SLOT(enableDisableActions()));
-    connect(m_hgTabs, SIGNAL(showAllChanged(bool)),
-            this, SLOT(showAllChanged(bool)));
+    connect(m_hgTabs, SIGNAL(showAllChanged()),
+            this, SLOT(showAllChanged()));
 
     setUnifiedTitleAndToolBarOnMac(true);
     connectActions();
@@ -206,9 +206,8 @@
     m_hgTabs->clearSelections();
 }
 
-void MainWindow::showAllChanged(bool s)
+void MainWindow::showAllChanged()
 {
-    m_showAllFiles = s;
     hgQueryPaths();
 }
 
@@ -257,6 +256,8 @@
 
 void MainWindow::hgQueryPaths()
 {
+    m_showAllFiles = m_hgTabs->shouldShowAll();
+
     // Quickest is to just read the file
 
     QFileInfo hgrc(m_workFolderPath + "/.hg/hgrc");
@@ -1334,7 +1335,7 @@
                      MultiChoiceDialog::DirectoryArg);
 
         QSettings settings;
-        settings.beginGroup("General");
+        settings.beginGroup("");
         QString lastChoice = settings.value("lastopentype", "remote").toString();
         if (lastChoice != "local" &&
             lastChoice != "remote" &&
@@ -2445,7 +2446,6 @@
     case ACT_TEST_HG:
     {
         QSettings settings;
-        settings.beginGroup("General");
         if (settings.value("useextension", true).toBool()) {
             hgTestExtension();
         } else if (m_workFolderPath == "") {