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
0346ce6b
Commit
0346ce6b
authored
Nov 02, 2020
by
Laurent Montel
😁
Browse files
Modernize code
parent
be257960
Pipeline
#39275
passed with stage
in 57 minutes and 8 seconds
Changes
271
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
kaddressbook/editorpages/cryptopageplugin.cpp
View file @
0346ce6b
...
...
@@ -31,7 +31,7 @@ CryptoPagePlugin::CryptoPagePlugin()
{
KIconLoader
::
global
()
->
addAppDir
(
QStringLiteral
(
"libkleopatra"
));
QGridLayo
ut
*
topLayout
=
new
QGridLayout
(
this
);
a
ut
o
*
topLayout
=
new
QGridLayout
(
this
);
topLayout
->
setColumnStretch
(
1
,
1
);
topLayout
->
setRowStretch
(
4
,
1
);
...
...
@@ -41,7 +41,7 @@ CryptoPagePlugin::CryptoPagePlugin()
uint
msgFormat
=
1
;
for
(
uint
i
=
0
;
i
<
NumberOfProtocols
;
++
i
)
{
Kleo
::
CryptoMessageFormat
f
=
static_cast
<
Kleo
::
CryptoMessageFormat
>
(
msgFormat
);
auto
f
=
static_cast
<
Kleo
::
CryptoMessageFormat
>
(
msgFormat
);
mProtocolCB
[
i
]
=
new
QCheckBox
(
Kleo
::
cryptoMessageFormatToLabel
(
f
),
protGB
);
protGBLayout
->
addWidget
(
mProtocolCB
[
i
]);
...
...
@@ -68,7 +68,7 @@ CryptoPagePlugin::CryptoPagePlugin()
// Send preferences/sign (see kleo/kleo/enum.h)
QWidget
*
hbox
=
new
QWidget
(
box
);
QHBoxLayo
ut
*
hboxHBoxLayout
=
new
QHBoxLayout
(
hbox
);
a
ut
o
*
hboxHBoxLayout
=
new
QHBoxLayout
(
hbox
);
hboxHBoxLayout
->
setContentsMargins
({});
l
=
new
QLabel
(
i18n
(
"Sign:"
),
hbox
);
...
...
@@ -162,14 +162,14 @@ void CryptoPagePlugin::storeContact(KContacts::Addressee &contact) const
contact
.
removeCustom
(
QStringLiteral
(
"KADDRESSBOOK"
),
QStringLiteral
(
"CRYPTOPROTOPREF"
));
}
const
Kleo
::
SigningPreference
signPref
=
static_cast
<
Kleo
::
SigningPreference
>
(
mSignPref
->
currentIndex
());
const
auto
signPref
=
static_cast
<
Kleo
::
SigningPreference
>
(
mSignPref
->
currentIndex
());
if
(
signPref
!=
Kleo
::
UnknownSigningPreference
)
{
contact
.
insertCustom
(
QStringLiteral
(
"KADDRESSBOOK"
),
QStringLiteral
(
"CRYPTOSIGNPREF"
),
QLatin1String
(
Kleo
::
signingPreferenceToString
(
signPref
)));
}
else
{
contact
.
removeCustom
(
QStringLiteral
(
"KADDRESSBOOK"
),
QStringLiteral
(
"CRYPTOSIGNPREF"
));
}
const
Kleo
::
EncryptionPreference
encryptPref
=
static_cast
<
Kleo
::
EncryptionPreference
>
(
mCryptPref
->
currentIndex
());
const
auto
encryptPref
=
static_cast
<
Kleo
::
EncryptionPreference
>
(
mCryptPref
->
currentIndex
());
if
(
encryptPref
!=
Kleo
::
UnknownPreference
)
{
contact
.
insertCustom
(
QStringLiteral
(
"KADDRESSBOOK"
),
QStringLiteral
(
"CRYPTOENCRYPTPREF"
),
QLatin1String
(
Kleo
::
encryptionPreferenceToString
(
encryptPref
)));
}
else
{
...
...
kaddressbook/importexportplugins/csv/csvimportexportplugin.cpp
View file @
0346ce6b
...
...
@@ -19,7 +19,7 @@ CSVImportExportPlugin::~CSVImportExportPlugin() = default;
PimCommon
::
AbstractGenericPluginInterface
*
CSVImportExportPlugin
::
createInterface
(
QObject
*
parent
)
{
CSVImportExportPluginInterface
*
interface
=
new
CSVImportExportPluginInterface
(
parent
);
auto
*
interface
=
new
CSVImportExportPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/importexportplugins/csv/csvimportexportplugininterface.cpp
View file @
0346ce6b
...
...
@@ -171,8 +171,8 @@ void CSVImportExportPluginInterface::exportCSV()
if
(
QFileInfo
::
exists
(
url
.
isLocalFile
()
?
url
.
toLocalFile
()
:
url
.
path
()))
{
if
(
url
.
isLocalFile
()
&&
QFileInfo
::
exists
(
url
.
toLocalFile
()))
{
PimCommon
::
RenameFileDialog
*
dialog
=
new
PimCommon
::
RenameFileDialog
(
url
,
false
,
parentWidget
());
PimCommon
::
RenameFileDialog
::
RenameFileDialogResult
result
=
static_cast
<
PimCommon
::
RenameFileDialog
::
RenameFileDialogResult
>
(
dialog
->
exec
());
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
();
}
else
if
(
result
==
PimCommon
::
RenameFileDialog
::
RENAMEFILE_IGNORE
)
{
...
...
kaddressbook/importexportplugins/csv/import/csvimportdialog.cpp
View file @
0346ce6b
...
...
@@ -125,7 +125,7 @@ public:
QWidget
*
createEditor
(
QWidget
*
parent
,
const
QStyleOptionViewItem
&
,
const
QModelIndex
&
)
const
override
{
ContactFieldComboBox
*
editor
=
new
ContactFieldComboBox
(
parent
);
auto
*
editor
=
new
ContactFieldComboBox
(
parent
);
return
editor
;
}
...
...
@@ -134,13 +134,13 @@ public:
{
const
unsigned
int
value
=
index
.
model
()
->
data
(
index
,
Qt
::
EditRole
).
toUInt
();
ContactFieldComboBox
*
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
{
ContactFieldComboBox
*
fieldCombo
=
static_cast
<
ContactFieldComboBox
*>
(
editor
);
auto
*
fieldCombo
=
static_cast
<
ContactFieldComboBox
*>
(
editor
);
model
->
setData
(
index
,
fieldCombo
->
currentField
(),
Qt
::
EditRole
);
}
...
...
@@ -278,7 +278,7 @@ void CSVImportDialog::initGUI()
{
QWidget
*
page
=
new
QWidget
(
this
);
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
this
);
mainLayout
->
addWidget
(
page
);
...
...
@@ -294,11 +294,11 @@ void CSVImportDialog::initGUI()
connect
(
buttonBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
CSVImportDialog
::
slotOk
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
QDialog
::
reject
);
QGridLayo
ut
*
layout
=
new
QGridLayout
;
a
ut
o
*
layout
=
new
QGridLayout
;
mainLayout
->
addLayout
(
layout
);
layout
->
setContentsMargins
({});
QHBoxLayo
ut
*
hbox
=
new
QHBoxLayout
;
a
ut
o
*
hbox
=
new
QHBoxLayout
;
QLabel
*
label
=
new
QLabel
(
i18nc
(
"@label"
,
"File to import:"
),
page
);
mainLayout
->
addWidget
(
label
);
...
...
@@ -321,7 +321,7 @@ void CSVImportDialog::initGUI()
// Delimiter: comma, semicolon, tab, space, other
QGroupBox
*
group
=
new
QGroupBox
(
i18nc
(
"@title:group"
,
"Delimiter"
),
page
);
mainLayout
->
addWidget
(
group
);
QGridLayo
ut
*
delimiterLayout
=
new
QGridLayout
;
a
ut
o
*
delimiterLayout
=
new
QGridLayout
;
group
->
setLayout
(
delimiterLayout
);
delimiterLayout
->
setAlignment
(
Qt
::
AlignTop
);
layout
->
addWidget
(
group
,
1
,
0
,
4
,
1
);
...
...
@@ -745,7 +745,7 @@ void CSVImportDialog::setFile(const QString &fileName)
return
;
}
QFile
*
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
;
...
...
@@ -793,7 +793,7 @@ void CSVImportDialog::codecChanged(bool reload)
void
CSVImportDialog
::
modelFinishedLoading
()
{
ContactFieldComboBox
*
box
=
new
ContactFieldComboBox
();
auto
*
box
=
new
ContactFieldComboBox
();
int
preferredWidth
=
box
->
sizeHint
().
width
();
delete
box
;
...
...
kaddressbook/importexportplugins/csv/import/templateselectiondialog.cpp
View file @
0346ce6b
...
...
@@ -198,7 +198,7 @@ TemplateSelectionDialog::TemplateSelectionDialog(QWidget *parent)
:
QDialog
(
parent
)
{
setWindowTitle
(
i18nc
(
"@title:window"
,
"Template Selection"
));
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
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 @
0346ce6b
...
...
@@ -19,7 +19,7 @@ GMXImportExportPlugin::~GMXImportExportPlugin() = default;
PimCommon
::
AbstractGenericPluginInterface
*
GMXImportExportPlugin
::
createInterface
(
QObject
*
parent
)
{
GMXImportExportPluginInterface
*
interface
=
new
GMXImportExportPluginInterface
(
parent
);
auto
*
interface
=
new
GMXImportExportPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/importexportplugins/gmx/gmximportexportplugininterface.cpp
View file @
0346ce6b
...
...
@@ -102,8 +102,8 @@ void GMXImportExportPluginInterface::exportGMX()
if
(
QFileInfo
::
exists
(
url
.
isLocalFile
()
?
url
.
toLocalFile
()
:
url
.
path
()))
{
if
(
url
.
isLocalFile
()
&&
QFileInfo
::
exists
(
url
.
toLocalFile
()))
{
PimCommon
::
RenameFileDialog
*
dialog
=
new
PimCommon
::
RenameFileDialog
(
url
,
false
,
parentWidget
());
const
PimCommon
::
RenameFileDialog
::
RenameFileDialogResult
result
=
static_cast
<
PimCommon
::
RenameFileDialog
::
RenameFileDialogResult
>
(
dialog
->
exec
());
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
();
}
else
if
(
result
==
PimCommon
::
RenameFileDialog
::
RENAMEFILE_IGNORE
)
{
...
...
@@ -470,7 +470,7 @@ void GMXImportExportPluginInterface::importGMX()
line
=
gmxStream
.
readLine
();
while
((
line
!=
QLatin1String
(
"####"
))
&&
!
gmxStream
.
atEnd
())
{
// an addressee entry may spread over several lines in the file
while
(
1
)
{
while
(
true
)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
itemList
=
line
.
split
(
QLatin1Char
(
'#'
),
QString
::
KeepEmptyParts
);
#else
...
...
@@ -484,7 +484,7 @@ void GMXImportExportPluginInterface::importGMX()
}
// populate the addressee
KContacts
::
Addressee
*
addressee
=
new
KContacts
::
Addressee
;
auto
*
addressee
=
new
KContacts
::
Addressee
;
addressee
->
setNickName
(
itemList
.
at
(
1
));
addressee
->
setGivenName
(
itemList
.
at
(
2
));
addressee
->
setFamilyName
(
itemList
.
at
(
3
));
...
...
@@ -519,7 +519,7 @@ void GMXImportExportPluginInterface::importGMX()
while
(
!
line
.
startsWith
(
QLatin1String
(
"####"
))
&&
!
gmxStream
.
atEnd
())
{
// an address entry may spread over several lines in the file
while
(
1
)
{
while
(
true
)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
itemList
=
line
.
split
(
QLatin1Char
(
'#'
),
QString
::
KeepEmptyParts
);
#else
...
...
@@ -618,7 +618,7 @@ void GMXImportExportPluginInterface::importGMX()
while
(
!
line
.
startsWith
(
QLatin1String
(
"####"
))
&&
!
gmxStream
.
atEnd
())
{
// a category should not spread over multiple lines, but just in case
while
(
1
)
{
while
(
true
)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
itemList
=
line
.
split
(
QLatin1Char
(
'#'
),
QString
::
KeepEmptyParts
);
#else
...
...
kaddressbook/importexportplugins/ldap/ldapimportexportplugin.cpp
View file @
0346ce6b
...
...
@@ -19,7 +19,7 @@ LDapImportExportPlugin::~LDapImportExportPlugin() = default;
PimCommon
::
AbstractGenericPluginInterface
*
LDapImportExportPlugin
::
createInterface
(
QObject
*
parent
)
{
LDapImportExportPluginInterface
*
interface
=
new
LDapImportExportPluginInterface
(
parent
);
auto
*
interface
=
new
LDapImportExportPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/importexportplugins/ldif/ldifimportexportplugin.cpp
View file @
0346ce6b
...
...
@@ -19,7 +19,7 @@ LDifImportExportPlugin::~LDifImportExportPlugin() = default;
PimCommon
::
AbstractGenericPluginInterface
*
LDifImportExportPlugin
::
createInterface
(
QObject
*
parent
)
{
LDifImportExportPluginInterface
*
interface
=
new
LDifImportExportPluginInterface
(
parent
);
auto
*
interface
=
new
LDifImportExportPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.cpp
View file @
0346ce6b
...
...
@@ -164,8 +164,8 @@ void LDifImportExportPluginInterface::exportLdif()
if
(
QFileInfo
::
exists
(
fileName
))
{
if
(
url
.
isLocalFile
()
&&
QFileInfo
::
exists
(
url
.
toLocalFile
()))
{
PimCommon
::
RenameFileDialog
*
dialog
=
new
PimCommon
::
RenameFileDialog
(
url
,
false
,
parentWidget
());
PimCommon
::
RenameFileDialog
::
RenameFileDialogResult
result
=
static_cast
<
PimCommon
::
RenameFileDialog
::
RenameFileDialogResult
>
(
dialog
->
exec
());
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
();
}
else
if
(
result
==
PimCommon
::
RenameFileDialog
::
RENAMEFILE_IGNORE
)
{
...
...
kaddressbook/importexportplugins/vcards/engine/vcardexportselectionwidget.cpp
View file @
0346ce6b
...
...
@@ -17,12 +17,12 @@
VCardExportSelectionWidget
::
VCardExportSelectionWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
mainLayout
->
setContentsMargins
({});
QGroupBox
*
gbox
=
new
QGroupBox
(
i18nc
(
"@title:group"
,
"Fields to be exported"
),
this
);
mainLayout
->
addWidget
(
gbox
);
QGridLayo
ut
*
layout
=
new
QGridLayout
;
a
ut
o
*
layout
=
new
QGridLayout
;
gbox
->
setLayout
(
layout
);
gbox
->
setFlat
(
true
);
layout
->
addWidget
(
gbox
,
0
,
0
,
1
,
2
);
...
...
@@ -76,7 +76,7 @@ VCardExportSelectionWidget::VCardExportSelectionWidget(QWidget *parent)
i18nc
(
"@title:group"
,
"Export options"
),
this
);
gbox
->
setFlat
(
true
);
mainLayout
->
addWidget
(
gbox
);
QHBoxLayo
ut
*
gbLayout
=
new
QHBoxLayout
;
a
ut
o
*
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 @
0346ce6b
...
...
@@ -20,12 +20,12 @@ VCardViewerDialog::VCardViewerDialog(const KContacts::Addressee::List &list, QWi
,
mContacts
(
list
)
{
setWindowTitle
(
i18nc
(
"@title:window"
,
"Import vCard"
));
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Cancel
|
QDialogButtonBox
::
Apply
,
this
);
QPushBut
to
n
*
user1Button
=
new
QPushButton
(
this
);
au
to
*
user1Button
=
new
QPushButton
(
this
);
buttonBox
->
addButton
(
user1Button
,
QDialogButtonBox
::
ActionRole
);
QPushBut
to
n
*
user2Button
=
new
QPushButton
(
this
);
au
to
*
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
);
QVBoxLayo
ut
*
layout
=
new
QVBoxLayout
(
page
);
a
ut
o
*
layout
=
new
QVBoxLayout
(
page
);
QLabel
*
label
=
new
QLabel
(
...
...
kaddressbook/importexportplugins/vcards/vcardimportexportplugin.cpp
View file @
0346ce6b
...
...
@@ -18,7 +18,7 @@ VCardImportExportPlugin::~VCardImportExportPlugin() = default;
PimCommon
::
AbstractGenericPluginInterface
*
VCardImportExportPlugin
::
createInterface
(
QObject
*
parent
)
{
VCardImportExportPluginInterface
*
interface
=
new
VCardImportExportPluginInterface
(
parent
);
auto
*
interface
=
new
VCardImportExportPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp
View file @
0346ce6b
...
...
@@ -352,8 +352,8 @@ bool VCardImportExportPluginInterface::doExport(const QUrl &url, const QByteArra
{
QUrl
newUrl
(
url
);
if
(
newUrl
.
isLocalFile
()
&&
QFileInfo
::
exists
(
newUrl
.
toLocalFile
()))
{
PimCommon
::
RenameFileDialog
*
dialog
=
new
PimCommon
::
RenameFileDialog
(
newUrl
,
false
,
parentWidget
());
PimCommon
::
RenameFileDialog
::
RenameFileDialogResult
result
=
static_cast
<
PimCommon
::
RenameFileDialog
::
RenameFileDialogResult
>
(
dialog
->
exec
());
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
();
}
else
if
(
result
==
PimCommon
::
RenameFileDialog
::
RENAMEFILE_IGNORE
)
{
...
...
kaddressbook/importexportplugins/windows-contacts/windowscontactimportexportplugin.cpp
View file @
0346ce6b
...
...
@@ -20,7 +20,7 @@ WindowsContactImportExportPlugin::~WindowsContactImportExportPlugin() = default;
PimCommon
::
AbstractGenericPluginInterface
*
WindowsContactImportExportPlugin
::
createInterface
(
QObject
*
parent
)
{
WindowsContactImportExportPluginInterface
*
interface
=
new
WindowsContactImportExportPluginInterface
(
parent
);
auto
*
interface
=
new
WindowsContactImportExportPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/plugins/checkgravatar/checkgravatarplugin.cpp
View file @
0346ce6b
...
...
@@ -22,7 +22,7 @@ CheckGravatarPlugin::~CheckGravatarPlugin()
PimCommon
::
GenericPluginInterface
*
CheckGravatarPlugin
::
createInterface
(
QObject
*
parent
)
{
CheckGravatarPluginInterface
*
interface
=
new
CheckGravatarPluginInterface
(
parent
);
auto
*
interface
=
new
CheckGravatarPluginInterface
(
parent
);
return
interface
;
}
...
...
kaddressbook/plugins/checkgravatar/checkgravatarplugininterface.cpp
View file @
0346ce6b
...
...
@@ -101,7 +101,7 @@ void CheckGravatarPluginInterface::exec()
address
.
setPhoto
(
picture
);
item
.
setPayload
<
KContacts
::
Addressee
>
(
address
);
Akonadi
::
ItemModifyJob
*
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 @
0346ce6b
...
...
@@ -25,7 +25,7 @@ GravatarUpdateJob::~GravatarUpdateJob()
void
GravatarUpdateJob
::
start
()
{
if
(
canStart
())
{
Gravatar
::
GravatarResolvUrlJob
*
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
Akonadi
::
ItemModifyJob
*
modifyJob
=
new
Akonadi
::
ItemModifyJob
(
mItem
);
auto
*
modifyJob
=
new
Akonadi
::
ItemModifyJob
(
mItem
);
connect
(
modifyJob
,
&
KJob
::
result
,
this
,
&
GravatarUpdateJob
::
slotUpdateGravatarDone
);
}
else
{
deleteLater
();
...
...
kaddressbook/plugins/checkgravatar/gravatar/widgets/gravatarupdatedialog.cpp
View file @
0346ce6b
...
...
@@ -20,7 +20,7 @@ static const char myConfigGroupName[] = "GravatarUpdateDialog";
GravatarUpdateDialog
::
GravatarUpdateDialog
(
QWidget
*
parent
)
:
QDialog
(
parent
)
{
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
setWindowTitle
(
i18nc
(
"@title:window"
,
"Check and update Gravatar"
));
mGravatarUpdateWidget
=
new
GravatarUpdateWidget
(
this
);
connect
(
mGravatarUpdateWidget
,
&
GravatarUpdateWidget
::
activateDialogButton
,
this
,
&
GravatarUpdateDialog
::
slotActivateButton
);
...
...
kaddressbook/plugins/checkgravatar/gravatar/widgets/gravatarupdatewidget.cpp
View file @
0346ce6b
...
...
@@ -20,10 +20,10 @@ using namespace KABGravatar;
GravatarUpdateWidget
::
GravatarUpdateWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QGridLayo
ut
*
mainLayout
=
new
QGridLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QGridLayout
(
this
);
mainLayout
->
setContentsMargins
({});
QHBoxLayo
ut
*
hboxEmail
=
new
QHBoxLayout
;
a
ut
o
*
hboxEmail
=
new
QHBoxLayout
;
QLabel
*
lab
=
new
QLabel
(
i18n
(
"Email:"
));
lab
->
setObjectName
(
QStringLiteral
(
"emaillabel"
));
...
...
@@ -97,7 +97,7 @@ void GravatarUpdateWidget::slotSearchGravatar()
{
mCurrentUrl
.
clear
();
if
(
!
mEmail
.
isEmpty
())
{
Gravatar
::
GravatarResolvUrlJob
*
job
=
new
Gravatar
::
GravatarResolvUrlJob
(
this
);
auto
*
job
=
new
Gravatar
::
GravatarResolvUrlJob
(
this
);
job
->
setEmail
(
mEmail
);
if
(
job
->
canStart
())
{
job
->
setUseDefaultPixmap
(
false
);
...
...
Prev
1
2
3
4
5
…
14
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