Don't shortcut the title change when the bookmark name changes. Fixes

2006-02-27  Alexander Larsson  <alexl@redhat.com>

	* src/nautilus-navigation-window.c:
	* src/nautilus-spatial-window.c:
	* src/nautilus-window.[ch]:
	Don't shortcut the title change when the bookmark name changes.
	Fixes #331383
	Patch from Christian Neumair.
This commit is contained in:
Alexander Larsson 2006-02-27 15:51:47 +00:00 committed by Alexander Larsson
parent 69facef412
commit 1dd6a21d79
5 changed files with 54 additions and 29 deletions

View file

@ -1,3 +1,12 @@
2006-02-27 Alexander Larsson <alexl@redhat.com>
* src/nautilus-navigation-window.c:
* src/nautilus-spatial-window.c:
* src/nautilus-window.[ch]:
Don't shortcut the title change when the bookmark name changes.
Fixes #331383
Patch from Christian Neumair.
2006-02-26 Zbigniew Chyla <mail@zbigniew.chyla.pl>
Get users' and groups' names via a cache to avoid calling

View file

@ -810,21 +810,26 @@ real_load_view_as_menu (NautilusWindow *window)
load_view_as_menu (window);
}
static void
static gboolean
real_set_title (NautilusWindow *window, const char *title)
{
char *full_title;
char *window_title;
EEL_CALL_PARENT (NAUTILUS_WINDOW_CLASS,
set_title, (window, title));
full_title = g_strdup_printf (_("%s - File Browser"), title);
gboolean changed;
window_title = eel_str_middle_truncate (full_title, MAX_TITLE_LENGTH);
gtk_window_set_title (GTK_WINDOW (window), window_title);
g_free (window_title);
g_free (full_title);
changed = EEL_CALL_PARENT_WITH_RETURN_VALUE
(NAUTILUS_WINDOW_CLASS, set_title, (window, title));
if (changed) {
full_title = g_strdup_printf (_("%s - File Browser"), title);
window_title = eel_str_middle_truncate (full_title, MAX_TITLE_LENGTH);
gtk_window_set_title (GTK_WINDOW (window), window_title);
g_free (window_title);
g_free (full_title);
}
return changed;
}
static char *

View file

@ -394,22 +394,25 @@ real_get_icon_name (NautilusWindow *window)
return nautilus_icon_factory_get_icon_for_file (window->details->viewed_file, FALSE);
}
static void
static gboolean
real_set_title (NautilusWindow *window, const char *title)
{
gboolean changed;
EEL_CALL_PARENT (NAUTILUS_WINDOW_CLASS,
set_title, (window, title));
if (title[0] == '\0') {
changed = EEL_CALL_PARENT_WITH_RETURN_VALUE
(NAUTILUS_WINDOW_CLASS, set_title, (window, title));
if (changed && title[0] == '\0') {
gtk_window_set_title (GTK_WINDOW (window), _("Nautilus"));
} else {
} else if (changed) {
char *window_title;
window_title = eel_str_middle_truncate (title, MAX_TITLE_LENGTH);
gtk_window_set_title (GTK_WINDOW (window), window_title);
g_free (window_title);
}
return changed;
}
static void

View file

@ -1095,25 +1095,38 @@ nautilus_window_get_title (NautilusWindow *window)
get_title, (window));
}
static void
static gboolean
real_set_title (NautilusWindow *window,
const char *title)
{
gboolean changed;
char *copy;
g_free (window->details->title);
window->details->title = g_strdup (title);
changed = FALSE;
if (eel_strcmp (title, window->details->title) != 0) {
changed = TRUE;
g_free (window->details->title);
window->details->title = g_strdup (title);
}
if (eel_strlen (window->details->title) > 0 && window->current_location_bookmark &&
nautilus_bookmark_set_name (window->current_location_bookmark, window->details->title)) {
changed = TRUE;
/* Name of item in history list changed, tell listeners. */
nautilus_send_history_list_changed ();
}
copy = g_strdup (window->details->title);
g_signal_emit_by_name (window, "title_changed",
copy);
g_free (copy);
if (changed) {
copy = g_strdup (window->details->title);
g_signal_emit_by_name (window, "title_changed",
copy);
g_free (copy);
}
return changed;
}
/* Sets window->details->title, and the actual GtkWindow title which
@ -1124,11 +1137,6 @@ nautilus_window_set_title (NautilusWindow *window,
{
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
if (window->details->title != NULL
&& strcmp (title, window->details->title) == 0) {
return;
}
EEL_CALL_METHOD (NAUTILUS_WINDOW_CLASS, window,
set_title, (window, title));

View file

@ -67,7 +67,7 @@ typedef struct {
void (* add_current_location_to_history_list) (NautilusWindow *window);
char * (* get_title) (NautilusWindow *window);
void (* set_title) (NautilusWindow *window, const char *title);
gboolean (* set_title) (NautilusWindow *window, const char *title);
char * (* get_icon_name) (NautilusWindow *window);
void (* load_view_as_menu) (NautilusWindow *window);