[MPlayer-cvslog] r34756 - in trunk/gui: cfg.c ui/gtk/url.c util/list.c util/list.h

ib subversion at mplayerhq.hu
Wed Feb 22 11:53:00 CET 2012


Author: ib
Date: Wed Feb 22 11:53:00 2012
New Revision: 34756

Log:
Remove global variable pointing to top of URL list.

Add a corresponding listMgr command and use it instead.

Modified:
   trunk/gui/cfg.c
   trunk/gui/ui/gtk/url.c
   trunk/gui/util/list.c
   trunk/gui/util/list.h

Modified: trunk/gui/cfg.c
==============================================================================
--- trunk/gui/cfg.c	Wed Feb 22 11:39:05 2012	(r34755)
+++ trunk/gui/cfg.c	Wed Feb 22 11:53:00 2012	(r34756)
@@ -416,7 +416,7 @@ void cfg_write(void)
     file  = fopen(fname, "wt+");
 
     if (file) {
-        urlItem *item = urlList;
+        urlItem *item = listMgr(URLLIST_GET, 0);
 
         while (item) {
             if (item->url)

Modified: trunk/gui/ui/gtk/url.c
==============================================================================
--- trunk/gui/ui/gtk/url.c	Wed Feb 22 11:39:05 2012	(r34755)
+++ trunk/gui/ui/gtk/url.c	Wed Feb 22 11:53:00 2012	(r34756)
@@ -44,12 +44,15 @@ static GList     * URLComboEntrys = NULL
 
 void ShowURLDialogBox( void )
 {
+ urlItem * item;
+
  if ( URL ) gtkActive( URL );
    else URL=create_URL();
 
- if ( urlList )
+ item = listMgr( URLLIST_GET,0 );
+
+ if ( item )
   {
-   urlItem * item = urlList;
    g_list_free( URLComboEntrys );
    URLComboEntrys=NULL;
    while( item )

Modified: trunk/gui/util/list.c
==============================================================================
--- trunk/gui/util/list.c	Wed Feb 22 11:39:05 2012	(r34755)
+++ trunk/gui/util/list.c	Wed Feb 22 11:53:00 2012	(r34756)
@@ -26,7 +26,7 @@ static plItem *plList;
 static plItem *plCurrent;
 plItem *plLastPlayed;
 
-urlItem *urlList;
+static urlItem *urlList;
 
 void *listMgr(int cmd, void *data)
 {
@@ -156,6 +156,11 @@ void *listMgr(int cmd, void *data)
         return NULL;
 
     // handle url
+
+    case URLLIST_GET:
+
+        return urlList;
+
     case URLLIST_ITEM_ADD:
         if (urlList) {
             urlItem *next_url = urlList;

Modified: trunk/gui/util/list.h
==============================================================================
--- trunk/gui/util/list.h	Wed Feb 22 11:39:05 2012	(r34755)
+++ trunk/gui/util/list.h	Wed Feb 22 11:53:00 2012	(r34756)
@@ -30,6 +30,7 @@ enum {
     PLAYLIST_ITEM_GET_NEXT,
     PLAYLIST_ITEM_DEL_CURR,
     PLAYLIST_DELETE,
+    URLLIST_GET,
     URLLIST_ITEM_ADD,
     URLLIST_DELETE
 };
@@ -47,8 +48,6 @@ typedef struct urlItem {
 
 extern plItem *plLastPlayed;
 
-extern urlItem *urlList;
-
 /// @name list manager (playlist, URL list)
 void *listMgr(int cmd, void *data);
 


More information about the MPlayer-cvslog mailing list