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
32281ec8
Commit
32281ec8
authored
13 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #10736: calltree: update call need not be recursive
parent
b97b9cce
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
gnome/src/contacts/calltree.c
+131
-135
131 additions, 135 deletions
gnome/src/contacts/calltree.c
with
131 additions
and
135 deletions
gnome/src/contacts/calltree.c
+
131
−
135
View file @
32281ec8
...
...
@@ -545,21 +545,25 @@ GdkPixbuf *history_state_to_pixbuf(const gchar *history_state)
return
pixbuf
;
}
static
void
calltree_update_call_recursive
(
calltab_t
*
tab
,
callable_obj_t
*
call
,
GtkTreeIter
*
parent
)
typedef
struct
{
calltab_t
*
tab
;
callable_obj_t
*
call
;
}
CallUpdateCtx
;
static
gboolean
update_call
(
GtkTreeModel
*
model
,
GtkTreePath
*
path
UNUSED
,
GtkTreeIter
*
iter
,
gpointer
data
)
{
GdkPixbuf
*
pixbuf
=
NULL
;
GdkPixbuf
*
pixbuf_security
=
NULL
;
GtkTreeIter
iter
;
CallUpdateCtx
*
ctx
=
(
CallUpdateCtx
*
)
data
;
calltab_t
*
tab
=
ctx
->
tab
;
callable_obj_t
*
call
=
ctx
->
call
;
GtkTreeStore
*
store
=
tab
->
store
;
gchar
*
srtp_enabled
=
NULL
;
gboolean
display_sas
=
TRUE
;
account_t
*
account
=
NULL
;
int
nbChild
=
gtk_tree_model_iter_n_children
(
GTK_TREE_MODEL
(
store
),
parent
);
if
(
call
)
{
account
=
account_list_get_by_id
(
call
->
_accountID
);
if
(
account
!=
NULL
)
{
...
...
@@ -572,24 +576,15 @@ calltree_update_call_recursive(calltab_t* tab, callable_obj_t * call, GtkTreeIte
display_sas
=
utf8_case_equal
(
g_hash_table_lookup
(
properties
,
ACCOUNT_ZRTP_DISPLAY_SAS
),
"true"
);
}
}
}
for
(
gint
i
=
0
;
i
<
nbChild
;
i
++
)
{
GtkTreeModel
*
model
=
GTK_TREE_MODEL
(
store
);
if
(
gtk_tree_model_iter_nth_child
(
model
,
&
iter
,
parent
,
i
))
{
if
(
is_conference
(
model
,
&
iter
))
{
calltree_update_call_recursive
(
tab
,
call
,
&
iter
);
}
else
{
gchar
*
id
;
gtk_tree_model_get
(
model
,
&
iter
,
COLUMN_ID
,
&
id
,
-
1
);
gtk_tree_model_get
(
model
,
iter
,
COLUMN_ID
,
&
id
,
-
1
);
callable_obj_t
*
iterCall
=
calllist_get_call
(
tab
,
id
);
g_free
(
id
);
if
(
iterCall
!=
call
)
continue
;
return
FALSE
;
/* Update text */
gchar
*
description
=
NULL
;
...
...
@@ -665,11 +660,7 @@ calltree_update_call_recursive(calltab_t* tab, callable_obj_t * call, GtkTreeIte
}
}
else
if
(
tab
==
history_tab
)
{
// parent is NULL this is not a conference participant
if
(
parent
==
NULL
)
pixbuf
=
history_state_to_pixbuf
(
call
->
_history_state
);
else
// parent is not NULL this is a conference participant
pixbuf
=
gdk_pixbuf_new_from_file
(
ICONS_DIR
"/current.svg"
,
NULL
);
g_free
(
description
);
description
=
calltree_display_call_info
(
call
,
DISPLAY_TYPE_HISTORY
,
""
);
...
...
@@ -685,7 +676,7 @@ calltree_update_call_recursive(calltab_t* tab, callable_obj_t * call, GtkTreeIte
g_free
(
old_description
);
}
gtk_tree_store_set
(
store
,
&
iter
,
gtk_tree_store_set
(
store
,
iter
,
COLUMN_ACCOUNT_PIXBUF
,
pixbuf
,
COLUMN_ACCOUNT_DESC
,
description
,
COLUMN_ACCOUNT_SECURITY_PIXBUF
,
pixbuf_security
,
...
...
@@ -699,14 +690,19 @@ calltree_update_call_recursive(calltab_t* tab, callable_obj_t * call, GtkTreeIte
g_object_unref
(
G_OBJECT
(
pixbuf
));
if
(
pixbuf_security
!=
NULL
)
g_object_unref
(
G_OBJECT
(
pixbuf_security
));
}
}
}
return
TRUE
;
}
void
calltree_update_call
(
calltab_t
*
tab
,
callable_obj_t
*
c
)
void
calltree_update_call
(
calltab_t
*
tab
,
callable_obj_t
*
c
all
)
{
calltree_update_call_recursive
(
tab
,
c
,
NULL
);
if
(
!
call
)
{
ERROR
(
"Call is NULL, ignoring"
);
return
;
}
CallUpdateCtx
ctx
=
{
tab
,
call
};
GtkTreeStore
*
store
=
tab
->
store
;
GtkTreeModel
*
model
=
GTK_TREE_MODEL
(
store
);
gtk_tree_model_foreach
(
model
,
update_call
,
(
gpointer
)
&
ctx
);
update_actions
();
}
...
...
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