Josselin Mouette wrote:
Le jeudi 01 mars 2007 à 20:10 +0100, Adrien DELLE CAVE a écrit :
Package: nautilus
Version: 2.14.3-9
Severity: wishlist
Description: A patch for added the current location in title bar.
It is useful for somebody to know the path of current location
when there are many nautilus' windows.
I see a few problems with your patch.
1. There is a memory leak as the "title" you are allocating is not
freed.
2. It doesn't change the behavior for spatial windows, for which
this change would be the most useful.
3. I also don't know if it's wise to make it the default. I think
we shouldn't make it such before having upstream's advice.
I'll see if I can update it, but I'm short on time and not much
interested in this issue, so it would be nice if you could provide an
updated patch.
Thanks,
Thanks for your reply, I have modify the patch.
Now, the feature is apply in spatial mode too.
Thanks,
--
Adrien DELLE CAVE
Proformatique - 67 rue Voltaire - 92800 Puteaux
Tel. : 01 41 38 99 60 - Fax. : 01 41 38 99 70
[EMAIL PROTECTED] - http://www.proformatique.com/
Index: nautilus-2.14.3/debian/changelog
===================================================================
--- nautilus-2.14.3.orig/debian/changelog 2007-03-02 11:39:25.000000000 +0100
+++ nautilus-2.14.3/debian/changelog 2007-03-02 11:33:39.000000000 +0100
@@ -1,3 +1,9 @@
+nautilus (2.14.3-9.pf.1) unstable; urgency=low
+
+ * Added patch to display current location in title bar.
+
+ -- Adrien DELLE CAVE (Decryptus) <[EMAIL PROTECTED]> Fri, 2 Mar 2007 11:33:39 +0100
+
nautilus (2.14.3-9) unstable; urgency=medium
* 07_desktop_file_activation.patch:
Index: nautilus-2.14.3/debian/patches/88_location-in-title-bar.patch
===================================================================
--- nautilus-2.14.3.orig/debian/patches/88_location-in-title-bar.patch 1970-01-01 01:00:00.000000000 +0100
+++ nautilus-2.14.3/debian/patches/88_location-in-title-bar.patch 2007-03-02 11:33:29.000000000 +0100
@@ -0,0 +1,128 @@
+Index: nautilus-2.14.3/libnautilus-private/apps_nautilus_preferences.schemas.in
+===================================================================
+--- nautilus-2.14.3.orig/libnautilus-private/apps_nautilus_preferences.schemas.in 2007-03-02 09:33:14.000000000 +0100
++++ nautilus-2.14.3/libnautilus-private/apps_nautilus_preferences.schemas.in 2007-03-02 09:44:25.000000000 +0100
+@@ -704,6 +704,21 @@
+ </locale>
+ </schema>
+
++ <schema>
++ <key>/schemas/apps/nautilus/preferences/location_in_title_bar</key>
++ <applyto>/apps/nautilus/preferences/location_in_title_bar</applyto>
++ <owner>nautilus</owner>
++ <type>bool</type>
++ <default>true</default>
++ <locale name="C">
++ <short>Show current location in title bar</short>
++ <long>
++ If set to true, newly opened windows will have location
++ in title bar.
++ </long>
++ </locale>
++ </schema>
++
+ <schema>
+ <key>/schemas/apps/nautilus/preferences/start_with_sidebar</key>
+ <applyto>/apps/nautilus/preferences/start_with_sidebar</applyto>
+Index: nautilus-2.14.3/libnautilus-private/nautilus-global-preferences.c
+===================================================================
+--- nautilus-2.14.3.orig/libnautilus-private/nautilus-global-preferences.c 2007-03-02 09:33:14.000000000 +0100
++++ nautilus-2.14.3/libnautilus-private/nautilus-global-preferences.c 2007-03-02 09:42:09.000000000 +0100
+@@ -376,6 +376,10 @@
+ PREFERENCE_BOOLEAN,
+ GINT_TO_POINTER (TRUE)
+ },
++ { NAUTILUS_PREFERENCES_LOCATION_IN_TITLE_BAR,
++ PREFERENCE_BOOLEAN,
++ GINT_TO_POINTER (TRUE)
++ },
+ { NAUTILUS_PREFERENCES_START_WITH_SIDEBAR,
+ PREFERENCE_BOOLEAN,
+ GINT_TO_POINTER (TRUE)
+Index: nautilus-2.14.3/libnautilus-private/nautilus-global-preferences.h
+===================================================================
+--- nautilus-2.14.3.orig/libnautilus-private/nautilus-global-preferences.h 2007-03-02 09:33:14.000000000 +0100
++++ nautilus-2.14.3/libnautilus-private/nautilus-global-preferences.h 2007-03-02 09:41:36.000000000 +0100
+@@ -84,6 +84,7 @@
+ #define NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR "preferences/start_with_location_bar"
+ #define NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY "preferences/always_use_location_entry"
+ #define NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR "preferences/start_with_status_bar"
++#define NAUTILUS_PREFERENCES_LOCATION_IN_TITLE_BAR "preferences/location_in_title_bar"
+ #define NAUTILUS_PREFERENCES_START_WITH_SIDEBAR "preferences/start_with_sidebar"
+ #define NAUTILUS_PREFERENCES_START_WITH_TOOLBAR "preferences/start_with_toolbar"
+ #define NAUTILUS_PREFERENCES_SIDE_PANE_VIEW "preferences/side_pane_view"
+Index: nautilus-2.14.3/src/nautilus-navigation-window.c
+===================================================================
+--- nautilus-2.14.3.orig/src/nautilus-navigation-window.c 2007-03-02 09:33:13.000000000 +0100
++++ nautilus-2.14.3/src/nautilus-navigation-window.c 2007-03-02 10:54:37.000000000 +0100
+@@ -813,20 +813,36 @@
+ static gboolean
+ real_set_title (NautilusWindow *window, const char *title)
+ {
+- char *full_title;
+- char *window_title;
+ gboolean changed;
+
+ 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);
++ char *full_title;
++ char *window_title;
++ char *new_title;
++ char *uri;
++ char *location;
++
++ if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_LOCATION_IN_TITLE_BAR) &&
++ (uri = nautilus_window_get_location (NAUTILUS_WINDOW (window))) != NULL &&
++ (location = gnome_vfs_format_uri_for_display(uri)) != NULL) {
++ new_title = g_strdup_printf("%s (%s)",title,location);
++ g_free (location);
++ }
++ else {
++ new_title = g_strdup(title);
++ }
++
++ full_title = g_strdup_printf (_("%s - File Browser"), new_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);
++ g_free (new_title);
++ g_free (uri);
+ }
+
+ return changed;
+Index: nautilus-2.14.3/src/nautilus-spatial-window.c
+===================================================================
+--- nautilus-2.14.3.orig/src/nautilus-spatial-window.c 2007-03-02 09:33:13.000000000 +0100
++++ nautilus-2.14.3/src/nautilus-spatial-window.c 2007-03-02 10:52:52.000000000 +0100
+@@ -406,10 +406,25 @@
+ gtk_window_set_title (GTK_WINDOW (window), _("Nautilus"));
+ } else if (changed) {
+ char *window_title;
++ char *new_title;
++ char *uri;
++ char *location;
++
++ if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_LOCATION_IN_TITLE_BAR) &&
++ (uri = nautilus_window_get_location (NAUTILUS_WINDOW (window))) != NULL &&
++ (location = gnome_vfs_format_uri_for_display(uri)) != NULL) {
++ new_title = g_strdup_printf("%s (%s)",title,location);
++ g_free (location);
++ }
++ else {
++ new_title = g_strdup(title);
++ }
+
+- window_title = eel_str_middle_truncate (title, MAX_TITLE_LENGTH);
++ window_title = eel_str_middle_truncate (new_title, MAX_TITLE_LENGTH);
+ gtk_window_set_title (GTK_WINDOW (window), window_title);
+ g_free (window_title);
++ g_free (new_title);
++ g_free (uri);
+ }
+
+ return changed;