CMakeProjectManager: General editor related code consolidation

Merge editor files, convert to new editor setup scheme,
fix names according to convention.

Change-Id: I2b3a72149be608df3813aaa00592c7c2facffc05
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
hjk
2014-08-20 00:07:43 +02:00
parent b86269edbd
commit f0dfe2dcab
7 changed files with 89 additions and 189 deletions

View File

@@ -33,17 +33,12 @@
#include <texteditor/basetextdocument.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/codeassist/completionassistprovider.h>
#include <utils/uncommentselection.h>
namespace TextEditor { class FontSettings; }
#include <coreplugin/editormanager/ieditorfactory.h>
namespace CMakeProjectManager {
namespace Internal {
class CMakeEditorWidget;
class CMakeHighlighter;
class CMakeManager;
class CMakeEditor : public TextEditor::BaseTextEditor
{
@@ -52,7 +47,6 @@ class CMakeEditor : public TextEditor::BaseTextEditor
public:
CMakeEditor();
Core::IEditor *duplicate();
QString contextHelpId() const;
friend class CMakeEditorWidget;
@@ -69,11 +63,9 @@ class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget
public:
CMakeEditorWidget();
private:
bool save(const QString &fileName = QString());
Link findLinkAt(const QTextCursor &cursor, bool resolveTarget = true, bool inNextSplit = false);
protected:
TextEditor::BaseTextEditor *createEditor();
void contextMenuEvent(QContextMenuEvent *e);
};
@@ -84,10 +76,20 @@ class CMakeDocument : public TextEditor::BaseTextDocument
public:
CMakeDocument();
QString defaultPath() const;
QString suggestedFileName() const;
};
class CMakeEditorFactory : public Core::IEditorFactory
{
Q_OBJECT
public:
CMakeEditorFactory();
Core::IEditor *createEditor();
};
} // namespace Internal
} // namespace CMakeProjectManager