[frogr] Remove extension, if present, from file title (#644797)



commit a90716784024b707b8596de10504037e00af4e9d
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Fri Apr 22 00:44:00 2011 +0200

    Remove extension, if present, from file title (#644797)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=644797

 src/frogr-picture-loader.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/frogr-picture-loader.c b/src/frogr-picture-loader.c
index da40949..d1b9780 100644
--- a/src/frogr-picture-loader.c
+++ b/src/frogr-picture-loader.c
@@ -234,6 +234,7 @@ _load_next_picture_cb (GObject *object,
           GFileInfo* fileinfo;
           gchar *fileuri;
           gchar *filename;
+          gchar *extension_dot;
 
           /* Gather needed information */
           fileinfo = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
@@ -252,6 +253,11 @@ _load_next_picture_cb (GObject *object,
           if (fileinfo)
             g_object_unref (fileinfo);
 
+          /* Remove extension if present */
+          extension_dot = g_strrstr (filename, ".");
+          if (extension_dot)
+            *extension_dot = '\0';
+
           fileuri = g_file_get_uri (file);
           gdk_pixbuf_loader_close (pixbuf_loader, NULL);
           pixbuf = gdk_pixbuf_loader_get_pixbuf (pixbuf_loader);



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