From: <des...@us...> - 2003-12-26 15:47:49
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv2771 Modified Files: playlist_list.c playlistwin.c prefswin.c util.c util.h Log Message: - cleanups Index: playlist_list.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist_list.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** playlist_list.c 26 Dec 2003 05:53:31 -0000 1.16 --- playlist_list.c 26 Dec 2003 15:47:45 -0000 1.17 *************** *** 344,365 **** } - static void convert_title_text(gchar * text) - { - gchar *match, *tmp; - - if (cfg.convert_underscore) - while ((match = strchr(text, '_'))) - *match = ' '; - - if (cfg.convert_twenty) - while ((match = strstr(text, "%20"))) { - tmp = match + 3; - *match++ = ' '; - while (*tmp) - *match++ = *tmp++; - *match = '\0'; - } - } - static void playlist_list_draw(Widget * w) { --- 344,347 ---- Index: playlistwin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlistwin.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** playlistwin.c 25 Dec 2003 23:26:13 -0000 1.11 --- playlistwin.c 26 Dec 2003 15:47:45 -0000 1.12 *************** *** 303,307 **** }; ! static const int playlist_menu_entries_num = sizeof(playlist_menu_entries) / sizeof(playlist_menu_entries[0]); --- 303,307 ---- }; ! static const gint playlist_menu_entries_num = sizeof(playlist_menu_entries) / sizeof(playlist_menu_entries[0]); *************** *** 310,314 **** static void playlistwin_update_info(void) { ! char *text, *sel_text, *tot_text; gulong selection, total; gboolean selection_more, total_more; --- 310,314 ---- static void playlistwin_update_info(void) { ! gchar *text, *sel_text, *tot_text; gulong selection, total; gboolean selection_more, total_more; *************** *** 351,356 **** void playlistwin_update_sinfo(void) { ! char *posstr, *timestr, *title, *info, *dots; ! int pos, time, max_len; pos = playlist_get_position(); --- 351,356 ---- void playlistwin_update_sinfo(void) { ! gchar *posstr, *timestr, *title, *info, *dots; ! gint pos, time, max_len; pos = playlist_get_position(); *************** *** 377,395 **** timestr = g_strdup(""); ! if (cfg.convert_underscore) { ! char *tmp; ! while ((tmp = strchr(title, '_')) != NULL) ! *tmp = ' '; ! } ! if (cfg.convert_twenty) { ! char *tmp, *tmp2; ! while ((tmp = strstr(title, "%20")) != NULL) { ! tmp2 = tmp + 3; ! *(tmp++) = ' '; ! while (*tmp2) ! *(tmp++) = *(tmp2++); ! *tmp = '\0'; ! } ! } if (strlen(title) > max_len) { --- 377,381 ---- timestr = g_strdup(""); ! convert_title_text(title); if (strlen(title) > max_len) { *************** *** 552,556 **** } ! void playlistwin_scroll(int num) { playlistwin_list->pl_first += num; --- 538,542 ---- } ! void playlistwin_scroll(gint num) { playlistwin_list->pl_first += num; *************** *** 684,688 **** } ! static void playlistwin_queue_resize(int width, int height) { if (playlistwin_resizeq.w == -1) --- 670,674 ---- } ! static void playlistwin_queue_resize(gint width, gint height) { if (playlistwin_resizeq.w == -1) *************** *** 725,729 **** } ! void playlistwin_add_dir_handler(gchar * dir) { g_free(cfg.filesel_path); --- 711,715 ---- } ! void playlistwin_add_dir_handler(const gchar * dir) { g_free(cfg.filesel_path); *************** *** 744,748 **** */ GList *list = playlist_get_selected(); ! if (list != NULL) { playlist_fileinfo(GPOINTER_TO_INT(list->data)); g_list_free(list); --- 730,734 ---- */ GList *list = playlist_get_selected(); ! if (list) { playlist_fileinfo(GPOINTER_TO_INT(list->data)); g_list_free(list); *************** *** 890,895 **** if (playlistwin_save_type == PLAYLISTWIN_SAVE_EXTENSION) { ! char *ext; ! int error = FALSE; if ((ext = strrchr(filename, '.')) != NULL && ext > slash) { if (!strcmp(ext, ".pls")) --- 876,881 ---- if (playlistwin_save_type == PLAYLISTWIN_SAVE_EXTENSION) { ! gchar *ext; ! gboolean error = FALSE; if ((ext = strrchr(filename, '.')) != NULL && ext > slash) { if (!strcmp(ext, ".pls")) *************** *** 900,904 **** error = TRUE; if (error) { ! char *m; GtkWidget *w; m = g_strdup_printf(_("Unknown filetype for %s"), filename); --- 886,890 ---- error = TRUE; if (error) { ! gchar *m; GtkWidget *w; m = g_strdup_printf(_("Unknown filetype for %s"), filename); *************** *** 916,920 **** if (!playlist_save(filename, pls)) ! // FIXME: Should be a seperate function without the file selection as a parameter playlistwin_save_playlist_error(filename, NULL); } --- 902,907 ---- if (!playlist_save(filename, pls)) ! /* FIXME: Should be a seperate function without the file ! * selection as a parameter */ playlistwin_save_playlist_error(filename, NULL); } *************** *** 938,943 **** if (playlistwin_save_type == PLAYLISTWIN_SAVE_EXTENSION) { ! char *ext; ! int error = FALSE; if ((ext = strrchr(filename, '.')) != NULL && ext > slash) { if (!strcmp(ext, ".pls")) --- 925,930 ---- if (playlistwin_save_type == PLAYLISTWIN_SAVE_EXTENSION) { ! gchar *ext; ! gboolean error = FALSE; if ((ext = strrchr(filename, '.')) != NULL && ext > slash) { if (!strcmp(ext, ".pls")) *************** *** 948,952 **** error = TRUE; if (error) { ! char *m; GtkWidget *w; m = g_strdup_printf(_("Unknown filetype for %s"), filename); --- 935,939 ---- error = TRUE; if (error) { ! gchar *m; GtkWidget *w; m = g_strdup_printf(_("Unknown filetype for %s"), filename); *************** *** 977,995 **** void playlistwin_load_filesel_ok(GtkWidget * w, GtkWidget * filesel) { ! gchar *filename, *text, *tmp; if (util_filebrowser_is_dir(GTK_FILE_SELECTION(filesel))) return; ! filename = ! g_strdup(gtk_file_selection_get_filename ! (GTK_FILE_SELECTION(filesel))); ! text = g_strdup(filename); ! if ((tmp = strrchr(text, '/')) != NULL) *(tmp + 1) = '\0'; g_free(cfg.playlist_path); ! cfg.playlist_path = g_strdup(text); ! g_free(text); if (filename && *filename) { --- 964,979 ---- void playlistwin_load_filesel_ok(GtkWidget * w, GtkWidget * filesel) { ! gchar *filename, *tmp; if (util_filebrowser_is_dir(GTK_FILE_SELECTION(filesel))) return; ! filename = g_strdup(gtk_file_selection_get_filename ! (GTK_FILE_SELECTION(filesel))); ! if ((tmp = strrchr(filename, '/')) != NULL) *(tmp + 1) = '\0'; g_free(cfg.playlist_path); ! cfg.playlist_path = filename; if (filename && *filename) { *************** *** 1001,1004 **** --- 985,989 ---- playlist_set_current_name(filename); } + gtk_widget_destroy(GTK_WIDGET(filesel)); } *************** *** 1009,1013 **** GtkWidget *widget; - widget = gtk_item_factory_get_widget(playlist_menu, "/Remove Unavailable Files"); --- 994,997 ---- *************** *** 1499,1503 **** GList *node, *selected_list = data; gint deleted = 0, length; ! char *message = NULL; length = g_list_length(selected_list); --- 1483,1487 ---- GList *node, *selected_list = data; gint deleted = 0, length; ! gchar *message = NULL; length = g_list_length(selected_list); *************** *** 1508,1517 **** deleted++; else { - if (length == 1) - message = - g_strdup_printf(_("Failed to delete \"%s\": %s."), - (char *) selected_list->data, - strerror(errno)); - /* The unlink failed, we dont want to remove the file from the playlist either */ --- 1492,1495 ---- *************** *** 1527,1534 **** g_list_free(selected_list); ! if (length > 1 && deleted < length) message = g_strdup_printf(_("%d of %d files successfully deleted."), deleted, length); if (message) { --- 1505,1518 ---- g_list_free(selected_list); ! if (length == 1) ! message = ! g_strdup_printf(_("Failed to delete \"%s\": %s."), ! (gchar *) selected_list->data, ! g_strerror(errno)); ! else if (length > 1 && deleted < length) { message = g_strdup_printf(_("%d of %d files successfully deleted."), deleted, length); + } if (message) { *************** *** 2343,2347 **** hint_set_always(cfg.always_on_top); hint_set_sticky(cfg.sticky); ! // gtk_window_present(GTK_WINDOW(playlistwin)); gtk_widget_show(playlistwin); } --- 2327,2331 ---- hint_set_always(cfg.always_on_top); hint_set_sticky(cfg.sticky); ! /* gtk_window_present(GTK_WINDOW(playlistwin)); */ gtk_widget_show(playlistwin); } Index: prefswin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/prefswin.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** prefswin.c 26 Dec 2003 09:31:29 -0000 1.8 --- prefswin.c 26 Dec 2003 15:47:45 -0000 1.9 *************** *** 1531,1535 **** } ! void gen_module_description(gchar * file, gchar * desc, gchar ** full_desc) { /* (*full_desc) = g_strdup_printf("%s [%s]", desc, g_basename(file)); */ --- 1531,1536 ---- } ! void gen_module_description(const gchar * file, const gchar * desc, ! gchar ** full_desc) { /* (*full_desc) = g_strdup_printf("%s [%s]", desc, g_basename(file)); */ Index: util.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/util.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** util.c 26 Dec 2003 06:47:05 -0000 1.13 --- util.c 26 Dec 2003 15:47:45 -0000 1.14 *************** *** 1136,1139 **** --- 1136,1157 ---- } + void convert_title_text(gchar * text) + { + gchar *match, *tmp; + + if (cfg.convert_underscore) + while ((match = strchr(text, '_'))) + *match = ' '; + + if (cfg.convert_twenty) + while ((match = strstr(text, "%20"))) { + tmp = match + 3; + *match++ = ' '; + while (*tmp) + *match++ = *tmp++; + *match = '\0'; + } + } + #if defined(USE_DMALLOC) Index: util.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/util.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** util.h 26 Dec 2003 08:30:16 -0000 1.9 --- util.h 26 Dec 2003 15:47:45 -0000 1.10 *************** *** 65,68 **** --- 65,70 ---- guint gint_count_digits(gint n); + void convert_title_text(gchar * text); + #if ENABLE_NLS gchar *util_menu_translate(const gchar * path, gpointer func_data); |