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
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show 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,49 +1355,42 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
...
@@ -1355,49 +1355,42 @@ 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
)
{
{
if
(
gtk_tree_path_compare
(
dpath
,
spath
)
==
0
)
{
// draged a call on itself
// draged a call on itself
}
}
else
else
{
{
// dragged a single call on a single call
// dragged a single call on a single call
if
(
selected_call
!=
NULL
&&
dragged_call
!=
NULL
)
if
(
selected_call
!=
NULL
&&
dragged_call
!=
NULL
)
sflphone_join_participant
(
selected_call
->
_callID
,
dragged_call
->
_callID
);
sflphone_join_participant
(
selected_call
->
_callID
,
dragged_call
->
_callID
);
}
}
}
}
else
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CONFERENCE
)
else
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CONFERENCE
)
{
{
// dragged a single call on a conference
// dragged a single call on a conference
selected_call
->
_confID
=
g_strdup
(
dragged_call_id
);
selected_call
->
_confID
=
g_strdup
(
dragged_call_id
);
sflphone_add_participant
(
selected_call_id
,
dragged_call_id
);
sflphone_add_participant
(
selected_call_id
,
dragged_call_id
);
}
}
else
if
(
selected_type
==
A_CONFERENCE
&&
dragged_type
==
A_CALL
)
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
);
conf
=
selected_conf
;
// dragged a conference on a single call (make no sence)
calltree_remove_conference
(
current_calls
,
conf
,
NULL
);
calltree_add_conference
(
current_calls
,
conf
);
}
}
else
if
(
selected_type
==
A_CONFERENCE
&&
dragged_type
==
A_CONFERENCE
)
else
if
(
selected_type
==
A_CONFERENCE
&&
dragged_type
==
A_CONFERENCE
)
{
{
// dragged a conference on a conference
// dragged a conference on a conference
if
(
gtk_tree_path_compare
(
dpath
,
spath
)
==
0
)
if
(
gtk_tree_path_compare
(
dpath
,
spath
)
==
0
)
{
{
DEBUG
(
"Joined the same conference!
\n
"
);
DEBUG
(
"Joined the same conference!
\n
"
);
gtk_tree_view_expand_row
(
GTK_TREE_VIEW
(
current_calls
->
view
),
path
,
FALSE
);
gtk_tree_view_expand_row
(
GTK_TREE_VIEW
(
current_calls
->
view
),
path
,
FALSE
);
}
}
else
else
{
{
DEBUG
(
"Joined two conference %s, %s!
\n
"
,
dragged_path
,
selected_path
);
DEBUG
(
"Joined two conference %s, %s!
\n
"
,
dragged_path
,
selected_path
);
sflphone_join_conference
(
selected_conf
->
_confID
,
dragged_conf
->
_confID
);
sflphone_join_conference
(
selected_conf
->
_confID
,
dragged_conf
->
_confID
);
}
}
...
@@ -1407,33 +1400,33 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
...
@@ -1407,33 +1400,33 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
// TODO: dragged a conference on a NULL element (should do nothing)
// TODO: dragged a conference on a NULL element (should do nothing)
}
}
else
// dragged_path_depth == 2
else
{
{
// dragged_path_depth == 2
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CALL
)
{
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CALL
)
{
// TODO: dragged a call on a conference call
// TODO: dragged a call on a conference call
calltree_remove_call
(
current_calls
,
selected_call
,
NULL
);
calltree_remove_call
(
current_calls
,
selected_call
,
NULL
);
calltree_add_call
(
current_calls
,
selected_call
,
NULL
);
calltree_add_call
(
current_calls
,
selected_call
,
NULL
);
}
}
else
if
(
selected_type
==
A_CONFERENCE
&&
dragged_type
==
A_CALL
)
else
if
(
selected_type
==
A_CONFERENCE
&&
dragged_type
==
A_CALL
)
{
{
// TODO: dragged a conference on a conference call
// TODO: dragged a conference on a conference call
calltree_remove_conference
(
current_calls
,
selected_conf
,
NULL
);
conf
=
selected_conf
;
calltree_add_conference
(
current_calls
,
selected_conf
);
calltree_remove_conference
(
current_calls
,
conf
,
NULL
);
calltree_add_conference
(
current_calls
,
conf
);
}
}
// TODO: dragged a single call on a NULL element
// TODO: dragged a single call on a NULL element
// TODO: dragged a conference on a NULL element
// TODO: dragged a conference on a NULL element
}
}
}
}
else
// selected_path_depth == 2
else
{
{
if
(
dragged_path_depth
==
1
)
// selected_path_depth == 2
{
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CALL
)
if
(
dragged_path_depth
==
1
)
{
{
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CALL
)
{
// dragged a conference call on a call
// dragged a conference call on a call
sflphone_detach_participant
(
selected_call_id
);
sflphone_detach_participant
(
selected_call_id
);
...
@@ -1442,27 +1435,24 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
...
@@ -1442,27 +1435,24 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
sflphone_join_participant
(
selected_call
->
_callID
,
dragged_call
->
_callID
);
sflphone_join_participant
(
selected_call
->
_callID
,
dragged_call
->
_callID
);
}
}
else
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CONFERENCE
)
else
if
(
selected_type
==
A_CALL
&&
dragged_type
==
A_CONFERENCE
)
{
{
// dragged a conference call on a conference
// dragged a conference call on a conference
sflphone_detach_participant
(
selected_call_id
);
sflphone_detach_participant
(
selected_call_id
);
if
(
selected_call
!=
NULL
&&
dragged_conf
!=
NULL
)
if
(
selected_call
!=
NULL
&&
dragged_conf
!=
NULL
)
{
{
DEBUG
(
"Adding a participant, since dragged call on a conference"
);
DEBUG
(
"Adding a participant, since dragged call on a conference"
);
sflphone_add_participant
(
selected_call_id
,
dragged_call_id
);
sflphone_add_participant
(
selected_call_id
,
dragged_call_id
);
}
}
}
}
else
else
{
{
// dragged a conference call on a NULL element
// dragged a conference call on a NULL element
sflphone_detach_participant
(
selected_call_id
);
sflphone_detach_participant
(
selected_call_id
);
}
}
}
}
else
// dragged_path_depth == 2
else
{
{
// dragged_path_depth == 2
// dragged a conference call on another conference call (same conference)
// dragged a conference call on another conference call (same conference)
// TODO: dragged a conference call on another conference call (different conference)
// TODO: dragged a conference call on another conference call (different conference)
...
@@ -1473,22 +1463,19 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
...
@@ -1473,22 +1463,19 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
gtk_tree_path_up
(
dpath
);
gtk_tree_path_up
(
dpath
);
gtk_tree_path_up
(
spath
);
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
);
...
@@ -1498,13 +1485,11 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
...
@@ -1498,13 +1485,11 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d
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!"
);
}
}
}
}
...
...
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