diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-05-31 13:48:41 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-05-31 13:48:41 +0200 |
commit | 4b6749f0a21547677ac4f9b2ea55a31b25432183 (patch) | |
tree | 39dbc1d4022d2d0ccb3913e1eab102eef812d7a4 /src/quickopen.c | |
parent | 49d37756967e3eecae07ff6797bd76a655c6632c (diff) | |
download | gtk-vlc-player-4b6749f0a21547677ac4f9b2ea55a31b25432183.tar.gz |
added inline function for common task of stripping a filename extension
Diffstat (limited to 'src/quickopen.c')
-rw-r--r-- | src/quickopen.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/quickopen.c b/src/quickopen.c index 636c100..30f089d 100644 --- a/src/quickopen.c +++ b/src/quickopen.c @@ -136,19 +136,17 @@ refresh_quickopen_menu(GtkMenu *menu) if (!quickopen_filter(name)) continue; - gchar *item_name, *p; + gchar *itemname; GtkWidget *item; fullnames = g_realloc(fullnames, (fullnames_n+2) * sizeof(gchar *)); fullnames[fullnames_n] = g_build_filename(quickopen_directory, name, NULL); - item_name = g_strdup(name); - if ((p = g_strrstr(item_name, ".")) != NULL) - *p = '\0'; - item = gtk_check_menu_item_new_with_label(item_name); + itemname = path_strip_extension(name); + item = gtk_check_menu_item_new_with_label(itemname); g_ptr_array_add(items, item); - g_free(item_name); + g_free(itemname); gtk_check_menu_item_set_draw_as_radio(GTK_CHECK_MENU_ITEM(item), TRUE); |