Code

removed LIST_FORMAT, STATUS_FORMAT
authorMax Kellermann <max@duempel.org>
Thu, 2 Oct 2008 15:48:01 +0000 (17:48 +0200)
committerMax Kellermann <max@duempel.org>
Thu, 2 Oct 2008 15:48:01 +0000 (17:48 +0200)
Use options.list_format and options.status_format directly instead of
these two macros.

src/mpdclient.c
src/ncmpc.h
src/screen.c
src/screen_browser.c
src/screen_play.c

index dbf285e0727bf60f941852102c308ab2984f758a..9beac9ee7e1bcdd7cb39f859bb914a3cf9a7f4ad 100644 (file)
@@ -19,7 +19,6 @@
 #include "mpdclient.h"
 #include "screen_utils.h"
 #include "config.h"
-#include "ncmpc.h"
 #include "support.h"
 #include "options.h"
 #include "strfsong.h"
@@ -83,8 +82,8 @@ compare_filelistentry_format(gconstpointer filelist_entry1,
        if (e1 && e2 &&
            e1->type == MPD_INFO_ENTITY_TYPE_SONG &&
            e2->type == MPD_INFO_ENTITY_TYPE_SONG) {
-               strfsong(key1, BUFSIZE, LIST_FORMAT, e1->info.song);
-               strfsong(key2, BUFSIZE, LIST_FORMAT, e2->info.song);
+               strfsong(key1, BUFSIZE, options.list_format, e1->info.song);
+               strfsong(key2, BUFSIZE, options.list_format, e2->info.song);
                n = strcmp(key1,key2);
        }
 
index a1cd9f9fdb302125e8edb25f5ff6b758e4045ab3..ca4af160df546a3d96be341841b87d4a14987728 100644 (file)
 /* time before trying to reconnect [ms] */
 #define MPD_RECONNECT_TIME  1500
 
-#define LIST_FORMAT options.list_format
-
-#define STATUS_FORMAT options.status_format
-
 void
 sigstop(void);
 
index da758b10dbc9c199d4d3031fd195f005cac9cc61..ac4a63ee1d47ed5a3bc875de03f006b076a85acf 100644 (file)
@@ -322,7 +322,8 @@ paint_status_window(mpdclient_t *c)
                int width = COLS-x-my_strlen(screen.buf);
 
                if (song)
-                       strfsong(songname, MAX_SONGNAME_LENGTH, STATUS_FORMAT, song);
+                       strfsong(songname, MAX_SONGNAME_LENGTH,
+                                options.status_format, song);
                else
                        songname[0] = '\0';
 
index ab10299c6f6d6947d22e324d8e4b40fc84f5e22c..52285152b57dd679d13ee1a2fd865606f0c969c5 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 #include "screen_browser.h"
-#include "ncmpc.h"
 #include "i18n.h"
 #include "options.h"
 #include "support.h"
@@ -143,7 +142,7 @@ browser_lw_callback(unsigned idx, int *highlight, void *data)
        } else if( entity->type==MPD_INFO_ENTITY_TYPE_SONG ) {
                mpd_Song *song = entity->info.song;
 
-               strfsong(buf, BUFSIZE, LIST_FORMAT, song);
+               strfsong(buf, BUFSIZE, options.list_format, song);
                return buf;
        } else if( entity->type==MPD_INFO_ENTITY_TYPE_PLAYLISTFILE ) {
                mpd_PlaylistFile *plf = entity->info.playlistFile;
@@ -233,7 +232,7 @@ enqueue_and_play(mpdclient_t *c, filelist_entry_t *entry)
                        char buf[BUFSIZE];
 
                        entry->flags |= HIGHLIGHT;
-                       strfsong(buf, BUFSIZE, LIST_FORMAT, song);
+                       strfsong(buf, BUFSIZE, options.list_format, song);
                        screen_status_printf(_("Adding \'%s\' to playlist\n"), buf);
                        mpdclient_update(c); /* get song id */
                } else
@@ -363,7 +362,7 @@ browser_select_entry(mpdclient_t *c, filelist_entry_t *entry,
                if (mpdclient_cmd_add(c, song) == 0) {
                        char buf[BUFSIZE];
 
-                       strfsong(buf, BUFSIZE, LIST_FORMAT, song);
+                       strfsong(buf, BUFSIZE, options.list_format, song);
                        screen_status_printf(_("Adding \'%s\' to playlist\n"), buf);
                }
        } else {
index 309b9a54ed656c7ebf7b80b2b6a8bcfddcdaf06e..adc46a511f6dee091a46d005a0c6846adba30286 100644 (file)
@@ -17,7 +17,6 @@
  */
 
 #include "config.h"
-#include "ncmpc.h"
 #include "i18n.h"
 #include "options.h"
 #include "support.h"
@@ -104,7 +103,7 @@ list_callback(unsigned idx, int *highlight, void *data)
            c->status != NULL && !IS_STOPPED(c->status->state))
                *highlight = 1;
 
-       strfsong(songname, MAX_SONG_LENGTH, LIST_FORMAT, song);
+       strfsong(songname, MAX_SONG_LENGTH, options.list_format, song);
        return songname;
 }