diff options
author | waker <wakeroid@gmail.com> | 2012-09-02 20:02:47 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-09-02 20:02:47 +0200 |
commit | f35127bab3075729ee29ed0a83ddae0306fed954 (patch) | |
tree | 552560d59ab6582f4ef6c78a7104b8f6f8757b12 /plugins | |
parent | f180ad11267a2bcef473bcc819a5c88ef69f537b (diff) |
gtkui: auto-name playlist when they are empty, even if the title is non-default
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/gtkui/fileman.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/gtkui/fileman.c b/plugins/gtkui/fileman.c index 36735cbe..bd52b4ab 100644 --- a/plugins/gtkui/fileman.c +++ b/plugins/gtkui/fileman.c @@ -27,6 +27,7 @@ gtkpl_adddir_cb (gpointer data, gpointer userdata) { void gtkpl_add_dirs (GSList *lst) { ddb_playlist_t *plt = deadbeef->plt_get_curr (); + int empty = 0 == deadbeef->plt_get_item_count (plt, PL_MAIN); if (deadbeef->pl_add_files_begin (plt) < 0) { deadbeef->plt_unref (plt); g_slist_free (lst); @@ -38,7 +39,7 @@ gtkpl_add_dirs (GSList *lst) { char t[1000]; if (!deadbeef->plt_get_title (plt, t, sizeof (t))) { char *def = _("New Playlist"); - if (!strncmp (t, def, strlen (def))) { + if (!strncmp (t, def, strlen (def)) || empty) { const char *folder = strrchr ((char*)lst->data, '/'); if (!folder) { folder = lst->data; |