diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index 89674ba002bb17d882a7428d333d3fd8e03134af..e7bd806f66287a2afe92ab7411f7df4f9428aa4f 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -278,6 +278,8 @@ public: QToolBar *toolBar() { return m_toolBar; } + bool temporayEditor() const { return false; } + signals: void changed(); diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 200d0ff626ed061c98be7a41131939d1b1a51265..0efe9428efbf4e3202c743780acb5a8c25421aaf 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1010,7 +1010,9 @@ void EditorManager::addEditor(IEditor *editor, bool isDuplicate) m_d->m_editorModel->addEditor(editor, isDuplicate); if (!isDuplicate) { m_d->m_core->fileManager()->addFile(editor->file()); - m_d->m_core->fileManager()->addToRecentFiles(editor->file()->fileName()); + if (!editor->temporayEditor()) { + m_d->m_core->fileManager()->addToRecentFiles(editor->file()->fileName()); + } } m_d->m_editorHistory.removeAll(editor); @@ -1275,7 +1277,7 @@ bool EditorManager::saveFile(IEditor *editor) m_d->m_core->fileManager()->unblockFileChange(file); } - if (success) + if (success && !editor->temporayEditor()) m_d->m_core->fileManager()->addToRecentFiles(editor->file()->fileName()); return success; @@ -1370,7 +1372,7 @@ bool EditorManager::saveFileAs(IEditor *editor) m_d->m_core->fileManager()->unblockFileChange(editor->file()); editor->file()->checkPermissions(); - if (success) + if (success && !editor->temporayEditor()) m_d->m_core->fileManager()->addToRecentFiles(editor->file()->fileName()); updateActions(); diff --git a/src/plugins/coreplugin/editormanager/ieditor.h b/src/plugins/coreplugin/editormanager/ieditor.h index 789863cce39b9084030ed4991501d451ee39cc11..159fc74263d4c658686eb65bb5ff9f13ed508cd8 100644 --- a/src/plugins/coreplugin/editormanager/ieditor.h +++ b/src/plugins/coreplugin/editormanager/ieditor.h @@ -63,6 +63,8 @@ public: virtual int currentLine() const { return 0; } virtual int currentColumn() const { return 0; } + virtual bool temporayEditor() const = 0; + virtual QToolBar *toolBar() = 0; signals: diff --git a/src/plugins/cppeditor/cppeditor.h b/src/plugins/cppeditor/cppeditor.h index 526faff87a7e01f7bd36f0073164a97bb7b6816f..ed38bc594dcf21d18f0c3a3516af616ca29e023a 100644 --- a/src/plugins/cppeditor/cppeditor.h +++ b/src/plugins/cppeditor/cppeditor.h @@ -69,6 +69,8 @@ public: Core::IEditor *duplicate(QWidget *parent); const char *kind() const; + bool temporayEditor() const { return false; } + private: QList<int> m_context; }; diff --git a/src/plugins/designer/formwindoweditor.h b/src/plugins/designer/formwindoweditor.h index d5727c9f8deb538093aaea7de370bd8e726b51b8..4a6a0758dbe23cb2c34741cdc5f37e838188542c 100644 --- a/src/plugins/designer/formwindoweditor.h +++ b/src/plugins/designer/formwindoweditor.h @@ -79,6 +79,7 @@ public: QToolBar *toolBar(); QByteArray saveState() const; bool restoreState(const QByteArray &state); + virtual bool temporayEditor() const { return false; } // ContextInterface virtual QList<int> context() const; diff --git a/src/plugins/genericprojectmanager/genericprojectfileseditor.h b/src/plugins/genericprojectmanager/genericprojectfileseditor.h index a3aed60f561d1a77873988860f9da8b467ee9ab4..a3ed4b1cfb540f10b5b1cc9a8c3676adac49aa95 100644 --- a/src/plugins/genericprojectmanager/genericprojectfileseditor.h +++ b/src/plugins/genericprojectmanager/genericprojectfileseditor.h @@ -80,6 +80,8 @@ public: virtual bool duplicateSupported() const; virtual Core::IEditor *duplicate(QWidget *parent); + virtual bool temporayEditor() const { return false; } + private: QList<int> m_context; }; diff --git a/src/plugins/qt4projectmanager/profileeditor.h b/src/plugins/qt4projectmanager/profileeditor.h index ba7c70b734c338613bb1d5f24e18c57e5dbbcf8a..796236726d0e8ab894dd779609adc379386567a8 100644 --- a/src/plugins/qt4projectmanager/profileeditor.h +++ b/src/plugins/qt4projectmanager/profileeditor.h @@ -62,6 +62,7 @@ public: bool duplicateSupported() const { return true; } Core::IEditor *duplicate(QWidget *parent); const char *kind() const; + bool temporayEditor() const { return false; } private: QList<int> m_context; }; diff --git a/src/plugins/qtscripteditor/qtscripteditor.h b/src/plugins/qtscripteditor/qtscripteditor.h index 8042185796b71e59de102e1fd8d2e50c7873623c..3f6f904d18b0c7817d310494464b5db4fa0e3976 100644 --- a/src/plugins/qtscripteditor/qtscripteditor.h +++ b/src/plugins/qtscripteditor/qtscripteditor.h @@ -58,6 +58,8 @@ public: Core::IEditor *duplicate(QWidget *parent); const char *kind() const; + bool temporayEditor() const { return false; } + private: QList<int> m_context; }; diff --git a/src/plugins/resourceeditor/resourceeditorw.h b/src/plugins/resourceeditor/resourceeditorw.h index de341d90c2cacfe7ba3de9dafb269154636480d6..fe411da4efd8311e27b8448cb225354ad0fd667f 100644 --- a/src/plugins/resourceeditor/resourceeditorw.h +++ b/src/plugins/resourceeditor/resourceeditorw.h @@ -105,6 +105,7 @@ public: QWidget *widget(); void setSuggestedFileName(const QString &fileName); + bool temporayEditor() const { return false; } private slots: void dirtyChanged(bool); diff --git a/src/plugins/texteditor/plaintexteditor.h b/src/plugins/texteditor/plaintexteditor.h index 8271d1fc37ae49627558b64f5a214aa3ae4f9854..1a225318a25f4690d1926cba3120f5424616042e 100644 --- a/src/plugins/texteditor/plaintexteditor.h +++ b/src/plugins/texteditor/plaintexteditor.h @@ -47,6 +47,7 @@ public: bool duplicateSupported() const { return true; } Core::IEditor *duplicate(QWidget *parent); const char *kind() const; + bool temporayEditor() const { return false; } private: QList<int> m_context; }; diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 3675999266e9d1b2e03891bdee26153f855d8dd0..5ed80e5db79466a7325c8d4ae048d6cb1f223a95 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -75,6 +75,8 @@ public: Core::IEditor *duplicate(QWidget * /*parent*/) { return 0; } const char *kind() const { return m_kind; } + bool temporayEditor() const { return true; } + private: const char *m_kind; QList<int> m_context; @@ -104,6 +106,8 @@ public: virtual QToolBar *toolBar() { return m_toolBar; } QComboBox *diffFileBrowseComboBox() const { return m_diffFileBrowseComboBox; } + bool temporayEditor() const { return true; } + private: QComboBox *m_diffFileBrowseComboBox; QToolBar *m_toolBar; diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.h b/src/plugins/vcsbase/vcsbasesubmiteditor.h index 3cd2e62bcba6785a61eaef47450695cd737f9bde..81b3c246281a53cdc57e578c412ba9fb9b8f6e7c 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.h +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.h @@ -159,6 +159,8 @@ public: // be restricted to them static QStringList currentProjectFiles(bool nativeSeparators, QString *name = 0); + bool temporayEditor() const { return true; } + signals: void diffSelectedFiles(const QStringList &files);