summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--src/file-manager/fm-list-view.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2102e2b20..e6bd8f6ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-10-13 Alexander Larsson <alexl@redhat.com>
+
+ * src/file-manager/fm-list-view.c (cell_renderer_edited):
+ Don't rename files to "". Fixes #124420
+ Based on patch from mwehner@tfh-berlin.de.
+
2003-10-11 Dave Camp <dave@ximian.com>
* src/Makefile.am: Add nautilus-location-dialog.[ch] and
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index 778b1c76f..3bdaef2f2 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -608,6 +608,16 @@ cell_renderer_edited (GtkCellRendererText *cell,
NautilusFile *file;
GtkTreeIter iter;
+ /* Don't allow a rename with an empty string. Revert to original
+ * without notifying the user.
+ */
+ if (new_text[0] == '\0') {
+ g_object_set (G_OBJECT (view->details->file_name_cell),
+ "editable", FALSE,
+ NULL);
+ return;
+ }
+
path = gtk_tree_path_new_from_string (path_str);
gtk_tree_model_get_iter (GTK_TREE_MODEL (view->details->model),