From fe247b1685f3a5a72ca3e9bad2496bd4ada54568 Mon Sep 17 00:00:00 2001 From: Jody Goldberg Date: Wed, 7 Aug 2002 17:06:12 +0000 Subject: [PATCH] Patch from JRB for 88443 2002-08-07 Jody Goldberg Patch from JRB for 88443 * theme-switcher.c (read_themes) : store the current cursor 2002-08-07 Jody Goldberg * mime-edit-dialog.c (mime_edit_dialog_get_app) : Be extra anal, just in case the db is corrupt. --- capplets/file-types/ChangeLog | 5 +++ capplets/file-types/mime-edit-dialog.c | 2 +- capplets/theme-switcher/ChangeLog | 5 +++ capplets/theme-switcher/theme-switcher.c | 39 +++++++++--------------- 4 files changed, 25 insertions(+), 26 deletions(-) diff --git a/capplets/file-types/ChangeLog b/capplets/file-types/ChangeLog index d1547a1c8..087445627 100644 --- a/capplets/file-types/ChangeLog +++ b/capplets/file-types/ChangeLog @@ -1,3 +1,8 @@ +2002-08-07 Jody Goldberg + + * mime-edit-dialog.c (mime_edit_dialog_get_app) : Be extra anal, just + in case the db is corrupt. + 2002-08-05 Jody Goldberg * mime-edit-dialog.c (mime_edit_dialog_get_app) : work around diff --git a/capplets/file-types/mime-edit-dialog.c b/capplets/file-types/mime-edit-dialog.c index cd5d5b788..802b405e8 100644 --- a/capplets/file-types/mime-edit-dialog.c +++ b/capplets/file-types/mime-edit-dialog.c @@ -702,7 +702,7 @@ mime_edit_dialog_get_app (GladeXML *glade, char const *mime_type, /* Look for a matching application (with or without path) */ if (app_cmd != NULL && - (!strcmp (cmd, app_cmd) || !strcmp (base_cmd, app_cmd))) { + (!strcmp (cmd, app_cmd) || (*base_cmd && !strcmp (base_cmd, app_cmd)))) { gboolean ok, app_req = gnome_vfs_application_registry_get_bool_value (ptr->data, GNOME_VFS_APPLICATION_REGISTRY_REQUIRES_TERMINAL, &ok); if (ok && app_req == requires_terminal) diff --git a/capplets/theme-switcher/ChangeLog b/capplets/theme-switcher/ChangeLog index a0de4f095..32220e98d 100644 --- a/capplets/theme-switcher/ChangeLog +++ b/capplets/theme-switcher/ChangeLog @@ -1,3 +1,8 @@ +2002-08-07 Jody Goldberg + Patch from JRB for 88443 + + * theme-switcher.c (read_themes) : store the current cursor + 2002-07-31 Federico Mena Quintero * theme-install.glade: Make the file entry modal. Fixes #89410. diff --git a/capplets/theme-switcher/theme-switcher.c b/capplets/theme-switcher/theme-switcher.c index 70c0894c5..557986552 100644 --- a/capplets/theme-switcher/theme-switcher.c +++ b/capplets/theme-switcher/theme-switcher.c @@ -141,18 +141,9 @@ read_themes (GladeXML *dialog) if (strcmp (current_theme, info->name) == 0) { - GtkTreeSelection *selection; - - selection = gtk_tree_view_get_selection (tree_view); - gtk_tree_selection_select_iter (selection, &iter); - if (initial_scroll) - { - GtkTreePath *path; - - path = gtk_tree_model_get_path (model, &iter); - row_ref = gtk_tree_row_reference_new (model, path); - gtk_tree_path_free (path); - } + GtkTreePath *path = gtk_tree_model_get_path (model, &iter); + row_ref = gtk_tree_row_reference_new (model, path); + gtk_tree_path_free (path); current_theme_found = TRUE; } @@ -169,36 +160,34 @@ read_themes (GladeXML *dialog) if (! current_theme_found) { - GtkTreeSelection *selection = gtk_tree_view_get_selection (tree_view); GtkTreeIter iter; + GtkTreePath *path; gtk_list_store_prepend (GTK_LIST_STORE (model), &iter); gtk_list_store_set (GTK_LIST_STORE (model), &iter, THEME_NAME_COLUMN, current_theme, -1); - gtk_tree_selection_select_iter (selection, &iter); - if (initial_scroll) - { - GtkTreePath *path; - path = gtk_tree_model_get_path (model, &iter); - row_ref = gtk_tree_row_reference_new (model, path); - gtk_tree_path_free (path); - } + path = gtk_tree_model_get_path (model, &iter); + row_ref = gtk_tree_row_reference_new (model, path); + gtk_tree_path_free (path); } - - if (row_ref && initial_scroll) + if (row_ref) { GtkTreePath *path; path = gtk_tree_row_reference_get_path (row_ref); + gtk_tree_view_set_cursor (tree_view,path, NULL, FALSE); - gtk_tree_view_scroll_to_cell (tree_view, path, NULL, TRUE, 0.5, 0.0); + if (initial_scroll) + { + gtk_tree_view_scroll_to_cell (tree_view, path, NULL, TRUE, 0.5, 0.0); + initial_scroll = FALSE; + } gtk_tree_path_free (path); gtk_tree_row_reference_free (row_ref); - initial_scroll = FALSE; } setting_model = FALSE;