diff --git a/ChangeLog b/ChangeLog index d6f7fe11bdf54f44183e9234cf2c19d3da95b085..901de600813f94c1750298ecb38a89f3676efcff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-10-02 Benedikt Meurer <benny@xfce.org> + + * thunar/thunar-properties-dialog.c(thunar_properties_dialog_update): + Don't update the name label/window title unless the file name has + changed. + 2005-09-28 Benedikt Meurer <benny@xfce.org> * thunar/thunar-launcher.c(thunar_launcher_update): Use mnemonics for diff --git a/thunar/thunar-properties-dialog.c b/thunar/thunar-properties-dialog.c index c60a150d5ee24906e8b4722c61878039f41fe8f2..b92ad0945a0fcbc4d5e8f2c554ac5f096651a743 100644 --- a/thunar/thunar-properties-dialog.c +++ b/thunar/thunar-properties-dialog.c @@ -540,27 +540,30 @@ thunar_properties_dialog_update (ThunarPropertiesDialog *dialog) if (G_LIKELY (icon != NULL)) g_object_unref (G_OBJECT (icon)); - /* update the name */ - name = thunar_file_get_display_name (dialog->file); + /* update the name (if it differs) */ gtk_entry_set_editable (GTK_ENTRY (dialog->name_entry), thunar_file_is_renameable (dialog->file)); - gtk_entry_set_text (GTK_ENTRY (dialog->name_entry), name); - str = g_strdup_printf (_("%s Info"), name); - gtk_window_set_title (GTK_WINDOW (dialog), str); - g_free (str); + name = thunar_file_get_display_name (dialog->file); + if (G_LIKELY (strcmp (name, gtk_entry_get_text (GTK_ENTRY (dialog->name_entry))) != 0)) + { + gtk_entry_set_text (GTK_ENTRY (dialog->name_entry), name); + str = g_strdup_printf (_("%s Info"), name); + gtk_window_set_title (GTK_WINDOW (dialog), str); + g_free (str); - /* grab the input focus to the name entry */ - gtk_widget_grab_focus (dialog->name_entry); + /* grab the input focus to the name entry */ + gtk_widget_grab_focus (dialog->name_entry); - /* select the pre-dot part of the name */ - str = strrchr (name, '.'); - if (G_LIKELY (str != NULL)) - { - /* calculate the offset */ - offset = g_utf8_pointer_to_offset (name, str); + /* select the pre-dot part of the name */ + str = strrchr (name, '.'); + if (G_LIKELY (str != NULL)) + { + /* calculate the offset */ + offset = g_utf8_pointer_to_offset (name, str); - /* select the region */ - if (G_LIKELY (offset > 0)) - gtk_entry_select_region (GTK_ENTRY (dialog->name_entry), 0, offset); + /* select the region */ + if (G_LIKELY (offset > 0)) + gtk_entry_select_region (GTK_ENTRY (dialog->name_entry), 0, offset); + } } /* update the mime type */