forked from qt-creator/qt-creator
QmakeProject: SetCurrentNode after renaming
The ProjectExplorer sets the current node after renaming, but since the qmake project manager is still parsing, that doesn't actually work. So we do set the current node via a small hack. Change-Id: Ideefef82740529f7acc71b4d0c467d6818a49710 Reviewed-by: Robert Loehning <robert.loehning@digia.com> Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
#include "qmakerunconfigurationfactory.h"
|
#include "qmakerunconfigurationfactory.h"
|
||||||
|
|
||||||
#include <projectexplorer/nodesvisitor.h>
|
#include <projectexplorer/nodesvisitor.h>
|
||||||
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
#include <coreplugin/fileiconprovider.h>
|
#include <coreplugin/fileiconprovider.h>
|
||||||
@@ -771,6 +772,10 @@ void QmakePriFileNode::update(const Internal::PriFileEvalResult &result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
contents.updateSubFolders(this);
|
contents.updateSubFolders(this);
|
||||||
|
if (!m_setCurrentNodeDelayed.isEmpty()) {
|
||||||
|
ProjectExplorer::ProjectExplorerPlugin::setCurrentFile(m_project, m_setCurrentNodeDelayed);
|
||||||
|
m_setCurrentNodeDelayed.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmakePriFileNode::watchFolders(const QSet<QString> &folders)
|
void QmakePriFileNode::watchFolders(const QSet<QString> &folders)
|
||||||
@@ -1112,6 +1117,7 @@ bool QmakePriFileNode::renameFile(const QString &filePath, const QString &newFil
|
|||||||
changeFiles(mt.type(), QStringList() << newFilePath, &dummy, AddToProFile);
|
changeFiles(mt.type(), QStringList() << newFilePath, &dummy, AddToProFile);
|
||||||
if (!dummy.isEmpty() && !changeProFileOptional)
|
if (!dummy.isEmpty() && !changeProFileOptional)
|
||||||
return false;
|
return false;
|
||||||
|
m_setCurrentNodeDelayed = newFilePath;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -240,6 +240,7 @@ private:
|
|||||||
QSet<Utils::FileName> m_recursiveEnumerateFiles;
|
QSet<Utils::FileName> m_recursiveEnumerateFiles;
|
||||||
QSet<QString> m_watchedFolders;
|
QSet<QString> m_watchedFolders;
|
||||||
bool m_includedInExactParse;
|
bool m_includedInExactParse;
|
||||||
|
QString m_setCurrentNodeDelayed;
|
||||||
|
|
||||||
// managed by QmakeProFileNode
|
// managed by QmakeProFileNode
|
||||||
friend class QmakeProjectManager::QmakeProFileNode;
|
friend class QmakeProjectManager::QmakeProFileNode;
|
||||||
|
|||||||
Reference in New Issue
Block a user