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

View File

@@ -91,7 +91,7 @@ public:
ProjectExplorer::Abi abi() const; ProjectExplorer::Abi abi() const;
private slots: private slots:
void changeCurrentFile(Core::IEditor*); void changeCurrentFile(Core::IEditor* = 0);
void updateEnabled(); void updateEnabled();
protected: protected: