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
e83d6605
Commit
e83d6605
authored
Oct 18, 2022
by
Laurent Montel
Browse files
Make compile without deprecated methods
parent
12b47608
Pipeline
#249902
passed with stage
in 15 minutes and 32 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
kaddressbook/importexportplugins/vcards/engine/vcardviewerdialog.cpp
View file @
e83d6605
...
...
@@ -36,8 +36,8 @@ VCardViewerDialog::VCardViewerDialog(const KContacts::Addressee::List &list, QWi
connect
(
buttonBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
VCardViewerDialog
::
accept
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
VCardViewerDialog
::
reject
);
KGuiItem
::
assign
(
user1Button
,
KStandardGuiItem
::
no
());
KGuiItem
::
assign
(
user2Button
,
KStandardGuiItem
::
yes
());
KGuiItem
::
assign
(
user1Button
,
KStandardGuiItem
::
cancel
());
KGuiItem
::
assign
(
user2Button
,
KStandardGuiItem
::
ok
());
mApplyButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Apply
);
user1Button
->
setDefault
(
true
);
setModal
(
true
);
...
...
kmail/plugins/akonadidatabasetools/akonadidatabasetoolsplugininterface.cpp
View file @
e83d6605
...
...
@@ -12,6 +12,7 @@
#include
<KLocalizedString>
#include
<KMessageBox>
#include
<QAction>
#include
<kwidgetsaddons_version.h>
AkonadiDatabaseToolsPluginInterface
::
AkonadiDatabaseToolsPluginInterface
(
QObject
*
parent
)
:
PimCommon
::
GenericPluginInterface
(
parent
)
...
...
@@ -26,7 +27,21 @@ void AkonadiDatabaseToolsPluginInterface::createAction(KActionCollection *ac)
auto
action
=
new
QAction
(
i18n
(
"&Akonadi Vacuum..."
),
this
);
ac
->
addAction
(
QStringLiteral
(
"akonadivacuum"
),
action
);
connect
(
action
,
&
QAction
::
triggered
,
this
,
[
this
]()
{
if
(
KMessageBox
::
questionYesNo
(
parentWidget
(),
i18n
(
"Do you want to vacuum akonadi database?"
),
i18n
(
"Akonadi Vacuum"
))
==
KMessageBox
::
Yes
)
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
KMessageBox
::
warningTwoActions
(
#else
if
(
KMessageBox
::
questionYesNo
(
#endif
parentWidget
(),
i18n
(
"Do you want to vacuum akonadi database?"
),
i18n
(
"Akonadi Vacuum"
),
KGuiItem
(
i18n
(
"Vacuum"
)),
KStandardGuiItem
::
cancel
())
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
==
KMessageBox
::
ButtonCode
::
PrimaryAction
)
{
#else
==
KMessageBox
::
Yes
)
{
#endif
mTool
=
AkonadiDatabaseToolsUtils
::
AkonadiDatabaseTool
::
Vacuum
;
slotActivated
();
}
...
...
@@ -39,7 +54,22 @@ void AkonadiDatabaseToolsPluginInterface::createAction(KActionCollection *ac)
auto
action
=
new
QAction
(
i18n
(
"&Akonadi Fsck..."
),
this
);
ac
->
addAction
(
QStringLiteral
(
"akonadifsck"
),
action
);
connect
(
action
,
&
QAction
::
triggered
,
this
,
[
this
]()
{
if
(
KMessageBox
::
questionYesNo
(
parentWidget
(),
i18n
(
"Do you want to fsck akonadi database?"
),
i18n
(
"Akonadi Fsck"
))
==
KMessageBox
::
Yes
)
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
KMessageBox
::
warningTwoActions
(
#else
if
(
KMessageBox
::
questionYesNo
(
#endif
parentWidget
(),
i18n
(
"Do you want to fsck akonadi database?"
),
i18n
(
"Akonadi Fsck"
),
KGuiItem
(
i18n
(
"Fsck"
)),
KStandardGuiItem
::
cancel
())
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
==
KMessageBox
::
ButtonCode
::
PrimaryAction
)
{
#else
==
KMessageBox
::
Yes
)
{
#endif
mTool
=
AkonadiDatabaseToolsUtils
::
AkonadiDatabaseTool
::
Fsck
;
slotActivated
();
}
...
...
plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp
View file @
e83d6605
...
...
@@ -856,14 +856,30 @@ public:
return
false
;
}
else
{
queryStr
=
i18n
(
"%1?"
,
path
);
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
yesItem
=
KStandardGuiItem
::
ok
();
#else
yesItem
=
KStandardGuiItem
::
yes
();
#endif
}
if
(
noItem
.
text
().
isEmpty
())
{
noItem
=
KStandardGuiItem
::
cancel
();
}
const
int
answer
=
KMessageBox
::
warningYesNo
(
nullptr
,
i18n
(
"%1
\n
%2"
,
warnStr
,
queryStr
),
QString
(),
yesItem
,
noItem
);
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const
int
answer
=
KMessageBox
::
warningTwoActions
(
nullptr
,
#else
const
int
answer
=
KMessageBox
::
warningYesNo
(
nullptr
,
#endif
i18n
(
"%1
\n
%2"
,
warnStr
,
queryStr
),
QString
(),
yesItem
,
noItem
);
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
answer
==
KMessageBox
::
ButtonCode
::
SecondaryAction
)
{
#else
if
(
answer
==
KMessageBox
::
No
)
{
#endif
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