Break a infinite loop.

Removing the last project did set startupproject to zero and unloaded
the project. Thus the check that the project for the current item and
the startup project are both null and the same.
This commit is contained in:
dt
2009-07-27 15:22:03 +02:00
parent f35a0f5429
commit 5c8566709d

View File

@@ -310,12 +310,14 @@ void ProjectWindow::handleCurrentItemChanged(QTreeWidgetItem *current)
void ProjectWindow::handleItem(QTreeWidgetItem *item, int column)
{
if (!item || column != 1) // startup project
return;
const QString path = item->data(2, Qt::UserRole).toString();
Project *project = findProject(path);
// Project no longer exists
if (!project)
return;
if (!(item->checkState(1) == Qt::Checked)) { // is now unchecked
if (m_session->startupProject() == project) {
item->setCheckState(1, Qt::Checked); // uncheck not supported