Commit c41b115f authored by Nicolas Fella's avatar Nicolas Fella Committed by Volker Krause
Browse files

Port away from KMimeTypeTrader

It is about to be deprecated

See https://phabricator.kde.org/T12177
parent 3f8d9f69
Pipeline #30683 passed with stage
in 53 minutes and 50 seconds
......@@ -40,7 +40,6 @@
#include <KEncodingFileDialog>
#include <KLocalizedString>
#include <KMessageBox>
#include <KMimeTypeTrader>
#include <QPushButton>
#include <KIO/ApplicationLauncherJob>
#include <QTemporaryFile>
......
......@@ -13,7 +13,7 @@
#include <KMessageBox>
#include <KOpenWithDialog>
#include <KProcess>
#include <KMimeTypeTrader>
#include <KApplicationTrader>
#include <KIO/DesktopExecParser>
#include <QSocketNotifier>
......@@ -55,8 +55,7 @@ EditorWatcher::ErrorEditorWatcher EditorWatcher::start()
// find an editor
QList<QUrl> list;
list.append(mUrl);
KService::Ptr offer
= KMimeTypeTrader::self()->preferredService(mMimeType, QStringLiteral("Application"));
KService::Ptr offer = KApplicationTrader::preferredService(mMimeType);
if ((mOpenWithOption == OpenWithDialog) || !offer) {
std::unique_ptr<KOpenWithDialog> dlg(new KOpenWithDialog(list, i18n("Edit with:"),
QString(), mParentWidget));
......
......@@ -45,7 +45,7 @@
#include <QMenu>
#include <KMessageBox>
#include <KMimeTypeChooser>
#include <KMimeTypeTrader>
#include <KApplicationTrader>
#include <kio_version.h>
#include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob>
......@@ -320,7 +320,7 @@ void ViewerPrivate::openAttachment(KMime::Content *node, const QUrl &url)
url.isLocalFile() ? url.toLocalFile() : url.fileName());
}
KService::Ptr offer
= KMimeTypeTrader::self()->preferredService(mimetype.name(), QStringLiteral("Application"));
= KApplicationTrader::preferredService(mimetype.name());
const QString filenameText = MimeTreeParser::NodeHelper::fileName(node);
......@@ -662,8 +662,7 @@ KService::Ptr ViewerPrivate::getServiceOffer(KMime::Content *content)
/*TODO(Andris) port when on-demand loading is done && msgPart.isComplete() */
mimetype = MimeTreeParser::Util::mimetype(fileName);
}
return KMimeTypeTrader::self()->preferredService(mimetype.name(),
QStringLiteral("Application"));
return KApplicationTrader::preferredService(mimetype.name());
}
KMime::Content::List ViewerPrivate::selectedContents() const
......
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