Update of /cvsroot/gtkpod/gtkpod/src
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv558/src

Modified Files:
        display_coverart.c file_itunesdb.c display_playlists.c 
Log Message:
2007-02-23 P.G. Richardson <phantom_sf at users.sourceforge.net>

        * display_coverart.c
                - Avoided null pointer exceptions by testing cdwidget first in 
coverart_block_change()
                - Ensured the pande0 button release event only initiaties if a 
width change has truly occurred
                  ie. gtk_paned_get_position() != WIDTH

        * display_playlists.c
                - Blocked other coverart related changes while a 
pm_playlist_change_cb is being enacted.
                - Blocking is lifted prior to the call to coverart_set_images
                - pm_playlist_change_cb() will occur on deletion of a playlist. 
In this case the deleted playlist
                  will be nullified. In this case, clear any coverart images 
rather than setting them (none to set)

        * file_itunesdb.c
                - data_changed function called whenever track details are 
changed. Added a resettting of the coverart
                  to this function so all tracks in coverart display are synced 
with database data

Index: display_coverart.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_coverart.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- display_coverart.c  22 Feb 2007 15:05:53 -0000      1.4
+++ display_coverart.c  22 Feb 2007 23:50:45 -0000      1.5
@@ -657,7 +657,7 @@
        Cover_Item *cover;
        
        width = gtk_paned_get_position (GTK_PANED(widget));
-       if (width >= DEFAULT_WIDTH)
+       if ((width >= DEFAULT_WIDTH) && (width != WIDTH))
        {
                WIDTH = width;
                gnome_canvas_item_set (GNOME_CANVAS_ITEM(cdwidget->cvrtext), 
@@ -1143,5 +1143,6 @@
  */
 void coverart_block_change (gboolean val)
 {
-       cdwidget->block_display_change = val;
+       if (cdwidget != NULL)
+               cdwidget->block_display_change = val;
 }

Index: file_itunesdb.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/file_itunesdb.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -d -r1.109 -r1.110
--- file_itunesdb.c     7 Feb 2007 16:55:27 -0000       1.109
+++ file_itunesdb.c     22 Feb 2007 23:50:45 -0000      1.110
@@ -48,6 +48,7 @@
 #include "ipod_init.h"
 #include "lastfm.h"
 #include "file_convert.h"
+#include "display_coverart.h"
 
 #define _TO_STR(x) #x
 #define TO_STR(x) _TO_STR(x)
@@ -2049,6 +2050,10 @@
     eitdb->data_changed = TRUE;
     pm_name_changed (itdb_playlist_mpl (itdb));
     space_data_update ();
+    
+    /* data has been modified so re-initialise the coverart display */
+    Playlist *plitem = pm_get_selected_playlist ();
+               coverart_set_images (plitem->members);
 }
 
 

Index: display_playlists.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_playlists.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- display_playlists.c 20 Feb 2007 14:11:24 -0000      1.96
+++ display_playlists.c 22 Feb 2007 23:50:45 -0000      1.97
@@ -1336,6 +1336,11 @@
          time.tv_sec % 3600, time.tv_usec);
 #endif
 
+       /* Avoid track selection errors on coverart while enacting a change
+        * in playlist
+        */
+        coverart_block_change (TRUE);
+  
   if (gtk_tree_selection_get_selected (selection, &model, &iter) == FALSE)
   {  /* no selection -> reset sort tabs */
       st_init (-1, 0);
@@ -1410,9 +1415,15 @@
       }
       gtkpod_tracks_statusbar_update();
   }
-    
+  
+  /* Reallow the coverart selection update */
+        coverart_block_change (FALSE);
+        
   /* Set the coverart display based on the selected playlist */
-  coverart_set_images (new_playlist->members);
+  if (new_playlist != NULL)
+       coverart_set_images (new_playlist->members);
+  else
+       coverart_clear_images ();
     
 #if DEBUG_TIMING
   g_get_current_time (&time);


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to