gnome-control-center r8624 - trunk/capplets/keybindings
- From: jensg svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-control-center r8624 - trunk/capplets/keybindings
- Date: Tue, 1 Apr 2008 20:24:43 +0100 (BST)
Author: jensg
Date: Tue Apr 1 20:24:43 2008
New Revision: 8624
URL: http://svn.gnome.org/viewvc/gnome-control-center?rev=8624&view=rev
Log:
2008-04-01 Jens Granseuer <jensgr gmx net>
* gnome-keybinding-properties.c: (get_real_model), (clear_old_model),
(append_keys_to_tree), (accel_edited_callback): get rid of unneeded
sort model indirection
Modified:
trunk/capplets/keybindings/ChangeLog
trunk/capplets/keybindings/gnome-keybinding-properties.c
Modified: trunk/capplets/keybindings/gnome-keybinding-properties.c
==============================================================================
--- trunk/capplets/keybindings/gnome-keybinding-properties.c (original)
+++ trunk/capplets/keybindings/gnome-keybinding-properties.c Tue Apr 1 20:24:43 2008
@@ -64,22 +64,6 @@
static gboolean block_accels = FALSE;
-static GtkTreeModel*
-get_real_model (GtkTreeView *tree_view)
-{
- GtkTreeModel *model;
- GtkTreeModel *submodel;
-
- model = gtk_tree_view_get_model (tree_view);
-
- if (model)
- submodel = gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (model));
- else
- submodel = NULL;
-
- return submodel;
-}
-
static GladeXML *
create_dialog (void)
{
@@ -268,32 +252,27 @@
}
static void
-clear_old_model (GladeXML *dialog)
+clear_old_model (GladeXML *dialog)
{
GtkWidget *tree_view;
GtkTreeModel *model;
tree_view = WID ("shortcut_treeview");
- model = get_real_model (GTK_TREE_VIEW (tree_view));
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
if (model == NULL)
{
/* create a new model */
- GtkTreeModel *sort_model;
-
model = (GtkTreeModel *) gtk_tree_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER);
- sort_model = gtk_tree_model_sort_new_with_model (model);
-
- gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (sort_model),
+ gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (model),
KEYENTRY_COLUMN,
keyentry_sort_func,
NULL, NULL);
- gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), sort_model);
+ gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), model);
g_object_unref (model);
- g_object_unref (sort_model);
}
else
{
@@ -308,8 +287,6 @@
* cached values do not have that set, though */
gconf_client_clear_cache (client);
- g_object_ref (model);
-
for (valid = gtk_tree_model_get_iter_first (model, &iter);
valid;
valid = gtk_tree_model_iter_next (model, &iter))
@@ -327,8 +304,7 @@
}
}
- gtk_tree_store_clear(GTK_TREE_STORE(model));
- g_object_unref (model);
+ gtk_tree_store_clear (GTK_TREE_STORE (model));
g_object_unref (client);
}
@@ -410,7 +386,7 @@
gint i, j;
client = gconf_client_get_default ();
- model = get_real_model (GTK_TREE_VIEW (WID ("shortcut_treeview")));
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (WID ("shortcut_treeview")));
/* Try to find a section parent iter, if it already exists */
i = gtk_tree_model_iter_n_children (model, NULL);
@@ -868,7 +844,6 @@
/* CapsLock isn't supported as a keybinding modifier, so keep it from confusing us */
mask &= ~EGG_VIRTUAL_LOCK_MASK;
- model = get_real_model (view);
tmp_key.model = model;
tmp_key.keyval = keyval;
tmp_key.keycode = keycode;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]