Code

let mpd add directories (just send the path)
authorKalle Wallin <kaw@linux.se>
Sun, 20 Jun 2004 10:00:25 +0000 (10:00 +0000)
committerKalle Wallin <kaw@linux.se>
Sun, 20 Jun 2004 10:00:25 +0000 (10:00 +0000)
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1581 09075e82-0dd4-0310-85a5-a0d7c8717e4f

src/screen_file.c

index 2caf2519723a6953185a60810a5d553af2d17d60..ebde970966af4d21528794a63cd549617462ca04 100644 (file)
@@ -36,6 +36,7 @@
 
 
 #define USE_OLD_LAYOUT
+#undef  USE_OLD_ADD
 
 #define BUFSIZE 1024
 
@@ -345,6 +346,7 @@ handle_enter(screen_t *screen, mpdclient_t *c)
 }
 
 
+#ifdef USE_OLD_ADD
 /* NOTE - The add_directory functions should move to mpdclient.c */
 extern gint mpdclient_finish_command(mpdclient_t *c);
 
@@ -398,6 +400,7 @@ add_directory(mpdclient_t *c, char *dir)
   g_list_free(subdir_list);
   return 0;
 }
+#endif
 
 static int
 handle_select(screen_t *screen, mpdclient_t *c)
@@ -414,7 +417,17 @@ handle_select(screen_t *screen, mpdclient_t *c)
   if( entry->entity->type==MPD_INFO_ENTITY_TYPE_DIRECTORY )
     {
       mpd_Directory *dir = entry->entity->info.directory;
+#ifdef USE_OLD_ADD
       add_directory(c, dir->path);
+#else
+      if( mpdclient_cmd_add_path(c, dir->path) == 0 )
+       {
+         char *tmp = utf8_to_locale(dir->path);
+
+         screen_status_printf(_("Adding \'%s\' to playlist\n"), tmp);
+         g_free(tmp);
+       }
+#endif
       return 0;
     }