Commit 886766e1 authored by Nicolas Fella's avatar Nicolas Fella Committed by Elvis Angelaccio
Browse files

Port from KMimeTypeTrader to KApplicationTrader

The former is obsolete. Also check whether we have a service at all
before using it.
parent 6b9caff2
......@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
include(FeatureSummary)
set(QT_MIN_VERSION "5.8.0")
set(KF5_MIN_VERSION "5.0.0")
set(KF5_MIN_VERSION "5.68.0")
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Core
......
......@@ -44,12 +44,13 @@
#include <QIcon>
#include <QMenu>
#include <QDebug>
#include <KApplicationTrader>
#include <KMessageBox>
#include <QFileDialog>
#include <KConfig>
#include <KConfigGroup>
#include <KService>
#include <KMimeTypeTrader>
#include <KLocalizedString>
#include <KPluginFactory>
......@@ -851,8 +852,8 @@ QString FileViewHgPlugin::visualDiffExecPath()
return result;
}
KService::List services = KMimeTypeTrader::self()->query("text/x-diff");
return services.first()->exec().split(' ').takeFirst();
KService::Ptr service = KApplicationTrader::preferredService(QStringLiteral("text/x-diff"));
return service ? service->exec().split(' ').takeFirst() : QString();
}
#include "fileviewhgplugin.moc"
......
Markdown is supported
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