[gnome-photos/wip/rishi/thumbnailer: 13/13] thumbnail: foo
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/thumbnailer: 13/13] thumbnail: foo
- Date: Mon, 13 Feb 2017 17:42:33 +0000 (UTC)
commit 4c2387ea839c61a4da17158c75daa04adca261f4
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Feb 13 16:36:28 2017 +0100
thumbnail: foo
src/photos-thumbnail.c | 5 ++++-
src/photos-thumbnail.h | 4 ++--
2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-thumbnail.c b/src/photos-thumbnail.c
index 0baeada..a86f229 100644
--- a/src/photos-thumbnail.c
+++ b/src/photos-thumbnail.c
@@ -31,14 +31,16 @@ enum
gchar *
-photos_thumbnail_path_for_uri (const gchar *uri, gint size)
+photos_thumbnail_get_path_for_file (GFile *file, gint size)
{
const gchar *cache_dir;
gchar *filename = NULL;
gchar *md5 = NULL;
gchar *path;
+ gchar *uri = NULL;
gchar *thumbnails_subdir = NULL;
+ uri = g_file_get_uri (file);
md5 = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri, -1);
filename = g_strconcat (md5, ".png", NULL);
@@ -55,5 +57,6 @@ photos_thumbnail_path_for_uri (const gchar *uri, gint size)
g_free (filename);
g_free (md5);
g_free (thumbnails_subdir);
+ g_free (uri);
return path;
}
diff --git a/src/photos-thumbnail.h b/src/photos-thumbnail.h
index eb0b4f1..53f6285 100644
--- a/src/photos-thumbnail.h
+++ b/src/photos-thumbnail.h
@@ -21,11 +21,11 @@
#ifndef PHOTOS_THUMBNAIL_H
#define PHOTOS_THUMBNAIL_H
-#include <glib.h>
+#include <gio/gio.h>
G_BEGIN_DECLS
-gchar *photos_thumbnail_path_for_uri (const gchar *uri, gint size);
+gchar *photos_thumbnail_get_path_for_file (GFile *file, gint size);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]