Commit 05b4bd6c authored by Nicolas Fella's avatar Nicolas Fella

Port away from KMimeTypeTrader

It is about to be deprecated

See https://phabricator.kde.org/T12177
parent 0f9de45f
......@@ -34,7 +34,7 @@
#include <KIO/OpenFileManagerWindowJob>
#include <KLocalizedString>
#include <KMessageBox>
#include <KMimeTypeTrader>
#include <KApplicationTrader>
#include <KOpenWithDialog>
#include <KRun>
#include <KStandardAction>
......@@ -280,7 +280,7 @@ void KateFileTree::slotFixOpenWithMenu()
QMimeType mime = db.mimeTypeForName(doc->mimeType());
QAction *a = nullptr;
const KService::List offers = KMimeTypeTrader::self()->query(mime.name(), QStringLiteral("Application"));
const KService::List offers = KApplicationTrader::queryByMimeType(mime.name());
// for each one, insert a menu item...
for (const auto &service : offers) {
if (service->name() == QLatin1String("Kate")) {
......
......@@ -22,7 +22,7 @@
#include <KIO/OpenFileManagerWindowJob>
#include <KLocalizedString>
#include <KMimeTypeTrader>
#include <KApplicationTrader>
#include <KNS3/KMoreTools>
#include <KNS3/KMoreToolsMenuFactory>
#include <KPropertiesDialog>
......@@ -91,7 +91,7 @@ void KateProjectTreeViewContextMenu::exec(const QString &filename, const QPoint
*/
QMenu *openWithMenu = menu.addMenu(i18n("Open With"));
QMimeType mimeType = QMimeDatabase().mimeTypeForFile(filename);
const KService::List offers = KMimeTypeTrader::self()->query(mimeType.name(), QStringLiteral("Application"));
const KService::List offers = KApplicationTrader::queryByMimeType(mimeType.name());
// For each one, insert a menu item...
for (const auto &service : offers) {
if (service->name() == QLatin1String("Kate")) {
......
......@@ -33,7 +33,6 @@
#include <KLocalizedString>
#include <KMessageBox>
#include <KMessageWidget>
#include <KMimeTypeTrader>
#include <QAction>
#include <QPushButton>
......
......@@ -49,7 +49,7 @@
#include <KHelpClient>
#include <KLocalizedString>
#include <KMessageBox>
#include <KMimeTypeTrader>
#include <KApplicationTrader>
#include <KMultiTabBar>
#include <KOpenWithDialog>
#include <KRecentDocument>
......@@ -901,7 +901,7 @@ void KateMainWindow::mSlotFixOpenWithMenu()
// qCDebug(LOG_KATE) << "mime type: " << mime.name();
QAction *a = nullptr;
const KService::List offers = KMimeTypeTrader::self()->query(mime.name(), QStringLiteral("Application"));
const KService::List offers = KApplicationTrader::queryByMimeType(mime.name());
// add all default open-with-actions except "Kate"
for (const auto &service : offers) {
if (service->name() == QLatin1String("Kate")) {
......
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