Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
148aec74
Commit
148aec74
authored
Jun 07, 2009
by
Emmanuel Milou
Browse files
[#1214] Handle empty field - remove g_print
parent
f655cb39
Changes
6
Hide whitespace changes
Inline
Side-by-side
sflphone-client-gnome/src/actions.c
View file @
148aec74
...
...
@@ -235,9 +235,11 @@ gboolean sflphone_init()
else
{
dbus_register
(
getpid
(),
"Gtk+ Client"
);
current_calls
=
calltab_init
(
NULL
);
contacts
=
calltab_init
(
"contacts"
);
history
=
calltab_init
(
"history"
);
account_list_init
();
codec_list_init
();
...
...
@@ -972,9 +974,7 @@ void sflphone_save_history (void)
if
(
current
)
{
value
=
serialize_history_entry
(
current
);
g_print
(
"before %i
\n
"
,
current
->
_time_start
);
key
=
convert_timestamp_to_gchar
(
current
->
_time_start
);
g_print
(
"after %s
\n
"
,
key
);
g_hash_table_replace
(
result
,
(
gpointer
)
key
,
(
gpointer
)
value
);
}
...
...
sflphone-client-gnome/src/callable_obj.c
View file @
148aec74
...
...
@@ -136,7 +136,6 @@ void create_history_entry_from_serialized_form (gchar *timestamp, gchar *details
if
((
ptr
=
strtok
(
details
,
delim
))
!=
NULL
)
{
do
{
g_print
(
"%s
\n
"
,
ptr
);
switch
(
token
)
{
case
0
:
...
...
@@ -224,8 +223,6 @@ gchar* get_call_duration (callable_obj_t *obj)
start
=
obj
->
_time_start
;
end
=
obj
->
_time_stop
;
g_print
(
"start = %i - end = %i
\n
"
,
start
,
end
);
if
(
start
==
end
)
return
g_markup_printf_escaped
(
"<small>Duration:</small> none"
);
...
...
@@ -262,7 +259,10 @@ gchar* serialize_history_entry (callable_obj_t *entry)
// and the timestamps
timestamp
=
convert_timestamp_to_gchar
(
entry
->
_time_stop
);
result
=
g_strconcat
(
history_state
,
"|"
,
entry
->
_peer_number
,
"|"
,
entry
->
_peer_name
,
"|"
,
timestamp
,
NULL
);
result
=
g_strconcat
(
history_state
,
separator
,
entry
->
_peer_number
,
separator
,
g_strcasecmp
(
entry
->
_peer_name
,
""
)
==
0
?
"empty"
:
entry
->
_peer_name
,
separator
,
timestamp
,
NULL
);
return
result
;
}
...
...
sflphone-client-gnome/src/contacts/calllist.c
View file @
148aec74
...
...
@@ -78,27 +78,32 @@ calllist_reset (calltab_t* tab)
tab
->
callQueue
=
g_queue_new
();
}
void
calllist_add
(
calltab_t
*
tab
,
callable_obj_t
*
c
)
void
calllist_add_history_entry
(
callable_obj_t
*
obj
)
{
if
(
tab
==
history
)
{
// First case: can still add calls to the list
if
(
calllist_get_size
(
tab
)
<
dbus_get_max_calls
()
)
if
(
calllist_get_size
(
history
)
<
dbus_get_max_calls
()
)
{
g_queue_push_tail
(
tab
->
callQueue
,
(
gpointer
*
)
c
);
calltree_add_call
(
history
,
c
);
g_queue_push_tail
(
history
->
callQueue
,
(
gpointer
*
)
obj
);
calltree_add_call
(
history
,
obj
);
}
// List full -> Remove the last call from history and preprend the new call to the list
else
{
calltree_remove_call
(
history
,
(
callable_obj_t
*
)
g_queue_pop_head
(
tab
->
callQueue
)
);
g_queue_push_tail
(
tab
->
callQueue
,
(
gpointer
*
)
c
);
calltree_add_call
(
history
,
c
);
calltree_remove_call
(
history
,
(
callable_obj_t
*
)
g_queue_pop_head
(
history
->
callQueue
)
);
g_queue_push_tail
(
history
->
callQueue
,
(
gpointer
*
)
obj
);
calltree_add_call
(
history
,
obj
);
}
}
else
g_queue_push_tail
(
tab
->
callQueue
,
(
gpointer
*
)
c
);
}
void
calllist_add
(
calltab_t
*
tab
,
callable_obj_t
*
c
)
{
if
(
tab
==
history
)
{
calllist_add_history_entry
(
c
);
}
else
g_queue_push_tail
(
tab
->
callQueue
,
(
gpointer
*
)
c
);
}
// TODO : sflphoneGTK : try to do this more generic
...
...
sflphone-client-gnome/src/contacts/calllist.h
View file @
148aec74
...
...
@@ -41,6 +41,8 @@ typedef struct {
void
calllist_add_contact
(
gchar
*
,
gchar
*
,
contact_type_t
,
GdkPixbuf
*
);
void
calllist_add_history_entry
(
callable_obj_t
*
obj
);
/** This function initialize a call list. */
void
calllist_init
(
calltab_t
*
tab
);
...
...
sflphone-client-gnome/src/main.c
View file @
148aec74
...
...
@@ -104,6 +104,8 @@ There is NO WARRANTY, to the extent permitted by law.\n\n");
// Get the active calls at startup
sflphone_fill_call_list
();
// Load the history
sflphone_fill_history
();
/* start the main loop */
...
...
sflphone-common/test/history-sample.tpl
View file @
148aec74
...
...
@@ -15,3 +15,9 @@ number=5143848557
name=Chez wam
timestamp_stop=775354987
type=1
[534244222]
number=136
name=empty
timestamp_stop=5656534543
type=1
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment