forked from qt-creator/qt-creator
Remove broken code that tried to select the project node
This code only works in some cases Change-Id: I7469ed2f14da4307cc6a3864a50eb577383082b3 Reviewed-on: http://codereview.qt.nokia.com/1079 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -101,8 +101,7 @@ ProjectTreeWidget::ProjectTreeWidget(QWidget *parent)
|
|||||||
m_model(0),
|
m_model(0),
|
||||||
m_filterProjectsAction(0),
|
m_filterProjectsAction(0),
|
||||||
m_autoSync(false),
|
m_autoSync(false),
|
||||||
m_autoExpand(true),
|
m_autoExpand(true)
|
||||||
m_currentItemLocked(0)
|
|
||||||
{
|
{
|
||||||
m_model = new FlatModel(m_explorer->session()->sessionNode(), this);
|
m_model = new FlatModel(m_explorer->session()->sessionNode(), this);
|
||||||
Project *pro = m_explorer->session()->startupProject();
|
Project *pro = m_explorer->session()->startupProject();
|
||||||
@@ -282,13 +281,6 @@ void ProjectTreeWidget::setCurrentItem(Node *node, Project *project)
|
|||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "ProjectTreeWidget::setCurrentItem(" << (project ? project->displayName() : "0")
|
qDebug() << "ProjectTreeWidget::setCurrentItem(" << (project ? project->displayName() : "0")
|
||||||
<< ", " << (node ? node->path() : "0") << ")";
|
<< ", " << (node ? node->path() : "0") << ")";
|
||||||
if (m_currentItemLocked) {
|
|
||||||
if (m_currentItemLocked == node) {
|
|
||||||
m_currentItemLocked = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_currentItemLocked = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!project) {
|
if (!project) {
|
||||||
return;
|
return;
|
||||||
@@ -326,10 +318,6 @@ void ProjectTreeWidget::showContextMenu(const QPoint &pos)
|
|||||||
|
|
||||||
void ProjectTreeWidget::handleProjectAdded(ProjectExplorer::Project *project)
|
void ProjectTreeWidget::handleProjectAdded(ProjectExplorer::Project *project)
|
||||||
{
|
{
|
||||||
// We disable auto-synchronization for the current node so that the project
|
|
||||||
// is selected until another file is opened
|
|
||||||
m_currentItemLocked = m_model->nodeForIndex(m_view->currentIndex());
|
|
||||||
|
|
||||||
Node *node = project->rootProjectNode();
|
Node *node = project->rootProjectNode();
|
||||||
QModelIndex idx = m_model->indexForNode(node);
|
QModelIndex idx = m_model->indexForNode(node);
|
||||||
if (m_autoExpand) // disabled while session restoring
|
if (m_autoExpand) // disabled while session restoring
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ private:
|
|||||||
QString m_modelId;
|
QString m_modelId;
|
||||||
bool m_autoSync;
|
bool m_autoSync;
|
||||||
bool m_autoExpand;
|
bool m_autoExpand;
|
||||||
Node *m_currentItemLocked;
|
|
||||||
friend class ProjectTreeWidgetFactory;
|
friend class ProjectTreeWidgetFactory;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user