[gnome-documents/wip/pranavk/lokdocview: 3/7] Use a function to detect if it is open document format



commit 30716938a4ee2a91b3d6a84aba1240f5c642f63d
Author: Pranav Kant <pranavk gnome org>
Date:   Fri Aug 14 19:02:00 2015 +0530

    Use a function to detect if it is open document format

 src/documents.js |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index 52dba53..5ea1c00 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -668,6 +668,12 @@ const DocCommon = new Lang.Class({
             retval = '{ ?urn nie:isPartOf <' + this.id + '> }';
 
         return retval;
+    },
+
+    isOpenDocumentFormat: function() {
+        if (openDocumentFormats.indexOf(this.mimeType) != -1)
+            return true;
+        return false;
     }
 });
 Signals.addSignalMethods(DocCommon.prototype);
@@ -744,7 +750,7 @@ const LocalDocument = new Lang.Class({
             return;
         }
 
-        if (openDocumentFormats.indexOf(this.mimeType) != -1) {
+        if (this.isOpenDocumentFormat()) {
             callback (this, null, null);
             return;
         }


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