summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--objects/editor.cpp6
-rw-r--r--objects/editor.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/objects/editor.cpp b/objects/editor.cpp
index 5bd706d..66512e1 100644
--- a/objects/editor.cpp
+++ b/objects/editor.cpp
@@ -34,6 +34,7 @@
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/idocument.h>
+#include <coreplugin/editormanager/editormanager.h>
using namespace Scripting;
using namespace Scripting::Internal;
@@ -102,6 +103,11 @@ QString Editor::fileName() const
return QString();
}
+void Editor::close()
+{
+ Core::EditorManager::instance()->closeEditors(QList<Core::IEditor*>() << m_editor, false);
+}
+
Core::IEditor * Editor::editor() const
{
return m_editor;
diff --git a/objects/editor.h b/objects/editor.h
index 0bbc03b..f4383f3 100644
--- a/objects/editor.h
+++ b/objects/editor.h
@@ -63,6 +63,7 @@ public slots:
void gotoPosition( const Position& pos );
QString fileName() const;
+ void close();
protected:
virtual Core::IEditor *editor() const;