diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-05-31 12:48:47 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-05-31 12:48:47 +0200 |
commit | 312a2bf8d7c8728581c4e7e1f00a8adbe188ff31 (patch) | |
tree | 2821def6da41edad35e9bb18695104ddace26aa4 | |
parent | 5bea3fb45b100f0890e54a36fa3d0e7863ab1042 (diff) | |
download | gtk-vlc-player-312a2bf8d7c8728581c4e7e1f00a8adbe188ff31.tar.gz |
display only filenames with stripped extension in format selection combo boxes
-rw-r--r-- | src/format-selection.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/format-selection.c b/src/format-selection.c index f7c3c22..b5abe5a 100644 --- a/src/format-selection.c +++ b/src/format-selection.c @@ -121,20 +121,26 @@ refresh_formats_store(GtkListStore *store) dir = g_dir_open(formats_directory, 0, NULL); while ((name = g_dir_read_name(dir)) != NULL) { + gchar *itemname, *p; gchar *fullname; if (!g_pattern_match_string(pattern, name)) continue; + itemname = g_strdup(name); + if ((p = g_strrstr(itemname, ".")) != NULL) + *p = '\0'; + fullname = g_build_filename(formats_directory, name, NULL); gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, - COL_NAME, name, + COL_NAME, itemname, COL_FILENAME, fullname, -1); g_free(fullname); + g_free(itemname); } g_dir_close(dir); |