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

David Mohr squisher at xfce.org
Sun Nov 23 19:13:54 CET 2008


Author: squisher
Date: 2008-11-23 18:13:54 +0000 (Sun, 23 Nov 2008)
New Revision: 6186

Modified:
   xfburn/trunk/xfburn/xfburn-audio-composition.c
   xfburn/trunk/xfburn/xfburn-error.h
Log:
Reset the track count on clear; check track count before inserting the iter

Modified: xfburn/trunk/xfburn/xfburn-audio-composition.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-audio-composition.c	2008-11-23 15:39:25 UTC (rev 6185)
+++ xfburn/trunk/xfburn/xfburn-audio-composition.c	2008-11-23 18:13:54 UTC (rev 6186)
@@ -712,6 +712,7 @@
       }
 
       gtk_tree_model_get (model, &current_iter, AUDIO_COMPOSITION_COLUMN_CONTENT, &current_filename, -1);
+
       if (strcmp (current_filename, filename) == 0) {
         g_free (current_filename);
         gtk_tree_path_free (current_path);
@@ -1007,6 +1008,7 @@
   gtk_tree_store_clear (GTK_TREE_STORE (model));
   
   xfburn_disc_usage_set_size (XFBURN_DISC_USAGE (priv->disc_usage), 0);
+  priv->n_tracks = 0;
 }
 
 static void
@@ -1212,6 +1214,19 @@
         return FALSE;
       }
 
+      if (priv->n_tracks == 99) {
+        XfburnError err_code = XFBURN_ERROR_TOO_MANY_AUDIO_TRACKS;
+
+        if (g_hash_table_lookup (priv->warned_about, GINT_TO_POINTER (err_code)) == NULL) {
+          g_hash_table_insert (priv->warned_about, GINT_TO_POINTER (err_code), did_warn);
+          gdk_threads_enter ();
+          xfce_err (_("You can only have a maximum of 99 tracks."));
+          gdk_threads_leave ();
+        }
+
+        return FALSE;
+      }
+
       gdk_threads_enter ();
       if (insertion != NULL) {
         if (position == GTK_TREE_VIEW_DROP_AFTER)
@@ -1228,13 +1243,6 @@
       secs = atrack->length;
       humanlength = g_strdup_printf ("%2d:%02d", secs / 60, secs % 60);
 
-      if (priv->n_tracks == 99) {
-        gdk_threads_enter ();
-        xfce_err (_("You can only have a maximum of 99 tracks."));
-        gdk_threads_leave ();
-        return FALSE;
-      }
-
       /* pos does not yet get recorded into atrack here, because it might
        * change still and is easier updated inside the model for now */
       gdk_threads_enter ();

Modified: xfburn/trunk/xfburn/xfburn-error.h
===================================================================
--- xfburn/trunk/xfburn/xfburn-error.h	2008-11-23 15:39:25 UTC (rev 6185)
+++ xfburn/trunk/xfburn/xfburn-error.h	2008-11-23 18:13:54 UTC (rev 6186)
@@ -41,6 +41,7 @@
   XFBURN_ERROR_GST_TIMEOUT,
   XFBURN_ERROR_PIPE,
   XFBURN_ERROR_GST_NO_AUDIO,
+  XFBURN_ERROR_TOO_MANY_AUDIO_TRACKS,
 } XfburnError;
 
 #define XFBURN_ERROR xfburn_error_quark ()




More information about the Goodies-commits mailing list