forked from qt-creator/qt-creator
Core: Make IEditorFactory::createEditor use a function object
Also, replace or remove unneeded Q_OBJECTs, and make base setters and adders protected. Change-Id: I212257ef53984d8852dc8c478537199fc9483486 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -38,17 +38,15 @@ using namespace Android::Internal;
|
||||
AndroidManifestEditorFactory::AndroidManifestEditorFactory()
|
||||
{
|
||||
setId(Constants::ANDROID_MANIFEST_EDITOR_ID);
|
||||
setDisplayName(tr("Android Manifest editor"));
|
||||
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();
|
||||
});
|
||||
}
|
||||
|
||||
Core::IEditor *AndroidManifestEditorFactory::createEditor()
|
||||
{
|
||||
auto androidManifestEditorWidget = new AndroidManifestEditorWidget();
|
||||
return androidManifestEditorWidget->editor();
|
||||
setEditorCreator([] {
|
||||
auto androidManifestEditorWidget = new AndroidManifestEditorWidget;
|
||||
return androidManifestEditorWidget->editor();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -30,14 +30,10 @@
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
class AndroidManifestEditorFactory : public Core::IEditorFactory
|
||||
class AndroidManifestEditorFactory final : public Core::IEditorFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AndroidManifestEditorFactory();
|
||||
|
||||
Core::IEditor *createEditor() override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user