[Goodies-commits] r2921 - xfce4-mpc-plugin/trunk/panel-plugin

Landry Breuil landry at xfce.org
Tue Jul 17 20:04:27 CEST 2007


Author: landry
Date: 2007-07-17 18:04:27 +0000 (Tue, 17 Jul 2007)
New Revision: 2921

Modified:
   xfce4-mpc-plugin/trunk/panel-plugin/xfce4-mpc-plugin.c
Log:
Show playlist only if not empty, was segfaulting before - spotted by markus.bergkvist -at- telia.com, thanks


Modified: xfce4-mpc-plugin/trunk/panel-plugin/xfce4-mpc-plugin.c
===================================================================
--- xfce4-mpc-plugin/trunk/panel-plugin/xfce4-mpc-plugin.c	2007-07-17 18:03:07 UTC (rev 2920)
+++ xfce4-mpc-plugin/trunk/panel-plugin/xfce4-mpc-plugin.c	2007-07-17 18:04:27 UTC (rev 2921)
@@ -341,9 +341,9 @@
          break;
    }
    song = mpd_playlist_get_current_song(mpc->mo);
-   if (song)
+   if (song && song->id != -1)
       g_sprintf(str,"%s - [%s - %s] -/- (#%s) %s", str, song->artist, song->album, song->track, song->title);
-   else
+   else if (!song)
       g_sprintf(str,"%s - Failed to get song info ?", str);
 
    gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mpc->random), mpd_player_get_random(mpc->mo));
@@ -454,7 +454,7 @@
             break;
       }
    }
-   else
+   else if (0 != mpd_playlist_get_playlist_length(mpc->mo))
       show_playlist(mpc);
 }
 
@@ -474,7 +474,7 @@
       else
          DBG("mpd_player_prev() ok");
    }
-   else
+   else if (0 != mpd_playlist_get_playlist_length(mpc->mo))
       show_playlist(mpc);
 }
 
@@ -494,7 +494,7 @@
       else
          DBG("mpd_player_stop() ok");
    }
-   else
+   else if (0 != mpd_playlist_get_playlist_length(mpc->mo))
       show_playlist(mpc);
 }
 
@@ -514,7 +514,7 @@
       else
          DBG("mpd_player_next() ok");
    }
-   else
+   else if (0 != mpd_playlist_get_playlist_length(mpc->mo))
       show_playlist(mpc);
 }
 




More information about the Goodies-commits mailing list