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
KBackup
Commits
b4077ab2
Commit
b4077ab2
authored
Sep 29, 2020
by
Laurent Montel
😁
Browse files
Port some deprecated method
parent
9608aa7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
b4077ab2
...
...
@@ -8,8 +8,8 @@ set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_
project
(
kbackup
)
set
(
QT_MIN_VERSION
"5.1
1
.0"
)
set
(
KF5_MIN_VERSION
"5.
45
.0"
)
set
(
QT_MIN_VERSION
"5.1
2
.0"
)
set
(
KF5_MIN_VERSION
"5.
71
.0"
)
find_package
(
ECM
${
KF5_MIN_VERSION
}
REQUIRED NO_MODULE
)
set
(
CMAKE_MODULE_PATH
${
ECM_MODULE_PATH
}
)
...
...
src/Selector.cxx
View file @
b4077ab2
...
...
@@ -17,15 +17,12 @@
#include <KPropertiesDialog>
#include <KFileItem>
#include <KMimeTypeTrader>
#include <KRun>
#include <KActionCollection>
#include <KMessageBox>
#if (KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0))
#include <KIO/ApplicationLauncherJob>
#include <KIO/OpenUrlJob>
#include <KIO/JobUiDelegate>
#endif
#include <QDir>
#include <QPixmap>
...
...
@@ -725,8 +722,10 @@ void Selector::open()
QUrl
sourceUrl
=
QUrl
::
fromLocalFile
(
getPath
(
item
));
KRun
*
run
=
new
KRun
(
sourceUrl
,
window
());
// auto-deletes itself
run
->
setRunExecutables
(
false
);
auto
*
job
=
new
KIO
::
OpenUrlJob
(
sourceUrl
,
window
());
job
->
setRunExecutables
(
false
);
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
job
->
start
();
}
//--------------------------------------------------------------------------------
...
...
@@ -744,39 +743,27 @@ void Selector::openWith(QAction *action)
if
(
name
.
isEmpty
()
)
// Other Application...
{
#if (KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0))
KIO
::
ApplicationLauncherJob
*
job
=
new
KIO
::
ApplicationLauncherJob
();
job
->
setUrls
(
QList
<
QUrl
>
()
<<
sourceUrl
);
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
job
->
start
();
#else
KRun
::
displayOpenWithDialog
(
QList
<
QUrl
>
()
<<
sourceUrl
,
this
);
#endif
return
;
}
if
(
name
==
QLatin1String
(
"-"
)
)
// File Manager
{
#if (KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0))
KIO
::
OpenUrlJob
*
job
=
new
KIO
::
OpenUrlJob
(
sourceUrl
.
adjusted
(
QUrl
::
RemoveFilename
),
QStringLiteral
(
"inode/directory"
));
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
job
->
start
();
#else
KRun
::
runUrl
(
sourceUrl
.
adjusted
(
QUrl
::
RemoveFilename
),
QStringLiteral
(
"inode/directory"
),
this
,
KRun
::
RunFlags
());
#endif
return
;
}
KService
::
Ptr
service
=
serviceForName
[
name
];
#if (KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0))
KIO
::
ApplicationLauncherJob
*
job
=
new
KIO
::
ApplicationLauncherJob
(
service
);
job
->
setUrls
(
QList
<
QUrl
>
()
<<
sourceUrl
);
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
job
->
start
();
#else
KRun
::
runApplication
(
*
service
,
QList
<
QUrl
>
()
<<
sourceUrl
,
this
);
#endif
}
//--------------------------------------------------------------------------------
...
...
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