[nautilus] gnome-desktop: update upstream gnome-desktop-thumbnail-script
- From: Ernestas Kulik <ernestask src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] gnome-desktop: update upstream gnome-desktop-thumbnail-script
- Date: Fri, 17 May 2019 16:04:09 +0000 (UTC)
commit 326fa60685f165ab74a09ac9c53f53a5b30fd66d
Author: daniel <daniel mohns posteo de>
Date: Wed May 15 21:46:44 2019 +0200
gnome-desktop: update upstream gnome-desktop-thumbnail-script
Parity change for
https://gitlab.gnome.org/GNOME/gnome-desktop/merge_requests/38
src/gnome-desktop/gnome-desktop-thumbnail-script.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/src/gnome-desktop/gnome-desktop-thumbnail-script.c
b/src/gnome-desktop/gnome-desktop-thumbnail-script.c
index 8e8b87653..0aa26444a 100644
--- a/src/gnome-desktop/gnome-desktop-thumbnail-script.c
+++ b/src/gnome-desktop/gnome-desktop-thumbnail-script.c
@@ -149,7 +149,9 @@ get_extension (const char *path)
basename = g_path_get_basename (path);
p = strrchr (basename, '.');
- if (p == NULL)
+ if (g_file_test (path, G_FILE_TEST_IS_DIR) ||
+ !p ||
+ p == basename) /* Leading periods on the basename are ignored. */
return NULL;
return g_strdup (p + 1);
}
@@ -717,7 +719,10 @@ script_exec_free (ScriptExec *exec)
g_free (exec->infile);
if (exec->infile_tmp)
{
- g_unlink (exec->infile_tmp);
+ if (g_file_test (exec->infile_tmp, G_FILE_TEST_IS_DIR))
+ g_rmdir (exec->infile_tmp);
+ else
+ g_unlink (exec->infile_tmp);
g_free (exec->infile_tmp);
}
if (exec->outfile)
@@ -795,7 +800,12 @@ script_exec_new (const char *uri,
}
exec->outfile = g_build_filename (exec->outdir, "gnome-desktop-thumbnailer.png", NULL);
ext = get_extension (exec->infile);
- infile = g_strdup_printf ("gnome-desktop-file-to-thumbnail.%s", ext);
+
+ if (ext)
+ infile = g_strdup_printf ("gnome-desktop-file-to-thumbnail.%s", ext);
+ else
+ infile = g_strdup_printf ("gnome-desktop-file-to-thumbnail");
+
exec->infile_tmp = g_build_filename (exec->outdir, infile, NULL);
exec->s_infile = g_build_filename ("/tmp/", infile, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]