changeset 34677:d3f65dd58eb9

Revise listMgr() command PLAYLIST_ITEM_DEL_CURR. Additionally, insert some blank lines and remove commented code.
author ib
date Thu, 23 Feb 2012 12:58:21 +0000
parents 207272df4aef
children 23f4f2104774
files gui/util/list.c
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gui/util/list.c	Thu Feb 23 12:39:29 2012 +0000
+++ b/gui/util/list.c	Thu Feb 23 12:58:21 2012 +0000
@@ -103,26 +103,25 @@
         return plCurrent;
 
     case PLAYLIST_ITEM_DEL_CURR:
-    {
+
+        if (plCurrent) {
         plItem *curr = plCurrent;
 
-        if (!curr)
-            return NULL;
-
         if (curr->prev)
             curr->prev->next = curr->next;
         if (curr->next)
             curr->next->prev = curr->prev;
-        if (curr == plList)
-            plList = curr->next;
 
         plCurrent = curr->next;
 
+        if (curr == plList)
+            plList = plCurrent;
+
         free(curr->path);
         free(curr->name);
         free(curr);
     }
-        //uiCurr();     // instead of using uiNext && uiPrev
+
         return plCurrent;
 
     case PLAYLIST_DELETE: