[gnome-documents] documents: rename 'title' property to 'name'



commit e1362212fc8f65d6291c81e9d5fc867166aec29d
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Nov 10 15:08:02 2011 -0500

    documents: rename 'title' property to 'name'
    
    For consistency with all the other BaseModels.

 src/documents.js   |   16 ++++++++--------
 src/error.js       |    2 +-
 src/mainToolbar.js |    6 +++---
 3 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index c489ebf..1b9b117 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -250,7 +250,7 @@ DocCommon.prototype = {
     _init: function(cursor) {
         this.id = null;
         this.uri = null;
-        this.title = null;
+        this.name = null;
         this.author = null;
         this.mtime = null;
         this.resourceUrn = null;
@@ -294,7 +294,7 @@ DocCommon.prototype = {
     },
 
     _sanitizeTitle: function() {
-        this.title = this.title.replace('Microsoft Word - ', '', 'g');
+        this.name = this.name.replace('Microsoft Word - ', '', 'g');
     },
 
     populateFromCursor: function(cursor) {
@@ -318,9 +318,9 @@ DocCommon.prototype = {
 
         let title = cursor.get_string(Query.QueryColumns.TITLE)[0];
         if (title && title != '')
-            this.title = title;
+            this.name = title;
         else
-            this.title = Gd.filename_strip_extension(
+            this.name = Gd.filename_strip_extension(
                 cursor.get_string(Query.QueryColumns.FILENAME)[0]);
 
         this._sanitizeTitle();
@@ -723,7 +723,7 @@ GoogleDocument.prototype = {
         this._createGDataEntry(null, Lang.bind(this,
             function(entry, service, exception) {
                 if (!entry) {
-                    log('Unable to call setFavorite on ' + this.title + ': ' + exception.toString());
+                    log('Unable to call setFavorite on ' + this.name + ': ' + exception.toString());
                     return;
                 }
 
@@ -751,7 +751,7 @@ GoogleDocument.prototype = {
                              try {
                                  service.update_entry_finish(res);
                              } catch (e) {
-                                 log('Unable to call setFavorite on ' + this.title + ': ' + e.toString());
+                                 log('Unable to call setFavorite on ' + this.name + ': ' + e.toString());
                              }
                          }));
             }));
@@ -897,7 +897,7 @@ DocumentModel.prototype = {
 
         Gd.store_set(this.model, iter,
                      doc.id,
-                     doc.title, doc.author,
+                     doc.name, doc.author,
                      doc.pixbuf, doc.mtime);
 
         let treePath = this.model.get_path(iter);
@@ -913,7 +913,7 @@ DocumentModel.prototype = {
                 if (objectIter)
                     Gd.store_set(this.model, iter,
                                  doc.id,
-                                 doc.title, doc.author,
+                                 doc.name, doc.author,
                                  doc.pixbuf, doc.mtime);
             }));
     },
diff --git a/src/error.js b/src/error.js
index 694538b..bdb8baa 100644
--- a/src/error.js
+++ b/src/error.js
@@ -34,7 +34,7 @@ ErrorHandler.prototype = {
 
     addLoadError: function(doc, exception) {
         // Translators: %s is the title of a document
-        let message = _("Unable to load \"%s\" for preview").format(doc.title);
+        let message = _("Unable to load \"%s\" for preview").format(doc.name);
 
         // FIXME: we need support for error codes in GJS
         if (exception.toString().indexOf('Operation was cancelled') != -1)
diff --git a/src/mainToolbar.js b/src/mainToolbar.js
index 6c3abf3..d4ef421 100644
--- a/src/mainToolbar.js
+++ b/src/mainToolbar.js
@@ -142,7 +142,7 @@ MainToolbar.prototype = {
 
         if (collection) {
             this._whereLabel.show();
-            this._whereLabel.set_markup ('<b>' + collection.title + '</b>');
+            this._whereLabel.set_markup ('<b>' + collection.name + '</b>');
         }
 
         let markup;
@@ -245,7 +245,7 @@ MainToolbar.prototype = {
 
         if (item) {
             this._overviewBack.show();
-            this._whereLabel.set_markup(('<b>%s</b>').format(item.title));
+            this._whereLabel.set_markup(('<b>%s</b>').format(item.name));
         } else {
             this._overviewBack.hide();
             this._whereLabel.set_text('');
@@ -286,7 +286,7 @@ MainToolbar.prototype = {
         let pageLabel = null;
         let doc = Global.documentManager.getActiveItem();
 
-        let titleLabel = ('<b>%s</b>').format(GLib.markup_escape_text(doc.title, -1));
+        let titleLabel = ('<b>%s</b>').format(GLib.markup_escape_text(doc.name, -1));
         this._titleLabel.set_markup(titleLabel);
 
         if (this._model) {



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