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
KDE PIM Add-ons
Commits
7f65a330
Commit
7f65a330
authored
Feb 04, 2021
by
Laurent Montel
😁
Browse files
Use auto vs auto * where it's possible
parent
7ca35b6f
Pipeline
#49679
failed with stage
in 23 minutes and 26 seconds
Changes
214
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
kaddressbook/editorpages/cryptopageplugin.cpp
View file @
7f65a330
...
...
@@ -31,7 +31,7 @@ CryptoPagePlugin::CryptoPagePlugin()
{
KIconLoader
::
global
()
->
addAppDir
(
QStringLiteral
(
"libkleopatra"
));
auto
*
topLayout
=
new
QGridLayout
(
this
);
auto
topLayout
=
new
QGridLayout
(
this
);
topLayout
->
setColumnStretch
(
1
,
1
);
topLayout
->
setRowStretch
(
4
,
1
);
...
...
@@ -68,7 +68,7 @@ CryptoPagePlugin::CryptoPagePlugin()
// Send preferences/sign (see kleo/kleo/enum.h)
QWidget
*
hbox
=
new
QWidget
(
box
);
auto
*
hboxHBoxLayout
=
new
QHBoxLayout
(
hbox
);
auto
hboxHBoxLayout
=
new
QHBoxLayout
(
hbox
);
hboxHBoxLayout
->
setContentsMargins
({});
l
=
new
QLabel
(
i18n
(
"Sign:"
),
hbox
);
...
...
kaddressbook/importexportplugins/csv/csvimportexportplugin.cpp
View file @
7f65a330
...
...
@@ -19,7 +19,7 @@ CSVImportExportPlugin::~CSVImportExportPlugin() = default;
PimCommon
::
AbstractGenericPluginInterface
*
CSVImportExportPlugin
::
createInterface
(
QObject
*
parent
)
{
auto
*
interface
=
new
CSVImportExportPluginInterface
(
parent
);
auto
interface
=
new
CSVImportExportPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/importexportplugins/csv/csvimportexportplugininterface.cpp
View file @
7f65a330
...
...
@@ -66,7 +66,7 @@ void CSVImportExportPluginInterface::importCSV()
}
delete
dlg
;
auto
*
engine
=
new
KAddressBookImportExport
::
ImportExportEngine
(
this
);
auto
engine
=
new
KAddressBookImportExport
::
ImportExportEngine
(
this
);
engine
->
setContactList
(
contactList
);
engine
->
setDefaultAddressBook
(
defaultCollection
());
engine
->
importContacts
();
...
...
@@ -169,7 +169,7 @@ void CSVImportExportPluginInterface::exportCSV()
if
(
QFileInfo
::
exists
(
url
.
isLocalFile
()
?
url
.
toLocalFile
()
:
url
.
path
()))
{
if
(
url
.
isLocalFile
()
&&
QFileInfo
::
exists
(
url
.
toLocalFile
()))
{
auto
*
dialog
=
new
PimCommon
::
RenameFileDialog
(
url
,
false
,
parentWidget
());
auto
dialog
=
new
PimCommon
::
RenameFileDialog
(
url
,
false
,
parentWidget
());
auto
result
=
static_cast
<
PimCommon
::
RenameFileDialog
::
RenameFileDialogResult
>
(
dialog
->
exec
());
if
(
result
==
PimCommon
::
RenameFileDialog
::
RENAMEFILE_RENAME
)
{
url
=
dialog
->
newName
();
...
...
kaddressbook/importexportplugins/csv/import/csvimportdialog.cpp
View file @
7f65a330
...
...
@@ -124,7 +124,7 @@ public:
QWidget
*
createEditor
(
QWidget
*
parent
,
const
QStyleOptionViewItem
&
,
const
QModelIndex
&
)
const
override
{
auto
*
editor
=
new
ContactFieldComboBox
(
parent
);
auto
editor
=
new
ContactFieldComboBox
(
parent
);
return
editor
;
}
...
...
@@ -133,13 +133,13 @@ public:
{
const
unsigned
int
value
=
index
.
model
()
->
data
(
index
,
Qt
::
EditRole
).
toUInt
();
auto
*
fieldCombo
=
static_cast
<
ContactFieldComboBox
*>
(
editor
);
auto
fieldCombo
=
static_cast
<
ContactFieldComboBox
*>
(
editor
);
fieldCombo
->
setCurrentField
((
KAddressBookImportExport
::
ContactFields
::
Field
)
value
);
}
void
setModelData
(
QWidget
*
editor
,
QAbstractItemModel
*
model
,
const
QModelIndex
&
index
)
const
override
{
auto
*
fieldCombo
=
static_cast
<
ContactFieldComboBox
*>
(
editor
);
auto
fieldCombo
=
static_cast
<
ContactFieldComboBox
*>
(
editor
);
model
->
setData
(
index
,
fieldCombo
->
currentField
(),
Qt
::
EditRole
);
}
...
...
@@ -269,7 +269,7 @@ void CSVImportDialog::initGUI()
{
QWidget
*
page
=
new
QWidget
(
this
);
auto
*
mainLayout
=
new
QVBoxLayout
(
this
);
auto
mainLayout
=
new
QVBoxLayout
(
this
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
this
);
mainLayout
->
addWidget
(
page
);
...
...
@@ -285,11 +285,11 @@ void CSVImportDialog::initGUI()
connect
(
buttonBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
CSVImportDialog
::
slotOk
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
QDialog
::
reject
);
auto
*
layout
=
new
QGridLayout
;
auto
layout
=
new
QGridLayout
;
mainLayout
->
addLayout
(
layout
);
layout
->
setContentsMargins
({});
auto
*
hbox
=
new
QHBoxLayout
;
auto
hbox
=
new
QHBoxLayout
;
QLabel
*
label
=
new
QLabel
(
i18nc
(
"@label"
,
"File to import:"
),
page
);
mainLayout
->
addWidget
(
label
);
...
...
@@ -310,7 +310,7 @@ void CSVImportDialog::initGUI()
// Delimiter: comma, semicolon, tab, space, other
QGroupBox
*
group
=
new
QGroupBox
(
i18nc
(
"@title:group"
,
"Delimiter"
),
page
);
mainLayout
->
addWidget
(
group
);
auto
*
delimiterLayout
=
new
QGridLayout
;
auto
delimiterLayout
=
new
QGridLayout
;
group
->
setLayout
(
delimiterLayout
);
delimiterLayout
->
setAlignment
(
Qt
::
AlignTop
);
layout
->
addWidget
(
group
,
1
,
0
,
4
,
1
);
...
...
@@ -694,7 +694,7 @@ void CSVImportDialog::setFile(const QString &fileName)
return
;
}
auto
*
file
=
new
QFile
(
fileName
);
auto
file
=
new
QFile
(
fileName
);
if
(
!
file
->
open
(
QIODevice
::
ReadOnly
))
{
KMessageBox
::
sorry
(
this
,
i18nc
(
"@info:status"
,
"Cannot open input file."
));
delete
file
;
...
...
@@ -742,7 +742,7 @@ void CSVImportDialog::codecChanged(bool reload)
void
CSVImportDialog
::
modelFinishedLoading
()
{
auto
*
box
=
new
ContactFieldComboBox
();
auto
box
=
new
ContactFieldComboBox
();
int
preferredWidth
=
box
->
sizeHint
().
width
();
delete
box
;
...
...
kaddressbook/importexportplugins/csv/import/templateselectiondialog.cpp
View file @
7f65a330
...
...
@@ -196,7 +196,7 @@ TemplateSelectionDialog::TemplateSelectionDialog(QWidget *parent)
:
QDialog
(
parent
)
{
setWindowTitle
(
i18nc
(
"@title:window"
,
"Template Selection"
));
auto
*
mainLayout
=
new
QVBoxLayout
(
this
);
auto
mainLayout
=
new
QVBoxLayout
(
this
);
QLabel
*
lab
=
new
QLabel
(
i18nc
(
"@info"
,
"Please select a template, that matches the CSV file:"
),
this
);
mainLayout
->
addWidget
(
lab
);
...
...
kaddressbook/importexportplugins/gmx/gmximportexportplugin.cpp
View file @
7f65a330
...
...
@@ -19,7 +19,7 @@ GMXImportExportPlugin::~GMXImportExportPlugin() = default;
PimCommon
::
AbstractGenericPluginInterface
*
GMXImportExportPlugin
::
createInterface
(
QObject
*
parent
)
{
auto
*
interface
=
new
GMXImportExportPluginInterface
(
parent
);
auto
interface
=
new
GMXImportExportPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/importexportplugins/gmx/gmximportexportplugininterface.cpp
View file @
7f65a330
...
...
@@ -106,7 +106,7 @@ void GMXImportExportPluginInterface::exportGMX()
if
(
QFileInfo
::
exists
(
url
.
isLocalFile
()
?
url
.
toLocalFile
()
:
url
.
path
()))
{
if
(
url
.
isLocalFile
()
&&
QFileInfo
::
exists
(
url
.
toLocalFile
()))
{
auto
*
dialog
=
new
PimCommon
::
RenameFileDialog
(
url
,
false
,
parentWidget
());
auto
dialog
=
new
PimCommon
::
RenameFileDialog
(
url
,
false
,
parentWidget
());
const
auto
result
=
static_cast
<
PimCommon
::
RenameFileDialog
::
RenameFileDialogResult
>
(
dialog
->
exec
());
if
(
result
==
PimCommon
::
RenameFileDialog
::
RENAMEFILE_RENAME
)
{
url
=
dialog
->
newName
();
...
...
@@ -465,7 +465,7 @@ void GMXImportExportPluginInterface::importGMX()
}
// populate the addressee
auto
*
addressee
=
new
KContacts
::
Addressee
;
auto
addressee
=
new
KContacts
::
Addressee
;
addressee
->
setNickName
(
itemList
.
at
(
1
));
addressee
->
setGivenName
(
itemList
.
at
(
2
));
addressee
->
setFamilyName
(
itemList
.
at
(
3
));
...
...
@@ -629,7 +629,7 @@ void GMXImportExportPluginInterface::importGMX()
KAddressBookImportExport
::
ContactList
contactList
;
contactList
.
setAddressList
(
addresseeList
);
auto
*
engine
=
new
KAddressBookImportExport
::
ImportExportEngine
(
this
);
auto
engine
=
new
KAddressBookImportExport
::
ImportExportEngine
(
this
);
engine
->
setContactList
(
contactList
);
engine
->
setDefaultAddressBook
(
defaultCollection
());
engine
->
importContacts
();
...
...
kaddressbook/importexportplugins/ldap/ldapimportexportplugin.cpp
View file @
7f65a330
...
...
@@ -19,7 +19,7 @@ LDapImportExportPlugin::~LDapImportExportPlugin() = default;
PimCommon
::
AbstractGenericPluginInterface
*
LDapImportExportPlugin
::
createInterface
(
QObject
*
parent
)
{
auto
*
interface
=
new
LDapImportExportPluginInterface
(
parent
);
auto
interface
=
new
LDapImportExportPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.cpp
View file @
7f65a330
...
...
@@ -55,7 +55,7 @@ void LDapImportExportPluginInterface::importLdap()
}
delete
dlg
;
auto
*
engine
=
new
KAddressBookImportExport
::
ImportExportEngine
(
this
);
auto
engine
=
new
KAddressBookImportExport
::
ImportExportEngine
(
this
);
engine
->
setContactList
(
contactList
);
engine
->
setDefaultAddressBook
(
defaultCollection
());
engine
->
importContacts
();
...
...
kaddressbook/importexportplugins/ldif/ldifimportexportplugin.cpp
View file @
7f65a330
...
...
@@ -19,7 +19,7 @@ LDifImportExportPlugin::~LDifImportExportPlugin() = default;
PimCommon
::
AbstractGenericPluginInterface
*
LDifImportExportPlugin
::
createInterface
(
QObject
*
parent
)
{
auto
*
interface
=
new
LDifImportExportPluginInterface
(
parent
);
auto
interface
=
new
LDifImportExportPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.cpp
View file @
7f65a330
...
...
@@ -95,7 +95,7 @@ void LDifImportExportPluginInterface::importLdifFile(const QString &fileName)
contactList
.
setAddressList
(
lstAddresses
);
contactList
.
setContactGroupList
(
lstGroup
);
auto
*
engine
=
new
KAddressBookImportExport
::
ImportExportEngine
(
this
);
auto
engine
=
new
KAddressBookImportExport
::
ImportExportEngine
(
this
);
engine
->
setContactList
(
contactList
);
engine
->
setDefaultAddressBook
(
defaultCollection
());
engine
->
importContacts
();
...
...
@@ -169,7 +169,7 @@ void LDifImportExportPluginInterface::exportLdif()
if
(
QFileInfo
::
exists
(
fileName
))
{
if
(
url
.
isLocalFile
()
&&
QFileInfo
::
exists
(
url
.
toLocalFile
()))
{
auto
*
dialog
=
new
PimCommon
::
RenameFileDialog
(
url
,
false
,
parentWidget
());
auto
dialog
=
new
PimCommon
::
RenameFileDialog
(
url
,
false
,
parentWidget
());
auto
result
=
static_cast
<
PimCommon
::
RenameFileDialog
::
RenameFileDialogResult
>
(
dialog
->
exec
());
if
(
result
==
PimCommon
::
RenameFileDialog
::
RENAMEFILE_RENAME
)
{
fileName
=
dialog
->
newName
().
toLocalFile
();
...
...
kaddressbook/importexportplugins/vcards/engine/vcardexportselectionwidget.cpp
View file @
7f65a330
...
...
@@ -17,11 +17,11 @@
VCardExportSelectionWidget
::
VCardExportSelectionWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
auto
*
mainLayout
=
new
QVBoxLayout
(
this
);
auto
mainLayout
=
new
QVBoxLayout
(
this
);
mainLayout
->
setContentsMargins
({});
QGroupBox
*
gbox
=
new
QGroupBox
(
i18nc
(
"@title:group"
,
"Fields to be exported"
),
this
);
mainLayout
->
addWidget
(
gbox
);
auto
*
layout
=
new
QGridLayout
;
auto
layout
=
new
QGridLayout
;
gbox
->
setLayout
(
layout
);
gbox
->
setFlat
(
true
);
layout
->
addWidget
(
gbox
,
0
,
0
,
1
,
2
);
...
...
@@ -64,7 +64,7 @@ VCardExportSelectionWidget::VCardExportSelectionWidget(QWidget *parent)
gbox
=
new
QGroupBox
(
i18nc
(
"@title:group"
,
"Export options"
),
this
);
gbox
->
setFlat
(
true
);
mainLayout
->
addWidget
(
gbox
);
auto
*
gbLayout
=
new
QHBoxLayout
;
auto
gbLayout
=
new
QHBoxLayout
;
gbox
->
setLayout
(
gbLayout
);
mDisplayNameBox
=
new
QCheckBox
(
i18nc
(
"@option:check"
,
"Display name as full name"
),
this
);
...
...
kaddressbook/importexportplugins/vcards/engine/vcardviewerdialog.cpp
View file @
7f65a330
...
...
@@ -20,12 +20,12 @@ VCardViewerDialog::VCardViewerDialog(const KContacts::Addressee::List &list, QWi
,
mContacts
(
list
)
{
setWindowTitle
(
i18nc
(
"@title:window"
,
"Import vCard"
));
auto
*
mainLayout
=
new
QVBoxLayout
(
this
);
auto
mainLayout
=
new
QVBoxLayout
(
this
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Cancel
|
QDialogButtonBox
::
Apply
,
this
);
auto
*
user1Button
=
new
QPushButton
(
this
);
auto
user1Button
=
new
QPushButton
(
this
);
buttonBox
->
addButton
(
user1Button
,
QDialogButtonBox
::
ActionRole
);
auto
*
user2Button
=
new
QPushButton
(
this
);
auto
user2Button
=
new
QPushButton
(
this
);
buttonBox
->
addButton
(
user2Button
,
QDialogButtonBox
::
ActionRole
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
VCardViewerDialog
::
accept
);
...
...
@@ -40,7 +40,7 @@ VCardViewerDialog::VCardViewerDialog(const KContacts::Addressee::List &list, QWi
mainLayout
->
addWidget
(
page
);
mainLayout
->
addWidget
(
buttonBox
);
auto
*
layout
=
new
QVBoxLayout
(
page
);
auto
layout
=
new
QVBoxLayout
(
page
);
QLabel
*
label
=
new
QLabel
(
i18nc
(
"@info"
,
"Do you want to import this contact into your address book?"
),
page
);
QFont
font
=
label
->
font
();
...
...
kaddressbook/importexportplugins/vcards/vcardimportexportplugin.cpp
View file @
7f65a330
...
...
@@ -18,7 +18,7 @@ VCardImportExportPlugin::~VCardImportExportPlugin() = default;
PimCommon
::
AbstractGenericPluginInterface
*
VCardImportExportPlugin
::
createInterface
(
QObject
*
parent
)
{
auto
*
interface
=
new
VCardImportExportPluginInterface
(
parent
);
auto
interface
=
new
VCardImportExportPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp
View file @
7f65a330
...
...
@@ -137,7 +137,7 @@ void VCardImportExportPluginInterface::importVCard()
}
ContactList
contactList
;
contactList
.
setAddressList
(
addrList
);
auto
*
engine
=
new
ImportExportEngine
(
this
);
auto
engine
=
new
ImportExportEngine
(
this
);
engine
->
setContactList
(
contactList
);
engine
->
setDefaultAddressBook
(
defaultCollection
());
engine
->
importContacts
();
...
...
@@ -343,7 +343,7 @@ bool VCardImportExportPluginInterface::doExport(const QUrl &url, const QByteArra
{
QUrl
newUrl
(
url
);
if
(
newUrl
.
isLocalFile
()
&&
QFileInfo
::
exists
(
newUrl
.
toLocalFile
()))
{
auto
*
dialog
=
new
PimCommon
::
RenameFileDialog
(
newUrl
,
false
,
parentWidget
());
auto
dialog
=
new
PimCommon
::
RenameFileDialog
(
newUrl
,
false
,
parentWidget
());
auto
result
=
static_cast
<
PimCommon
::
RenameFileDialog
::
RenameFileDialogResult
>
(
dialog
->
exec
());
if
(
result
==
PimCommon
::
RenameFileDialog
::
RENAMEFILE_RENAME
)
{
newUrl
=
dialog
->
newName
();
...
...
kaddressbook/importexportplugins/windows-contacts/windowscontactimportexportplugin.cpp
View file @
7f65a330
...
...
@@ -20,7 +20,7 @@ WindowsContactImportExportPlugin::~WindowsContactImportExportPlugin() = default;
PimCommon
::
AbstractGenericPluginInterface
*
WindowsContactImportExportPlugin
::
createInterface
(
QObject
*
parent
)
{
auto
*
interface
=
new
WindowsContactImportExportPluginInterface
(
parent
);
auto
interface
=
new
WindowsContactImportExportPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/importexportplugins/windows-contacts/windowscontactimportexportplugininterface.cpp
View file @
7f65a330
...
...
@@ -83,7 +83,7 @@ void WindowsContactImportExportPluginInterface::importWindowsContact()
KAddressBookImportExport
::
ContactList
contactList
;
contactList
.
setAddressList
(
addresseeList
);
auto
*
engine
=
new
KAddressBookImportExport
::
ImportExportEngine
(
this
);
auto
engine
=
new
KAddressBookImportExport
::
ImportExportEngine
(
this
);
engine
->
setContactList
(
contactList
);
engine
->
setDefaultAddressBook
(
defaultCollection
());
engine
->
importContacts
();
...
...
kaddressbook/plugins/checkgravatar/checkgravatarplugin.cpp
View file @
7f65a330
...
...
@@ -21,7 +21,7 @@ CheckGravatarPlugin::~CheckGravatarPlugin()
PimCommon
::
GenericPluginInterface
*
CheckGravatarPlugin
::
createInterface
(
QObject
*
parent
)
{
auto
*
interface
=
new
CheckGravatarPluginInterface
(
parent
);
auto
interface
=
new
CheckGravatarPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/plugins/checkgravatar/checkgravatarplugininterface.cpp
View file @
7f65a330
...
...
@@ -101,7 +101,7 @@ void CheckGravatarPluginInterface::exec()
address
.
setPhoto
(
picture
);
item
.
setPayload
<
KContacts
::
Addressee
>
(
address
);
auto
*
modifyJob
=
new
Akonadi
::
ItemModifyJob
(
item
,
this
);
auto
modifyJob
=
new
Akonadi
::
ItemModifyJob
(
item
,
this
);
connect
(
modifyJob
,
&
Akonadi
::
ItemModifyJob
::
result
,
this
,
&
CheckGravatarPluginInterface
::
slotModifyContactFinished
);
}
}
...
...
kaddressbook/plugins/checkgravatar/gravatar/job/gravatarupdatejob.cpp
View file @
7f65a330
...
...
@@ -25,7 +25,7 @@ GravatarUpdateJob::~GravatarUpdateJob()
void
GravatarUpdateJob
::
start
()
{
if
(
canStart
())
{
auto
*
job
=
new
Gravatar
::
GravatarResolvUrlJob
(
this
);
auto
job
=
new
Gravatar
::
GravatarResolvUrlJob
(
this
);
job
->
setEmail
(
mEmail
);
if
(
job
->
canStart
())
{
connect
(
job
,
&
Gravatar
::
GravatarResolvUrlJob
::
finished
,
this
,
&
GravatarUpdateJob
::
slotGravatarResolvUrlFinished
);
...
...
@@ -87,7 +87,7 @@ void GravatarUpdateJob::updatePixmap(const QPixmap &pix)
mItem
.
setPayload
<
KContacts
::
Addressee
>
(
contact
);
// save the new item in akonadi storage
auto
*
modifyJob
=
new
Akonadi
::
ItemModifyJob
(
mItem
);
auto
modifyJob
=
new
Akonadi
::
ItemModifyJob
(
mItem
);
connect
(
modifyJob
,
&
KJob
::
result
,
this
,
&
GravatarUpdateJob
::
slotUpdateGravatarDone
);
}
else
{
deleteLater
();
...
...
Prev
1
2
3
4
5
…
11
Next
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