Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
KDE PIM Runtime
Commits
71ef699f
Commit
71ef699f
authored
Jun 24, 2020
by
Shashwat Jolly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement address book modification and deletion
parent
b8a8c853
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
resources/etesync/etesyncresource.cpp
resources/etesync/etesyncresource.cpp
+30
-0
resources/etesync/etesyncresource.h
resources/etesync/etesyncresource.h
+2
-0
No files found.
resources/etesync/etesyncresource.cpp
View file @
71ef699f
...
...
@@ -478,4 +478,34 @@ void EteSyncResource::collectionAdded(const Akonadi::Collection &collection, con
changeCommitted
(
newCollection
);
}
void
EteSyncResource
::
collectionChanged
(
const
Akonadi
::
Collection
&
collection
)
{
qCDebug
(
ETESYNC_LOG
)
<<
"Collection changed"
<<
collection
.
mimeType
();
QString
journalUid
=
collection
.
remoteId
();
EteSyncJournalPtr
journal
(
etesync_journal_manager_fetch
(
mJournalManager
.
get
(),
journalUid
));
EteSyncCollectionInfoPtr
info
(
etesync_collection_info_new
(
QStringLiteral
(
ETESYNC_COLLECTION_TYPE_ADDRESS_BOOK
),
collection
.
displayName
(),
QString
(),
EteSyncDEFAULT_COLOR
));
EteSyncCryptoManagerPtr
cryptoManager
(
etesync_journal_get_crypto_manager
(
journal
.
get
(),
mDerived
,
mKeypair
.
get
()));
etesync_journal_set_info
(
journal
.
get
(),
cryptoManager
.
get
(),
info
.
get
());
etesync_journal_manager_update
(
mJournalManager
.
get
(),
journal
.
get
());
Collection
newCollection
(
collection
);
newCollection
.
setRemoteId
(
journalUid
);
changeCommitted
(
newCollection
);
}
void
EteSyncResource
::
collectionRemoved
(
const
Akonadi
::
Collection
&
collection
)
{
qCDebug
(
ETESYNC_LOG
)
<<
"Collection removed"
<<
collection
.
mimeType
();
QString
journalUid
=
collection
.
remoteId
();
EteSyncJournalPtr
journal
(
etesync_journal_manager_fetch
(
mJournalManager
.
get
(),
journalUid
));
etesync_journal_manager_delete
(
mJournalManager
.
get
(),
journal
.
get
());
}
AKONADI_RESOURCE_MAIN
(
EteSyncResource
)
resources/etesync/etesyncresource.h
View file @
71ef699f
...
...
@@ -47,6 +47,8 @@ protected Q_SLOTS:
void
itemRemoved
(
const
Akonadi
::
Item
&
item
)
override
;
void
collectionAdded
(
const
Akonadi
::
Collection
&
collection
,
const
Akonadi
::
Collection
&
parent
)
override
;
void
collectionChanged
(
const
Akonadi
::
Collection
&
collection
);
void
collectionRemoved
(
const
Akonadi
::
Collection
&
collection
);
protected:
void
aboutToQuit
()
override
;
...
...
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