[Goodies-commits] r7715 - xfburn/trunk/xfburn

David Mohr squisher at xfce.org
Sat Jul 11 04:57:13 CEST 2009


Author: squisher
Date: 2009-07-11 02:57:13 +0000 (Sat, 11 Jul 2009)
New Revision: 7715

Modified:
   xfburn/trunk/xfburn/xfburn-data-composition.c
Log:
Rename files not just in the GUI but also in the generated IsoImage

Modified: xfburn/trunk/xfburn/xfburn-data-composition.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-data-composition.c	2009-07-10 12:36:46 UTC (rev 7714)
+++ xfburn/trunk/xfburn/xfburn-data-composition.c	2009-07-11 02:57:13 UTC (rev 7715)
@@ -1784,6 +1784,7 @@
       IsoNode *node = NULL;
       IsoDir *dir = NULL;
       int r;
+      gchar *basename;
       
       gtk_tree_model_get (model, iter, DATA_COMPOSITION_COLUMN_TYPE, &type,
 			  DATA_COMPOSITION_COLUMN_CONTENT, &name, DATA_COMPOSITION_COLUMN_PATH, &src, -1);
@@ -1813,6 +1814,25 @@
           g_error ("Failed adding %s as a node to the image: code %d!", src, r);
       }
 
+      basename = g_path_get_basename (src);
+
+      /* check if the file has been renamed */
+      if (strcmp (basename, name) != 0) {
+        /* rename the iso_node */
+        r = iso_node_set_name (node, name);
+
+        if (r == 0) {
+          xfce_warn (_("Duplicate filename '%s' for '%s'"), name, src);
+
+          g_free (basename);
+          g_free (name);
+          g_free (src);
+
+          continue;
+        }
+      }
+
+      g_free (basename);
       g_free (name);
       g_free (src);
 




More information about the Goodies-commits mailing list