[gnome-documents/gnome-3-22] documents: Track nfo:fileName for later use



commit 5838bd78e25ba5768097b61d08884ee0bc9836de
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 f860f8a..b32720a 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -228,6 +228,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;
@@ -305,12 +306,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]