forked from qt-creator/qt-creator
QmakeProjectManager: Move .pro editor over to new construction scheme
Change-Id: I1894e6ae622cb43ef6974aac82505c1f9912ff7b Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
#include <texteditor/texteditoractionhandler.h>
|
#include <texteditor/texteditoractionhandler.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
@@ -54,18 +55,13 @@ namespace Internal {
|
|||||||
|
|
||||||
ProFileEditor::ProFileEditor()
|
ProFileEditor::ProFileEditor()
|
||||||
{
|
{
|
||||||
setContext(Core::Context(Constants::C_PROFILEEDITOR,
|
addContext(Constants::C_PROFILEEDITOR);
|
||||||
TextEditor::Constants::C_TEXTEDITOR));
|
|
||||||
setDuplicateSupported(true);
|
setDuplicateSupported(true);
|
||||||
setCommentStyle(Utils::CommentDefinition::HashStyle);
|
setCommentStyle(Utils::CommentDefinition::HashStyle);
|
||||||
setCompletionAssistProvider(ExtensionSystem::PluginManager::getObject<ProFileCompletionAssistProvider>());
|
setCompletionAssistProvider(ExtensionSystem::PluginManager::getObject<ProFileCompletionAssistProvider>());
|
||||||
}
|
setEditorCreator([]() { return new ProFileEditor; });
|
||||||
|
setDocumentCreator([]() { return new ProFileDocument; });
|
||||||
Core::IEditor *ProFileEditor::duplicate()
|
setWidgetCreator([]() { return new ProFileEditorWidget; });
|
||||||
{
|
|
||||||
ProFileEditorWidget *ret = new ProFileEditorWidget;
|
|
||||||
ret->setTextDocument(editorWidget()->textDocumentPtr());
|
|
||||||
return ret->editor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -165,7 +161,7 @@ ProFileEditorWidget::Link ProFileEditorWidget::findLinkAt(const QTextCursor &cur
|
|||||||
|
|
||||||
TextEditor::BaseTextEditor *ProFileEditorWidget::createEditor()
|
TextEditor::BaseTextEditor *ProFileEditorWidget::createEditor()
|
||||||
{
|
{
|
||||||
return new ProFileEditor;
|
QTC_ASSERT("should not happen anymore" && false, return 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProFileEditorWidget::contextMenuEvent(QContextMenuEvent *e)
|
void ProFileEditorWidget::contextMenuEvent(QContextMenuEvent *e)
|
||||||
@@ -222,9 +218,7 @@ ProFileEditorFactory::ProFileEditorFactory()
|
|||||||
|
|
||||||
Core::IEditor *ProFileEditorFactory::createEditor()
|
Core::IEditor *ProFileEditorFactory::createEditor()
|
||||||
{
|
{
|
||||||
ProFileEditorWidget *editor = new ProFileEditorWidget;
|
return new ProFileEditor;
|
||||||
editor->setTextDocument(TextEditor::BaseTextDocumentPtr(new ProFileDocument));
|
|
||||||
return editor->editor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ class ProFileEditor : public TextEditor::BaseTextEditor
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ProFileEditor();
|
ProFileEditor();
|
||||||
|
|
||||||
Core::IEditor *duplicate();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ProFileEditorWidget : public TextEditor::BaseTextEditorWidget
|
class ProFileEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||||
|
|||||||
Reference in New Issue
Block a user