[gnome-documents] documents: Simplify calculation of thumbnail paths for GoogleDocuments
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] documents: Simplify calculation of thumbnail paths for GoogleDocuments
- Date: Fri, 31 Mar 2017 05:25:59 +0000 (UTC)
commit 8cd95fea023916b46fd54c85bb2b03c11a994ac3
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Mar 29 16:04:08 2017 +0200
documents: Simplify calculation of thumbnail paths for GoogleDocuments
https://bugzilla.gnome.org/show_bug.cgi?id=780718
src/documents.js | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index 8e9044e..e41a3b7 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -30,6 +30,7 @@ const GdPrivate = imports.gi.GdPrivate;
const Gdk = imports.gi.Gdk;
const GData = imports.gi.GData;
const GLib = imports.gi.GLib;
+const GnomeDesktop = imports.gi.GnomeDesktop;
const Gtk = imports.gi.Gtk;
const Zpj = imports.gi.Zpj;
const _ = imports.gettext.gettext;
@@ -918,12 +919,10 @@ const GoogleDocument = new Lang.Class({
authorization_domain: authorizationDomain,
download_uri: uri });
- let checksum = new GLib.Checksum(GLib.ChecksumType.MD5);
- checksum.update(this.uri, -1);
- let dirPath = GLib.build_filenamev([GLib.get_user_cache_dir(), "thumbnails", "normal"]);
+ let path = GnomeDesktop.desktop_thumbnail_path_for_uri (this.uri,
+
GnomeDesktop.DesktopThumbnailSize.NORMAL);
+ let dirPath = GLib.path_get_dirname(path);
GLib.mkdir_with_parents(dirPath, 448);
- let basename = checksum.get_string() + '.png';
- let path = GLib.build_filenamev([dirPath, basename])
let downloadFile = Gio.File.new_for_path(path);
downloadFile.replace_async
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]