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
Network
KIO Extras
Commits
8bc9c7f0
Commit
8bc9c7f0
authored
Aug 16, 2020
by
Nicolas Fella
Browse files
Port away from KToolInvocation
It's about to be deprecated.
parent
7eee1f67
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
8bc9c7f0
...
...
@@ -15,7 +15,7 @@ include(FeatureSummary)
set
(
QT_MIN_VERSION
"5.11.0"
)
# TODO: when bumping to 5.72+ drop FindTaglib.cmake
set
(
KF5_MIN_VERSION
"5.6
6
.0"
)
set
(
KF5_MIN_VERSION
"5.6
9
.0"
)
find_package
(
Qt5
${
QT_MIN_VERSION
}
CONFIG REQUIRED COMPONENTS DBus Network Widgets Svg
)
find_package
(
Qt5Test
${
QT_MIN_VERSION
}
CONFIG QUIET
)
...
...
bookmarks/kio_bookmarks.cpp
View file @
8bc9c7f0
...
...
@@ -37,8 +37,8 @@
#include
<kfileplacesmodel.h>
#include
<solid/device.h>
#include
<solid/deviceinterface.h>
#include
<ktoolinvocation.h>
#include
<QGuiApplication>
#include
<KIO/ApplicationLauncherJob>
using
namespace
KIO
;
...
...
@@ -185,10 +185,22 @@ void BookmarksProtocol::get( const QUrl& url )
if
(
path
.
isEmpty
()
||
path
==
"/"
)
{
echoIndex
();
}
else
if
(
path
==
"/config"
)
{
KToolInvocation
::
startServiceByDesktopName
(
"bookmarks"
,
""
);
const
KService
::
Ptr
bookmarksKCM
=
KService
::
serviceByDesktopName
(
QStringLiteral
(
"bookmarks"
));
if
(
bookmarksKCM
)
{
auto
job
=
new
KIO
::
ApplicationLauncherJob
(
bookmarksKCM
);
job
->
start
();
}
else
{
error
(
KIO
::
ERR_SLAVE_DEFINED
,
i18n
(
"Could not find bookmarks config"
));
}
echoHead
(
"bookmarks:/"
);
}
else
if
(
path
==
"/editbookmarks"
)
{
KToolInvocation
::
kdeinitExec
(
"keditbookmarks"
);
const
KService
::
Ptr
keditbookmarks
=
KService
::
serviceByDesktopName
(
QStringLiteral
(
"org.kde.keditbookmarks"
));
if
(
keditbookmarks
)
{
auto
job
=
new
KIO
::
ApplicationLauncherJob
(
keditbookmarks
);
job
->
start
();
}
else
{
error
(
KIO
::
ERR_SLAVE_DEFINED
,
i18n
(
"Could not find bookmarks editor"
));
}
echoHead
(
"bookmarks:/"
);
}
else
if
(
path
.
indexOf
(
regexp
,
0
,
&
rmatch
)
>=
0
)
{
echoImage
(
rmatch
.
captured
(
1
),
rmatch
.
captured
(
2
),
QUrlQuery
(
url
).
queryItemValue
(
"size"
));
...
...
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