Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
Konversation
Commits
ae0790dd
Commit
ae0790dd
authored
Aug 21, 2022
by
Laurent Montel
Browse files
Port away from deprecated KIO code
parent
8c6e07dc
Pipeline
#220955
passed with stage
in 3 minutes and 42 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/application.cpp
View file @
ae0790dd
...
...
@@ -30,7 +30,12 @@
#include
"konversation_log.h"
#include
"konversation_state.h"
#include
<kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include
<KIO/JobUiDelegateFactory>
#else
#include
<KIO/JobUiDelegate>
#endif
#include
<KIO/OpenUrlJob>
#include
<KConfig>
#include
<KShell>
...
...
@@ -1249,7 +1254,11 @@ void Application::openUrl(const QString& url)
#else
auto
*
job
=
new
KIO
::
OpenUrlJob
(
QUrl
(
url
));
job
->
setFollowRedirections
(
false
);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
Application
::
instance
()
->
getMainWindow
()));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
Application
::
instance
()
->
getMainWindow
()));
#endif
job
->
start
();
#endif
return
;
...
...
src/dcc/transfer.cpp
View file @
ae0790dd
...
...
@@ -17,7 +17,13 @@
#include
<config-konversation.h>
#include
<kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include
<KIO/JobUiDelegateFactory>
#else
#include
<KIO/JobUiDelegate>
#endif
#include
<KIO/OpenUrlJob>
#include
<QFileInfo>
...
...
@@ -102,7 +108,11 @@ namespace Konversation
if
(
getType
()
==
Transfer
::
Send
||
getStatus
()
==
Transfer
::
Done
)
{
auto
*
job
=
new
KIO
::
OpenUrlJob
(
getFileURL
());
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
nullptr
));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
nullptr
));
#endif
job
->
setRunExecutables
(
false
);
job
->
start
();
}
...
...
src/viewer/irccontextmenus.cpp
View file @
ae0790dd
...
...
@@ -19,7 +19,12 @@
#include
<QFileDialog>
#include
<KIO/CopyJob>
#include
<KIO/ApplicationLauncherJob>
#include
<kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include
<KIO/JobUiDelegateFactory>
#else
#include
<KIO/JobUiDelegate>
#endif
#include
<QMenu>
#include
<KMessageBox>
#include
<KStandardAction>
...
...
@@ -750,7 +755,11 @@ void IrcContextMenus::processLinkAction(int actionId, const QString& link)
{
// ApplicationLauncherJob ctor without args will invoke the open-with dialog
auto
*
job
=
new
KIO
::
ApplicationLauncherJob
();
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
Application
::
instance
()
->
getMainWindow
()));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
Application
::
instance
()
->
getMainWindow
()));
#endif
job
->
setUrls
({
QUrl
(
link
)
});
job
->
start
();
...
...
src/viewer/viewcontainer.cpp
View file @
ae0790dd
...
...
@@ -38,7 +38,12 @@
#include
<KMessageBox>
#include
<KIO/OpenUrlJob>
#include
<kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include
<KIO/JobUiDelegateFactory>
#else
#include
<KIO/JobUiDelegate>
#endif
#include
<QUrl>
#include
<KXMLGUIFactory>
#include
<KActionCollection>
...
...
@@ -2589,7 +2594,11 @@ void ViewContainer::openLogFile(const QString& caption, const QString& file)
if
(
Preferences
::
self
()
->
useExternalLogViewer
())
{
auto
*
job
=
new
KIO
::
OpenUrlJob
(
QUrl
::
fromLocalFile
(
file
),
QStringLiteral
(
"text/plain"
));
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
m_window
));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
m_window
));
#endif
job
->
start
();
return
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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