forked from qt-creator/qt-creator
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:
@@ -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();
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user