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
|
fakevim.qrc
|
||||||
fakevimactions.cpp fakevimactions.h
|
fakevimactions.cpp fakevimactions.h
|
||||||
fakevimhandler.cpp fakevimhandler.h
|
fakevimhandler.cpp fakevimhandler.h
|
||||||
fakevimplugin.cpp fakevimplugin.h
|
fakevimplugin.cpp
|
||||||
fakevimtr.h
|
fakevimtr.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ QtcPlugin {
|
|||||||
"fakevimhandler.cpp",
|
"fakevimhandler.cpp",
|
||||||
"fakevimhandler.h",
|
"fakevimhandler.h",
|
||||||
"fakevimplugin.cpp",
|
"fakevimplugin.cpp",
|
||||||
"fakevimplugin.h",
|
|
||||||
"fakevimtr.h",
|
"fakevimtr.h",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
// Copyright (C) 2016 The Qt Company Ltd.
|
// Copyright (C) 2016 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 "fakevimplugin.h"
|
|
||||||
|
|
||||||
#include "fakevimactions.h"
|
#include "fakevimactions.h"
|
||||||
#include "fakevimhandler.h"
|
#include "fakevimhandler.h"
|
||||||
#include "fakevimtr.h"
|
#include "fakevimtr.h"
|
||||||
@@ -25,6 +23,8 @@
|
|||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
#include <coreplugin/statusbarmanager.h>
|
#include <coreplugin/statusbarmanager.h>
|
||||||
|
|
||||||
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
|
||||||
#include <texteditor/codeassist/assistinterface.h>
|
#include <texteditor/codeassist/assistinterface.h>
|
||||||
@@ -88,8 +88,7 @@ using namespace TextEditor;
|
|||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace FakeVim {
|
namespace FakeVim::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
const char INSTALL_HANDLER[] = "TextEditor.FakeVimHandler";
|
const char INSTALL_HANDLER[] = "TextEditor.FakeVimHandler";
|
||||||
const char SETTINGS_CATEGORY[] = "D.FakeVim";
|
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
|
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); });
|
addTestCreator([] { return createFakeVimTester(&setupTest); });
|
||||||
dd = new FakeVimPluginPrivate;
|
dd = new FakeVimPluginPrivate;
|
||||||
}
|
}
|
||||||
|
~FakeVimPlugin() override
|
||||||
FakeVimPlugin::~FakeVimPlugin()
|
{
|
||||||
{
|
|
||||||
delete dd;
|
delete dd;
|
||||||
dd = nullptr;
|
dd = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FakeVimPlugin::initialize()
|
ExtensionSystem::IPlugin::ShutdownFlag aboutToShutdown()
|
||||||
{
|
{
|
||||||
dd->initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
ExtensionSystem::IPlugin::ShutdownFlag FakeVimPlugin::aboutToShutdown()
|
|
||||||
{
|
|
||||||
StatusBarManager::destroyStatusBarWidget(dd->m_miniBuffer);
|
StatusBarManager::destroyStatusBarWidget(dd->m_miniBuffer);
|
||||||
dd->m_miniBuffer = nullptr;
|
dd->m_miniBuffer = nullptr;
|
||||||
return SynchronousShutdown;
|
return SynchronousShutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FakeVimPlugin::extensionsInitialized()
|
void initialize() override
|
||||||
{
|
{
|
||||||
|
dd->initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void extensionsInitialized() override
|
||||||
|
{
|
||||||
dd->m_miniBuffer = new MiniBuffer;
|
dd->m_miniBuffer = new MiniBuffer;
|
||||||
StatusBarManager::addStatusBarWidget(dd->m_miniBuffer, StatusBarManager::LastLeftAligned);
|
StatusBarManager::addStatusBarWidget(dd->m_miniBuffer, StatusBarManager::LastLeftAligned);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // FakeVim::Internal
|
||||||
} // namespace Internal
|
|
||||||
} // namespace FakeVim
|
|
||||||
|
|
||||||
#include "fakevimplugin.moc"
|
#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