[gnome-documents/wip/rishi/onedrive: 3/8] documents: Track nfo:fileName for later use



commit 53b1b57be98736daa0a32a95b6a4de5fd18271e0
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Mar 30 16:54:15 2017 +0200

    documents: Track nfo:fileName for later use
    
    Now that we can open ODFs and OOXMLs in LOKDocView, we don't need to
    convert all remote documents to PDF. For example, we can open office
    documents stored from OneDrive without any format conversion. The
    nfo:fileName can be used to determine the extension of the cached file.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774937

 src/documents.js |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index 1cb66a7..586abd3 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -234,6 +234,7 @@ const DocCommon = new Lang.Class({
     _init: function(cursor) {
         this.id = null;
         this.uri = null;
+        this.filename = null;
         this.name = null;
         this.author = null;
         this.mtime = null;
@@ -311,12 +312,12 @@ const DocCommon = new Lang.Class({
             this.uri = '';
 
         let title = cursor.get_string(Query.QueryColumns.TITLE)[0];
-        let filename = cursor.get_string(Query.QueryColumns.FILENAME)[0];
+        this.filename = cursor.get_string(Query.QueryColumns.FILENAME)[0];
 
         if (title && title != '')
             this.name = title;
-        else if (filename)
-            this.name = GdPrivate.filename_strip_extension(filename);
+        else if (this.filename)
+            this.name = GdPrivate.filename_strip_extension(this.filename);
         else
             this.name = '';
 


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