summaryrefslogtreecommitdiffstats
path: root/pbap/pbap.cpp
diff options
context:
space:
mode:
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>2019-06-20 16:19:47 +0000
committerGerrit Code Review <gerrit@automotivelinux.org>2019-06-20 16:19:47 +0000
commit46a79c44b7ac8da7208658fc26d3eec152f7b616 (patch)
tree54d95dc1dad039147194dcccc58c3cc9f5dfb8a8 /pbap/pbap.cpp
parente89c4886888a322a21cf7c89c1ee2864dbb4e815 (diff)
parentb3d51e2d73a1e7e0fbd3d7a1b8d203b3d15b81f2 (diff)
Merge "libqtappfw: pbap: add import verb for contacts"
Diffstat (limited to 'pbap/pbap.cpp')
-rw-r--r--pbap/pbap.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/pbap/pbap.cpp b/pbap/pbap.cpp
index bdd2bd9..53b646b 100644
--- a/pbap/pbap.cpp
+++ b/pbap/pbap.cpp
@@ -98,13 +98,20 @@ Pbap::~Pbap()
delete m_mloop;
}
-void Pbap::refreshContacts(int max_entries)
+void Pbap::importContacts(int max_entries)
{
PbapMessage *tmsg = new PbapMessage();
QJsonObject parameter;
- if (max_entries >= 0)
- parameter.insert("max_entries", max_entries);
+ tmsg->createRequest("import", parameter);
+ m_mloop->sendMessage(tmsg);
+ delete tmsg;
+}
+
+void Pbap::refreshContacts(int max_entries)
+{
+ PbapMessage *tmsg = new PbapMessage();
+ QJsonObject parameter;
tmsg->createRequest("contacts", parameter);
m_mloop->sendMessage(tmsg);
@@ -285,7 +292,7 @@ void Pbap::onMessageReceived(MessageType type, Message *msg)
} else if (msg->isReply() && type == ResponseRequestMessage) {
ResponseMessage *tmsg = qobject_cast<ResponseMessage*>(msg);
- if (tmsg->requestVerb() == "contacts") {
+ if (tmsg->requestVerb() == "contacts") || tmsg->requestVerb() == "import") {
updateContacts(tmsg->replyData().value("vcards").toArray());
} else if (tmsg->requestVerb() == "history") {
updateCalls(tmsg->replyData().value("vcards").toArray());