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
PIM
Kontact
Commits
a4220050
Commit
a4220050
authored
May 02, 2021
by
Laurent Montel
😁
Browse files
Modernize code
parent
4522a188
Pipeline
#60479
passed with stage
in 5 minutes and 30 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/aboutdialog.cpp
View file @
a4220050
...
...
@@ -64,7 +64,7 @@ void AboutDialog::addAboutData(const QString &title, const QString &icon, const
{
QIcon
pixmap
=
QIcon
::
fromTheme
(
icon
);
QFrame
*
topFrame
=
new
QFrame
();
auto
topFrame
=
new
QFrame
();
auto
pageItem
=
new
KPageWidgetItem
(
topFrame
,
title
);
pageItem
->
setIcon
(
pixmap
);
...
...
@@ -73,7 +73,7 @@ void AboutDialog::addAboutData(const QString &title, const QString &icon, const
QBoxLayout
*
topLayout
=
new
QVBoxLayout
(
topFrame
);
if
(
about
.
displayName
().
isEmpty
())
{
QLabel
*
label
=
new
QLabel
(
i18n
(
"No about information available."
),
topFrame
);
auto
label
=
new
QLabel
(
i18n
(
"No about information available."
),
topFrame
);
topLayout
->
addWidget
(
label
);
}
else
{
QString
text
=
QStringLiteral
(
"<p>"
);
...
...
@@ -94,7 +94,7 @@ void AboutDialog::addAboutData(const QString &title, const QString &icon, const
text
.
replace
(
QLatin1Char
(
'\n'
),
QStringLiteral
(
"<br>"
));
QLabel
*
label
=
new
QLabel
(
text
,
topFrame
);
auto
label
=
new
QLabel
(
text
,
topFrame
);
label
->
setAlignment
(
Qt
::
AlignTop
);
label
->
setOpenExternalLinks
(
true
);
label
->
setTextInteractionFlags
(
Qt
::
TextSelectableByMouse
|
Qt
::
TextSelectableByKeyboard
|
Qt
::
LinksAccessibleByMouse
);
...
...
@@ -260,7 +260,7 @@ void AboutDialog::addLicenseText(const KAboutData &about)
const
QString
title
=
i18n
(
"%1 License"
,
about
.
displayName
());
QFrame
*
topFrame
=
new
QFrame
();
auto
topFrame
=
new
QFrame
();
auto
page
=
new
KPageWidgetItem
(
topFrame
,
title
);
page
->
setIcon
(
QIcon
(
pixmap
));
addPage
(
page
);
...
...
src/kcmkontact.cpp
View file @
a4220050
...
...
@@ -36,7 +36,7 @@ KcmKontact::KcmKontact(QWidget *parent)
QBoxLayout
*
pluginStartupLayout
=
new
QHBoxLayout
();
topLayout
->
addLayout
(
pluginStartupLayout
);
QCheckBox
*
forceStartupPluginCheckBox
=
new
QCheckBox
(
Prefs
::
self
()
->
forceStartupPluginItem
()
->
label
(),
this
);
auto
forceStartupPluginCheckBox
=
new
QCheckBox
(
Prefs
::
self
()
->
forceStartupPluginItem
()
->
label
(),
this
);
forceStartupPluginCheckBox
->
setObjectName
(
QStringLiteral
(
"kcfg_ForceStartupPlugin"
));
pluginStartupLayout
->
addWidget
(
forceStartupPluginCheckBox
);
...
...
@@ -55,7 +55,7 @@ KcmKontact::KcmKontact(QWidget *parent)
connect
(
forceStartupPluginCheckBox
,
&
QAbstractButton
::
toggled
,
mPluginCombo
,
&
QWidget
::
setEnabled
);
QCheckBox
*
showSideBarCheckbox
=
new
QCheckBox
(
Prefs
::
self
()
->
sideBarOpenItem
()
->
label
(),
this
);
auto
showSideBarCheckbox
=
new
QCheckBox
(
Prefs
::
self
()
->
sideBarOpenItem
()
->
label
(),
this
);
showSideBarCheckbox
->
setObjectName
(
QStringLiteral
(
"kcfg_SideBarOpen"
));
topLayout
->
addWidget
(
showSideBarCheckbox
);
...
...
@@ -114,12 +114,12 @@ void KcmKontact::save()
const
KAboutData
*
KcmKontact
::
aboutData
()
const
{
KAboutData
*
about
=
new
KAboutData
(
QStringLiteral
(
"kontactconfig"
),
i18nc
(
"@title"
,
"KDE Kontact"
),
QString
(),
QString
(),
KAboutLicense
::
GPL
,
i18nc
(
"@info:credit"
,
"(c), 2003 Cornelius Schumacher"
));
auto
about
=
new
KAboutData
(
QStringLiteral
(
"kontactconfig"
),
i18nc
(
"@title"
,
"KDE Kontact"
),
QString
(),
QString
(),
KAboutLicense
::
GPL
,
i18nc
(
"@info:credit"
,
"(c), 2003 Cornelius Schumacher"
));
about
->
addAuthor
(
i18nc
(
"@info:credit"
,
"Cornelius Schumacher"
),
i18nc
(
"@info:credit"
,
"Developer"
),
QStringLiteral
(
"schumacher@kde.org"
));
about
->
addAuthor
(
i18nc
(
"@info:credit"
,
"Tobias Koenig"
),
i18nc
(
"@info:credit"
,
"Developer"
),
QStringLiteral
(
"tokoe@kde.org"
));
...
...
src/mainwindow.cpp
View file @
a4220050
...
...
@@ -231,7 +231,7 @@ void MainWindow::activateInitialPluginModule()
void
MainWindow
::
initWidgets
()
{
QWidget
*
mTopWidget
=
new
QWidget
(
this
);
auto
mTopWidget
=
new
QWidget
(
this
);
auto
layout
=
new
QVBoxLayout
;
layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
layout
->
setSpacing
(
0
);
...
...
@@ -277,7 +277,7 @@ void MainWindow::paintAboutScreen(const QString &templateName, const QVariantHas
void
MainWindow
::
initAboutScreen
()
{
QWidget
*
introbox
=
new
QWidget
(
mPartsStack
);
auto
introbox
=
new
QWidget
(
mPartsStack
);
auto
introboxHBoxLayout
=
new
QHBoxLayout
(
introbox
);
introboxHBoxLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
mPartsStack
->
addWidget
(
introbox
);
...
...
@@ -296,7 +296,7 @@ void MainWindow::setupActions()
actionCollection
()
->
setDefaultShortcuts
(
mNewActions
,
KStandardShortcut
::
openNew
());
connect
(
mNewActions
,
&
KActionMenu
::
triggered
,
this
,
&
MainWindow
::
slotNewClicked
);
QAction
*
action
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"configure"
)),
i18nc
(
"@action:inmenu"
,
"Configure Kontact..."
),
this
);
auto
action
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"configure"
)),
i18nc
(
"@action:inmenu"
,
"Configure Kontact..."
),
this
);
setHelpText
(
action
,
i18nc
(
"@info:status"
,
"Configure Kontact"
));
action
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"You will be presented with a dialog where you can configure Kontact."
));
actionCollection
()
->
addAction
(
QStringLiteral
(
"settings_configure_kontact"
),
action
);
...
...
@@ -474,7 +474,7 @@ void MainWindow::addPlugin(KontactInterface::Plugin *plugin)
mPlugins
.
append
(
plugin
);
if
(
plugin
->
showInSideBar
())
{
QAction
*
action
=
new
QAction
(
QIcon
::
fromTheme
(
plugin
->
icon
()),
plugin
->
title
(),
this
);
auto
action
=
new
QAction
(
QIcon
::
fromTheme
(
plugin
->
icon
()),
plugin
->
title
(),
this
);
// action->setHelpText(
// i18nc( "@info:status", "Plugin %1", plugin->title() ) );
action
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Switch to plugin %1"
,
plugin
->
title
()));
...
...
@@ -822,7 +822,7 @@ void MainWindow::slotOpenUrl(const QUrl &url)
mPartsStack
->
setCurrentIndex
(
mPartsStack
->
indexOf
(
mCurrentPlugin
->
part
()
->
widget
()));
}
}
else
if
(
path
==
QLatin1String
(
"/accountwizard"
))
{
KIO
::
CommandLauncherJob
*
job
=
new
KIO
::
CommandLauncherJob
(
QStringLiteral
(
"accountwizard"
));
auto
job
=
new
KIO
::
CommandLauncherJob
(
QStringLiteral
(
"accountwizard"
));
job
->
setUiDelegate
(
new
KDialogJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
job
->
exec
();
slotQuit
();
...
...
src/mainwindow.h
View file @
a4220050
...
...
@@ -23,8 +23,8 @@ class QSplitter;
class
QStackedWidget
;
class
IntroductionWebEngineView
;
typedef
QList
<
KontactInterface
::
Plugin
*>
PluginList
;
typedef
QList
<
QAction
*>
ActionPluginList
;
using
PluginList
=
QList
<
KontactInterface
::
Plugin
*>
;
using
ActionPluginList
=
QList
<
QAction
*>
;
namespace
Kontact
{
...
...
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