[plugins/contacts] Unify coding style
This commit is contained in:
parent
aff3d20e7e
commit
137d504b58
2 changed files with 23 additions and 25 deletions
|
@ -53,7 +53,7 @@ ContactsPlugin::ContactsPlugin (QObject* parent, const QVariantList& args) :
|
||||||
qCWarning(KDECONNECT_PLUGIN_CONTACTS) << "handleResponseVCards:" << "Unable to create VCard directory";
|
qCWarning(KDECONNECT_PLUGIN_CONTACTS) << "handleResponseVCards:" << "Unable to create VCard directory";
|
||||||
}
|
}
|
||||||
|
|
||||||
this->synchronizeRemoteWithLocal();
|
synchronizeRemoteWithLocal();
|
||||||
|
|
||||||
qCDebug(KDECONNECT_PLUGIN_CONTACTS) << "Contacts constructor for device " << device()->name();
|
qCDebug(KDECONNECT_PLUGIN_CONTACTS) << "Contacts constructor for device " << device()->name();
|
||||||
}
|
}
|
||||||
|
@ -68,9 +68,9 @@ bool ContactsPlugin::receivePacket (const NetworkPacket& np) {
|
||||||
//qCDebug(KDECONNECT_PLUGIN_CONTACTS) << np.body();
|
//qCDebug(KDECONNECT_PLUGIN_CONTACTS) << np.body();
|
||||||
|
|
||||||
if (np.type() == PACKAGE_TYPE_CONTACTS_RESPONSE_UIDS_TIMESTAMPS) {
|
if (np.type() == PACKAGE_TYPE_CONTACTS_RESPONSE_UIDS_TIMESTAMPS) {
|
||||||
return this->handleResponseUIDsTimestamps(np);
|
return handleResponseUIDsTimestamps(np);
|
||||||
} else if (np.type() == PACKET_TYPE_CONTACTS_RESPONSE_VCARDS) {
|
} else if (np.type() == PACKET_TYPE_CONTACTS_RESPONSE_VCARDS) {
|
||||||
return this->handleResponseVCards(np);
|
return handleResponseVCards(np);
|
||||||
} else {
|
} else {
|
||||||
// Is this check necessary?
|
// Is this check necessary?
|
||||||
qCDebug(KDECONNECT_PLUGIN_CONTACTS) << "Unknown package type received from device: "
|
qCDebug(KDECONNECT_PLUGIN_CONTACTS) << "Unknown package type received from device: "
|
||||||
|
@ -80,7 +80,7 @@ bool ContactsPlugin::receivePacket (const NetworkPacket& np) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContactsPlugin::synchronizeRemoteWithLocal() {
|
void ContactsPlugin::synchronizeRemoteWithLocal() {
|
||||||
this->sendRequest(PACKET_TYPE_CONTACTS_REQUEST_ALL_UIDS_TIMESTAMP);
|
sendRequest(PACKET_TYPE_CONTACTS_REQUEST_ALL_UIDS_TIMESTAMP);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContactsPlugin::handleResponseUIDsTimestamps(const NetworkPacket& np) {
|
bool ContactsPlugin::handleResponseUIDsTimestamps(const NetworkPacket& np) {
|
||||||
|
@ -150,7 +150,7 @@ bool ContactsPlugin::handleResponseUIDsTimestamps (const NetworkPacket& np) {
|
||||||
toDelete.remove();
|
toDelete.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
this->sendRequestWithIDs(PACKET_TYPE_CONTACTS_REQUEST_VCARDS_BY_UIDS, uIDsToUpdate);
|
sendRequestWithIDs(PACKET_TYPE_CONTACTS_REQUEST_VCARDS_BY_UIDS, uIDsToUpdate);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,8 +113,7 @@ public Q_SLOTS:
|
||||||
* Update any contacts which are known locally but have an older timestamp
|
* Update any contacts which are known locally but have an older timestamp
|
||||||
* Add any contacts which are not known locally but are reported by the remote
|
* Add any contacts which are not known locally but are reported by the remote
|
||||||
*/
|
*/
|
||||||
Q_SCRIPTABLE
|
Q_SCRIPTABLE void synchronizeRemoteWithLocal();
|
||||||
void synchronizeRemoteWithLocal ();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
@ -123,8 +122,7 @@ Q_SIGNALS:
|
||||||
*
|
*
|
||||||
* @param newContacts The list of just-synchronized contacts
|
* @param newContacts The list of just-synchronized contacts
|
||||||
*/
|
*/
|
||||||
Q_SCRIPTABLE
|
Q_SCRIPTABLE void localCacheSynchronized(const uIDList_t& newContacts);
|
||||||
void localCacheSynchronized (const uIDList_t& newContacts);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue