[gnac/devel] Replaced gtk_*_store_append/set with gtk_*_store_insert_with_values
- From: Benoît Dupasquier <bdupasqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnac/devel] Replaced gtk_*_store_append/set with gtk_*_store_insert_with_values
- Date: Mon, 4 Mar 2013 19:18:30 +0000 (UTC)
commit 00be46ee520c5ca38dca9154c74993ea2383dc7c
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date: Sat Mar 2 00:05:30 2013 +0100
Replaced gtk_*_store_append/set with gtk_*_store_insert_with_values
src/gnac-file-list.c | 3 +--
src/gnac-properties.c | 3 +--
src/gnac-ui.c | 33 +++++++++++----------------------
3 files changed, 13 insertions(+), 26 deletions(-)
---
diff --git a/src/gnac-file-list.c b/src/gnac-file-list.c
index 2ceeac8..5a7e73d 100644
--- a/src/gnac-file-list.c
+++ b/src/gnac-file-list.c
@@ -172,8 +172,7 @@ gnac_file_list_add_row(const gchar *uri)
gchar *name = gnac_utils_get_display_name(uri, NULL);
GtkTreeIter iter;
- gtk_list_store_append(GTK_LIST_STORE(model), &iter);
- gtk_list_store_set(GTK_LIST_STORE(model), &iter,
+ gtk_list_store_insert_with_values(GTK_LIST_STORE(model), &iter, -1,
COL_URI, uri, COL_DISPLAY, name, -1);
g_free(name);
diff --git a/src/gnac-properties.c b/src/gnac-properties.c
index 0687c53..0cff5ff 100644
--- a/src/gnac-properties.c
+++ b/src/gnac-properties.c
@@ -196,8 +196,7 @@ gnac_properties_build_table(void)
for (i = 0; displayed_properties[i][0]; i++) {
GtkTreeIter iter;
- gtk_list_store_append(GTK_LIST_STORE(model), &iter);
- gtk_list_store_set(GTK_LIST_STORE(model), &iter,
+ gtk_list_store_insert_with_values(GTK_LIST_STORE(model), &iter, -1,
PROPERTY_NAME, gettext(displayed_properties[i][1]),
PROPERTY_VISIBLE, TRUE,
-1);
diff --git a/src/gnac-ui.c b/src/gnac-ui.c
index 6afdcf0..0a54306 100644
--- a/src/gnac-ui.c
+++ b/src/gnac-ui.c
@@ -188,8 +188,7 @@ gnac_ui_file_chooser_get_filters_model(void)
filter = gtk_file_filter_new();
gtk_file_filter_add_pattern(filter, "*");
gtk_file_filter_set_name(filter, _("All files"));
- gtk_tree_store_append(store, &iter1, NULL);
- gtk_tree_store_set(store, &iter1, 0, filter, -1);
+ gtk_tree_store_insert_with_values(store, &iter1, NULL, -1, 0, filter, -1);
filters = g_slist_prepend(filters, filter);
/* Supported files */
@@ -215,8 +214,7 @@ gnac_ui_file_chooser_get_filters_model(void)
gtk_file_filter_add_mime_type(filter, video_mime[i][0]);
i++;
}
- gtk_tree_store_append(store, &iter1, NULL);
- gtk_tree_store_set(store, &iter1, 0, filter, -1);
+ gtk_tree_store_insert_with_values(store, &iter1, NULL, -1, 0, filter, -1);
filters = g_slist_prepend(filters, filter);
default_file_filter = filter;
@@ -238,8 +236,7 @@ gnac_ui_file_chooser_get_filters_model(void)
gtk_file_filter_add_mime_type(filter, playlists_mime[i][0]);
i++;
}
- gtk_tree_store_append(store, &iter1, NULL);
- gtk_tree_store_set(store, &iter1, 0, filter, -1);
+ gtk_tree_store_insert_with_values(store, &iter1, NULL, -1, 0, filter, -1);
filters = g_slist_prepend(filters, filter);
/* Lossy files */
@@ -250,8 +247,7 @@ gnac_ui_file_chooser_get_filters_model(void)
gtk_file_filter_add_mime_type(filter, lossy_mime[i][0]);
i++;
}
- gtk_tree_store_append(store, &iter2, &iter1);
- gtk_tree_store_set(store, &iter2, 0, filter, -1);
+ gtk_tree_store_insert_with_values(store, &iter2, &iter1, -1, 0, filter, -1);
filters = g_slist_prepend(filters, filter);
/* Individual lossy files */
@@ -260,8 +256,7 @@ gnac_ui_file_chooser_get_filters_model(void)
filter = gtk_file_filter_new();
gtk_file_filter_add_mime_type(filter, lossy_mime[i][0]);
gtk_file_filter_set_name(filter, lossy_mime[i][1]);
- gtk_tree_store_append(store, &iter3, &iter2);
- gtk_tree_store_set(store, &iter3, 0, filter, -1);
+ gtk_tree_store_insert_with_values(store, &iter3, &iter2, -1, 0, filter, -1);
filters = g_slist_prepend(filters, filter);
i++;
}
@@ -274,8 +269,7 @@ gnac_ui_file_chooser_get_filters_model(void)
gtk_file_filter_add_mime_type(filter, lossless_mime[i][0]);
i++;
}
- gtk_tree_store_append(store, &iter2, &iter1);
- gtk_tree_store_set(store, &iter2, 0, filter, -1);
+ gtk_tree_store_insert_with_values(store, &iter2, &iter1, -1, 0, filter, -1);
filters = g_slist_prepend(filters, filter);
/* Individual lossless files */
@@ -284,8 +278,7 @@ gnac_ui_file_chooser_get_filters_model(void)
filter = gtk_file_filter_new();
gtk_file_filter_add_mime_type(filter, lossless_mime[i][0]);
gtk_file_filter_set_name(filter, lossless_mime[i][1]);
- gtk_tree_store_append(store, &iter3, &iter2);
- gtk_tree_store_set(store, &iter3, 0, filter, -1);
+ gtk_tree_store_insert_with_values(store, &iter3, &iter2, -1, 0, filter, -1);
filters = g_slist_prepend(filters, filter);
i++;
}
@@ -298,8 +291,7 @@ gnac_ui_file_chooser_get_filters_model(void)
gtk_file_filter_add_mime_type(filter, playlists_mime[i][0]);
i++;
}
- gtk_tree_store_append(store, &iter1, NULL);
- gtk_tree_store_set(store, &iter1, 0, filter, -1);
+ gtk_tree_store_insert_with_values(store, &iter1, NULL, -1, 0, filter, -1);
filters = g_slist_prepend(filters, filter);
/* Individual playlists */
@@ -308,8 +300,7 @@ gnac_ui_file_chooser_get_filters_model(void)
filter = gtk_file_filter_new();
gtk_file_filter_add_mime_type(filter, playlists_mime[i][0]);
gtk_file_filter_set_name(filter, playlists_mime[i][1]);
- gtk_tree_store_append(store, &iter2, &iter1);
- gtk_tree_store_set(store, &iter2, 0, filter, -1);
+ gtk_tree_store_insert_with_values(store, &iter2, &iter1, -1, 0, filter, -1);
filters = g_slist_prepend(filters, filter);
i++;
}
@@ -322,8 +313,7 @@ gnac_ui_file_chooser_get_filters_model(void)
gtk_file_filter_add_mime_type(filter, video_mime[i][0]);
i++;
}
- gtk_tree_store_append(store, &iter1, NULL);
- gtk_tree_store_set(store, &iter1, 0, filter, -1);
+ gtk_tree_store_insert_with_values(store, &iter1, NULL, -1, 0, filter, -1);
filters = g_slist_prepend(filters, filter);
/* Individual video files */
@@ -332,8 +322,7 @@ gnac_ui_file_chooser_get_filters_model(void)
filter = gtk_file_filter_new();
gtk_file_filter_add_mime_type(filter, video_mime[i][0]);
gtk_file_filter_set_name(filter, video_mime[i][1]);
- gtk_tree_store_append(store, &iter2, &iter1);
- gtk_tree_store_set(store, &iter2, 0, filter, -1);
+ gtk_tree_store_insert_with_values(store, &iter2, &iter1, -1, 0, filter, -1);
filters = g_slist_prepend(filters, filter);
i++;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]