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
PIM
KDE PIM Add-ons
Commits
1539a0c4
Commit
1539a0c4
authored
Aug 20, 2022
by
Laurent Montel
Browse files
Port away from deprecated KIO code
parent
628ff4cb
Pipeline
#220526
passed with stage
in 18 minutes and 55 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
plugins/webengineurlinterceptor/adblock/lib/widgets/adblockblockableitemswidget.cpp
View file @
1539a0c4
...
...
@@ -10,7 +10,12 @@
#include
"adblockmanager.h"
#include
"adblockutil.h"
#include
<KConfigGroup>
#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
<KLocalizedString>
#include
<KSharedConfig>
...
...
@@ -146,7 +151,11 @@ void AdBlockBlockableItemsWidget::slotOpenItem()
}
const
QUrl
url
(
item
->
text
(
Url
));
auto
job
=
new
KIO
::
OpenUrlJob
(
url
);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
#endif
job
->
setRunExecutables
(
false
);
job
->
start
();
}
...
...
plugins/webengineurlinterceptor/adblock/lib/widgets/adblocksettingwidget.cpp
View file @
1539a0c4
...
...
@@ -35,8 +35,12 @@ using namespace PimCommon::ConfigureImmutableWidgetUtils;
#include
<KMessageBox>
#include
<QWhatsThisClickedEvent>
// Qt Includes
#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
<QPointer>
#include
<QStandardPaths>
...
...
@@ -158,7 +162,11 @@ bool AdBlockSettingWidget::event(QEvent *event)
if
(
event
->
type
()
==
QEvent
::
WhatsThisClicked
)
{
auto
clicked
=
static_cast
<
QWhatsThisClickedEvent
*>
(
event
);
auto
job
=
new
KIO
::
OpenUrlJob
(
QUrl
(
clicked
->
href
()));
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
#endif
job
->
start
();
return
true
;
}
...
...
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