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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
12f5e607
Commit
12f5e607
authored
13 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #10736: calltree: no more recursive calls
parent
1bc38feb
Branches
Branches containing commit
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
+38
-37
38 additions, 37 deletions
gnome/src/contacts/calltree.c
with
38 additions
and
37 deletions
gnome/src/contacts/calltree.c
+
38
−
37
View file @
12f5e607
...
@@ -550,6 +550,11 @@ typedef struct {
...
@@ -550,6 +550,11 @@ typedef struct {
callable_obj_t
*
call
;
callable_obj_t
*
call
;
}
CallUpdateCtx
;
}
CallUpdateCtx
;
typedef
struct
{
calltab_t
*
tab
;
const
conference_obj_t
*
conf
;
}
ConferenceRemoveCtx
;
static
gboolean
static
gboolean
update_call
(
GtkTreeModel
*
model
,
GtkTreePath
*
path
UNUSED
,
GtkTreeIter
*
iter
,
gpointer
data
)
update_call
(
GtkTreeModel
*
model
,
GtkTreePath
*
path
UNUSED
,
GtkTreeIter
*
iter
,
gpointer
data
)
{
{
...
@@ -1004,36 +1009,32 @@ void calltree_add_conference_to_current_calls(conference_obj_t* conf)
...
@@ -1004,36 +1009,32 @@ void calltree_add_conference_to_current_calls(conference_obj_t* conf)
}
}
static
static
void
calltree_remove_conference_recursive
(
calltab_t
*
tab
,
const
conference_obj_t
*
conf
,
GtkTreeIter
*
parent
)
gboolean
remove_conference
(
GtkTreeModel
*
model
,
GtkTreePath
*
path
UNUSED
,
GtkTreeIter
*
iter
,
gpointer
data
)
{
{
GtkTreeModel
*
model
=
GTK_TREE_MODEL
(
tab
->
store
);
if
(
!
is_conference
(
model
,
iter
))
int
nbChildren
=
gtk_tree_model_iter_n_children
(
model
,
parent
);
return
FALSE
;
for
(
int
i
=
0
;
i
<
nbChildren
;
i
++
)
{
GtkTreeIter
iter_parent
;
/* if the nth child of parent has one or more children */
if
(
gtk_tree_model_iter_nth_child
(
model
,
&
iter_parent
,
parent
,
i
))
{
/* RECURSION! */
if
(
gtk_tree_model_iter_has_child
(
model
,
&
iter_parent
))
calltree_remove_conference_recursive
(
tab
,
conf
,
&
iter_parent
);
if
(
is_conference
(
model
,
&
iter_parent
))
{
gchar
*
conf_id
;
gchar
*
conf_id
;
gtk_tree_model_get
(
model
,
&
iter
_parent
,
COLUMN_ID
,
&
conf_id
,
-
1
);
gtk_tree_model_get
(
model
,
iter
,
COLUMN_ID
,
&
conf_id
,
-
1
);
ConferenceRemoveCtx
*
ctx
=
(
ConferenceRemoveCtx
*
)
data
;
calltab_t
*
tab
=
ctx
->
tab
;
conference_obj_t
*
tempconf
=
conferencelist_get
(
tab
,
conf_id
);
conference_obj_t
*
tempconf
=
conferencelist_get
(
tab
,
conf_id
);
g_free
(
conf_id
);
g_free
(
conf_id
);
/* if this is the conference we want to remove */
const
conference_obj_t
*
conf
=
ctx
->
conf
;
if
(
tempconf
==
conf
)
{
/* if this is not the conference we want to remove */
int
nbParticipants
=
gtk_tree_model_iter_n_children
(
model
,
&
iter_parent
);
if
(
tempconf
!=
conf
)
return
FALSE
;
int
nbParticipants
=
gtk_tree_model_iter_n_children
(
model
,
iter
);
DEBUG
(
"nbParticipants: %d"
,
nbParticipants
);
DEBUG
(
"nbParticipants: %d"
,
nbParticipants
);
for
(
int
j
=
0
;
j
<
nbParticipants
;
j
++
)
{
for
(
int
j
=
0
;
j
<
nbParticipants
;
j
++
)
{
GtkTreeIter
iter_child
;
GtkTreeIter
iter_child
;
if
(
gtk_tree_model_iter_nth_child
(
model
,
&
iter_child
,
&
iter
_parent
,
j
))
{
if
(
gtk_tree_model_iter_nth_child
(
model
,
&
iter_child
,
iter
,
j
))
{
gchar
*
call_id
;
gchar
*
call_id
;
gtk_tree_model_get
(
model
,
&
iter_child
,
COLUMN_ID
,
&
call_id
,
-
1
);
gtk_tree_model_get
(
model
,
&
iter_child
,
COLUMN_ID
,
&
call_id
,
-
1
);
...
@@ -1046,19 +1047,19 @@ void calltree_remove_conference_recursive(calltab_t* tab, const conference_obj_t
...
@@ -1046,19 +1047,19 @@ void calltree_remove_conference_recursive(calltab_t* tab, const conference_obj_t
}
}
}
}
gtk_tree_store_remove
(
tab
->
store
,
&
iter_parent
);
gtk_tree_store_remove
(
GTK_TREE_STORE
(
model
),
iter
);
}
}
}
}
if
(
calltab_get_selected_conf
(
tab
)
==
conf
)
if
(
calltab_get_selected_conf
(
tab
)
==
conf
)
calltab_select_conf
(
tab
,
NULL
);
calltab_select_conf
(
tab
,
NULL
);
return
TRUE
;
}
}
void
calltree_remove_conference
(
calltab_t
*
tab
,
const
conference_obj_t
*
conf
)
void
calltree_remove_conference
(
calltab_t
*
tab
,
const
conference_obj_t
*
conf
)
{
{
calltree_remove_conference_recursive
(
tab
,
conf
,
NULL
);
ConferenceRemoveCtx
context
=
{
tab
,
conf
};
GtkTreeStore
*
store
=
tab
->
store
;
GtkTreeModel
*
model
=
GTK_TREE_MODEL
(
store
);
gtk_tree_model_foreach
(
model
,
remove_conference
,
(
gpointer
)
&
context
);
update_actions
();
update_actions
();
DEBUG
(
"Finished removing conference %s"
,
conf
->
_confID
);
DEBUG
(
"Finished removing conference %s"
,
conf
->
_confID
);
...
...
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