diff --git a/src/screen_file.c b/src/screen_file.c
index b14b3b10495aac68bd14ad75792ffe45162f1bac..f4229797137d598498f675e0b0df5266e8a7d1fd 100644 (file)
--- a/src/screen_file.c
+++ b/src/screen_file.c
mpd_unused gpointer data)
{
browser.filelist = mpdclient_filelist_update(c, browser.filelist);
+#ifndef NCMPC_MINI
sync_highlights(c, browser.filelist);
+#endif
list_window_check_selected(browser.lw, filelist_length(browser.filelist));
file_repaint_if_active();
}
+#ifndef NCMPC_MINI
/* the playlist have been updated -> fix highlights */
static void
playlist_changed_callback(mpdclient_t *c, int event, gpointer data)
file_repaint_if_active();
}
+#endif
static int
handle_save(mpdclient_t *c)
{
filelist_entry_t *entry;
char *defaultname = NULL;
+ int ret;
if (browser.lw->selected >= filelist_length(browser.filelist))
return -1;
}
}
- return playlist_save(c, NULL, defaultname);
+ defaultname = utf8_to_locale(defaultname);
+ ret = playlist_save(c, NULL, defaultname);
+ g_free(defaultname);
+
+ return ret;
}
static int
return 0;
}
- if( mpdclient_cmd_delete_playlist_utf8(c, plf->path) )
+ if( mpdclient_cmd_delete_playlist(c, plf->path) )
return -1;
screen_status_printf(_("Playlist deleted!"));
{
if (browser.filelist == NULL) {
browser.filelist = mpdclient_filelist_get(c, "");
+#ifndef NCMPC_MINI
mpdclient_install_playlist_callback(c, playlist_changed_callback);
+#endif
mpdclient_install_browse_callback(c, file_changed_callback);
}
}
static const char *
browse_title(char *str, size_t size)
{
- char *dirname, *parentdir;
-
- dirname = g_path_get_dirname(browser.filelist->path);
- parentdir = g_path_get_basename(dirname);
+ const char *path = NULL, *prev = NULL, *slash = browser.filelist->path;
+ char *path_locale;
- if( parentdir[0] == '.' && strlen(parentdir) == 1 ) {
- parentdir = NULL;
+ /* determine the last 2 parts of the path */
+ while ((slash = strchr(slash, '/')) != NULL) {
+ path = prev;
+ prev = ++slash;
}
- g_snprintf(str, size, _("Browse: %s%s%s"),
- parentdir ? parentdir : "",
- parentdir ? "/" : "",
- g_basename(browser.filelist->path));
- free(dirname);
- free(parentdir);
+ if (path == NULL)
+ /* fall back to full path */
+ path = browser.filelist->path;
+
+ path_locale = utf8_to_locale(path);
+ g_snprintf(str, size, _("Browse: %s"), path_locale);
+ g_free(path_locale);
return str;
}
break;
case CMD_SCREEN_UPDATE:
browser.filelist = mpdclient_filelist_update(c, browser.filelist);
+#ifndef NCMPC_MINI
sync_highlights(c, browser.filelist);
+#endif
list_window_check_selected(browser.lw,
filelist_length(browser.filelist));
file_repaint();
if (!c->status->updatingDb) {
if (mpdclient_cmd_db_update_utf8(c, browser.filelist->path) == 0) {
- if (strcmp(browser.filelist->path, ""))
+ if (strcmp(browser.filelist->path, "")) {
+ char *path_locale =
+ utf8_to_locale(browser.filelist->path);
screen_status_printf(_("Database update of %s started!"),
- browser.filelist->path);
- else
+ path_locale);
+ g_free(path_locale);
+ } else
screen_status_printf(_("Database update started!"));
/* set updatingDb to make shure the browse callback gets called