Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/2] Remove unnecessary ordering from single vCard query
@ 2011-01-26 11:01 Rafal Michalski
  2011-01-26 11:01 ` [PATCH 2/2] Fix fetching non-empty single owner vCard Rafal Michalski
  2011-01-26 11:29 ` [PATCH 1/2] Remove unnecessary ordering from single vCard query Johan Hedberg
  0 siblings, 2 replies; 4+ messages in thread
From: Rafal Michalski @ 2011-01-26 11:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rafal Michalski

Previously ordering for query called CONTACTS_QUERY_FROM_URI was applied.
It is not needed since always only one vCard (with id specified)
is fetched.
---
 plugins/phonebook-tracker.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index e60cf74..aee159c 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -788,11 +788,9 @@
 "\"NOTACALL\" \"false\" \"false\" "					\
 "<%s> "									\
 "WHERE {"								\
-"	<%s> a nco:PersonContact ;"					\
-"	nco:nameFamily ?_key ."						\
+"	<%s> a nco:PersonContact ."					\
 "	OPTIONAL {<%s> nco:hasAffiliation ?_role .}"			\
-"}"									\
-"ORDER BY ?_key tracker:id(<%s>)"
+"}"
 
 #define CONTACTS_OTHER_QUERY_FROM_URI					\
 	"SELECT fn:concat(\"TYPE_OTHER\", \"\31\", nco:phoneNumber(?t))"\
-- 
1.6.3.3


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

* [PATCH 2/2] Fix fetching non-empty single owner vCard
  2011-01-26 11:01 [PATCH 1/2] Remove unnecessary ordering from single vCard query Rafal Michalski
@ 2011-01-26 11:01 ` Rafal Michalski
  2011-01-26 11:19   ` Luiz Augusto von Dentz
  2011-01-26 11:29 ` [PATCH 1/2] Remove unnecessary ordering from single vCard query Johan Hedberg
  1 sibling, 1 reply; 4+ messages in thread
From: Rafal Michalski @ 2011-01-26 11:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rafal Michalski

Previously only empty owner vCard fetching was handled.
This patch makes that fetching empty (by default) and non-empty
(filled somehow by the user) single owner vCard is handled.
---
 plugins/phonebook-tracker.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index aee159c..8fe8ade 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -1922,7 +1922,9 @@ void *phonebook_get_entry(const char *folder, const char *id,
 	data->cb = cb;
 	data->vcardentry = TRUE;
 
-	if (strncmp(id, CONTACT_ID_PREFIX, strlen(CONTACT_ID_PREFIX)) == 0)
+	if (strncmp(id, CONTACT_ID_PREFIX, strlen(CONTACT_ID_PREFIX)) == 0 ||
+		strncmp(id, TRACKER_DEFAULT_CONTACT_ME,
+		strlen(TRACKER_DEFAULT_CONTACT_ME)) == 0)
 		query = g_strdup_printf(CONTACTS_QUERY_FROM_URI, id, id, id, id,
 						id, id, id, id, id, id, id, id,
 						id, id);
-- 
1.6.3.3


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

* Re: [PATCH 2/2] Fix fetching non-empty single owner vCard
  2011-01-26 11:01 ` [PATCH 2/2] Fix fetching non-empty single owner vCard Rafal Michalski
@ 2011-01-26 11:19   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2011-01-26 11:19 UTC (permalink / raw)
  To: Rafal Michalski; +Cc: linux-bluetooth

Hi,

On Wed, Jan 26, 2011 at 1:01 PM, Rafal Michalski
<michalski.raf@gmail.com> wrote:
> Previously only empty owner vCard fetching was handled.
> This patch makes that fetching empty (by default) and non-empty
> (filled somehow by the user) single owner vCard is handled.
> ---
>  plugins/phonebook-tracker.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
> index aee159c..8fe8ade 100644
> --- a/plugins/phonebook-tracker.c
> +++ b/plugins/phonebook-tracker.c
> @@ -1922,7 +1922,9 @@ void *phonebook_get_entry(const char *folder, const char *id,
>        data->cb = cb;
>        data->vcardentry = TRUE;
>
> -       if (strncmp(id, CONTACT_ID_PREFIX, strlen(CONTACT_ID_PREFIX)) == 0)
> +       if (strncmp(id, CONTACT_ID_PREFIX, strlen(CONTACT_ID_PREFIX)) == 0 ||
> +               strncmp(id, TRACKER_DEFAULT_CONTACT_ME,
> +               strlen(TRACKER_DEFAULT_CONTACT_ME)) == 0)
>                query = g_strdup_printf(CONTACTS_QUERY_FROM_URI, id, id, id, id,
>                                                id, id, id, id, id, id, id, id,
>                                                id, id);

The strncmp combine with strlen looks like it could be replaced by
g_str_has_prefix, also the code that you are adding it probably need
to be a full match not just the prefix than use g_strcmp0 otherwise
g_str_has_prefix can probably be used there too.

-- 
Luiz Augusto von Dentz
Computer Engineer

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

* Re: [PATCH 1/2] Remove unnecessary ordering from single vCard query
  2011-01-26 11:01 [PATCH 1/2] Remove unnecessary ordering from single vCard query Rafal Michalski
  2011-01-26 11:01 ` [PATCH 2/2] Fix fetching non-empty single owner vCard Rafal Michalski
@ 2011-01-26 11:29 ` Johan Hedberg
  1 sibling, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2011-01-26 11:29 UTC (permalink / raw)
  To: Rafal Michalski; +Cc: linux-bluetooth

Hi Rafal,

On Wed, Jan 26, 2011, Rafal Michalski wrote:
> Previously ordering for query called CONTACTS_QUERY_FROM_URI was applied.
> It is not needed since always only one vCard (with id specified)
> is fetched.
> ---
>  plugins/phonebook-tracker.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)

Doesn't compile:

plugins/phonebook.c: In function 'phonebook_get_entry':
plugins/phonebook.c:1928: error: too many arguments for format
make[1]: *** [plugins/phonebook.o] Error 1

Did you forget to compile with ./bootstrap-configure? Never submit
patches without first checking that they compile cleanly this way.

Johan

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

end of thread, other threads:[~2011-01-26 11:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-26 11:01 [PATCH 1/2] Remove unnecessary ordering from single vCard query Rafal Michalski
2011-01-26 11:01 ` [PATCH 2/2] Fix fetching non-empty single owner vCard Rafal Michalski
2011-01-26 11:19   ` Luiz Augusto von Dentz
2011-01-26 11:29 ` [PATCH 1/2] Remove unnecessary ordering from single vCard query Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox