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
475cecf4
Commit
475cecf4
authored
15 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#2466] GUI-Gnome: Segfault when dragging a conference on a call
Happen when as current_calls may change during gui manipulation
parent
85a4a861
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-client-gnome/src/contacts/calltree.c
+116
-131
116 additions, 131 deletions
sflphone-client-gnome/src/contacts/calltree.c
with
116 additions
and
131 deletions
sflphone-client-gnome/src/contacts/calltree.c
+
116
−
131
View file @
475cecf4
...
@@ -1355,165 +1355,150 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
...
@@ -1355,165 +1355,150 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
conference_obj_t
*
conf
;
conference_obj_t
*
conf
;
if
(
selected_path_depth
==
1
)
if
(
selected_path_depth
==
1
)
{
{
if
(
dragged_path_depth
==
1
)
{
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CALL
)
if
(
dragged_path_depth
==
1
)
{
{
if
(
gtk_tree_path_compare
(
dpath
,
spath
)
==
0
)
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CALL
)
{
{
// draged a call on itself
}
else
{
// dragged a single call on a single call
if
(
selected_call
!=
NULL
&&
dragged_call
!=
NULL
)
sflphone_join_participant
(
selected_call
->
_callID
,
dragged_call
->
_callID
);
}
}
else
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CONFERENCE
)
{
// dragged a single call on a conference
selected_call
->
_confID
=
g_strdup
(
dragged_call_id
);
sflphone_add_participant
(
selected_call_id
,
dragged_call_id
);
}
else
if
(
selected_type
==
A_CONFERENCE
&&
dragged_type
==
A_CALL
)
{
// dragged a conference on a single call (make no sence)
calltree_remove_conference
(
current_calls
,
selected_conf
,
NULL
);
calltree_add_conference
(
current_calls
,
selected_conf
);
if
(
gtk_tree_path_compare
(
dpath
,
spath
)
==
0
)
{
// draged a call on itself
}
else
{
// dragged a single call on a single call
if
(
selected_call
!=
NULL
&&
dragged_call
!=
NULL
)
sflphone_join_participant
(
selected_call
->
_callID
,
dragged_call
->
_callID
);
}
}
else
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CONFERENCE
)
{
// dragged a single call on a conference
selected_call
->
_confID
=
g_strdup
(
dragged_call_id
);
sflphone_add_participant
(
selected_call_id
,
dragged_call_id
);
}
else
if
(
selected_type
==
A_CONFERENCE
&&
dragged_type
==
A_CALL
)
{
}
conf
=
selected_conf
;
else
if
(
selected_type
==
A_CONFERENCE
&&
dragged_type
==
A_CONFERENCE
)
{
// dragged a conference on a conference
if
(
gtk_tree_path_compare
(
dpath
,
spath
)
==
0
)
{
DEBUG
(
"Joined the same conference!
\n
"
);
gtk_tree_view_expand_row
(
GTK_TREE_VIEW
(
current_calls
->
view
),
path
,
FALSE
);
}
else
{
DEBUG
(
"Joined two conference %s, %s!
\n
"
,
dragged_path
,
selected_path
);
sflphone_join_conference
(
selected_conf
->
_confID
,
dragged_conf
->
_confID
);
}
}
// TODO: dragged a single call on a NULL element (should do nothing)
// dragged a conference on a single call (make no sence)
// TODO: dragged a conference on a NULL element (should do nothing)
calltree_remove_conference
(
current_calls
,
conf
,
NULL
);
calltree_add_conference
(
current_calls
,
conf
);
}
}
else
// dragged_path_depth == 2
else
if
(
selected_type
==
A_CONFERENCE
&&
dragged_type
==
A_CONFERENCE
)
{
{
// dragged a conference on a conference
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CALL
)
if
(
gtk_tree_path_compare
(
dpath
,
spath
)
==
0
)
{
{
DEBUG
(
"Joined the same conference!
\n
"
);
// TODO: dragged a call on a conference call
gtk_tree_view_expand_row
(
GTK_TREE_VIEW
(
current_calls
->
view
),
path
,
FALSE
);
calltree_remove_call
(
current_calls
,
selected_call
,
NULL
);
}
calltree_add_call
(
current_calls
,
selected_call
,
NULL
);
else
{
}
DEBUG
(
"Joined two conference %s, %s!
\n
"
,
dragged_path
,
selected_path
);
else
if
(
selected_type
==
A_CONFERENCE
&&
dragged_type
==
A_CALL
)
sflphone_join_conference
(
selected_conf
->
_confID
,
dragged_conf
->
_confID
);
{
}
// TODO: dragged a conference on a conference call
calltree_remove_conference
(
current_calls
,
selected_conf
,
NULL
);
calltree_add_conference
(
current_calls
,
selected_conf
);
}
// TODO: dragged a single call on a NULL element
// TODO: dragged a conference on a NULL element
}
}
}
else
// selected_path_depth == 2
{
if
(
dragged_path_depth
==
1
)
{
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CALL
)
// TODO: dragged a single call on a NULL element (should do nothing
)
{
// TODO: dragged a conference on a NULL element (should do nothing)
// dragged a conference call on a call
}
sflphone_detach_participant
(
selected_call_id
);
else
{
// dragged_path_depth == 2
if
(
selected_call
!=
NULL
&&
dragged_call
!=
NULL
)
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CALL
)
{
sflphone_join_participant
(
selected_call
->
_callID
,
dragged_call
->
_callID
);
// TODO: dragged a call on a conference call
calltree_remove_call
(
current_calls
,
selected_call
,
NULL
);
calltree_add_call
(
current_calls
,
selected_call
,
NULL
);
}
else
if
(
selected_type
==
A_CONFERENCE
&&
dragged_type
==
A_CALL
)
{
// TODO: dragged a conference on a conference call
conf
=
selected_conf
;
}
calltree_remove_conference
(
current_calls
,
conf
,
NULL
);
else
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CONFERENCE
)
calltree_add_conference
(
current_calls
,
conf
);
{
}
// dragged a conference call on a conference
sflphone_detach_participant
(
selected_call_id
);
// TODO: dragged a single call on a NULL element
// TODO: dragged a conference on a NULL element
}
}
else
{
if
(
selected_call
!=
NULL
&&
dragged_conf
!=
NULL
)
// selected_path_depth == 2
{
DEBUG
(
"Adding a participant, since dragged call on a conference"
);
sflphone_add_participant
(
selected_call_id
,
dragged_call_id
);
if
(
dragged_path_depth
==
1
)
{
}
}
else
{
// dragged a conference call on a NULL element
sflphone_detach_participant
(
selected_call_id
);
}
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CALL
)
{
// dragged a conference call on a call
sflphone_detach_participant
(
selected_call_id
);
if
(
selected_call
!=
NULL
&&
dragged_call
!=
NULL
)
sflphone_join_participant
(
selected_call
->
_callID
,
dragged_call
->
_callID
);
}
}
else
// dragged_path_depth == 2
else
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CONFERENCE
)
{
{
// dragged a conference call on a conference
// dragged a conference call on another conference call (same conference)
sflphone_detach_participant
(
selected_call_id
);
// TODO: dragged a conference call on another conference call (different conference)
gtk_tree_path_up
(
path
);
if
(
selected_call
!=
NULL
&&
dragged_conf
!=
NULL
)
{
DEBUG
(
"Adding a participant, since dragged call on a conference"
);
gtk_tree_model_get_iter
(
GTK_TREE_MODEL
(
model
),
&
parent_conference
,
path
);
sflphone_add_participant
(
selected_call_id
,
dragged_call_id
);
}
}
else
{
// dragged a conference call on a NULL element
sflphone_detach_participant
(
selected_call_id
);
}
}
else
{
// dragged_path_depth == 2
// dragged a conference call on another conference call (same conference)
// TODO: dragged a conference call on another conference call (different conference)
gtk_tree_path_up
(
dpath
);
gtk_tree_path_up
(
path
);
gtk_tree_path_up
(
spath
);
gtk_tree_model_get_iter
(
GTK_TREE_MODEL
(
model
),
&
parent_conference
,
path
);
gtk_tree_path_up
(
dpath
);
gtk_tree_path_up
(
spath
);
if
(
gtk_tree_path_compare
(
dpath
,
spath
)
==
0
)
if
(
gtk_tree_path_compare
(
dpath
,
spath
)
==
0
)
{
{
DEBUG
(
"Dragged a call in the same conference"
);
DEBUG
(
"Dragged a call in the same conference"
);
calltree_remove_call
(
current_calls
,
selected_call
,
NULL
);
calltree_remove_call
(
current_calls
,
selected_call
,
NULL
);
calltree_add_call
(
current_calls
,
selected_call
,
&
parent_conference
);
calltree_add_call
(
current_calls
,
selected_call
,
&
parent_conference
);
}
}
else
else
{
{
DEBUG
(
"Dragged a conference call onto another conference call %s, %s"
,
gtk_tree_path_to_string
(
dpath
),
gtk_tree_path_to_string
(
spath
));
DEBUG
(
"Dragged a conference call onto another conference call %s, %s"
,
gtk_tree_path_to_string
(
dpath
),
gtk_tree_path_to_string
(
spath
));
conf
=
NULL
;
conf
=
NULL
;
val
.
g_type
=
0
;
val
.
g_type
=
0
;
if
(
gtk_tree_model_get_iter
(
model
,
&
iter
,
dpath
))
if
(
gtk_tree_model_get_iter
(
model
,
&
iter
,
dpath
))
{
{
DEBUG
(
"we got an iter!"
);
DEBUG
(
"we got an iter!"
);
gtk_tree_model_get_value
(
model
,
&
iter
,
COLUMN_ACCOUNT_PTR
,
&
val
);
gtk_tree_model_get_value
(
model
,
&
iter
,
COLUMN_ACCOUNT_PTR
,
&
val
);
conf
=
(
conference_obj_t
*
)
g_value_get_pointer
(
&
val
);
conf
=
(
conference_obj_t
*
)
g_value_get_pointer
(
&
val
);
}
}
g_value_unset
(
&
val
);
g_value_unset
(
&
val
);
sflphone_detach_participant
(
selected_call_id
);
sflphone_detach_participant
(
selected_call_id
);
if
(
conf
)
if
(
conf
)
{
{
DEBUG
(
"we got a conf!"
);
DEBUG
(
"we got a conf!"
);
sflphone_add_participant
(
selected_call_id
,
conf
->
_confID
);
sflphone_add_participant
(
selected_call_id
,
conf
->
_confID
);
}
}
else
{
else
DEBUG
(
"didn't find a conf!"
);
{
}
DEBUG
(
"didn't find a conf!"
);
}
}
}
// TODO: dragged a conference call on another conference call (different conference)
// TODO: dragged a conference call on another conference call (different conference)
// TODO: dragged a conference call on a NULL element (same conference)
// TODO: dragged a conference call on a NULL element (same conference)
// TODO: dragged a conference call on a NULL element (different conference)
// TODO: dragged a conference call on a NULL element (different conference)
}
}
}
}
...
...
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