changeset 135:908a1fdeed6a

* Ensure only one list can contain a selection at once in file status widget
author Chris Cannam
date Tue, 30 Nov 2010 13:08:18 +0000
parents 1208d9688a8f
children d66fcf2e0342
files filestatuswidget.cpp
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/filestatuswidget.cpp	Tue Nov 30 13:07:53 2010 +0000
+++ b/filestatuswidget.cpp	Tue Nov 30 13:08:18 2010 +0000
@@ -136,10 +136,22 @@
 
 void FileStatusWidget::itemSelectionChanged()
 {
+    DEBUG << "FileStatusWidget::itemSelectionChanged" << endl;
+
+    QListWidget *list = qobject_cast<QListWidget *>(sender());
+
+    if (list) {
+        foreach (QListWidget *w, m_stateListMap) {
+            if (w != list) {
+                w->blockSignals(true);
+                w->clearSelection();
+                w->blockSignals(false);
+            }
+        }
+    }
+
     m_selectedFiles.clear();
 
-    DEBUG << "FileStatusWidget::itemSelectionChanged" << endl;
-
     foreach (QListWidget *w, m_stateListMap) {
         QList<QListWidgetItem *> sel = w->selectedItems();
         foreach (QListWidgetItem *i, sel) {