Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
05b4bd6c
Commit
05b4bd6c
authored
Aug 12, 2020
by
Nicolas Fella
Browse files
Port away from KMimeTypeTrader
It is about to be deprecated See
https://phabricator.kde.org/T12177
parent
0f9de45f
Changes
4
Hide whitespace changes
Inline
Side-by-side
addons/filetree/katefiletree.cpp
View file @
05b4bd6c
...
...
@@ -34,7 +34,7 @@
#include <KIO/OpenFileManagerWindowJob>
#include <KLocalizedString>
#include <KMessageBox>
#include <K
MimeType
Trader>
#include <K
Application
Trader>
#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
=
K
MimeTypeTrader
::
self
()
->
query
(
mime
.
name
(),
QStringLiteral
(
"Application"
));
const
KService
::
List
offers
=
K
ApplicationTrader
::
queryByMimeType
(
mime
.
name
(
));
// for each one, insert a menu item...
for
(
const
auto
&
service
:
offers
)
{
if
(
service
->
name
()
==
QLatin1String
(
"Kate"
))
{
...
...
addons/project/kateprojecttreeviewcontextmenu.cpp
View file @
05b4bd6c
...
...
@@ -22,7 +22,7 @@
#include <KIO/OpenFileManagerWindowJob>
#include <KLocalizedString>
#include <K
MimeType
Trader>
#include <K
Application
Trader>
#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
=
K
MimeTypeTrader
::
self
()
->
query
(
mimeType
.
name
(),
QStringLiteral
(
"Application"
));
const
KService
::
List
offers
=
K
ApplicationTrader
::
queryByMimeType
(
mimeType
.
name
(
));
// For each one, insert a menu item...
for
(
const
auto
&
service
:
offers
)
{
if
(
service
->
name
()
==
QLatin1String
(
"Kate"
))
{
...
...
addons/snippets/editsnippet.cpp
View file @
05b4bd6c
...
...
@@ -33,7 +33,6 @@
#include <KLocalizedString>
#include <KMessageBox>
#include <KMessageWidget>
#include <KMimeTypeTrader>
#include <QAction>
#include <QPushButton>
...
...
kate/katemainwindow.cpp
View file @
05b4bd6c
...
...
@@ -49,7 +49,7 @@
#include <KHelpClient>
#include <KLocalizedString>
#include <KMessageBox>
#include <K
MimeType
Trader>
#include <K
Application
Trader>
#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
=
K
MimeTypeTrader
::
self
()
->
query
(
mime
.
name
(),
QStringLiteral
(
"Application"
));
const
KService
::
List
offers
=
K
ApplicationTrader
::
queryByMimeType
(
mime
.
name
(
));
// add all default open-with-actions except "Kate"
for
(
const
auto
&
service
:
offers
)
{
if
(
service
->
name
()
==
QLatin1String
(
"Kate"
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment