[gnome-documents] documents: Use a global named constant for the OneDrive prefix



commit df805da1a1092e35974608e3f3d1eae17d1d5d59
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Mar 29 15:29:58 2017 +0200

    documents: Use a global named constant for the OneDrive prefix
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780718

 src/documents.js |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index eae3071..8e9044e 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -1059,6 +1059,8 @@ const OwncloudDocument = new Lang.Class({
     }
 });
 
+const SKYDRIVE_PREFIX = 'windows-live:skydrive:';
+
 const SkydriveDocument = new Lang.Class({
     Name: 'SkydriveDocument',
     Extends: DocCommon,
@@ -1078,9 +1080,7 @@ const SkydriveDocument = new Lang.Class({
 
         let authorizer = new Zpj.GoaAuthorizer({ goa_object: source.object });
         let service = new Zpj.Skydrive({ authorizer: authorizer });
-
-        const zpj_prefix = "windows-live:skydrive:";
-        let zpj_id = this.identifier.substring(zpj_prefix.length);
+        let zpj_id = this.identifier.substring(SKYDRIVE_PREFIX.length);
 
         service.query_info_from_id_async
             (zpj_id, cancellable,
@@ -1231,7 +1231,7 @@ const DocumentManager = new Lang.Class({
 
     _identifierIsSkydrive: function(identifier) {
         return (identifier &&
-                (identifier.indexOf('windows-live:skydrive:') != -1));
+                (identifier.indexOf(SKYDRIVE_PREFIX) != -1));
     },
 
     createDocumentFromCursor: function(cursor) {


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