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 Runtime
Commits
4aa611b5
Commit
4aa611b5
authored
Sep 29, 2021
by
Laurent Montel
😁
Browse files
Remove some cppcheck warning
parent
f1bfb618
Pipeline
#83621
failed with stage
in 27 minutes and 46 seconds
Changes
16
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
agents/newmailnotifier/specialnotifierjob.cpp
View file @
4aa611b5
...
...
@@ -65,10 +65,10 @@ void SpecialNotifierJob::slotItemFetchJobDone(KJob *job)
mFrom
=
mb
->
from
()
->
asUnicodeString
();
mSubject
=
mb
->
subject
()
->
asUnicodeString
();
if
(
NewMailNotifierAgentSettings
::
showPhoto
())
{
auto
j
ob
=
new
Akonadi
::
ContactSearchJob
(
this
);
j
ob
->
setLimit
(
1
);
j
ob
->
setQuery
(
Akonadi
::
ContactSearchJob
::
Email
,
KEmailAddress
::
firstEmailAddress
(
mFrom
).
toLower
(),
Akonadi
::
ContactSearchJob
::
ExactMatch
);
connect
(
j
ob
,
&
Akonadi
::
ItemFetchJob
::
result
,
this
,
&
SpecialNotifierJob
::
slotSearchJobFinished
);
auto
searchJ
ob
=
new
Akonadi
::
ContactSearchJob
(
this
);
searchJ
ob
->
setLimit
(
1
);
searchJ
ob
->
setQuery
(
Akonadi
::
ContactSearchJob
::
Email
,
KEmailAddress
::
firstEmailAddress
(
mFrom
).
toLower
(),
Akonadi
::
ContactSearchJob
::
ExactMatch
);
connect
(
searchJ
ob
,
&
Akonadi
::
ItemFetchJob
::
result
,
this
,
&
SpecialNotifierJob
::
slotSearchJobFinished
);
}
else
{
emitNotification
();
}
...
...
kioslave/akonadi/akonadislave.cpp
View file @
4aa611b5
...
...
@@ -87,8 +87,8 @@ void AkonadiSlave::get(const QUrl &url)
if
(
job
->
items
().
count
()
!=
1
)
{
error
(
KIO
::
ERR_DOES_NOT_EXIST
,
i18n
(
"No such item."
));
}
else
{
const
Item
item
=
job
->
items
().
at
(
0
);
QByteArray
tmp
=
item
.
payloadData
();
const
Item
item
Job
=
job
->
items
().
at
(
0
);
const
QByteArray
tmp
=
item
Job
.
payloadData
();
data
(
tmp
);
data
(
QByteArray
());
finished
();
...
...
migration/gid/gidmigrator.h
View file @
4aa611b5
...
...
@@ -13,7 +13,7 @@ class GidMigrator : public MigratorBase
{
Q_OBJECT
public:
GidMigrator
(
const
QString
&
mimeType
);
explicit
GidMigrator
(
const
QString
&
mimeType
);
~
GidMigrator
()
override
;
Q_REQUIRED_RESULT
QString
displayName
()
const
override
;
...
...
migration/migratorbase.h
View file @
4aa611b5
...
...
@@ -20,7 +20,7 @@ public:
{
}
NullableConfigGroup
(
const
KConfigGroup
&
grp
)
explicit
NullableConfigGroup
(
const
KConfigGroup
&
grp
)
:
mConfigGroup
(
grp
)
{
}
...
...
resources/dav/resource/davgroupwareresource.cpp
View file @
4aa611b5
...
...
@@ -913,8 +913,8 @@ void DavGroupwareResource::onRetrieveItemsFinished(KJob *job)
auto
CTagAttr
=
collection
.
attribute
<
CTagAttribute
>
(
Collection
::
AddIfMissing
);
qCDebug
(
DAVRESOURCE_LOG
)
<<
"Updating collection CTag from"
<<
CTagAttr
->
CTag
()
<<
"to"
<<
mCTagCache
.
value
(
collection
.
remoteId
());
CTagAttr
->
setCTag
(
mCTagCache
.
value
(
collection
.
remoteId
()));
auto
j
ob
=
new
Akonadi
::
CollectionModifyJob
(
collection
);
j
ob
->
start
();
auto
modifyJ
ob
=
new
Akonadi
::
CollectionModifyJob
(
collection
);
modifyJ
ob
->
start
();
}
itemsRetrievedIncremental
(
changedItems
,
Akonadi
::
Item
::
List
());
...
...
@@ -979,8 +979,8 @@ void DavGroupwareResource::onMultigetFinished(KJob *job)
auto
CTagAttr
=
collection
.
attribute
<
CTagAttribute
>
(
Collection
::
AddIfMissing
);
qCDebug
(
DAVRESOURCE_LOG
)
<<
"Updating collection CTag from"
<<
CTagAttr
->
CTag
()
<<
"to"
<<
mCTagCache
.
value
(
collection
.
remoteId
());
CTagAttr
->
setCTag
(
mCTagCache
.
value
(
collection
.
remoteId
()));
auto
j
ob
=
new
Akonadi
::
CollectionModifyJob
(
collection
);
j
ob
->
start
();
auto
modifyJ
ob
=
new
Akonadi
::
CollectionModifyJob
(
collection
);
modifyJ
ob
->
start
();
}
itemsRetrievedIncremental
(
items
,
Akonadi
::
Item
::
List
());
...
...
resources/ews/ewsclient/ewsdeleteitemrequest.h
View file @
4aa611b5
...
...
@@ -28,7 +28,7 @@ public:
{
public:
protected:
Response
(
QXmlStreamReader
&
reader
);
explicit
Response
(
QXmlStreamReader
&
reader
);
friend
class
EwsDeleteItemRequest
;
};
...
...
resources/ews/ewsclient/ewsmoveitemrequest.h
View file @
4aa611b5
...
...
@@ -28,7 +28,7 @@ public:
}
protected:
Response
(
QXmlStreamReader
&
reader
);
explicit
Response
(
QXmlStreamReader
&
reader
);
EwsId
mId
;
...
...
resources/ews/ewsclient/ewsunsubscriberequest.h
View file @
4aa611b5
...
...
@@ -25,7 +25,7 @@ public:
class
Response
:
public
EwsRequest
::
Response
{
protected:
Response
(
QXmlStreamReader
&
reader
);
explicit
Response
(
QXmlStreamReader
&
reader
);
friend
class
EwsUnsubscribeRequest
;
};
...
...
resources/ews/ewsclient/ewsupdatefolderrequest.h
View file @
4aa611b5
...
...
@@ -67,7 +67,7 @@ public:
class
DeleteUpdate
:
public
Update
{
public:
DeleteUpdate
(
const
EwsPropertyField
&
field
)
explicit
DeleteUpdate
(
const
EwsPropertyField
&
field
)
:
Update
(
field
,
QVariant
(),
Delete
)
{
}
...
...
resources/ews/ewsfetchfoldersjob.cpp
View file @
4aa611b5
...
...
@@ -172,12 +172,12 @@ void EwsFetchFoldersJobPrivate::remoteFolderIdFullFetchDone(KJob *job)
mPendingFetchJobs
=
0
;
for
(
int
i
=
0
,
total
=
mRemoteFolderIds
.
size
();
i
<
total
;
i
+=
fetchBatchSize
)
{
auto
r
eq
=
new
EwsGetFolderRequest
(
mClient
,
this
);
r
eq
->
setFolderIds
(
mRemoteFolderIds
.
mid
(
i
,
fetchBatchSize
));
r
eq
->
setFolderShape
(
shape
);
connect
(
r
eq
,
&
EwsSyncFolderHierarchyRequest
::
result
,
this
,
&
EwsFetchFoldersJobPrivate
::
remoteFolderDetailFetchDone
);
r
eq
->
start
();
q
->
addSubjob
(
r
eq
);
auto
folderR
eq
=
new
EwsGetFolderRequest
(
mClient
,
this
);
folderR
eq
->
setFolderIds
(
mRemoteFolderIds
.
mid
(
i
,
fetchBatchSize
));
folderR
eq
->
setFolderShape
(
shape
);
connect
(
folderR
eq
,
&
EwsSyncFolderHierarchyRequest
::
result
,
this
,
&
EwsFetchFoldersJobPrivate
::
remoteFolderDetailFetchDone
);
folderR
eq
->
start
();
q
->
addSubjob
(
folderR
eq
);
mPendingFetchJobs
++
;
}
...
...
resources/ews/mail/ewscreatemailjob.cpp
View file @
4aa611b5
...
...
@@ -177,12 +177,12 @@ void EwsCreateMailJob::mailCreateWorkaroundFinished(KJob *job)
EwsCreateItemRequest
::
Response
resp
=
req
->
responses
().
first
();
if
(
resp
.
isSuccess
())
{
EwsId
id
=
resp
.
itemId
();
auto
r
eq
=
new
EwsMoveItemRequest
(
mClient
,
this
);
r
eq
->
setItemIds
(
EwsId
::
List
()
<<
id
);
r
eq
->
setDestinationFolderId
(
EwsId
(
mCollection
.
remoteId
()));
connect
(
r
eq
,
&
EwsCreateItemRequest
::
finished
,
this
,
&
EwsCreateMailJob
::
mailMoveWorkaroundFinished
);
addSubjob
(
r
eq
);
r
eq
->
start
();
auto
moveItemR
eq
=
new
EwsMoveItemRequest
(
mClient
,
this
);
moveItemR
eq
->
setItemIds
(
EwsId
::
List
()
<<
id
);
moveItemR
eq
->
setDestinationFolderId
(
EwsId
(
mCollection
.
remoteId
()));
connect
(
moveItemR
eq
,
&
EwsCreateItemRequest
::
finished
,
this
,
&
EwsCreateMailJob
::
mailMoveWorkaroundFinished
);
addSubjob
(
moveItemR
eq
);
moveItemR
eq
->
start
();
}
else
{
setErrorMsg
(
i18n
(
"Failed to create mail item"
));
emitResult
();
...
...
resources/ews/test/unittests/ewsgetitemrequest_ut.cpp
View file @
4aa611b5
...
...
@@ -125,8 +125,8 @@ void UtEwsGetItemRequest::twoFailures()
auto
id
=
resp
.
item
()[
EwsItemFieldItemId
].
value
<
EwsId
>
();
QCOMPARE
(
id
,
*
idsIt
);
}
idsIt
++
;
respClassesIt
++
;
++
idsIt
;
++
respClassesIt
;
}
}
...
...
resources/ews/test/unittests/ewsmoveitemrequest_ut.cpp
View file @
4aa611b5
...
...
@@ -157,7 +157,7 @@ void UtEwsMoveItemRequest::twoItems()
for
(
const
EwsMoveItemRequest
::
Response
&
resp
:
reqResponses
)
{
QCOMPARE
(
resp
.
responseClass
(),
EwsResponseSuccess
);
QCOMPARE
(
resp
.
itemId
(),
*
newIdsIt
);
newIdsIt
++
;
++
newIdsIt
;
}
}
...
...
@@ -240,8 +240,8 @@ void UtEwsMoveItemRequest::twoItemsOneFailed()
}
else
{
QCOMPARE
(
resp
.
itemId
(),
EwsId
());
}
newIdsIt
++
;
respClassesIt
++
;
++
newIdsIt
;
++
respClassesIt
;
}
}
...
...
resources/kolab/kolabhelpers.cpp
View file @
4aa611b5
...
...
@@ -141,7 +141,6 @@ Akonadi::Item KolabHelpers::translateFromImap(Kolab::FolderType folderType, cons
newItem
.
setRemoteId
(
imapItem
.
remoteId
());
newItem
.
setGid
(
incidencePtr
->
instanceIdentifier
());
return
newItem
;
break
;
}
case
Kolab
::
NoteObject
:
{
const
KMime
::
Message
::
Ptr
note
=
reader
.
getNote
();
...
...
@@ -156,7 +155,6 @@ Akonadi::Item KolabHelpers::translateFromImap(Kolab::FolderType folderType, cons
const
Akonadi
::
NoteUtils
::
NoteMessageWrapper
wrapper
(
note
);
newItem
.
setGid
(
wrapper
.
uid
());
return
newItem
;
break
;
}
case
Kolab
::
ContactObject
:
{
Akonadi
::
Item
newItem
(
KContacts
::
Addressee
::
mimeType
());
...
...
@@ -164,7 +162,6 @@ Akonadi::Item KolabHelpers::translateFromImap(Kolab::FolderType folderType, cons
newItem
.
setRemoteId
(
imapItem
.
remoteId
());
newItem
.
setGid
(
reader
.
getContact
().
uid
());
return
newItem
;
break
;
}
case
Kolab
::
DistlistObject
:
{
KContacts
::
ContactGroup
contactGroup
=
reader
.
getDistlist
();
...
...
@@ -186,7 +183,6 @@ Akonadi::Item KolabHelpers::translateFromImap(Kolab::FolderType folderType, cons
newItem
.
setRemoteId
(
imapItem
.
remoteId
());
newItem
.
setGid
(
contactGroup
.
id
());
return
newItem
;
break
;
}
case
Kolab
::
RelationConfigurationObject
:
// Do nothing about tags and relations, this is handled separately in KolabRetrieveTagTask::onMessagesAvailable
...
...
resources/kolab/pimkolab/kolabformat/kolabobject.cpp
View file @
4aa611b5
...
...
@@ -202,11 +202,11 @@ class KolabObjectReader::Private
{
public:
Private
()
:
mObjectType
(
InvalidObject
)
:
mAddressee
(
KContacts
::
Addressee
())
,
mObjectType
(
InvalidObject
)
,
mVersion
(
KolabV3
)
,
mOverrideObjectType
(
InvalidObject
)
{
mAddressee
=
KContacts
::
Addressee
();
}
KCalendarCore
::
Incidence
::
Ptr
mIncidence
;
...
...
resources/mixedmaildir/mixedmaildirstore.cpp
View file @
4aa611b5
...
...
@@ -1679,7 +1679,7 @@ bool MixedMaildirStore::Private::visit(FileStore::ItemFetchJob *job)
Item
::
List
::
iterator
endIt
=
items
.
end
();
for
(;
it
!=
endIt
;
++
it
)
{
if
(
!
fillItem
(
findIt
.
value
(),
includeHeaders
,
includeBody
,
*
it
))
{
const
QString
errorText
=
i18nc
(
"@info:status"
,
"Error while reading mails from folder %1"
,
collection
.
name
());
errorText
=
i18nc
(
"@info:status"
,
"Error while reading mails from folder %1"
,
collection
.
name
());
q
->
notifyError
(
FileStore
::
Job
::
InvalidJobContext
,
errorText
);
// TODO should be a different error code
qCCritical
(
MIXEDMAILDIRRESOURCE_LOG
)
<<
"Failed to read item"
<<
(
*
it
).
remoteId
()
<<
"in MBox file"
<<
path
;
return
false
;
...
...
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