diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-06-02 17:14:48 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-06-10 11:21:17 +0000 |
commit | 4f927e4c87f07c4d50efcef5b61478df61cc9d3f (patch) | |
tree | a9bbeafa63ea92a5171990bdc8639f93282a7252 /src/plugins/imageviewer/imageviewerfile.cpp | |
parent | c916d250b3c1ff28a4ad0c93ccbd6005c9ff9f42 (diff) | |
download | qt-creator-4f927e4c87f07c4d50efcef5b61478df61cc9d3f.tar.gz |
Move "open" from IEditor to IDocument
For non-editor documents it currently is not used, but for editors it
makes more sense to have that on the document instead of the editor.
Most actual implementations of "open" were done in the documents already
anyhow, because it is needed for reloading.
Change-Id: I29d4df2078995cbe80172b51a9bebeecb3afad3c
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Diffstat (limited to 'src/plugins/imageviewer/imageviewerfile.cpp')
-rw-r--r-- | src/plugins/imageviewer/imageviewerfile.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/imageviewer/imageviewerfile.cpp b/src/plugins/imageviewer/imageviewerfile.cpp index 6a0599cbc1..92309678e2 100644 --- a/src/plugins/imageviewer/imageviewerfile.cpp +++ b/src/plugins/imageviewer/imageviewerfile.cpp @@ -88,7 +88,13 @@ ImageViewerFile::~ImageViewerFile() bool ImageViewerFile::open(QString *errorString, const QString &fileName, const QString &realFileName) { QTC_CHECK(fileName == realFileName); // does not support auto save + bool success = openImpl(errorString, fileName); + emit openFinished(success); + return success; +} +bool ImageViewerFile::openImpl(QString *errorString, const QString &fileName) +{ cleanUp(); m_type = TypeInvalid; @@ -160,7 +166,7 @@ bool ImageViewerFile::reload(QString *errorString, return true; } emit aboutToReload(); - bool success = open(errorString, filePath().toString(), filePath().toString()); + bool success = openImpl(errorString, filePath().toString()); emit reloadFinished(success); return success; } |