Commit ac3ec3f4 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Port away from deprecated KServiceTypeTrader

parent 1292ada7
Pipeline #260735 passed with stage
in 1 minute and 31 seconds
......@@ -13,7 +13,7 @@ set(KOMPARE_VERSION "${KOMPARE_BASE_VERSION}.${RELEASE_SERVICE_COMPACT_VERSION}"
project(Kompare VERSION ${KOMPARE_VERSION})
set(QT_MIN_VERSION "5.15.2")
set(KF5_MIN_VERSION "5.90.0")
set(KF5_MIN_VERSION "5.100.0")
find_package(ECM ${KF5_MIN_VERSION} NO_MODULE REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
......
......@@ -18,6 +18,7 @@
#include <KTextEditor/Document>
#include <KTextEditor/View>
#include <KParts/PartLoader>
#include <KEditToolBar>
#include <KFile>
#include <KShortcutsDialog>
......@@ -25,7 +26,6 @@
#include <KMessageBox>
#include <KSqueezedTextLabel>
#include <KStandardAction>
#include <KServiceTypeTrader>
#include <KSharedConfig>
#include <KToggleAction>
#include <KActionCollection>
......@@ -399,11 +399,12 @@ void KompareShell::slotShowTextView()
m_textViewWidget = new QDockWidget(i18nc("@title:window", "Text View"), this);
m_textViewWidget->setObjectName(QStringLiteral("Text View"));
// m_textViewWidget = createDockWidget(i18n("Text View"), SmallIcon("text-x-generic"));
m_textViewPart = KServiceTypeTrader::createInstanceFromQuery<KTextEditor::Document>(
QStringLiteral("KTextEditor/Document"),
this, this, QString(), QVariantList(), &error);
if (m_textViewPart)
const auto result = KParts::PartLoader::instantiatePart<KTextEditor::Document>(KPluginMetaData(QStringLiteral("kf" QT_STRINGIFY(QT_VERSION_MAJOR) "/parts/katepart")), this, this);
if (result)
{
m_textViewPart = result.plugin;
m_textView = qobject_cast<KTextEditor::View*>(m_textViewPart->createView(this));
m_textViewWidget->setWidget(static_cast<QWidget*>(m_textView));
m_textViewPart->setHighlightingMode(QStringLiteral("Diff"));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment