[nautilus] Don't try to change the window icon when the view changes
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Don't try to change the window icon when the view changes
- Date: Sun, 26 Aug 2012 13:06:53 +0000 (UTC)
commit e479c004f9c8d95588954ea316f7bcb471a68d2d
Author: William Jon McCann <jmccann redhat com>
Date: Sat Aug 25 12:37:53 2012 -0400
Don't try to change the window icon when the view changes
This avoids problems with using symbolic icons in the window titles
and with icons not updating.
https://bugzilla.gnome.org/show_bug.cgi?id=652212
src/nautilus-window-manage-views.c | 4 +--
src/nautilus-window-slot.c | 41 ------------------------------------
src/nautilus-window-slot.h | 1 -
src/nautilus-window.c | 2 +-
4 files changed, 2 insertions(+), 46 deletions(-)
---
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index 6db4598..57a8bc8 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -345,12 +345,11 @@ viewed_file_changed_callback (NautilusFile *file,
}
} else {
/* TODO?
- * why do we update title & icon at all in this case? */
+ * why do we update title at all in this case? */
g_object_unref (new_location);
}
nautilus_window_slot_update_title (slot);
- nautilus_window_slot_update_icon (slot);
}
}
@@ -1479,7 +1478,6 @@ update_for_new_location (NautilusWindowSlot *slot)
}
nautilus_window_slot_update_title (slot);
- nautilus_window_slot_update_icon (slot);
if (slot == slot->window->details->active_slot) {
nautilus_window_sync_location_widgets (slot->window);
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index ecf1deb..def4fe9 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -507,47 +507,6 @@ nautilus_window_slot_update_title (NautilusWindowSlot *slot)
}
}
-/* nautilus_window_slot_update_icon:
- *
- * Re-calculate the slot icon
- * Called when the location or view or icon set has changed.
- * @slot: The NautilusWindowSlot in question.
- */
-void
-nautilus_window_slot_update_icon (NautilusWindowSlot *slot)
-{
- NautilusWindow *window;
- NautilusIconInfo *info;
- const char *icon_name;
- GdkPixbuf *pixbuf;
-
- window = nautilus_window_slot_get_window (slot);
- info = NAUTILUS_WINDOW_CLASS (G_OBJECT_GET_CLASS (window))->get_icon (window, slot);
-
- icon_name = NULL;
- if (info) {
- icon_name = nautilus_icon_info_get_used_name (info);
- if (icon_name != NULL) {
- /* Gtk+ doesn't short circuit this (yet), so avoid lots of work
- * if we're setting to the same icon. This happens a lot e.g. when
- * the trash directory changes due to the file count changing.
- */
- if (g_strcmp0 (icon_name, gtk_window_get_icon_name (GTK_WINDOW (window))) != 0) {
- gtk_window_set_icon_name (GTK_WINDOW (window), icon_name);
- }
- } else {
- pixbuf = nautilus_icon_info_get_pixbuf_nodefault (info);
-
- if (pixbuf) {
- gtk_window_set_icon (GTK_WINDOW (window), pixbuf);
- g_object_unref (pixbuf);
- }
- }
-
- g_object_unref (info);
- }
-}
-
void
nautilus_window_slot_set_content_view_widget (NautilusWindowSlot *slot,
NautilusView *new_view)
diff --git a/src/nautilus-window-slot.h b/src/nautilus-window-slot.h
index 8be2f8c..b55a419 100644
--- a/src/nautilus-window-slot.h
+++ b/src/nautilus-window-slot.h
@@ -123,7 +123,6 @@ GType nautilus_window_slot_get_type (void);
NautilusWindowSlot * nautilus_window_slot_new (NautilusWindow *window);
void nautilus_window_slot_update_title (NautilusWindowSlot *slot);
-void nautilus_window_slot_update_icon (NautilusWindowSlot *slot);
void nautilus_window_slot_set_query_editor_visible (NautilusWindowSlot *slot,
gboolean visible);
gboolean nautilus_window_slot_handle_event (NautilusWindowSlot *slot,
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 89b1738..a2497f9 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1235,7 +1235,6 @@ nautilus_window_view_visible (NautilusWindow *window,
slot = l->data;
nautilus_window_slot_update_title (slot);
- nautilus_window_slot_update_icon (slot);
}
nautilus_window_grab_focus (window);
@@ -1879,6 +1878,7 @@ nautilus_window_init (NautilusWindow *window)
/* Set initial window title */
gtk_window_set_title (GTK_WINDOW (window), _("Files"));
+ gtk_window_set_icon_name (GTK_WINDOW (window), "system-file-manager");
gtk_window_set_hide_titlebar_when_maximized (GTK_WINDOW (window), TRUE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]