Mercurial > hg > easyhg
comparison filestatuswidget.cpp @ 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 | 9734fb0d6fff |
children | 70fe12873106 |
comparison
equal
deleted
inserted
replaced
134:1208d9688a8f | 135:908a1fdeed6a |
---|---|
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 void FileStatusWidget::itemSelectionChanged() | 137 void FileStatusWidget::itemSelectionChanged() |
138 { | 138 { |
139 DEBUG << "FileStatusWidget::itemSelectionChanged" << endl; | |
140 | |
141 QListWidget *list = qobject_cast<QListWidget *>(sender()); | |
142 | |
143 if (list) { | |
144 foreach (QListWidget *w, m_stateListMap) { | |
145 if (w != list) { | |
146 w->blockSignals(true); | |
147 w->clearSelection(); | |
148 w->blockSignals(false); | |
149 } | |
150 } | |
151 } | |
152 | |
139 m_selectedFiles.clear(); | 153 m_selectedFiles.clear(); |
140 | |
141 DEBUG << "FileStatusWidget::itemSelectionChanged" << endl; | |
142 | 154 |
143 foreach (QListWidget *w, m_stateListMap) { | 155 foreach (QListWidget *w, m_stateListMap) { |
144 QList<QListWidgetItem *> sel = w->selectedItems(); | 156 QList<QListWidgetItem *> sel = w->selectedItems(); |
145 foreach (QListWidgetItem *i, sel) { | 157 foreach (QListWidgetItem *i, sel) { |
146 m_selectedFiles.push_back(i->text()); | 158 m_selectedFiles.push_back(i->text()); |