forked from qt-creator/qt-creator
Mercurial: Hide plugin class definion in .cpp
Change-Id: I027e058eb555a3b4ccc06eaa11c8e0ecf38f51e2 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -8,7 +8,7 @@ add_qtc_plugin(Mercurial
|
||||
mercurialclient.cpp mercurialclient.h
|
||||
mercurialcommitwidget.cpp mercurialcommitwidget.h
|
||||
mercurialeditor.cpp mercurialeditor.h
|
||||
mercurialplugin.cpp mercurialplugin.h
|
||||
mercurialplugin.cpp
|
||||
mercurialsettings.cpp mercurialsettings.h
|
||||
mercurialtr.h
|
||||
revertdialog.cpp revertdialog.h
|
||||
|
@@ -26,7 +26,6 @@ QtcPlugin {
|
||||
"mercurialeditor.cpp",
|
||||
"mercurialeditor.h",
|
||||
"mercurialplugin.cpp",
|
||||
"mercurialplugin.h",
|
||||
"mercurialsettings.cpp",
|
||||
"mercurialsettings.h",
|
||||
"mercurialtr.h",
|
||||
|
@@ -1,8 +1,6 @@
|
||||
// Copyright (C) 2016 Brian McGillion
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "mercurialplugin.h"
|
||||
|
||||
#include "commiteditor.h"
|
||||
#include "constants.h"
|
||||
#include "mercurialclient.h"
|
||||
@@ -23,6 +21,8 @@
|
||||
#include <coreplugin/locator/commandlocator.h>
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
#include <utils/commandline.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/parameteraction.h>
|
||||
@@ -218,22 +218,6 @@ public:
|
||||
|
||||
static MercurialPluginPrivate *dd = nullptr;
|
||||
|
||||
MercurialPlugin::~MercurialPlugin()
|
||||
{
|
||||
delete dd;
|
||||
dd = nullptr;
|
||||
}
|
||||
|
||||
void MercurialPlugin::initialize()
|
||||
{
|
||||
dd = new MercurialPluginPrivate;
|
||||
}
|
||||
|
||||
void MercurialPlugin::extensionsInitialized()
|
||||
{
|
||||
dd->extensionsInitialized();
|
||||
}
|
||||
|
||||
MercurialPluginPrivate::MercurialPluginPrivate()
|
||||
: VcsBase::VcsBasePluginPrivate(Core::Context(Constants::MERCURIAL_CONTEXT))
|
||||
{
|
||||
@@ -813,7 +797,17 @@ void MercurialPluginPrivate::changed(const QVariant &v)
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
void MercurialPlugin::testDiffFileResolving_data()
|
||||
class MercurialTest final : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void testDiffFileResolving_data();
|
||||
void testDiffFileResolving();
|
||||
void testLogResolving();
|
||||
};
|
||||
|
||||
void MercurialTest::testDiffFileResolving_data()
|
||||
{
|
||||
QTest::addColumn<QByteArray>("header");
|
||||
QTest::addColumn<QByteArray>("fileName");
|
||||
@@ -840,12 +834,12 @@ void MercurialPlugin::testDiffFileResolving_data()
|
||||
<< QByteArray("src/plugins/mercurial/mercurialeditor.cpp");
|
||||
}
|
||||
|
||||
void MercurialPlugin::testDiffFileResolving()
|
||||
void MercurialTest::testDiffFileResolving()
|
||||
{
|
||||
VcsBaseEditorWidget::testDiffFileResolving(dd->diffEditorFactory);
|
||||
}
|
||||
|
||||
void MercurialPlugin::testLogResolving()
|
||||
void MercurialTest::testLogResolving()
|
||||
{
|
||||
QByteArray data(
|
||||
"changeset: 18473:692cbda1eb50\n"
|
||||
@@ -866,4 +860,31 @@ void MercurialPlugin::testLogResolving()
|
||||
}
|
||||
#endif
|
||||
|
||||
class MercurialPlugin final : public ExtensionSystem::IPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Mercurial.json")
|
||||
|
||||
~MercurialPlugin() final
|
||||
{
|
||||
delete dd;
|
||||
dd = nullptr;
|
||||
}
|
||||
|
||||
void initialize() final
|
||||
{
|
||||
dd = new MercurialPluginPrivate;
|
||||
#ifdef WITH_TESTS
|
||||
addTest<MercurialTest>();
|
||||
#endif
|
||||
}
|
||||
|
||||
void extensionsInitialized() final
|
||||
{
|
||||
dd->extensionsInitialized();
|
||||
}
|
||||
};
|
||||
|
||||
} // Mercurial::Internal
|
||||
|
||||
#include "mercurialplugin.moc"
|
||||
|
@@ -1,29 +0,0 @@
|
||||
// Copyright (C) 2016 Brian McGillion
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
namespace Mercurial::Internal {
|
||||
|
||||
class MercurialPlugin final : public ExtensionSystem::IPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Mercurial.json")
|
||||
|
||||
~MercurialPlugin() final;
|
||||
|
||||
void initialize() final;
|
||||
void extensionsInitialized() final;
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
private slots:
|
||||
void testDiffFileResolving_data();
|
||||
void testDiffFileResolving();
|
||||
void testLogResolving();
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
} // Mercurial::Internal
|
Reference in New Issue
Block a user