mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-09-13 04:51:15 +00:00
Stop cell editing when disposing the view. Fixes #322821.
2006-01-26 Martin Wehner <martin.wehner@gmail.com> * src/file-manager/fm-list-view.c: (cell_renderer_edited), (stop_cell_editing), (fm_list_view_clear), (fm_list_view_dispose): Stop cell editing when disposing the view. Fixes #322821.
This commit is contained in:
parent
9054df1ad0
commit
2477cae8fc
|
@ -1,3 +1,9 @@
|
|||
2006-01-26 Martin Wehner <martin.wehner@gmail.com>
|
||||
|
||||
* src/file-manager/fm-list-view.c: (cell_renderer_edited),
|
||||
(stop_cell_editing), (fm_list_view_clear), (fm_list_view_dispose):
|
||||
Stop cell editing when disposing the view. Fixes #322821.
|
||||
|
||||
2006-01-26 Martin Wehner <martin.wehner@gmail.com>
|
||||
|
||||
* libnautilus-private/nautilus-file-operations.c:
|
||||
|
|
|
@ -1485,26 +1485,32 @@ fm_list_view_begin_loading (FMDirectoryView *view)
|
|||
set_column_order_from_metadata_and_preferences (list_view);
|
||||
}
|
||||
|
||||
static void
|
||||
stop_cell_editing (FMListView *list_view)
|
||||
{
|
||||
GtkTreeViewColumn *column;
|
||||
|
||||
/* 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);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
fm_list_view_clear (FMDirectoryView *view)
|
||||
{
|
||||
FMListView *list_view;
|
||||
GtkTreeViewColumn *column;
|
||||
|
||||
list_view = FM_LIST_VIEW (view);
|
||||
|
||||
if (list_view->details->model != NULL) {
|
||||
/* 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);
|
||||
}
|
||||
|
||||
stop_cell_editing (list_view);
|
||||
fm_list_model_clear (list_view->details->model);
|
||||
}
|
||||
}
|
||||
|
@ -2324,6 +2330,7 @@ fm_list_view_dispose (GObject *object)
|
|||
list_view = FM_LIST_VIEW (object);
|
||||
|
||||
if (list_view->details->model) {
|
||||
stop_cell_editing (list_view);
|
||||
g_object_unref (list_view->details->model);
|
||||
list_view->details->model = NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue