[gnome-documents/gnome-3-8] documents: The directory must exist before we fetch the thumbnail
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents/gnome-3-8] documents: The directory must exist before we fetch the thumbnail
- Date: Wed, 23 Oct 2013 09:25:17 +0000 (UTC)
commit 378fc90f836bb9f9fd980408a94847430b06f6da
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Oct 22 12:10:59 2013 +0200
documents: The directory must exist before we fetch the thumbnail
https://bugzilla.gnome.org/show_bug.cgi?id=698315
src/documents.js | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index 4da2a4f..bbd10d0 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -746,8 +746,10 @@ const GoogleDocument = new Lang.Class({
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"]);
+ GLib.mkdir_with_parents(dirPath, 0700);
let basename = checksum.get_string() + '.png';
- let path = GLib.build_filenamev([GLib.get_user_cache_dir(), "thumbnails", "normal",
basename]);
+ 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]