Mercurial > geeqie.yaz
comparison src/bar_keywords.c @ 1396:58f0b4586c8c
dnd fixes
author | nadvornik |
---|---|
date | Sun, 08 Mar 2009 12:42:23 +0000 |
parents | e86d8facbdae |
children | 6ce1f7171d48 |
comparison
equal
deleted
inserted
replaced
1395:e86d8facbdae | 1396:58f0b4586c8c |
---|---|
525 static void bar_pane_keywords_dnd_receive(GtkWidget *tree_view, GdkDragContext *context, | 525 static void bar_pane_keywords_dnd_receive(GtkWidget *tree_view, GdkDragContext *context, |
526 gint x, gint y, | 526 gint x, gint y, |
527 GtkSelectionData *selection_data, guint info, | 527 GtkSelectionData *selection_data, guint info, |
528 guint time, gpointer data) | 528 guint time, gpointer data) |
529 { | 529 { |
530 PaneKeywordsData *pkd = data; | |
530 GtkTreePath *tpath = NULL; | 531 GtkTreePath *tpath = NULL; |
531 GtkTreeViewDropPosition pos; | 532 GtkTreeViewDropPosition pos; |
532 GtkTreeModel *model; | 533 GtkTreeModel *model; |
533 | 534 |
534 GtkTreeModel *keyword_tree; | 535 GtkTreeModel *keyword_tree; |
573 gtk_tree_model_filter_convert_iter_to_child_iter(GTK_TREE_MODEL_FILTER(model), &dest_kw_iter, &dest_iter); | 574 gtk_tree_model_filter_convert_iter_to_child_iter(GTK_TREE_MODEL_FILTER(model), &dest_kw_iter, &dest_iter); |
574 | 575 |
575 if (src_valid && gtk_tree_store_is_ancestor(GTK_TREE_STORE(keyword_tree), &src_kw_iter, &dest_kw_iter)) | 576 if (src_valid && gtk_tree_store_is_ancestor(GTK_TREE_STORE(keyword_tree), &src_kw_iter, &dest_kw_iter)) |
576 { | 577 { |
577 /* can't move to it's own child */ | 578 /* can't move to it's own child */ |
579 return; | |
580 } | |
581 | |
582 if (src_valid && keyword_compare(keyword_tree, &src_kw_iter, &dest_kw_iter) == 0) | |
583 { | |
584 /* can't move to itself */ | |
578 return; | 585 return; |
579 } | 586 } |
580 | 587 |
581 if ((pos == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE || pos == GTK_TREE_VIEW_DROP_INTO_OR_AFTER) && | 588 if ((pos == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE || pos == GTK_TREE_VIEW_DROP_INTO_OR_AFTER) && |
582 !gtk_tree_model_iter_has_child(keyword_tree, &dest_kw_iter)) | 589 !gtk_tree_model_iter_has_child(keyword_tree, &dest_kw_iter)) |
620 gtk_tree_store_insert_after(GTK_TREE_STORE(keyword_tree), &add, NULL, &new_kw_iter); | 627 gtk_tree_store_insert_after(GTK_TREE_STORE(keyword_tree), &add, NULL, &new_kw_iter); |
621 new_kw_iter = add; | 628 new_kw_iter = add; |
622 } | 629 } |
623 } | 630 } |
624 string_list_free(new_keywords); | 631 string_list_free(new_keywords); |
632 bar_keyword_tree_sync(pkd); | |
625 } | 633 } |
626 | 634 |
627 static gint bar_pane_keywords_dnd_motion(GtkWidget *tree_view, GdkDragContext *context, | 635 static gint bar_pane_keywords_dnd_motion(GtkWidget *tree_view, GdkDragContext *context, |
628 gint x, gint y, guint time, gpointer data) | 636 gint x, gint y, guint time, gpointer data) |
629 { | 637 { |