forked from qt-creator/qt-creator
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:
@@ -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
|
||||||
|
Reference in New Issue
Block a user