forked from qt-creator/qt-creator
AndroidManifestEditor: Fix handling of external changes
The editor was not updating the UI part if that is active when external changes happen. Switching to XML Source would then overwrite the external change. Change-Id: Ib63257e75e065d151cb2a078443dc2afc8392ab8 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
@@ -122,6 +122,8 @@ AndroidManifestEditorWidget::AndroidManifestEditorWidget()
|
||||
|
||||
connect(m_textEditorWidget->document(), SIGNAL(contentsChanged()),
|
||||
this, SLOT(startParseCheck()));
|
||||
connect(m_textEditorWidget->textDocument(), &TextEditor::TextDocument::reloadFinished,
|
||||
this, &AndroidManifestEditorWidget::updateAfterFileLoad);
|
||||
}
|
||||
|
||||
void AndroidManifestEditorWidget::initializePage()
|
||||
@@ -501,11 +503,15 @@ void AndroidManifestEditorWidget::updateTargetComboBox()
|
||||
bool AndroidManifestEditorWidget::open(QString *errorString, const QString &fileName, const QString &realFileName)
|
||||
{
|
||||
bool result = m_textEditorWidget->open(errorString, fileName, realFileName);
|
||||
|
||||
updateSdkVersions();
|
||||
updateAfterFileLoad(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!result)
|
||||
return result;
|
||||
void AndroidManifestEditorWidget::updateAfterFileLoad(bool success)
|
||||
{
|
||||
if (!success)
|
||||
return;
|
||||
|
||||
QString error;
|
||||
int errorLine;
|
||||
@@ -515,13 +521,12 @@ bool AndroidManifestEditorWidget::open(QString *errorString, const QString &file
|
||||
if (checkDocument(doc, &error, &errorLine, &errorColumn)) {
|
||||
if (activePage() != Source)
|
||||
syncToWidgets(doc);
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// some error occurred
|
||||
updateInfoBar(error, errorLine, errorColumn);
|
||||
setActivePage(Source);
|
||||
return true;
|
||||
}
|
||||
|
||||
void AndroidManifestEditorWidget::setDirty(bool dirty)
|
||||
|
Reference in New Issue
Block a user