summaryrefslogtreecommitdiff
path: root/src/file-manager
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2001-02-17 02:44:51 +0000
committerDarin Adler <darin@src.gnome.org>2001-02-17 02:44:51 +0000
commitb65fe4644d2a21dd0b66b16fe22d7bd88ea3b410 (patch)
tree06f632af83fcd322b164644a6d71208b26292ea5 /src/file-manager
parente9d6ca305696c29a8e61b5520979f85002bc4032 (diff)
downloadnautilus-b65fe4644d2a21dd0b66b16fe22d7bd88ea3b410.tar.gz
reviewed by: Gene Ragan <gzr@eazel.com>
Fix bug 4070 (Repeated clicks of BACK cause core dump): * src/nautilus-window-manage-views.c: (viewed_file_changed_callback): Use end_location_change instead, since cancel_location_change just does extra "go back to old view" that we don't need. (cancel_location_change): A little more sanity checking. Not sure if it really helps. The other changes should fix the bug. (begin_location_change): Use end_location_change to get rid of any previous change in progress since cancel_location_change just does extra "go back to old view" that we don't need. (report_location_change_callback): Use end_location_change to get rid of any previous change in progress since cancel_location_change just does extra "go back to old view" that we don't need. * src/file-manager/fm-list-view.c: (get_list_if_exists), (fm_list_view_clear): Don't create a list just to clear it. Crashed here while I was trying to work on the other bug.
Diffstat (limited to 'src/file-manager')
-rw-r--r--src/file-manager/fm-list-view.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index 95227414f..1058d542a 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -1126,6 +1126,21 @@ add_to_list (FMListView *list_view, NautilusFile *file)
}
static NautilusList *
+get_list_if_exists (FMListView *list_view)
+{
+ GtkWidget *child;
+
+ g_return_val_if_fail (FM_IS_LIST_VIEW (list_view), NULL);
+
+ child = GTK_BIN (list_view)->child;
+ if (child == NULL) {
+ return NULL;
+ }
+
+ return NAUTILUS_LIST (child);
+}
+
+static NautilusList *
get_list (FMListView *list_view)
{
GtkWidget *child;
@@ -1218,19 +1233,24 @@ fm_list_view_get_background_widget (FMDirectoryView *view)
static void
fm_list_view_clear (FMDirectoryView *view)
{
- NautilusCList *list;
+ NautilusList *list;
+ NautilusCList *clist;
int row;
g_return_if_fail (FM_IS_LIST_VIEW (view));
- list = NAUTILUS_CLIST (get_list (FM_LIST_VIEW (view)));
+ list = get_list_if_exists (FM_LIST_VIEW (view));
+ if (list == NULL) {
+ return;
+ }
/* Clear away the existing list items. */
- for (row = 0; row < list->rows; ++row) {
+ clist = NAUTILUS_CLIST (list);
+ for (row = 0; row < clist->rows; ++row) {
fm_list_view_removing_file
- (FM_LIST_VIEW (view), NAUTILUS_FILE (nautilus_clist_get_row_data (list, row)));
+ (FM_LIST_VIEW (view), NAUTILUS_FILE (nautilus_clist_get_row_data (clist, row)));
}
- nautilus_clist_clear (list);
+ nautilus_clist_clear (clist);
}
static void