[Xfce4-commits] [apps/xfburn] 38/42: refactored file addition setup for thread_add_files_drag

noreply at xfce.org noreply at xfce.org
Tue Oct 15 02:22:21 CEST 2019


This is an automated email from the git hooks/post-receive script.

k   a   t   a   n   a   s   t   e   e   l       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfburn.

commit 5683cd77ded67000bf33a55e6d95800bf6aefbf6
Author: Rene Kjellerup <rk.katana.steel at gmail.com>
Date:   Fri Sep 6 12:59:51 2019 -0700

    refactored file addition setup for thread_add_files_drag
---
 xfburn/xfburn-data-composition.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/xfburn/xfburn-data-composition.c b/xfburn/xfburn-data-composition.c
index dc29876..34456f3 100644
--- a/xfburn/xfburn-data-composition.c
+++ b/xfburn/xfburn-data-composition.c
@@ -1907,6 +1907,9 @@ thread_add_files_drag (ThreadAddFilesDragParams *params)
 
   GtkTreeModel *model;
   GtkTreeIter iter_where_insert;
+  GtkTreeIter *iter_insert = (priv->path_where_insert) ? &iter_where_insert : NULL;
+  gboolean expand = (position == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE || position == GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
+  gboolean success = FALSE;
   GList *files = priv->full_paths_to_add;
 
   gdk_threads_enter ();
@@ -1924,21 +1927,19 @@ thread_add_files_drag (ThreadAddFilesDragParams *params)
       gdk_threads_enter ();
       gtk_tree_model_get_iter (model, &iter_where_insert, priv->path_where_insert);
       gdk_threads_leave ();
+    }
 
-      if (thread_add_file_to_list (composition, model, full_path, &iter, &iter_where_insert, position)) {
-        if (position == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE
-            || position == GTK_TREE_VIEW_DROP_INTO_OR_AFTER) {
-          gdk_threads_enter ();
-          gtk_tree_view_expand_row (GTK_TREE_VIEW (widget), priv->path_where_insert, FALSE);
-          gdk_threads_leave ();
-        }
-      }
+    success = thread_add_file_to_list (composition, model, full_path, &iter, iter_insert, position);
 
-    } else  {
-      thread_add_file_to_list (composition, model, full_path, &iter, NULL, position);
+    if (success && expand && priv->path_where_insert) {
+      gdk_threads_enter ();
+      gtk_tree_view_expand_row (GTK_TREE_VIEW (widget), priv->path_where_insert, FALSE);
+      gdk_threads_leave ();
     }
+
   }
   xfburn_adding_progress_done (XFBURN_ADDING_PROGRESS (priv->progress));
+  return NULL;
 }
 
 static void

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list