summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/taskwindow.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2011-10-12 15:48:59 +0200
committerKai Koehne <kai.koehne@nokia.com>2011-10-12 16:14:55 +0200
commit9ae35f797206a650f53b0ddbab63910f4d10d8ba (patch)
treead24608f1a0830e0a6425b402affd28775c8f50b /src/plugins/projectexplorer/taskwindow.cpp
parent55ebeddb1cee95a5cc569280ef3af3a022e42fd6 (diff)
downloadqt-creator-9ae35f797206a650f53b0ddbab63910f4d10d8ba.tar.gz
Task Pane: Sort list of filters alphabetically
Change-Id: Ife88fd800da42d45c859a5637bfa4259f898add2 Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Diffstat (limited to 'src/plugins/projectexplorer/taskwindow.cpp')
-rw-r--r--src/plugins/projectexplorer/taskwindow.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp
index ebbe5e0728..d024f32ec6 100644
--- a/src/plugins/projectexplorer/taskwindow.cpp
+++ b/src/plugins/projectexplorer/taskwindow.cpp
@@ -464,15 +464,17 @@ void TaskWindow::updateCategoriesMenu()
const QStringList filteredCategories = d->m_filter->filteredCategories();
- foreach (const QString &categoryId, d->m_model->categoryIds()) {
- const QString categoryName = d->m_model->categoryDisplayName(categoryId);
+ QMap<QString, QString> nameToIds;
+ foreach (const QString &categoryId, d->m_model->categoryIds())
+ nameToIds.insert(d->m_model->categoryDisplayName(categoryId), categoryId);
+ foreach (const QString &displayName, nameToIds.keys()) {
+ const QString categoryId = nameToIds.value(displayName);
QAction *action = new QAction(d->m_categoriesMenu);
action->setCheckable(true);
- action->setText(categoryName);
+ action->setText(displayName);
action->setData(categoryId);
action->setChecked(!filteredCategories.contains(categoryId));
-
d->m_categoriesMenu->addAction(action);
}
}