forked from qt-creator/qt-creator
TextEditor: De-QObject-ify TextEditorActionHandler
Change-Id: I8c4919b89ce35d421edd4a21a650d5e0df4a7ead Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -29,22 +29,20 @@
|
||||
#include "androidmanifesteditor.h"
|
||||
|
||||
#include <coreplugin/id.h>
|
||||
#include <texteditor/texteditoractionhandler.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
|
||||
using namespace Android;
|
||||
using namespace Android::Internal;
|
||||
|
||||
AndroidManifestEditorFactory::AndroidManifestEditorFactory()
|
||||
: m_actionHandler(Constants::ANDROID_MANIFEST_EDITOR_ID,
|
||||
Constants::ANDROID_MANIFEST_EDITOR_CONTEXT,
|
||||
TextEditor::TextEditorActionHandler::None,
|
||||
[](Core::IEditor *editor) { return static_cast<AndroidManifestEditor *>(editor)->textEditor(); })
|
||||
{
|
||||
setId(Constants::ANDROID_MANIFEST_EDITOR_ID);
|
||||
setDisplayName(AndroidManifestEditorWidget::tr("Android Manifest editor"));
|
||||
addMimeType(Constants::ANDROID_MANIFEST_MIME_TYPE);
|
||||
auto actionHandler = new TextEditor::TextEditorActionHandler(
|
||||
this, id(), Constants::ANDROID_MANIFEST_EDITOR_CONTEXT);
|
||||
actionHandler->setTextEditorWidgetResolver([](Core::IEditor *editor) {
|
||||
return static_cast<AndroidManifestEditor *>(editor)->textEditor();
|
||||
});
|
||||
setEditorCreator([] {
|
||||
auto androidManifestEditorWidget = new AndroidManifestEditorWidget;
|
||||
return androidManifestEditorWidget->editor();
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
#include <coreplugin/editormanager/ieditorfactory.h>
|
||||
|
||||
#include <texteditor/texteditoractionhandler.h>
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
@@ -34,6 +36,9 @@ class AndroidManifestEditorFactory final : public Core::IEditorFactory
|
||||
{
|
||||
public:
|
||||
AndroidManifestEditorFactory();
|
||||
|
||||
private:
|
||||
TextEditor::TextEditorActionHandler m_actionHandler;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user