[gnome-notes/136-implement-the-list-row-pattern-in-main-view] gd-main-column: Remove references to them
- From: Isaque Galdino de Araujo <igaldino src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-notes/136-implement-the-list-row-pattern-in-main-view] gd-main-column: Remove references to them
- Date: Fri, 24 Jan 2020 02:28:07 +0000 (UTC)
commit cc940aea50142567b330242db652608978f42ace
Author: Isaque Galdino <igaldino gmail com>
Date: Thu Jan 23 23:27:52 2020 -0300
gd-main-column: Remove references to them
src/bjb-controller.c | 37 +++++++++++++++++++------------------
src/bjb-controller.h | 12 ++++++++++++
src/bjb-main-view.c | 4 ++--
3 files changed, 33 insertions(+), 20 deletions(-)
---
diff --git a/src/bjb-controller.c b/src/bjb-controller.c
index 7aca0d2..54d7634 100644
--- a/src/bjb-controller.c
+++ b/src/bjb-controller.c
@@ -91,15 +91,15 @@ bjb_controller_init (BjbController *self)
GtkListStore *store;
/* Create the columns */
- store = gtk_list_store_new (GD_MAIN_COLUMN_LAST,
- G_TYPE_STRING, // urn
- G_TYPE_STRING, // uri
- G_TYPE_STRING, // name
- G_TYPE_STRING, // author
- CAIRO_GOBJECT_TYPE_SURFACE, // icon then note
- G_TYPE_INT64, // mtime
- G_TYPE_BOOLEAN, // state
- G_TYPE_UINT); // pulse
+ store = gtk_list_store_new (BJB_MODEL_COLUMN_LAST,
+ G_TYPE_STRING, // urn / id
+ G_TYPE_STRING, // uri
+ G_TYPE_STRING, // name / primary text
+ G_TYPE_STRING, // author / seconday text / null
+ CAIRO_GOBJECT_TYPE_SURFACE, // icon
+ G_TYPE_INT64, // mtime
+ G_TYPE_BOOLEAN, // state / selected
+ G_TYPE_UINT); // pulse ?
self->model = GTK_TREE_MODEL (store);
self->n_items_to_show = BJB_ITEMS_SLICE;
@@ -203,7 +203,7 @@ bjb_controller_get_iter (BjbController *self,
while (try)
{
gchar *item_path;
- gtk_tree_model_get (self->model, *iter, GD_MAIN_COLUMN_URI, &item_path, -1);
+ gtk_tree_model_get (self->model, *iter, BJB_MODEL_COLUMN_URI, &item_path, -1);
/* If we look for the item, check by uid */
if (needle && g_strcmp0 (item_path, needle) == 0)
@@ -267,14 +267,15 @@ bjb_controller_add_item (BjbController *self,
* currently use the same model */
uuid = biji_item_get_uuid (item);
- gtk_list_store_set (store, &iter,
- GD_MAIN_COLUMN_ID, uuid,
- GD_MAIN_COLUMN_URI, uuid,
- GD_MAIN_COLUMN_PRIMARY_TEXT, biji_item_get_title (item),
- GD_MAIN_COLUMN_SECONDARY_TEXT, NULL,
- GD_MAIN_COLUMN_ICON, surface,
- GD_MAIN_COLUMN_MTIME, biji_item_get_mtime (item),
- -1);
+ gtk_list_store_set (store,
+ &iter,
+ BJB_MODEL_COLUMN_ID, uuid,
+ BJB_MODEL_COLUMN_URI, uuid,
+ BJB_MODEL_COLUMN_PRIMARY_TEXT, biji_item_get_title (item),
+ BJB_MODEL_COLUMN_SECONDARY_TEXT, NULL,
+ BJB_MODEL_COLUMN_ICON, surface,
+ BJB_MODEL_COLUMN_MTIME, biji_item_get_mtime (item),
+ -1);
}
diff --git a/src/bjb-controller.h b/src/bjb-controller.h
index fa46aa6..12426a3 100644
--- a/src/bjb-controller.h
+++ b/src/bjb-controller.h
@@ -29,6 +29,18 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (BjbController, bjb_controller, BJB, CONTROLLER, GObject)
+typedef enum {
+ BJB_MODEL_COLUMN_ID,
+ BJB_MODEL_COLUMN_URI,
+ BJB_MODEL_COLUMN_PRIMARY_TEXT,
+ BJB_MODEL_COLUMN_SECONDARY_TEXT,
+ BJB_MODEL_COLUMN_ICON,
+ BJB_MODEL_COLUMN_MTIME,
+ BJB_MODEL_COLUMN_SELECTED,
+ BJB_MODEL_COLUMN_PULSE,
+ BJB_MODEL_COLUMN_LAST
+} BjbModelColumnsType;
+
BjbController * bjb_controller_new (BijiManager *manager,
GtkWindow *bjb_window_base,
gchar *needle);
diff --git a/src/bjb-main-view.c b/src/bjb-main-view.c
index 01e8514..08dcdc5 100644
--- a/src/bjb-main-view.c
+++ b/src/bjb-main-view.c
@@ -246,7 +246,7 @@ get_note_url_from_tree_path(GtkTreePath *path,
model = bjb_controller_get_model (self->controller);
gtk_tree_model_get_iter (model, &iter, path);
- gtk_tree_model_get (model, &iter, GD_MAIN_COLUMN_URI, ¬e_path, -1);
+ gtk_tree_model_get (model, &iter, BJB_MODEL_COLUMN_URI, ¬e_path, -1);
return note_path;
}
@@ -341,7 +341,7 @@ on_item_activated (GdMainView *gd,
/* Get Item Path */
model = gd_main_view_get_model (gd);
gtk_tree_model_get_iter (model, &iter, (GtkTreePath *) path);
- gtk_tree_model_get (model, &iter, GD_MAIN_COLUMN_URI, &item_path,-1);
+ gtk_tree_model_get (model, &iter, BJB_MODEL_COLUMN_URI, &item_path,-1);
g_return_val_if_fail (item_path != NULL, FALSE); // #709197
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]