diff src/filestatuswidget.cpp @ 548:dca5bd5b2a06

Merge from branch "fswatcher"
author Chris Cannam
date Tue, 14 Feb 2012 17:55:39 +0000
parents 7829da6abe97
children a1d210c767ab
line wrap: on
line diff
--- a/src/filestatuswidget.cpp	Fri Feb 10 13:08:07 2012 +0000
+++ b/src/filestatuswidget.cpp	Tue Feb 14 17:55:39 2012 +0000
@@ -178,6 +178,13 @@
     return m_showAllFiles->isChecked();
 }
 
+bool FileStatusWidget::shouldShow(FileStates::State s) const
+{
+    if (shouldShowAll()) return true;
+    else return (s != FileStates::Clean &&
+                 s != FileStates::Ignored);
+}
+
 QString FileStatusWidget::labelFor(FileStates::State s, bool addHighlightExplanation)
 {
     QSettings settings;
@@ -193,11 +200,9 @@
                 .arg(m_simpleLabels[s])
                 .arg(m_descriptions[s]);
         }
-    } else {
-        return QString("<qt><b>%1</b></qt>")
-            .arg(m_simpleLabels[s]);
     }
-    settings.endGroup();
+    return QString("<qt><b>%1</b></qt>")
+        .arg(m_simpleLabels[s]);
 }
 
 void FileStatusWidget::setNoModificationsLabelText()
@@ -425,6 +430,12 @@
 
         QListWidget *w = m_stateListMap[s];
         w->clear();
+
+        if (!shouldShow(s)) {
+            w->parentWidget()->hide();
+            continue;
+        }
+
         QStringList files = m_fileStates.filesInState(s);
 
         QStringList highPriority, lowPriority;