diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-04-18 01:12:25 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2013-04-18 01:12:25 +0200 |
commit | 549ab7e18cefd7deb16f2a60063856420d89d6ba (patch) | |
tree | ae367d1f500cd1886f0cfb9695ced77a3c88844e /src/totem-video-thumbnailer.c | |
parent | 5cf4f4b78038a22eb5e287699adeabdf27afd096 (diff) | |
download | totem-549ab7e18cefd7deb16f2a60063856420d89d6ba.tar.gz |
thumbnailer: Simplify getting the file's basename
Diffstat (limited to 'src/totem-video-thumbnailer.c')
-rw-r--r-- | src/totem-video-thumbnailer.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/totem-video-thumbnailer.c b/src/totem-video-thumbnailer.c index 38d4df0f7..a7ddeda94 100644 --- a/src/totem-video-thumbnailer.c +++ b/src/totem-video-thumbnailer.c @@ -711,6 +711,7 @@ create_gallery (ThumbApp *app) gint screenshot_width = 0, screenshot_height = 0, x_padding = 0, y_padding = 0; gfloat scale = 1.0; gchar *header_text, *duration_text, *filename; + GFile *file; /* Calculate how many screenshots we're going to take */ stream_length = app->duration; @@ -827,15 +828,9 @@ create_gallery (ThumbApp *app) /* Build the header information */ duration_text = totem_time_to_string (stream_length, FALSE, FALSE); - filename = NULL; - if (strstr (app->input, "://")) { - char *local; - local = g_filename_from_uri (app->input, NULL, NULL); - filename = g_path_get_basename (local); - g_free (local); - } - if (filename == NULL) - filename = g_path_get_basename (app->input); + file = g_file_new_for_commandline_arg (app->input); + filename = g_file_get_basename (file); + g_object_unref (file); /* Translators: The first string is "Filename" (as translated); the second is an actual filename. The third string is "Resolution" (as translated); the fourth and fifth are screenshot height and width, respectively. |