2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2013-02-15 12:49:50 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-02-15 12:49:50 +01:00
|
|
|
|
2013-05-07 14:02:08 +02:00
|
|
|
#include "diffeditor_global.h"
|
|
|
|
|
|
2016-10-05 17:37:00 +02:00
|
|
|
#include <coreplugin/diffservice.h>
|
2013-02-15 12:49:50 +01:00
|
|
|
#include <extensionsystem/iplugin.h>
|
|
|
|
|
|
2022-10-28 15:09:46 +02:00
|
|
|
namespace Utils { class FutureSynchronizer; }
|
|
|
|
|
|
2022-09-22 13:48:54 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
template <typename T>
|
|
|
|
|
class QFuture;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2013-02-21 17:03:00 +01:00
|
|
|
namespace DiffEditor {
|
2013-02-15 12:49:50 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2016-10-05 17:37:00 +02:00
|
|
|
class DiffEditorServiceImpl : public QObject, public Core::DiffService
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_INTERFACES(Core::DiffService)
|
2020-02-05 15:50:46 +01:00
|
|
|
|
2016-10-05 17:37:00 +02:00
|
|
|
public:
|
2020-02-05 15:50:46 +01:00
|
|
|
DiffEditorServiceImpl();
|
2016-10-05 17:37:00 +02:00
|
|
|
|
2016-11-25 15:23:52 +01:00
|
|
|
void diffFiles(const QString &leftFileName, const QString &rightFileName) override;
|
2016-10-05 17:37:00 +02:00
|
|
|
void diffModifiedFiles(const QStringList &fileNames) override;
|
|
|
|
|
};
|
|
|
|
|
|
2020-02-05 15:50:46 +01:00
|
|
|
class DiffEditorPlugin final : public ExtensionSystem::IPlugin
|
2013-02-15 12:49:50 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "DiffEditor.json")
|
|
|
|
|
|
|
|
|
|
public:
|
2022-09-22 13:48:54 +02:00
|
|
|
DiffEditorPlugin();
|
|
|
|
|
~DiffEditorPlugin();
|
2013-02-15 12:49:50 +01:00
|
|
|
|
2020-02-05 15:50:46 +01:00
|
|
|
bool initialize(const QStringList &arguments, QString *errorMessage) final;
|
2013-02-15 12:49:50 +01:00
|
|
|
|
2022-10-28 15:09:46 +02:00
|
|
|
static Utils::FutureSynchronizer *futureSynchronizer();
|
2022-09-22 13:48:54 +02:00
|
|
|
|
2020-02-05 15:50:46 +01:00
|
|
|
private:
|
|
|
|
|
class DiffEditorPluginPrivate *d = nullptr;
|
2017-03-18 23:31:08 +02:00
|
|
|
|
2014-02-13 16:43:28 +01:00
|
|
|
#ifdef WITH_TESTS
|
2017-03-18 23:31:08 +02:00
|
|
|
private slots:
|
2014-02-13 16:43:28 +01:00
|
|
|
void testMakePatch_data();
|
|
|
|
|
void testMakePatch();
|
|
|
|
|
void testReadPatch_data();
|
|
|
|
|
void testReadPatch();
|
2017-11-29 21:36:30 +01:00
|
|
|
void testFilterPatch_data();
|
|
|
|
|
void testFilterPatch();
|
2014-02-13 16:43:28 +01:00
|
|
|
#endif // WITH_TESTS
|
2013-02-15 12:49:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
2013-02-21 17:03:00 +01:00
|
|
|
} // namespace DiffEditor
|