Skip to content
Snippets Groups Projects
Commit 5c856670 authored by dt's avatar dt
Browse files

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.
parent f35a0f54
No related branches found
No related tags found
No related merge requests found
...@@ -310,12 +310,14 @@ void ProjectWindow::handleCurrentItemChanged(QTreeWidgetItem *current) ...@@ -310,12 +310,14 @@ void ProjectWindow::handleCurrentItemChanged(QTreeWidgetItem *current)
void ProjectWindow::handleItem(QTreeWidgetItem *item, int column) void ProjectWindow::handleItem(QTreeWidgetItem *item, int column)
{ {
if (!item || column != 1) // startup project if (!item || column != 1) // startup project
return; return;
const QString path = item->data(2, Qt::UserRole).toString(); const QString path = item->data(2, Qt::UserRole).toString();
Project *project = findProject(path); Project *project = findProject(path);
// Project no longer exists
if (!project)
return;
if (!(item->checkState(1) == Qt::Checked)) { // is now unchecked if (!(item->checkState(1) == Qt::Checked)) { // is now unchecked
if (m_session->startupProject() == project) { if (m_session->startupProject() == project) {
item->setCheckState(1, Qt::Checked); // uncheck not supported item->setCheckState(1, Qt::Checked); // uncheck not supported
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment