Commit 2eacd1b7 authored by dt's avatar dt
Browse files

Fix crash in the project mode.

Reviewed-By: con
parent 109b9d8e
......@@ -57,7 +57,8 @@ namespace {
bool debug = false;
}
ProjectWindow::ProjectWindow(QWidget *parent) : QWidget(parent)
ProjectWindow::ProjectWindow(QWidget *parent)
: QWidget(parent), m_currentItemChanged(false)
{
setWindowTitle(tr("Project Explorer"));
setWindowIcon(QIcon(":/projectexplorer/images/projectexplorer.png"));
......@@ -253,16 +254,20 @@ Project *ProjectWindow::findProject(const QString &path) const
void ProjectWindow::handleCurrentItemChanged(QTreeWidgetItem *current)
{
if (m_currentItemChanged)
return;
m_currentItemChanged = true;
if (current) {
QString path = current->data(2, Qt::UserRole).toString();
if (Project *project = findProject(path)) {
m_projectExplorer->setCurrentFile(project, path);
showProperties(project, QModelIndex());
m_currentItemChanged = false;
return;
}
} else {
showProperties(0, QModelIndex());
}
showProperties(0, QModelIndex());
m_currentItemChanged = false;
}
......
......@@ -79,6 +79,7 @@ private:
QList<PropertiesPanel*> m_panels;
Project *findProject(const QString &path) const;
bool m_currentItemChanged;
};
} // namespace Internal
......
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