Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Akonadi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
Akonadi
Commits
c0dd38fb
Commit
c0dd38fb
authored
Jun 19, 2015
by
Daniel Vrátil
🤖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid passing empty entity sets to ProtocolHelper
The methods there tend to throw Exceptions in such situations.
parent
adb5b8c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
src/core/jobs/itemcreatejob.cpp
src/core/jobs/itemcreatejob.cpp
+8
-3
src/core/jobs/itemfetchjob.cpp
src/core/jobs/itemfetchjob.cpp
+2
-2
src/core/protocolhelper_p.h
src/core/protocolhelper_p.h
+1
-1
No files found.
src/core/jobs/itemcreatejob.cpp
View file @
c0dd38fb
...
...
@@ -118,11 +118,16 @@ void ItemCreateJob::doStart()
cmd
.
setAddedFlags
(
d
->
mItem
.
d_func
()
->
mAddedFlags
);
cmd
.
setRemovedFlags
(
d
->
mItem
.
d_func
()
->
mDeletedFlags
);
}
if
(
d
->
mItem
.
d_func
()
->
mTagsOverwritten
||
!
merge
)
{
if
(
!
d
->
mItem
.
d_func
()
->
mAddedTags
.
isEmpty
()
&&
(
d
->
mItem
.
d_func
()
->
mTagsOverwritten
||
!
merge
))
{
cmd
.
setTags
(
ProtocolHelper
::
entitySetToScope
(
d
->
mItem
.
d_func
()
->
mAddedTags
));
}
else
{
cmd
.
setAddedTags
(
ProtocolHelper
::
entitySetToScope
(
d
->
mItem
.
d_func
()
->
mAddedTags
));
cmd
.
setRemovedTags
(
ProtocolHelper
::
entitySetToScope
(
d
->
mItem
.
d_func
()
->
mDeletedTags
));
if
(
!
d
->
mItem
.
d_func
()
->
mAddedTags
.
isEmpty
())
{
cmd
.
setAddedTags
(
ProtocolHelper
::
entitySetToScope
(
d
->
mItem
.
d_func
()
->
mAddedTags
));
}
if
(
!
d
->
mItem
.
d_func
()
->
mDeletedTags
.
isEmpty
())
{
cmd
.
setRemovedTags
(
ProtocolHelper
::
entitySetToScope
(
d
->
mItem
.
d_func
()
->
mDeletedTags
));
}
}
cmd
.
setCollection
(
ProtocolHelper
::
entityToScope
(
d
->
mCollection
));
...
...
src/core/jobs/itemfetchjob.cpp
View file @
c0dd38fb
...
...
@@ -171,8 +171,8 @@ void ItemFetchJob::doStart()
try
{
d
->
sendCommand
(
Protocol
::
FetchItemsCommand
(
ProtocolHelper
::
entitySetToScope
(
d
->
mRequestedItems
)
,
Scope
itemScope
(
d
->
mRequestedItems
.
isEmpty
()
?
ImapSet
::
all
()
:
ProtocolHelper
::
entitySetToScope
(
d
->
mRequestedItems
));
d
->
sendCommand
(
Protocol
::
FetchItemsCommand
(
itemScope
,
ProtocolHelper
::
commandContextToProtocol
(
d
->
mCollection
,
d
->
mTag
,
d
->
mRequestedItems
),
ProtocolHelper
::
itemFetchScopeToProtocol
(
d
->
mFetchScope
)));
}
catch
(
const
Akonadi
::
Exception
&
e
)
{
...
...
src/core/protocolhelper_p.h
View file @
c0dd38fb
...
...
@@ -138,7 +138,7 @@ public:
Container
<
T
>
objects
(
_objects
);
std
::
sort
(
objects
.
begin
(),
objects
.
end
(),
boost
::
bind
(
&
T
::
id
,
_1
)
<
boost
::
bind
(
&
T
::
id
,
_2
));
if
(
objects
.
first
(
).
isValid
())
{
if
(
objects
.
at
(
0
).
isValid
())
{
QVector
<
typename
T
::
Id
>
uids
;
uids
.
reserve
(
objects
.
size
());
for
(
const
T
&
object
:
objects
)
{
...
...
Write
Preview
Markdown
is supported
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