[gnome-documents/gnome-3-24] documents: Specify uriToLoad for GoogleDocument
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents/gnome-3-24] documents: Specify uriToLoad for GoogleDocument
- Date: Mon, 24 Apr 2017 12:42:59 +0000 (UTC)
commit bdd6256fb090f2aadde441d33742753d117f766a
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Apr 5 17:03:04 2017 +0200
documents: Specify uriToLoad for GoogleDocument
This will let us use the new JavaScript-based download and caching
implementation and reduce our reliance on GdPdfLoader.
https://bugzilla.gnome.org/show_bug.cgi?id=781032
src/documents.js | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index d475eab..849d0c0 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -1018,6 +1018,15 @@ const GoogleDocument = new Lang.Class({
this.shared = cursor.get_boolean(Query.QueryColumns.SHARED);
this.parent(cursor);
+
+ let localDir = GLib.build_filenamev([GLib.get_user_cache_dir(), "gnome-documents", "google"]);
+
+ let identifierHash = GLib.compute_checksum_for_string(GLib.ChecksumType.SHA1, this.identifier, -1);
+ let localFilename = identifierHash + ".pdf";
+
+ let localPath = GLib.build_filenamev([localDir, localFilename]);
+ let localFile = Gio.File.new_for_path(localPath);
+ this.uriToLoad = localFile.get_uri();
},
canEdit: function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]