forked from qt-creator/qt-creator
Haskell: Move plugin class definition to .cpp
... and simplify setup a bit. Change-Id: Ic5a36c35c083232cb8df3c7a06aaac46bcef55e0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -9,7 +9,7 @@ add_qtc_plugin(Haskell
|
|||||||
haskelleditorfactory.cpp haskelleditorfactory.h
|
haskelleditorfactory.cpp haskelleditorfactory.h
|
||||||
haskellhighlighter.cpp haskellhighlighter.h
|
haskellhighlighter.cpp haskellhighlighter.h
|
||||||
haskellmanager.cpp haskellmanager.h
|
haskellmanager.cpp haskellmanager.h
|
||||||
haskellplugin.cpp haskellplugin.h
|
haskellplugin.cpp
|
||||||
haskellproject.cpp haskellproject.h
|
haskellproject.cpp haskellproject.h
|
||||||
haskellrunconfiguration.cpp haskellrunconfiguration.h
|
haskellrunconfiguration.cpp haskellrunconfiguration.h
|
||||||
haskellsettings.cpp haskellsettings.h
|
haskellsettings.cpp haskellsettings.h
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ QtcPlugin {
|
|||||||
"haskell_global.h",
|
"haskell_global.h",
|
||||||
"haskellhighlighter.cpp", "haskellhighlighter.h",
|
"haskellhighlighter.cpp", "haskellhighlighter.h",
|
||||||
"haskellmanager.cpp", "haskellmanager.h",
|
"haskellmanager.cpp", "haskellmanager.h",
|
||||||
"haskellplugin.cpp", "haskellplugin.h",
|
"haskellplugin.cpp",
|
||||||
"haskellproject.cpp", "haskellproject.h",
|
"haskellproject.cpp", "haskellproject.h",
|
||||||
"haskellrunconfiguration.cpp", "haskellrunconfiguration.h",
|
"haskellrunconfiguration.cpp", "haskellrunconfiguration.h",
|
||||||
"haskellsettings.cpp", "haskellsettings.h",
|
"haskellsettings.cpp", "haskellsettings.h",
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) 2017 The Qt Company Ltd.
|
// Copyright (c) 2017 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include "haskellplugin.h"
|
|
||||||
|
|
||||||
#include "haskellbuildconfiguration.h"
|
#include "haskellbuildconfiguration.h"
|
||||||
#include "haskellconstants.h"
|
#include "haskellconstants.h"
|
||||||
#include "haskelleditorfactory.h"
|
#include "haskelleditorfactory.h"
|
||||||
@@ -16,6 +14,8 @@
|
|||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
#include <projectexplorer/jsonwizard/jsonwizardfactory.h>
|
#include <projectexplorer/jsonwizard/jsonwizardfactory.h>
|
||||||
#include <projectexplorer/projectmanager.h>
|
#include <projectexplorer/projectmanager.h>
|
||||||
#include <projectexplorer/runcontrol.h>
|
#include <projectexplorer/runcontrol.h>
|
||||||
@@ -24,8 +24,7 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
namespace Haskell {
|
namespace Haskell::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class HaskellPluginPrivate
|
class HaskellPluginPrivate
|
||||||
{
|
{
|
||||||
@@ -37,11 +36,6 @@ public:
|
|||||||
ProjectExplorer::SimpleTargetRunnerFactory runWorkerFactory{{Constants::C_HASKELL_RUNCONFIG_ID}};
|
ProjectExplorer::SimpleTargetRunnerFactory runWorkerFactory{{Constants::C_HASKELL_RUNCONFIG_ID}};
|
||||||
};
|
};
|
||||||
|
|
||||||
HaskellPlugin::~HaskellPlugin()
|
|
||||||
{
|
|
||||||
delete d;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void registerGhciAction(QObject *guard)
|
static void registerGhciAction(QObject *guard)
|
||||||
{
|
{
|
||||||
QAction *action = new QAction(Tr::tr("Run GHCi"), guard);
|
QAction *action = new QAction(Tr::tr("Run GHCi"), guard);
|
||||||
@@ -52,11 +46,17 @@ static void registerGhciAction(QObject *guard)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HaskellPlugin::initialize(const QStringList &arguments, QString *errorString)
|
class HaskellPlugin final : public ExtensionSystem::IPlugin
|
||||||
{
|
{
|
||||||
Q_UNUSED(arguments)
|
Q_OBJECT
|
||||||
Q_UNUSED(errorString)
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Haskell.json")
|
||||||
|
|
||||||
|
public:
|
||||||
|
~HaskellPlugin() final { delete d; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
void initialize() final
|
||||||
|
{
|
||||||
d = new HaskellPluginPrivate;
|
d = new HaskellPluginPrivate;
|
||||||
|
|
||||||
ProjectExplorer::ProjectManager::registerProjectType<HaskellProject>(
|
ProjectExplorer::ProjectManager::registerProjectType<HaskellProject>(
|
||||||
@@ -67,8 +67,11 @@ bool HaskellPlugin::initialize(const QStringList &arguments, QString *errorStrin
|
|||||||
registerGhciAction(this);
|
registerGhciAction(this);
|
||||||
|
|
||||||
ProjectExplorer::JsonWizardFactory::addWizardPath(":/haskell/share/wizards/");
|
ProjectExplorer::JsonWizardFactory::addWizardPath(":/haskell/share/wizards/");
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
HaskellPluginPrivate *d = nullptr;
|
||||||
} // namespace Haskell
|
};
|
||||||
|
|
||||||
|
} // Haskell::Internal
|
||||||
|
|
||||||
|
#include "haskellplugin.moc"
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
// Copyright (c) 2017 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "haskell_global.h"
|
|
||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
|
||||||
|
|
||||||
namespace Haskell {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class HaskellPlugin : public ExtensionSystem::IPlugin
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Haskell.json")
|
|
||||||
|
|
||||||
public:
|
|
||||||
HaskellPlugin() = default;
|
|
||||||
~HaskellPlugin() final;
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool initialize(const QStringList &arguments, QString *errorString) final;
|
|
||||||
void extensionsInitialized() final {}
|
|
||||||
|
|
||||||
class HaskellPluginPrivate *d = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Haskell
|
|
||||||
Reference in New Issue
Block a user