Commit 488e8334 authored by dt's avatar dt
Browse files

Sort names in mini target selector

Task-Nr: QTCREATORBUG-1935
parent cce21d43
......@@ -440,9 +440,17 @@ void MiniProjectTargetSelector::addProject(ProjectExplorer::Project* project)
ProjectListWidget *targetList = new ProjectListWidget(project);
targetList->setStyleSheet(QString::fromLatin1("QListWidget { background: %1; border: none; }")
.arg(QColor(70, 70, 70).name()));
int pos = m_widgetStack->addWidget(targetList);
m_projectsBox->addItem(project->displayName(), QVariant::fromValue(project));
m_ignoreIndexChange = true;
int pos = 0;
for (int i=0; i < m_projectsBox->count(); ++i)
if (m_projectsBox->itemText(i) > project->displayName())
pos = i;
m_widgetStack->insertWidget(pos, targetList);
m_projectsBox->insertItem(pos, project->displayName(), QVariant::fromValue(project));
connect(project, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),
SLOT(updateAction()));
......@@ -459,6 +467,8 @@ void MiniProjectTargetSelector::addProject(ProjectExplorer::Project* project)
m_widgetStack->setCurrentIndex(pos);
}
m_ignoreIndexChange = false;
foreach (Target *t, project->targets())
addTarget(t, t == project->activeTarget());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment