aboutsummaryrefslogtreecommitdiff
path: root/src/format-selection.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-05-31 13:48:41 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-05-31 13:48:41 +0200
commit4b6749f0a21547677ac4f9b2ea55a31b25432183 (patch)
tree39dbc1d4022d2d0ccb3913e1eab102eef812d7a4 /src/format-selection.c
parent49d37756967e3eecae07ff6797bd76a655c6632c (diff)
downloadexperiment-player-4b6749f0a21547677ac4f9b2ea55a31b25432183.tar.gz
added inline function for common task of stripping a filename extension
Diffstat (limited to 'src/format-selection.c')
-rw-r--r--src/format-selection.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/format-selection.c b/src/format-selection.c
index 80fe7c3..fcbff24 100644
--- a/src/format-selection.c
+++ b/src/format-selection.c
@@ -134,16 +134,12 @@ 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;
+ gchar *itemname, *fullname;
if (!g_pattern_match_string(pattern, name))
continue;
- itemname = g_strdup(name);
- if ((p = g_strrstr(itemname, ".")) != NULL)
- *p = '\0';
-
+ itemname = path_strip_extension(name);
fullname = g_build_filename(formats_directory, name, NULL);
gtk_list_store_append(store, &iter);