Skip to content

Commit 9f8d0ec

Browse files
authored
Bugfix: rename replaces parent directory (issue #3750) (#3751)
* nemo-file-conflict-dialog.c: check for empty dialog->details->entry No call to nemo_file_conflict_dialog_get_new_name() would usually be possible while entry is empty, but can be made to happen, see #3750. * nemo-file-conflict-dialog.c: hide details->rename_button initially Ensure the existing attempt to hide details->rename_button is not undone by the call to gtk_widget_show_all() at the end of the nemo_file_conflict_dialog_init() function. Fixes #3750.
1 parent bc0c8cc commit 9f8d0ec

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

libnemo-private/nemo-file-conflict-dialog.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ nemo_file_conflict_dialog_init (NemoFileConflictDialog *fcd)
566566
_("Re_name"),
567567
CONFLICT_RESPONSE_RENAME);
568568
gtk_widget_hide (details->rename_button);
569+
gtk_widget_set_no_show_all(details->rename_button, TRUE);
569570

570571
details->replace_button =
571572
gtk_dialog_add_button (dialog,
@@ -622,6 +623,7 @@ nemo_file_conflict_dialog_class_init (NemoFileConflictDialogClass *klass)
622623
char *
623624
nemo_file_conflict_dialog_get_new_name (NemoFileConflictDialog *dialog)
624625
{
626+
g_assert(gtk_entry_get_text_length (GTK_ENTRY (dialog->details->entry)) > 0);
625627
return g_strdup (gtk_entry_get_text
626628
(GTK_ENTRY (dialog->details->entry)));
627629
}

0 commit comments

Comments
 (0)