Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
ad9263c6
Commit
ad9263c6
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#3854] Use e_book_new_default_addressbook if current_name is "Default"
parent
5e60aeda
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-client-gnome/src/contacts/addressbook/eds.c
+23
-11
23 additions, 11 deletions
sflphone-client-gnome/src/contacts/addressbook/eds.c
with
23 additions
and
11 deletions
sflphone-client-gnome/src/contacts/addressbook/eds.c
+
23
−
11
View file @
ad9263c6
...
...
@@ -68,7 +68,7 @@ int remaining_books_to_open;
*/
static
gchar
*
current_uri
=
NULL
;
static
gchar
*
current_uid
=
NULL
;
static
gchar
*
current_name
=
NULL
;
static
gchar
*
current_name
=
"Default"
;
/**
* Freeing a hit instance
...
...
@@ -430,6 +430,8 @@ void
init
(
OpenAsyncHandler
callback
UNUSED
)
{
GError
*
err
=
NULL
;
ESourceGroup
*
group
;
gchar
*
absuri
,
*
reluri
;
EBook
*
default_addressbook
=
e_book_new_default_addressbook
(
&
err
);
...
...
@@ -451,16 +453,22 @@ init (OpenAsyncHandler callback UNUSED)
current_uid
=
NULL
;
}
if
(
current_name
)
{
if
(
strcmp
(
current_name
,
"Default"
)
!=
0
)
{
g_free
(
current_name
);
current_name
=
NULL
;
}
gchar
*
absuri
,
*
reluri
;
// TODO: This should work but return a NULL pointer ...
// if (! (group = e_source_peek_group (default_source)));
// ERROR ("Addressbook: Error: No group found for default addressbook");
absuri
=
g_strdup
(
e_source_peek_absolute_uri
(
default_source
));
// absuri = g_strdup (e_source_group_peek_base_uri (group));
reluri
=
g_strdup
(
e_source_peek_relative_uri
(
default_source
));
current_name
=
g_strdup
(
e_source_peek_name
(
default_source
));
// Do not overwrite current_name for default
// current_name = g_strdup (e_source_peek_name (default_source));
current_uid
=
g_strdup
(
e_source_peek_uid
(
default_source
));
...
...
@@ -469,8 +477,6 @@ init (OpenAsyncHandler callback UNUSED)
else
current_uri
=
g_strjoin
(
"/"
,
absuri
,
reluri
,
NULL
);
DEBUG
(
"Addressbook: Default source uri: %s"
,
current_uri
);
g_free
(
absuri
);
g_free
(
reluri
);
}
...
...
@@ -540,6 +546,7 @@ void
search_async_by_contacts
(
const
char
*
query
,
int
max_results
,
SearchAsyncHandler
handler
,
gpointer
user_data
)
{
GError
*
err
=
NULL
;
EBook
*
book
;
DEBUG
(
"Addressbook: New search by contacts: %s, max_results %d"
,
query
,
max_results
);
...
...
@@ -563,7 +570,15 @@ search_async_by_contacts (const char *query, int max_results, SearchAsyncHandler
DEBUG
(
"Addressbook: Opening addressbook: %s"
,
current_uri
);
EBook
*
book
=
e_book_new_from_uri
(
current_uri
,
&
err
);
DEBUG
(
"Addressbook: Opening addressbook: %s"
,
current_name
);
// TODO: This hack is necessary as we cannot access group's base_uri of the default book
// see init()
if
(
strcmp
(
current_name
,
"Default"
)
==
0
)
book
=
e_book_new_default_addressbook
(
&
err
);
else
book
=
e_book_new_from_uri
(
current_uri
,
&
err
);
if
(
err
)
ERROR
(
"Addressbook: Error: Could not open new book: %s"
,
err
->
message
);
...
...
@@ -618,8 +633,5 @@ set_current_addressbook (const gchar *name)
const
gchar
*
get_current_addressbook
(
void
)
{
if
(
current_name
)
return
current_name
;
else
return
"Default"
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment