QmlProject: Update current file name if file gets renamed

Task-number: QTCREATORBUG-10630
Change-Id: I7901b1204a389e6b9349e059186d0e89f7437740
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Kai Koehne
2013-11-05 13:30:08 +01:00
parent 686e523f29
commit fbe855126b
2 changed files with 6 additions and 1 deletions

View File

@@ -92,6 +92,8 @@ void QmlProjectRunConfiguration::ctor()
// reset default settings in constructor
connect(EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)),
this, SLOT(changeCurrentFile(Core::IEditor*)));
connect(EditorManager::instance(), SIGNAL(currentDocumentStateChanged()),
this, SLOT(changeCurrentFile()));
connect(target(), SIGNAL(kitChanged()),
this, SLOT(updateEnabled()));
@@ -263,6 +265,9 @@ bool QmlProjectRunConfiguration::fromMap(const QVariantMap &map)
void QmlProjectRunConfiguration::changeCurrentFile(IEditor *editor)
{
if (!editor)
editor = EditorManager::currentEditor();
if (editor)
m_currentFileFilename = editor->document()->filePath();
updateEnabled();