changeset 34674:a99f159b137d

Revise listMgr() command PLAYLIST_ITEM_ADD. Change return value to pointer to current playlist item. Additionally, some cosmetic code and formatting changes.
author ib
date Thu, 23 Feb 2012 11:44:49 +0000
parents ea1df3e51d3f
children 45b2c7bbec60
files gui/util/list.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gui/util/list.c	Thu Feb 23 09:32:28 2012 +0000
+++ b/gui/util/list.c	Thu Feb 23 11:44:49 2012 +0000
@@ -41,6 +41,7 @@
         return plList;
 
     case PLAYLIST_ITEM_ADD:
+
         if (plList) {
             plItem *item = plList;
 
@@ -51,10 +52,11 @@
             pdat->prev = item;
             pdat->next = NULL;
         } else {
-            pdat->prev = pdat->next = NULL;
+            pdat->next = pdat->prev = NULL;
             plCurrent  = plList = pdat;
         }
-        return NULL;
+
+        return plCurrent;
 
     case PLAYLIST_ITEM_INSERT:
         if (plCurrent) {