forked from qt-creator/qt-creator
Clear the uniqueId of diff editor when saving
Saving diff editor transforms it to patch-file read only editor. Clearing the uniqueId ensures we don't use it anymore for showing e.g. current file's modifications. Change-Id: I2010161697bbad254ce1ebe5d0bb6a1f38ae323c Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -2798,6 +2798,11 @@ bool EditorManager::skipOpeningBigTextFile(const QString &filePath)
|
|||||||
return EditorManagerPrivate::skipOpeningBigTextFile(filePath);
|
return EditorManagerPrivate::skipOpeningBigTextFile(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditorManager::clearUniqueId(IDocument *document)
|
||||||
|
{
|
||||||
|
document->setProperty(scratchBufferKey, QVariant());
|
||||||
|
}
|
||||||
|
|
||||||
bool EditorManager::saveDocument(IDocument *document)
|
bool EditorManager::saveDocument(IDocument *document)
|
||||||
{
|
{
|
||||||
return EditorManagerPrivate::saveDocument(document);
|
return EditorManagerPrivate::saveDocument(document);
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ public:
|
|||||||
const QString &uniqueId = QString(),
|
const QString &uniqueId = QString(),
|
||||||
OpenEditorFlags flags = NoFlags);
|
OpenEditorFlags flags = NoFlags);
|
||||||
static bool skipOpeningBigTextFile(const QString &filePath);
|
static bool skipOpeningBigTextFile(const QString &filePath);
|
||||||
|
static void clearUniqueId(IDocument *document);
|
||||||
|
|
||||||
static bool openExternalEditor(const QString &fileName, Id editorId);
|
static bool openExternalEditor(const QString &fileName, Id editorId);
|
||||||
static void addCloseEditorListener(const std::function<bool(IEditor *)> &listener);
|
static void addCloseEditorListener(const std::function<bool(IEditor *)> &listener);
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ bool DiffEditorDocument::save(QString *errorString, const QString &fileName, boo
|
|||||||
|
|
||||||
setController(0);
|
setController(0);
|
||||||
setDescription(QString());
|
setDescription(QString());
|
||||||
|
Core::EditorManager::clearUniqueId(this);
|
||||||
|
|
||||||
const QFileInfo fi(fileName);
|
const QFileInfo fi(fileName);
|
||||||
setTemporary(false);
|
setTemporary(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user