diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-09-29 21:27:03 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-09-29 21:27:03 (GMT) |
commit | 3a83a06db8ee27eafcd0219d1d26bf2af23737f5 (patch) | |
tree | 163ea7fbe1435b9f380e7ae96dfc36d8f16d1d0a /src/gui/panels/history.c | |
parent | 55bc8570f25a479b222733c4093f9ae996c9f68e (diff) |
Cleaned the DB code a little bit.
Diffstat (limited to 'src/gui/panels/history.c')
-rw-r--r-- | src/gui/panels/history.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/panels/history.c b/src/gui/panels/history.c index df3fde1..bb71cf2 100644 --- a/src/gui/panels/history.c +++ b/src/gui/panels/history.c @@ -442,7 +442,7 @@ static void on_history_changed(GDbCollection *collec, DBAction action, GDbItem * gtk_list_store_set(store, &iter, HTC_ITEM, item, //HTC_PICTURE, G_BOOKMARKS_PANEL_GET_CLASS(panel)->bookmark_img, - HTC_FOREGROUND, g_db_item_is_enabled(item) ? NULL : "grey", + HTC_FOREGROUND, g_db_item_has_flag(item, DIF_DISABLED) ? "grey" : NULL, HTC_LABEL, label, -1); @@ -461,7 +461,7 @@ static void on_history_changed(GDbCollection *collec, DBAction action, GDbItem * if (find_changed_item(model, item, &iter)) gtk_list_store_set(store, &iter, - HTC_FOREGROUND, g_db_item_is_enabled(item) ? NULL : "grey", + HTC_FOREGROUND, g_db_item_has_flag(item, DIF_DISABLED) ? "grey" : NULL, -1); break; @@ -482,7 +482,7 @@ static void on_history_changed(GDbCollection *collec, DBAction action, GDbItem * gtk_tree_model_get(_model, _iter, HTC_ITEM, &item, -1); - active = g_db_item_is_enabled(item); + active = !g_db_item_has_flag(item, DIF_DISABLED); g_object_unref(G_OBJECT(item)); @@ -530,7 +530,7 @@ static gint sort_history_lines(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter gtk_tree_model_get(model, a, HTC_ITEM, &item_a, -1); gtk_tree_model_get(model, b, HTC_ITEM, &item_b, -1); - result = g_db_item_cmp(item_a, item_b, true); + result = g_db_item_cmp(item_a, item_b); g_object_unref(G_OBJECT(item_a)); g_object_unref(G_OBJECT(item_b)); @@ -568,10 +568,10 @@ static void on_history_selection_change(GtkTreeSelection *selection, GHistoryPan gtk_tree_model_get(model, &iter, HTC_ITEM, &item, -1); button = GTK_WIDGET(gtk_builder_get_object(builder, "undo")); - gtk_widget_set_sensitive(button, g_db_item_is_enabled(item)); + gtk_widget_set_sensitive(button, !g_db_item_has_flag(item, DIF_DISABLED)); button = GTK_WIDGET(gtk_builder_get_object(builder, "redo")); - gtk_widget_set_sensitive(button, !g_db_item_is_enabled(item)); + gtk_widget_set_sensitive(button, g_db_item_has_flag(item, DIF_DISABLED)); g_object_unref(G_OBJECT(item)); |