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) ...@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
include(FeatureSummary) include(FeatureSummary)
set(QT_MIN_VERSION "5.8.0") 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 find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Core Core
......
...@@ -44,12 +44,13 @@ ...@@ -44,12 +44,13 @@
#include <QIcon> #include <QIcon>
#include <QMenu> #include <QMenu>
#include <QDebug> #include <QDebug>
#include <KApplicationTrader>
#include <KMessageBox> #include <KMessageBox>
#include <QFileDialog> #include <QFileDialog>
#include <KConfig> #include <KConfig>
#include <KConfigGroup> #include <KConfigGroup>
#include <KService> #include <KService>
#include <KMimeTypeTrader>
#include <KLocalizedString> #include <KLocalizedString>
#include <KPluginFactory> #include <KPluginFactory>
...@@ -851,8 +852,8 @@ QString FileViewHgPlugin::visualDiffExecPath() ...@@ -851,8 +852,8 @@ QString FileViewHgPlugin::visualDiffExecPath()
return result; return result;
} }
KService::List services = KMimeTypeTrader::self()->query("text/x-diff"); KService::Ptr service = KApplicationTrader::preferredService(QStringLiteral("text/x-diff"));
return services.first()->exec().split(' ').takeFirst(); return service ? service->exec().split(' ').takeFirst() : QString();
} }
#include "fileviewhgplugin.moc" #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