[PATCH] List View Rename Crash (#143830)
- From: Martin Wehner <martin wehner epost de>
- To: nautilus-list gnome org
- Subject: [PATCH] List View Rename Crash (#143830)
- Date: Sun, 08 Aug 2004 16:59:27 +0200
When you start a rename operation in the list view and then change the
directory without exiting the cell edit mode, the "edited" signal is
emitted at a time when the model is already torn down. This makes
Nautilus act on the wrong file or crash altogether (see #143830). This
patch forces cell edit mode to be exited and the changes to be commited
before the model is cleared, making the list view act like the icon view
in this regard (and fixing the crash).
Martin
Index: src/file-manager/fm-list-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-list-view.c,v
retrieving revision 1.226
diff -u -p -w -r1.226 fm-list-view.c
--- src/file-manager/fm-list-view.c 8 Jun 2004 19:33:49 -0000 1.226
+++ src/file-manager/fm-list-view.c 8 Aug 2004 14:33:25 -0000
@@ -1276,9 +1276,21 @@ static void
fm_list_view_clear (FMDirectoryView *view)
{
FMListView *list_view;
+ GtkTreeViewColumn *column;
list_view = FM_LIST_VIEW (view);
+ /* Stop an ongoing rename to commit the name changes when the user
+ * changes directories without exiting cell edit mode. It also prevents
+ * the edited handler from being called on the cleared list model.
+ */
+
+ column = list_view->details->file_name_column;
+ if (column != NULL && column->editable_widget != NULL &&
+ GTK_IS_CELL_EDITABLE (column->editable_widget)) {
+ gtk_cell_editable_editing_done (column->editable_widget);
+ }
+
if (list_view->details->model != NULL) {
fm_list_model_clear (list_view->details->model);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]