From 096a821c2d015e103cf0a7b2f9f58720319d88a5 Mon Sep 17 00:00:00 2001 From: dt <qtc-committer@nokia.com> Date: Mon, 27 Jul 2009 13:49:31 +0200 Subject: [PATCH] Make the logic easier to understand for setting the startup project On the Project Mode. Might fix a bug hjk found, which i can't reproduce. --- src/plugins/projectexplorer/projectwindow.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 48811707c12..6636498e086 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -316,13 +316,13 @@ void ProjectWindow::handleItem(QTreeWidgetItem *item, int column) const QString path = item->data(2, Qt::UserRole).toString(); Project *project = findProject(path); - if (project && project->isApplication()) { - if (!(item->checkState(1) == Qt::Checked)) { // is now unchecked - if (m_session->startupProject() == project) { - item->setCheckState(1, Qt::Checked); // uncheck not supported - } - } else { // is now checked - m_session->setStartupProject(project); - } - } + if (!(item->checkState(1) == Qt::Checked)) { // is now unchecked + if (m_session->startupProject() == project) { + item->setCheckState(1, Qt::Checked); // uncheck not supported + } + } else if (project && project->isApplication()) { // is now checked + m_session->setStartupProject(project); + } else { + item->setCheckState(1, Qt::Unchecked); // check not supported + } } -- GitLab