Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
KDE PIM Runtime
Commits
b36568ad
Commit
b36568ad
authored
Aug 17, 2020
by
Shashwat Jolly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update cache on adding collection
parent
34d38977
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
resources/etesync/calendartaskbasehandler.cpp
resources/etesync/calendartaskbasehandler.cpp
+3
-2
resources/etesync/contacthandler.cpp
resources/etesync/contacthandler.cpp
+2
-1
resources/etesync/etesyncresource.cpp
resources/etesync/etesyncresource.cpp
+2
-3
No files found.
resources/etesync/calendartaskbasehandler.cpp
View file @
b36568ad
...
...
@@ -211,7 +211,7 @@ void CalendarTaskBaseHandler::collectionAdded(const Akonadi::Collection &collect
EteSyncJournalPtr
journal
=
etesync_journal_new
(
journalUid
,
ETESYNC_CURRENT_VERSION
);
/// TODO: Description?
EteSyncCollectionInfoPtr
info
=
etesync_collection_info_new
(
etesyncCollectionType
(),
collection
.
displayName
(),
QString
(),
E
teSync
DEFAULT_COLOR
);
EteSyncCollectionInfoPtr
info
=
etesync_collection_info_new
(
etesyncCollectionType
(),
collection
.
displayName
(),
QString
(),
E
TESYNC_COLLECTION_
DEFAULT_COLOR
);
EteSyncCryptoManagerPtr
cryptoManager
=
etesync_journal_get_crypto_manager
(
journal
.
get
(),
mClientState
->
derived
(),
mClientState
->
keypair
());
...
...
@@ -225,6 +225,7 @@ void CalendarTaskBaseHandler::collectionAdded(const Akonadi::Collection &collect
Collection
newCollection
(
collection
);
mResource
->
setupCollection
(
newCollection
,
journal
.
get
());
mResource
->
mJournalsCache
[
newCollection
.
remoteId
()]
=
std
::
move
(
journal
);
mResource
->
changeCommitted
(
newCollection
);
}
...
...
@@ -233,7 +234,7 @@ void CalendarTaskBaseHandler::collectionChanged(const Akonadi::Collection &colle
const
QString
journalUid
=
collection
.
remoteId
();
const
EteSyncJournalPtr
&
journal
=
mResource
->
getJournal
(
journalUid
);
auto
journalColor
=
E
teSync
DEFAULT_COLOR
;
auto
journalColor
=
E
TESYNC_COLLECTION_
DEFAULT_COLOR
;
if
(
collection
.
hasAttribute
<
CollectionColorAttribute
>
())
{
const
CollectionColorAttribute
*
colorAttr
=
collection
.
attribute
<
CollectionColorAttribute
>
();
if
(
colorAttr
)
{
...
...
resources/etesync/contacthandler.cpp
View file @
b36568ad
...
...
@@ -210,7 +210,7 @@ void ContactHandler::collectionAdded(const Akonadi::Collection &collection, cons
const
QString
journalUid
=
QStringFromCharPtr
(
CharPtr
(
etesync_gen_uid
()));
EteSyncJournalPtr
journal
=
etesync_journal_new
(
journalUid
,
ETESYNC_CURRENT_VERSION
);
EteSyncCollectionInfoPtr
info
=
etesync_collection_info_new
(
etesyncCollectionType
(),
collection
.
displayName
(),
QString
(),
E
teSync
DEFAULT_COLOR
);
EteSyncCollectionInfoPtr
info
=
etesync_collection_info_new
(
etesyncCollectionType
(),
collection
.
displayName
(),
QString
(),
E
TESYNC_COLLECTION_
DEFAULT_COLOR
);
EteSyncCryptoManagerPtr
cryptoManager
=
etesync_journal_get_crypto_manager
(
journal
.
get
(),
mClientState
->
derived
(),
mClientState
->
keypair
());
...
...
@@ -224,6 +224,7 @@ void ContactHandler::collectionAdded(const Akonadi::Collection &collection, cons
Collection
newCollection
(
collection
);
mResource
->
setupCollection
(
newCollection
,
journal
.
get
());
mResource
->
mJournalsCache
[
newCollection
.
remoteId
()]
=
std
::
move
(
journal
);
mResource
->
changeCommitted
(
newCollection
);
}
...
...
resources/etesync/etesyncresource.cpp
View file @
b36568ad
...
...
@@ -160,8 +160,10 @@ void EteSyncResource::slotCollectionsRetrieved(KJob *job)
Collection
collection
;
collection
.
setParentCollection
(
rootCollection
);
setupCollection
(
collection
,
*
iter
);
mJournalsCache
[
collection
.
remoteId
()]
=
EteSyncJournalPtr
(
*
iter
);
list
.
push_back
(
collection
);
}
mJournalsCacheUpdateTime
=
QDateTime
::
currentDateTime
();
free
(
journals
);
collectionsRetrieved
(
list
);
collectionsRetrievalDone
();
...
...
@@ -221,9 +223,6 @@ void EteSyncResource::setupCollection(Collection &collection, EteSyncJournal *jo
collection
.
setRemoteId
(
journalUid
);
collection
.
setName
(
journalUid
);
collection
.
setContentMimeTypes
(
mimeTypes
);
mJournalsCache
[
journalUid
]
=
EteSyncJournalPtr
(
journal
);
mJournalsCacheUpdateTime
=
QDateTime
::
currentDateTime
();
}
BaseHandler
*
EteSyncResource
::
fetchHandlerForMimeType
(
const
QString
&
mimeType
)
...
...
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