Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
130
Issues
130
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
4f31abe6
Commit
4f31abe6
authored
May 15, 2012
by
Tristan Matthews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* #10736: calltree: cleanup
parent
df303839
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
28 deletions
+24
-28
gnome/src/contacts/calltree.c
gnome/src/contacts/calltree.c
+24
-28
No files found.
gnome/src/contacts/calltree.c
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment