forked from qt-creator/qt-creator
FakeVim: Move plugin class definition to .cpp
Change-Id: Iac485bbd6cd00ddfae189a6f82c9f5f2c7e9aaf9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -5,7 +5,7 @@ add_qtc_plugin(FakeVim
|
||||
fakevim.qrc
|
||||
fakevimactions.cpp fakevimactions.h
|
||||
fakevimhandler.cpp fakevimhandler.h
|
||||
fakevimplugin.cpp fakevimplugin.h
|
||||
fakevimplugin.cpp
|
||||
fakevimtr.h
|
||||
)
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ QtcPlugin {
|
||||
"fakevimhandler.cpp",
|
||||
"fakevimhandler.h",
|
||||
"fakevimplugin.cpp",
|
||||
"fakevimplugin.h",
|
||||
"fakevimtr.h",
|
||||
]
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "fakevimplugin.h"
|
||||
|
||||
#include "fakevimactions.h"
|
||||
#include "fakevimhandler.h"
|
||||
#include "fakevimtr.h"
|
||||
@@ -25,6 +23,8 @@
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <coreplugin/statusbarmanager.h>
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <texteditor/codeassist/assistinterface.h>
|
||||
@@ -88,8 +88,7 @@ using namespace TextEditor;
|
||||
using namespace Core;
|
||||
using namespace Utils;
|
||||
|
||||
namespace FakeVim {
|
||||
namespace Internal {
|
||||
namespace FakeVim::Internal {
|
||||
|
||||
const char INSTALL_HANDLER[] = "TextEditor.FakeVimHandler";
|
||||
const char SETTINGS_CATEGORY[] = "D.FakeVim";
|
||||
@@ -2050,38 +2049,42 @@ static void setupTest(QString *title, FakeVimHandler **handler, QWidget **edit)
|
||||
|
||||
QObject *createFakeVimTester( void (*setupTest)(QString *, FakeVimHandler **, QWidget **) ); // in fakevim_test.cpp
|
||||
|
||||
FakeVimPlugin::FakeVimPlugin()
|
||||
class FakeVimPlugin : public ExtensionSystem::IPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "FakeVim.json")
|
||||
|
||||
public:
|
||||
FakeVimPlugin()
|
||||
{
|
||||
addTestCreator([] { return createFakeVimTester(&setupTest); });
|
||||
dd = new FakeVimPluginPrivate;
|
||||
}
|
||||
|
||||
FakeVimPlugin::~FakeVimPlugin()
|
||||
{
|
||||
}
|
||||
~FakeVimPlugin() override
|
||||
{
|
||||
delete dd;
|
||||
dd = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void FakeVimPlugin::initialize()
|
||||
{
|
||||
dd->initialize();
|
||||
}
|
||||
|
||||
ExtensionSystem::IPlugin::ShutdownFlag FakeVimPlugin::aboutToShutdown()
|
||||
{
|
||||
ExtensionSystem::IPlugin::ShutdownFlag aboutToShutdown()
|
||||
{
|
||||
StatusBarManager::destroyStatusBarWidget(dd->m_miniBuffer);
|
||||
dd->m_miniBuffer = nullptr;
|
||||
return SynchronousShutdown;
|
||||
}
|
||||
}
|
||||
|
||||
void FakeVimPlugin::extensionsInitialized()
|
||||
{
|
||||
void initialize() override
|
||||
{
|
||||
dd->initialize();
|
||||
}
|
||||
|
||||
void extensionsInitialized() override
|
||||
{
|
||||
dd->m_miniBuffer = new MiniBuffer;
|
||||
StatusBarManager::addStatusBarWidget(dd->m_miniBuffer, StatusBarManager::LastLeftAligned);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace FakeVim
|
||||
} // FakeVim::Internal
|
||||
|
||||
#include "fakevimplugin.moc"
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
namespace FakeVim {
|
||||
namespace Internal {
|
||||
|
||||
class FakeVimHandler;
|
||||
|
||||
class FakeVimPlugin : public ExtensionSystem::IPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "FakeVim.json")
|
||||
|
||||
public:
|
||||
FakeVimPlugin();
|
||||
~FakeVimPlugin() override;
|
||||
|
||||
private:
|
||||
// implementation of ExtensionSystem::IPlugin
|
||||
void initialize() override;
|
||||
ShutdownFlag aboutToShutdown() override;
|
||||
void extensionsInitialized() override;
|
||||
|
||||
private:
|
||||
friend class FakeVimPluginPrivate;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace FakeVim
|
||||
Reference in New Issue
Block a user