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
KMail Account Wizard
Commits
3e616400
Commit
3e616400
authored
Nov 05, 2020
by
Laurent Montel
😁
Browse files
Modernize code
parent
ee91c0d6
Pipeline
#39714
passed with stage
in 12 minutes and 45 seconds
Changes
12
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/cryptopage.cpp
View file @
3e616400
...
...
@@ -71,7 +71,7 @@ Q_SIGNALS:
private
Q_SLOTS
:
void
onObjectSetupFinished
(
SetupObject
*
obj
)
{
if
(
Transport
*
transport
=
qobject_cast
<
Transport
*>
(
obj
))
{
if
(
auto
*
transport
=
qobject_cast
<
Transport
*>
(
obj
))
{
mTransportId
=
transport
->
transportId
();
}
}
...
...
src/dialog.cpp
View file @
3e616400
...
...
@@ -42,7 +42,7 @@ Dialog::Dialog(QWidget *parent)
const
bool
showPersonalDataPage
=
Global
::
typeFilter
().
size
()
==
1
&&
Global
::
typeFilter
().
at
(
0
)
==
KMime
::
Message
::
mimeType
();
if
(
showPersonalDataPage
)
{
// todo: don't ask these details based on a setting of the desktop file.
PersonalDataPage
*
pdpage
=
new
PersonalDataPage
(
this
);
auto
*
pdpage
=
new
PersonalDataPage
(
this
);
addPage
(
pdpage
,
i18n
(
"Provide personal data"
));
connect
(
pdpage
,
&
PersonalDataPage
::
manualWanted
,
this
,
&
Dialog
::
slotManualConfigWanted
);
if
(
!
Global
::
assistant
().
isEmpty
())
{
...
...
@@ -50,13 +50,13 @@ Dialog::Dialog(QWidget *parent)
}
if
(
!
GpgME
::
checkEngine
(
GpgME
::
OpenPGP
))
{
CryptoPage
*
cryptoPage
=
new
CryptoPage
(
this
);
auto
*
cryptoPage
=
new
CryptoPage
(
this
);
addPage
(
cryptoPage
,
i18n
(
"Secure your Communication"
));
}
}
if
(
Global
::
assistant
().
isEmpty
())
{
TypePage
*
typePage
=
new
TypePage
(
this
);
auto
*
typePage
=
new
TypePage
(
this
);
connect
(
typePage
->
treeview
(),
&
QAbstractItemView
::
doubleClicked
,
this
,
&
Dialog
::
slotNextPage
);
#ifndef ACCOUNTWIZARD_NO_GHNS
connect
(
typePage
,
&
TypePage
::
ghnsWanted
,
this
,
&
Dialog
::
slotGhnsWanted
);
...
...
@@ -65,7 +65,7 @@ Dialog::Dialog(QWidget *parent)
setAppropriate
(
mTypePage
,
false
);
#ifndef ACCOUNTWIZARD_NO_GHNS
ProviderPage
*
ppage
=
new
ProviderPage
(
this
);
auto
*
ppage
=
new
ProviderPage
(
this
);
connect
(
typePage
,
&
TypePage
::
ghnsWanted
,
ppage
,
&
ProviderPage
::
startFetchingData
);
connect
(
ppage
->
treeview
(),
&
QAbstractItemView
::
doubleClicked
,
this
,
&
Dialog
::
slotNextPage
);
connect
(
ppage
,
&
ProviderPage
::
ghnsNotWanted
,
this
,
&
Dialog
::
slotGhnsNotWanted
);
...
...
@@ -74,7 +74,7 @@ Dialog::Dialog(QWidget *parent)
#endif
}
LoadPage
*
loadPage
=
new
LoadPage
(
this
);
auto
*
loadPage
=
new
LoadPage
(
this
);
mLoadPage
=
addPage
(
loadPage
,
i18n
(
"Loading Assistant"
));
setAppropriate
(
mLoadPage
,
false
);
loadPage
->
exportObject
(
this
,
QStringLiteral
(
"Dialog"
));
...
...
@@ -82,7 +82,7 @@ Dialog::Dialog(QWidget *parent)
loadPage
->
exportObject
(
new
ServerTest
(
this
),
QStringLiteral
(
"ServerTest"
));
connect
(
loadPage
,
&
LoadPage
::
aboutToStart
,
this
,
&
Dialog
::
clearDynamicPages
);
SetupPage
*
setupPage
=
new
SetupPage
(
this
);
auto
*
setupPage
=
new
SetupPage
(
this
);
mLastPage
=
addPage
(
setupPage
,
i18n
(
"Setting up Account"
));
mSetupManager
->
setSetupPage
(
setupPage
);
...
...
src/dynamicpage.cpp
View file @
3e616400
...
...
@@ -19,7 +19,7 @@
DynamicPage
::
DynamicPage
(
const
QString
&
uiFile
,
KAssistantDialog
*
parent
)
:
Page
(
parent
)
{
QVBoxLayo
ut
*
layout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
layout
=
new
QVBoxLayout
(
this
);
layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
QWidget
*
pageParent
=
this
;
...
...
@@ -32,7 +32,7 @@ DynamicPage::DynamicPage(const QString &uiFile, KAssistantDialog *parent)
m_dynamicWidget
=
loader
.
load
(
&
file
,
pageParent
);
file
.
close
();
if
(
!
Global
::
poFileName
().
isEmpty
())
{
KLocalizedTransl
ato
r
*
translator
=
new
KLocalizedTranslator
(
this
);
a
u
to
*
translator
=
new
KLocalizedTranslator
(
this
);
QCoreApplication
::
instance
()
->
installTranslator
(
translator
);
translator
->
setTranslationDomain
(
Global
::
poFileName
());
...
...
src/ispdb/autoconfigkolabmail.cpp
View file @
3e616400
...
...
@@ -50,7 +50,7 @@ void AutoconfigKolabMail::slotResult(KJob *job)
return
;
}
KIO
::
TransferJob
*
tjob
=
qobject_cast
<
KIO
::
TransferJob
*>
(
job
);
auto
*
tjob
=
qobject_cast
<
KIO
::
TransferJob
*>
(
job
);
int
responsecode
=
tjob
->
queryMetaData
(
QStringLiteral
(
"responsecode"
)).
toInt
();
...
...
src/personaldatapage.cpp
View file @
3e616400
...
...
@@ -38,7 +38,7 @@ PersonalDataPage::PersonalDataPage(Dialog *parent)
ui
.
setupUi
(
pageParent
);
ui
.
mProgress
->
stop
();
PimCommon
::
EmailValid
ato
r
*
emailValidator
=
new
PimCommon
::
EmailValidator
(
this
);
a
u
to
*
emailValidator
=
new
PimCommon
::
EmailValidator
(
this
);
ui
.
emailEdit
->
setValidator
(
emailValidator
);
// KEmailSettings defaults
...
...
@@ -158,7 +158,7 @@ void PersonalDataPage::configureSmtpAccount()
qCDebug
(
ACCOUNTWIZARD_LOG
)
<<
"Configuring transport for"
<<
s
.
hostname
;
QObject
*
object
=
mSetupManager
->
createTransport
(
QStringLiteral
(
"smtp"
));
Transport
*
t
=
qobject_cast
<
Transport
*>
(
object
);
auto
*
t
=
qobject_cast
<
Transport
*>
(
object
);
t
->
setName
(
accountName
(
mIspdb
,
s
.
username
));
t
->
setHost
(
s
.
hostname
);
t
->
setPort
(
s
.
port
);
...
...
@@ -209,7 +209,7 @@ void PersonalDataPage::configureImapAccount()
qCDebug
(
ACCOUNTWIZARD_LOG
)
<<
"Configuring imap for"
<<
s
.
hostname
;
QObject
*
object
=
mSetupManager
->
createResource
(
QStringLiteral
(
"akonadi_imap_resource"
));
Resource
*
t
=
qobject_cast
<
Resource
*>
(
object
);
auto
*
t
=
qobject_cast
<
Resource
*>
(
object
);
t
->
setName
(
accountName
(
mIspdb
,
s
.
username
));
t
->
setOption
(
QStringLiteral
(
"ImapServer"
),
s
.
hostname
);
t
->
setOption
(
QStringLiteral
(
"ImapPort"
),
s
.
port
);
...
...
@@ -261,7 +261,7 @@ void PersonalDataPage::configurePop3Account()
qCDebug
(
ACCOUNTWIZARD_LOG
)
<<
"No Imap to be created, configuring pop3 for"
<<
s
.
hostname
;
QObject
*
object
=
mSetupManager
->
createResource
(
QStringLiteral
(
"akonadi_pop3_resource"
));
Resource
*
t
=
qobject_cast
<
Resource
*>
(
object
);
auto
*
t
=
qobject_cast
<
Resource
*>
(
object
);
t
->
setName
(
accountName
(
mIspdb
,
s
.
username
));
t
->
setOption
(
QStringLiteral
(
"Host"
),
s
.
hostname
);
t
->
setOption
(
QStringLiteral
(
"Port"
),
s
.
port
);
...
...
src/providerpage.cpp
View file @
3e616400
...
...
@@ -92,7 +92,7 @@ void ProviderPage::leavePageNext()
return
;
}
const
QSortFilterProxyModel
*
proxy
=
static_cast
<
const
QSortFilterProxyModel
*>
(
ui
.
listView
->
model
());
const
auto
*
proxy
=
static_cast
<
const
QSortFilterProxyModel
*>
(
ui
.
listView
->
model
());
const
QStandardItem
*
item
=
m_model
->
itemFromIndex
(
proxy
->
mapToSource
(
index
));
qCDebug
(
ACCOUNTWIZARD_LOG
)
<<
"Item selected:"
<<
item
->
text
();
...
...
src/resource.cpp
View file @
3e616400
...
...
@@ -92,7 +92,7 @@ void Resource::create()
}
Q_EMIT
info
(
i18n
(
"Creating resource instance for '%1'..."
,
type
.
name
()));
AgentInstanceCreateJob
*
job
=
new
AgentInstanceCreateJob
(
type
,
this
);
auto
*
job
=
new
AgentInstanceCreateJob
(
type
,
this
);
connect
(
job
,
&
AgentInstanceCreateJob
::
result
,
this
,
&
Resource
::
instanceCreateResult
);
job
->
start
();
}
...
...
src/setupautoconfigkolabfreebusy.cpp
View file @
3e616400
...
...
@@ -33,7 +33,7 @@ int SetupAutoconfigKolabFreebusy::countFreebusyServers() const
void
SetupAutoconfigKolabFreebusy
::
fillFreebusyServer
(
int
i
,
QObject
*
o
)
const
{
const
freebusy
isp
=
mIspdb
->
freebusyServers
().
values
().
at
(
i
);
ConfigFile
*
korganizer
=
qobject_cast
<
ConfigFile
*>
(
o
);
auto
*
korganizer
=
qobject_cast
<
ConfigFile
*>
(
o
);
QFileInfo
path
(
isp
.
path
);
QString
url
(
QStringLiteral
(
"https://"
));
...
...
src/setupispdb.cpp
View file @
3e616400
...
...
@@ -50,7 +50,7 @@ void SetupIspdb::fillIdentity(int i, QObject *o) const
{
identity
isp
=
mIspdb
->
identities
().
at
(
i
);
Identity
*
id
=
qobject_cast
<
Identity
*>
(
o
);
auto
*
id
=
qobject_cast
<
Identity
*>
(
o
);
id
->
setIdentityName
(
isp
.
name
);
id
->
setRealName
(
isp
.
name
);
...
...
@@ -65,7 +65,7 @@ void SetupIspdb::fillImapServer(int i, QObject *o) const
return
;
}
Server
isp
=
mIspdb
->
imapServers
().
at
(
i
);
Resource
*
imapRes
=
qobject_cast
<
Resource
*>
(
o
);
auto
*
imapRes
=
qobject_cast
<
Resource
*>
(
o
);
imapRes
->
setName
(
isp
.
hostname
);
imapRes
->
setOption
(
QStringLiteral
(
"ImapServer"
),
isp
.
hostname
);
...
...
@@ -89,7 +89,7 @@ int SetupIspdb::countImapServers() const
void
SetupIspdb
::
fillSmtpServer
(
int
i
,
QObject
*
o
)
const
{
Server
isp
=
mIspdb
->
smtpServers
().
at
(
i
);
Transport
*
smtpRes
=
qobject_cast
<
Transport
*>
(
o
);
auto
*
smtpRes
=
qobject_cast
<
Transport
*>
(
o
);
smtpRes
->
setName
(
isp
.
hostname
);
smtpRes
->
setHost
(
isp
.
hostname
);
...
...
src/setupmanager.cpp
View file @
3e616400
...
...
@@ -63,7 +63,7 @@ QObject *SetupManager::createLdap()
QObject
*
SetupManager
::
createIdentity
()
{
Identity
*
identity
=
new
Identity
(
this
);
auto
*
identity
=
new
Identity
(
this
);
identity
->
setEmail
(
m_email
);
identity
->
setRealName
(
m_name
);
identity
->
setPgpAutoSign
(
m_pgpAutoSign
);
...
...
src/setuppage.cpp
View file @
3e616400
...
...
@@ -29,7 +29,7 @@ void SetupPage::detailsClicked()
void
SetupPage
::
addMessage
(
SetupPage
::
MessageType
type
,
const
QString
&
msg
)
{
QStandardItem
*
item
=
new
QStandardItem
;
auto
*
item
=
new
QStandardItem
;
item
->
setText
(
msg
);
item
->
setEditable
(
false
);
switch
(
type
)
{
...
...
src/transport.cpp
View file @
3e616400
...
...
@@ -16,7 +16,7 @@ template<typename T>
struct
StringValueTable
{
const
char
*
name
;
typename
T
::
type
value
;
type
def
typename
T
::
type
value_type
;
using
value_
type
=
typename
T
::
type
;
};
static
const
StringValueTable
<
MailTransport
::
Transport
::
EnumEncryption
>
encryptionEnum
[]
=
{
...
...
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