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
4f31abe6
Commit
4f31abe6
authored
12 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #10736: calltree: cleanup
parent
df303839
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gnome/src/contacts/calltree.c
+24
-28
24 additions, 28 deletions
gnome/src/contacts/calltree.c
with
24 additions
and
28 deletions
gnome/src/contacts/calltree.c
+
24
−
28
View file @
4f31abe6
...
...
@@ -1206,6 +1206,24 @@ handle_drop_into(GtkTreeModel *model, GtkTreeIter *source_iter, GtkTreeIter *des
return
result
;
}
static
gboolean
valid_drop
(
GtkTreeModel
*
model
,
GtkTreeIter
*
source_iter
,
GtkTreePath
*
dest_path
)
{
gboolean
result
=
TRUE
;
GtkTreePath
*
source_path
=
gtk_tree_model_get_path
(
model
,
source_iter
);
if
(
!
gtk_tree_path_compare
(
source_path
,
dest_path
))
{
ERROR
(
"invalid drop: source and destination are the same"
);
result
=
FALSE
;
}
else
if
(
gtk_tree_path_is_ancestor
(
source_path
,
dest_path
))
{
ERROR
(
"invalid drop: source is ancestor of destination"
);
result
=
FALSE
;
}
else
if
(
gtk_tree_path_is_descendant
(
source_path
,
dest_path
))
{
ERROR
(
"invalid drop: source is descendant of destination"
);
result
=
FALSE
;
}
gtk_tree_path_free
(
source_path
);
return
result
;
}
static
gboolean
render_drop
(
GtkTreeModel
*
model
,
GtkTreePath
*
dest_path
,
GtkTreeViewDropPosition
dest_pos
,
GtkTreeIter
*
source_iter
)
...
...
@@ -1216,41 +1234,19 @@ render_drop(GtkTreeModel *model, GtkTreePath *dest_path, GtkTreeViewDropPosition
return
FALSE
;
}
gboolean
result
;
gboolean
result
=
FALSE
;
switch
(
dest_pos
)
{
case
GTK_TREE_VIEW_DROP_BEFORE
:
DEBUG
(
"DROP_BEFORE, detaching if appropriate"
);
case
GTK_TREE_VIEW_DROP_AFTER
:
DEBUG
(
"dropped at position %d, detaching if appropriate"
,
dest_pos
);
result
=
try_detach
(
model
,
source_iter
,
&
dest_iter
);
break
;
case
GTK_TREE_VIEW_DROP_INTO_OR_BEFORE
:
/* fallthrough */
case
GTK_TREE_VIEW_DROP_INTO_OR_AFTER
:
DEBUG
(
"DROP_INTO"
);
GtkTreePath
*
source_path
=
gtk_tree_model_get_path
(
model
,
source_iter
);
if
(
!
gtk_tree_path_compare
(
source_path
,
dest_path
))
{
ERROR
(
"invalid drop: source and dest are same"
);
gtk_tree_path_free
(
source_path
);
return
FALSE
;
}
else
if
(
gtk_tree_path_is_ancestor
(
source_path
,
dest_path
))
{
ERROR
(
"invalid drop: source is ancestor of dest"
);
gtk_tree_path_free
(
source_path
);
return
FALSE
;
}
else
if
(
gtk_tree_path_is_descendant
(
source_path
,
dest_path
))
{
ERROR
(
"invalid drop: source is descendant of dest"
);
gtk_tree_path_free
(
source_path
);
return
FALSE
;
}
gtk_tree_path_free
(
source_path
);
result
=
handle_drop_into
(
model
,
source_iter
,
&
dest_iter
);
break
;
case
GTK_TREE_VIEW_DROP_AFTER
:
DEBUG
(
"DROP_AFTER, detaching if appropriate"
);
result
=
try_detach
(
model
,
source_iter
,
&
dest_iter
);
break
;
default:
ERROR
(
"Unexpected position"
);
result
=
FALSE
;
if
(
valid_drop
(
model
,
source_iter
,
dest_path
))
result
=
handle_drop_into
(
model
,
source_iter
,
&
dest_iter
);
break
;
}
return
result
;
...
...
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