linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix handling of UID contact's field in vCARD
@ 2010-09-03 11:13 Rafał Michalski
  2010-09-06  7:04 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Rafał Michalski @ 2010-09-03 11:13 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rafał Michalski

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0001-Fix-handling-of-UID-contact-s-field-in-vCARD.patch --]
[-- Type: text/x-patch, Size: 4547 bytes --]

From 36b2e6ca79f993eb7fe25bd05897293d8d56242f Mon Sep 17 00:00:00 2001
From: Rafal Michalski <michalski.raf@gmail.com>
Date: Fri, 3 Sep 2010 12:24:03 +0200
Subject: [PATCH] Fix handling of UID contact's field in vCARD

Previously invalid field was assigned to uid data. To solve this
problem extending number of columns and queries of database was needed
especially (one field in database query was added).
---
 plugins/phonebook-tracker.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index bdd9587..b64be12 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -43,16 +43,16 @@
 #define TRACKER_RESOURCES_INTERFACE "org.freedesktop.Tracker1.Resources"
 
 #define TRACKER_DEFAULT_CONTACT_ME "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#default-contact-me"
-#define CONTACTS_ID_COL 35
-#define PULL_QUERY_COL_AMOUNT 36
+#define CONTACTS_ID_COL 36
+#define PULL_QUERY_COL_AMOUNT 37
 #define COL_HOME_NUMBER 0
 #define COL_HOME_EMAIL 7
 #define COL_WORK_NUMBER 8
 #define COL_FAX_NUMBER 16
 #define COL_WORK_EMAIL 17
-#define COL_DATE 32
-#define COL_SENT 33
-#define COL_ANSWERED 34
+#define COL_DATE 33
+#define COL_SENT 34
+#define COL_ANSWERED 35
 #define ADDR_FIELD_AMOUNT 7
 
 #define CONTACTS_QUERY_ALL						\
@@ -67,7 +67,7 @@
 	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
 	"nco:role(?a) nco:pobox(?pw) nco:extendedAddress(?pw) "		\
 	"nco:streetAddress(?pw) nco:locality(?pw) nco:region(?pw) "	\
-	"nco:postalcode(?pw) nco:country(?pw) "				\
+	"nco:postalcode(?pw) nco:country(?pw) nco:contactUID(?c) "	\
 	"\"NOTACALL\" \"false\" \"false\" ?c "				\
 	"WHERE { "							\
 		"?c a nco:PersonContact . "				\
@@ -118,7 +118,7 @@
 	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
 	"nco:role(?a) nco:pobox(?pw) nco:extendedAddress(?pw) "		\
 	"nco:streetAddress(?pw) nco:locality(?pw) nco:region(?pw) "	\
-	"nco:postalcode(?pw) nco:country(?pw) "				\
+	"nco:postalcode(?pw) nco:country(?pw) nco:contactUID(?c) "	\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -170,7 +170,7 @@
 	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
 	"nco:role(?a) nco:pobox(?pw) nco:extendedAddress(?pw) "		\
 	"nco:streetAddress(?pw) nco:locality(?pw) nco:region(?pw) "	\
-	"nco:postalcode(?pw) nco:country(?pw) "				\
+	"nco:postalcode(?pw) nco:country(?pw) nco:contactUID(?c) "	\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -222,7 +222,7 @@
 	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
 	"nco:role(?a) nco:pobox(?pw) nco:extendedAddress(?pw) "		\
 	"nco:streetAddress(?pw) nco:locality(?pw) nco:region(?pw) "	\
-	"nco:postalcode(?pw) nco:country(?pw) "				\
+	"nco:postalcode(?pw) nco:country(?pw) nco:contactUID(?c) "	\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -272,7 +272,7 @@
 	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
 	"nco:role(?a) nco:pobox(?pw) nco:extendedAddress(?pw) "		\
 	"nco:streetAddress(?pw) nco:locality(?pw) nco:region(?pw) "	\
-	"nco:postalcode(?pw) nco:country(?pw) "				\
+	"nco:postalcode(?pw) nco:country(?pw) nco:contactUID(?c) "	\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -348,7 +348,7 @@
 	"nco:photo(<%s>) nco:fullname(?o) nco:department(?a) "		\
 	"nco:role(?a) nco:pobox(?pw) nco:extendedAddress(?pw) "		\
 	"nco:streetAddress(?pw) nco:locality(?pw) nco:region(?pw) "	\
-	"nco:postalcode(?pw) nco:country(?pw) "				\
+	"nco:postalcode(?pw) nco:country(?pw) nco:contactUID(<%s>) "	\
 	"\"NOTACALL\" \"false\" \"false\" <%s> "			\
 	"WHERE { "							\
 		"<%s> a nco:Contact . "					\
@@ -866,7 +866,7 @@ add_entry:
 	contact->company = g_strdup(reply[22]);
 	contact->department = g_strdup(reply[23]);
 	contact->title = g_strdup(reply[24]);
-	contact->uid = g_strdup(reply[CONTACTS_ID_COL]);
+	contact->uid = g_strdup(reply[32]);
 
 	set_call_type(contact, reply[COL_DATE], reply[COL_SENT],
 			reply[COL_ANSWERED]);
@@ -1084,7 +1084,7 @@ int phonebook_get_entry(const char *folder, const char *id,
 
 	query = g_strdup_printf(CONTACTS_QUERY_FROM_URI, id, id, id, id, id,
 						id, id, id, id, id, id, id,
-						id, id, id, id);
+						id, id, id, id, id);
 
 	ret = query_tracker(query, PULL_QUERY_COL_AMOUNT, pull_contacts, data);
 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix handling of UID contact's field in vCARD
  2010-09-03 11:13 [PATCH] Fix handling of UID contact's field in vCARD Rafał Michalski
@ 2010-09-06  7:04 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2010-09-06  7:04 UTC (permalink / raw)
  To: Rafał Michalski; +Cc: linux-bluetooth

Hi Rafal,

On Fri, Sep 03, 2010, Rafał Michalski wrote:
> From: Rafal Michalski <michalski.raf@gmail.com>
> Date: Fri, 3 Sep 2010 12:24:03 +0200
> Subject: [PATCH] Fix handling of UID contact's field in vCARD
> 
> Previously invalid field was assigned to uid data. To solve this
> problem extending number of columns and queries of database was needed
> especially (one field in database query was added).
> ---
>  plugins/phonebook-tracker.c |   26 +++++++++++++-------------
>  1 files changed, 13 insertions(+), 13 deletions(-)

Thanks for the patch. It's now upstream.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-06  7:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-03 11:13 [PATCH] Fix handling of UID contact's field in vCARD Rafał Michalski
2010-09-06  7:04 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).