forked from qt-creator/qt-creator
Cvs: Move plugin class definition to .cpp
Change-Id: Icb1e3644498c3e3acd26d88e87425f040132687a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -2,10 +2,14 @@ add_qtc_plugin(CVS
|
|||||||
PLUGIN_CLASS CvsPlugin
|
PLUGIN_CLASS CvsPlugin
|
||||||
PLUGIN_DEPENDS Core TextEditor VcsBase
|
PLUGIN_DEPENDS Core TextEditor VcsBase
|
||||||
SOURCES
|
SOURCES
|
||||||
cvseditor.cpp cvseditor.h
|
cvseditor.cpp
|
||||||
cvsplugin.cpp cvsplugin.h
|
cvseditor.h
|
||||||
cvssettings.cpp cvssettings.h
|
cvsplugin.cpp
|
||||||
cvssubmiteditor.cpp cvssubmiteditor.h
|
cvssettings.cpp
|
||||||
|
cvssettings.h
|
||||||
|
cvssubmiteditor.cpp
|
||||||
|
cvssubmiteditor.h
|
||||||
cvstr.h
|
cvstr.h
|
||||||
cvsutils.cpp cvsutils.h
|
cvsutils.cpp
|
||||||
|
cvsutils.h
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ QtcPlugin {
|
|||||||
"cvseditor.cpp",
|
"cvseditor.cpp",
|
||||||
"cvseditor.h",
|
"cvseditor.h",
|
||||||
"cvsplugin.cpp",
|
"cvsplugin.cpp",
|
||||||
"cvsplugin.h",
|
|
||||||
"cvssettings.cpp",
|
"cvssettings.cpp",
|
||||||
"cvssettings.h",
|
"cvssettings.h",
|
||||||
"cvssubmiteditor.cpp",
|
"cvssubmiteditor.cpp",
|
||||||
|
|||||||
@@ -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 "cvsplugin.h"
|
|
||||||
|
|
||||||
#include "cvseditor.h"
|
#include "cvseditor.h"
|
||||||
#include "cvssettings.h"
|
#include "cvssettings.h"
|
||||||
#include "cvssubmiteditor.h"
|
#include "cvssubmiteditor.h"
|
||||||
@@ -34,6 +32,8 @@
|
|||||||
#include <coreplugin/locator/commandlocator.h>
|
#include <coreplugin/locator/commandlocator.h>
|
||||||
#include <coreplugin/vcsmanager.h>
|
#include <coreplugin/vcsmanager.h>
|
||||||
|
|
||||||
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
#include <utils/commandline.h>
|
#include <utils/commandline.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
@@ -460,27 +460,12 @@ void CvsPluginPrivate::cleanCommitMessageFile()
|
|||||||
m_commitRepository.clear();
|
m_commitRepository.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CvsPluginPrivate::isCommitEditorOpen() const
|
bool CvsPluginPrivate::isCommitEditorOpen() const
|
||||||
{
|
{
|
||||||
return !m_commitMessageFileName.isEmpty();
|
return !m_commitMessageFileName.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
CvsPlugin::~CvsPlugin()
|
|
||||||
{
|
|
||||||
delete dd;
|
|
||||||
dd = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CvsPlugin::initialize()
|
|
||||||
{
|
|
||||||
dd = new CvsPluginPrivate;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CvsPlugin::extensionsInitialized()
|
|
||||||
{
|
|
||||||
dd->extensionsInitialized();
|
|
||||||
}
|
|
||||||
|
|
||||||
CvsPluginPrivate::CvsPluginPrivate()
|
CvsPluginPrivate::CvsPluginPrivate()
|
||||||
: VcsBasePluginPrivate(Context(CVS_CONTEXT))
|
: VcsBasePluginPrivate(Context(CVS_CONTEXT))
|
||||||
{
|
{
|
||||||
@@ -1408,7 +1393,18 @@ bool CvsPluginPrivate::checkCVSDirectory(const QDir &directory) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
void CvsPlugin::testDiffFileResolving_data()
|
|
||||||
|
class CvsTest final : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void testDiffFileResolving_data();
|
||||||
|
void testDiffFileResolving();
|
||||||
|
void testLogResolving();
|
||||||
|
};
|
||||||
|
|
||||||
|
void CvsTest::testDiffFileResolving_data()
|
||||||
{
|
{
|
||||||
QTest::addColumn<QByteArray>("header");
|
QTest::addColumn<QByteArray>("header");
|
||||||
QTest::addColumn<QByteArray>("fileName");
|
QTest::addColumn<QByteArray>("fileName");
|
||||||
@@ -1422,12 +1418,12 @@ void CvsPlugin::testDiffFileResolving_data()
|
|||||||
<< QByteArray("src/plugins/cvs/cvseditor.cpp");
|
<< QByteArray("src/plugins/cvs/cvseditor.cpp");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CvsPlugin::testDiffFileResolving()
|
void CvsTest::testDiffFileResolving()
|
||||||
{
|
{
|
||||||
VcsBaseEditorWidget::testDiffFileResolving(dd->diffEditorFactory);
|
VcsBaseEditorWidget::testDiffFileResolving(dd->diffEditorFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CvsPlugin::testLogResolving()
|
void CvsTest::testLogResolving()
|
||||||
{
|
{
|
||||||
QByteArray data(
|
QByteArray data(
|
||||||
"RCS file: /sources/cvs/ccvs/Attic/FIXED-BUGS,v\n"
|
"RCS file: /sources/cvs/ccvs/Attic/FIXED-BUGS,v\n"
|
||||||
@@ -1454,4 +1450,32 @@ void CvsPlugin::testLogResolving()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class CvsPlugin final : public ExtensionSystem::IPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CVS.json")
|
||||||
|
|
||||||
|
~CvsPlugin() final
|
||||||
|
{
|
||||||
|
delete dd;
|
||||||
|
dd = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void initialize() final
|
||||||
|
{
|
||||||
|
dd = new CvsPluginPrivate;
|
||||||
|
|
||||||
|
#ifdef WITH_TESTS
|
||||||
|
addTest<CvsTest>();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void extensionsInitialized() final
|
||||||
|
{
|
||||||
|
dd->extensionsInitialized();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Cvs::Internal
|
} // namespace Cvs::Internal
|
||||||
|
|
||||||
|
#include "cvsplugin.moc"
|
||||||
|
|||||||
@@ -1,28 +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 Cvs::Internal {
|
|
||||||
|
|
||||||
class CvsPlugin final : public ExtensionSystem::IPlugin
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CVS.json")
|
|
||||||
|
|
||||||
~CvsPlugin() final;
|
|
||||||
|
|
||||||
void initialize() final;
|
|
||||||
void extensionsInitialized() final;
|
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
|
||||||
private slots:
|
|
||||||
void testDiffFileResolving_data();
|
|
||||||
void testDiffFileResolving();
|
|
||||||
void testLogResolving();
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Cvs::Internal
|
|
||||||
Reference in New Issue
Block a user