changeset 35962:df731f25759e

Add new listMgr command PLAYLIST_ITEM_GET_LAST. Patch by Hans-Dieter Kosch, hdkosch kabelbw de.
author ib
date Mon, 25 Mar 2013 00:44:28 +0000
parents 373c1104023f
children db72a3183d41
files gui/util/list.c gui/util/list.h
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gui/util/list.c	Sun Mar 24 15:15:26 2013 +0000
+++ b/gui/util/list.c	Mon Mar 25 00:44:28 2013 +0000
@@ -165,6 +165,19 @@
 
         return NULL;
 
+    case PLAYLIST_ITEM_GET_LAST:
+
+        if (plList) {
+            plItem *item = plList;
+
+            while (item->next)
+                item = item->next;
+
+            return item;
+        }
+
+        return NULL;
+
     case PLAYLIST_ITEM_DEL_CURR:
 
         if (plCurrent) {
--- a/gui/util/list.h	Sun Mar 24 15:15:26 2013 +0000
+++ b/gui/util/list.h	Mon Mar 25 00:44:28 2013 +0000
@@ -30,6 +30,7 @@
     PLAYLIST_ITEM_GET_POS,
     PLAYLIST_ITEM_GET_PREV,
     PLAYLIST_ITEM_GET_NEXT,
+    PLAYLIST_ITEM_GET_LAST,
     PLAYLIST_ITEM_DEL_CURR,
     PLAYLIST_DELETE,
     URLLIST_GET,