[gnome-documents] documents: store the actual URI in the GtkTreeModel



commit 793570f3469a27e1f3917adc130c54639836c434
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Mar 1 17:23:34 2012 -0500

    documents: store the actual URI in the GtkTreeModel
    
    This is needed for DnD.

 src/documents.js       |    4 ++--
 src/lib/gd-main-view.h |    1 +
 src/lib/gd-utils.c     |   13 ++++++++-----
 src/lib/gd-utils.h     |    1 +
 4 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index c11c081..dd7f17a 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -934,7 +934,7 @@ DocumentModel.prototype = {
         let iter = this.model.append();
 
         Gd.store_set(this.model, iter,
-                     doc.id,
+                     doc.id, doc.uri,
                      doc.name, doc.author,
                      doc.pixbuf, doc.mtime);
 
@@ -950,7 +950,7 @@ DocumentModel.prototype = {
                 let objectIter = this.model.get_iter(objectPath)[1];
                 if (objectIter)
                     Gd.store_set(this.model, iter,
-                                 doc.id,
+                                 doc.id, doc.uri,
                                  doc.name, doc.author,
                                  doc.pixbuf, doc.mtime);
             }));
diff --git a/src/lib/gd-main-view.h b/src/lib/gd-main-view.h
index 641db26..113355d 100644
--- a/src/lib/gd-main-view.h
+++ b/src/lib/gd-main-view.h
@@ -56,6 +56,7 @@ typedef struct _GdMainViewPrivate GdMainViewPrivate;
 
 typedef enum {
   GD_MAIN_COLUMN_ID,
+  GD_MAIN_COLUMN_URI,
   GD_MAIN_COLUMN_TITLE,
   GD_MAIN_COLUMN_AUTHOR,
   GD_MAIN_COLUMN_ICON,
diff --git a/src/lib/gd-utils.c b/src/lib/gd-utils.c
index 4d97316..35cda0e 100644
--- a/src/lib/gd-utils.c
+++ b/src/lib/gd-utils.c
@@ -39,8 +39,9 @@
 GtkListStore *
 gd_create_list_store (void)
 {
-  return gtk_list_store_new (6,
+  return gtk_list_store_new (7,
                              G_TYPE_STRING, // URN
+                             G_TYPE_STRING, // URI
                              G_TYPE_STRING, // TITLE
                              G_TYPE_STRING, // AUTHOR
                              GDK_TYPE_PIXBUF, // ICON
@@ -52,6 +53,7 @@ void
 gd_store_set (GtkListStore *store,
               GtkTreeIter *iter,
               const gchar *urn,
+              const gchar *uri,
               const gchar *title,
               const gchar *author,
               GdkPixbuf *icon,
@@ -59,10 +61,11 @@ gd_store_set (GtkListStore *store,
 {
   gtk_list_store_set (store, iter,
                       0, urn,
-                      1, title,
-                      2, author,
-                      3, icon,
-                      4, mtime,
+                      1, uri,
+                      2, title,
+                      3, author,
+                      4, icon,
+                      5, mtime,
                       -1);
 }
 
diff --git a/src/lib/gd-utils.h b/src/lib/gd-utils.h
index f6e856e..0104bf0 100644
--- a/src/lib/gd-utils.h
+++ b/src/lib/gd-utils.h
@@ -28,6 +28,7 @@ GtkListStore* gd_create_list_store (void);
 void gd_store_set (GtkListStore *store,
                    GtkTreeIter *iter,
                    const gchar *urn,
+                   const gchar *uri,
                    const gchar *title,
                    const gchar *author,
                    GdkPixbuf *icon,



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