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
Graphics
Gwenview
Commits
4793f94d
Commit
4793f94d
authored
Nov 18, 2020
by
Friedrich W. H. Kossebau
Browse files
Port away from deprecated KRun
parent
2378d3b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/fileopscontextmanageritem.cpp
View file @
4793f94d
...
...
@@ -30,6 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <QShortcut>
// KF
#include <kio_version.h>
#include <KActionCollection>
#include <KActionCategory>
#include <KFileItem>
...
...
@@ -43,11 +44,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <KLocalizedString>
#include <KOpenWithDialog>
#include <KPropertiesDialog>
#include <KRun>
#include <KXMLGUIClient>
#include <KUrlMimeData>
#include <KFileItemListProperties>
#include <KIO/OpenFileManagerWindowJob>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0)
#include <KIO/ApplicationLauncherJob>
#include <KIO/JobUiDelegate>
#else
#include <KRun>
#endif
// Local
#include "dialogguard.h"
...
...
@@ -400,6 +406,16 @@ void FileOpsContextManagerItem::openWith(QAction* action)
bool
ok
;
int
idx
=
action
->
data
().
toInt
(
&
ok
);
GV_RETURN_IF_FAIL
(
ok
);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0)
if
(
idx
!=
-
1
)
{
service
=
mServiceList
.
at
(
idx
);
}
// If service is null, ApplicationLauncherJob will invoke the open-with dialog
auto
*
job
=
new
KIO
::
ApplicationLauncherJob
(
service
);
job
->
setUrls
(
list
);
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
mGroup
));
job
->
start
();
#else
if
(
idx
==
-
1
)
{
// Other Application...
DialogGuard
<
KOpenWithDialog
>
dlg
(
list
,
mGroup
);
...
...
@@ -420,6 +436,7 @@ void FileOpsContextManagerItem::openWith(QAction* action)
Q_ASSERT
(
service
);
KRun
::
runService
(
*
service
,
list
,
mGroup
);
#endif
}
void
FileOpsContextManagerItem
::
openContainingFolder
()
...
...
importer/importdialog.cpp
View file @
4793f94d
...
...
@@ -28,14 +28,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
#include <QStandardPaths>
// KF
#include <kio_version.h>
#include <KIO/DeleteJob>
#include <KMessageBox>
#include <KProtocolInfo>
#include <KRun>
#include <KService>
#include <KStandardGuiItem>
#include <Solid/Device>
#include <KLocalizedString>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0)
#include <KIO/ApplicationLauncherJob>
#include <KIO/JobUiDelegate>
#else
#include <KRun>
#endif
// Local
#include "gwenview_importer_debug.h"
...
...
@@ -165,7 +171,14 @@ public:
if
(
!
service
)
{
qCCritical
(
GWENVIEW_IMPORTER_LOG
)
<<
"Could not find gwenview"
;
}
else
{
#if KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0)
auto
*
job
=
new
KIO
::
ApplicationLauncherJob
(
service
);
job
->
setUrls
({
mThumbnailPage
->
destinationUrl
()});
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
nullptr
));
job
->
start
();
#else
KRun
::
runService
(
*
service
,
{
mThumbnailPage
->
destinationUrl
()},
nullptr
/* window */
);
#endif
}
}
...
...
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