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
Plasma
Plasma Browser Integration
Commits
7f842887
Commit
7f842887
authored
Mar 27, 2021
by
Kai Uwe Broulik
🍇
Browse files
[Purpose Plugin] Use MimeTypeFinderJob
parent
25e139e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
host/purposeplugin.cpp
View file @
7f842887
...
...
@@ -11,7 +11,7 @@
#include <QJsonArray>
#include <QJsonObject>
#include <KIO/Mime
t
ypeJob>
#include <KIO/Mime
T
ype
Finder
Job>
#include <Purpose/AlternativesModel>
#include <PurposeWidgets/Menu>
...
...
@@ -129,10 +129,12 @@ QJsonObject PurposePlugin::handleData(int serial, const QString &event, const QJ
}
if
(
!
urls
.
isEmpty
())
{
auto
*
mimeJob
=
KIO
::
mimetype
(
QUrl
(
urlString
),
KIO
::
HideProgressInfo
);
connect
(
mimeJob
,
&
KJob
::
finished
,
this
,
[
this
,
mimeJob
,
shareJson
]
{
showShareMenu
(
shareJson
,
mimeJob
->
mimetype
());
auto
*
mimeJob
=
new
KIO
::
MimeTypeFinderJob
(
QUrl
(
urlString
));
mimeJob
->
setAuthenticationPromptEnabled
(
false
);
connect
(
mimeJob
,
&
KIO
::
MimeTypeFinderJob
::
result
,
this
,
[
this
,
mimeJob
,
shareJson
]
{
showShareMenu
(
shareJson
,
mimeJob
->
mimeType
());
});
mimeJob
->
start
();
return
{};
}
...
...
Write
Preview
Supports
Markdown
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