[gnome-desktop] thumbnail: Fix gsf-office-thumbnailer not working



commit 26b1b55949459d93d82147b3ceded2405064a244
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Sep 6 13:32:39 2017 +0200

    thumbnail: Fix gsf-office-thumbnailer not working
    
    The gsf-office-thumbnailer expects a local file path to be passed, but
    instead of treating one of expand_thumbnailing_elem()'s arguments as a
    local path (which it is), we treated it as a URI and tried to convert it
    to a URI.
    
    That obviously failed, and the thumbnailer wasn't even launched.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787249

 libgnome-desktop/gnome-desktop-thumbnail-script.c |   22 ++++++++++----------
 1 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/libgnome-desktop/gnome-desktop-thumbnail-script.c 
b/libgnome-desktop/gnome-desktop-thumbnail-script.c
index 52dbf7b..be603d3 100644
--- a/libgnome-desktop/gnome-desktop-thumbnail-script.c
+++ b/libgnome-desktop/gnome-desktop-thumbnail-script.c
@@ -60,14 +60,14 @@ typedef struct {
 static char *
 expand_thumbnailing_elem (const char *elem,
                          const int   size,
-                         const char *inuri,
+                         const char *infile,
                          const char *outfile,
                          gboolean   *got_input,
                          gboolean   *got_output)
 {
   GString *str;
   const char *p, *last;
-  char *localfile;
+  char *inuri;
 
   str = g_string_new (NULL);
 
@@ -79,20 +79,20 @@ expand_thumbnailing_elem (const char *elem,
 
       switch (*p) {
       case 'u':
-       g_string_append (str, inuri);
-       *got_input = TRUE;
-       p++;
-       break;
-      case 'i':
-       localfile = g_filename_from_uri (inuri, NULL, NULL);
-       if (localfile)
+        inuri = g_filename_to_uri (infile, NULL, NULL);
+        if (inuri)
          {
-           g_string_append (str, localfile);
+           g_string_append (str, inuri);
            *got_input = TRUE;
-           g_free (localfile);
+           g_free (inuri);
          }
        p++;
        break;
+      case 'i':
+       g_string_append (str, infile);
+       *got_input = TRUE;
+       p++;
+       break;
       case 'o':
        g_string_append (str, outfile);
        *got_output = TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]