forked from qt-creator/qt-creator
Make document model static and add some document related methods
Change-Id: Ibcb863e67a2433529c9d2b6dec237f9d8b1d8d50 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -233,11 +233,11 @@ void StateListener::slotStateChanged()
|
||||
// temporary path prefix or does the file contains a hash, indicating a project
|
||||
// folder?
|
||||
State state;
|
||||
Core::IEditor *currentEditor = Core::EditorManager::currentEditor();
|
||||
if (!currentEditor || !currentEditor->document())
|
||||
Core::IDocument *currentDocument = Core::EditorManager::currentDocument();
|
||||
if (!currentDocument)
|
||||
state.currentFile.clear();
|
||||
else
|
||||
state.currentFile = currentEditor->document()->filePath();
|
||||
state.currentFile = currentDocument->filePath();
|
||||
QScopedPointer<QFileInfo> currentFileInfo; // Instantiate QFileInfo only once if required.
|
||||
if (!state.currentFile.isEmpty()) {
|
||||
const bool isTempFile = state.currentFile.startsWith(QDir::tempPath());
|
||||
|
||||
Reference in New Issue
Block a user