[Xfce4-commits] <gigolo:master> Fix displayed URI/bookmark name in the mount progress dialog

Enrico Tröger noreply at xfce.org
Sat Jul 31 15:48:01 CEST 2010


Updating branch refs/heads/master
         to f464a768880db0976b0f411d76cd60239055993c (commit)
       from 20420e53a50e643ff88c382bd6209d26c73f532f (commit)

commit f464a768880db0976b0f411d76cd60239055993c
Author: Enrico Tröger <enrico at xfce.org>
Date:   Sat Jul 31 15:07:57 2010 +0200

    Fix displayed URI/bookmark name in the mount progress dialog

 src/bookmarkeditdialog.c |    2 +-
 src/common.h             |    3 +++
 src/window.c             |    6 +++++-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/bookmarkeditdialog.c b/src/bookmarkeditdialog.c
index 5cbeebb..3c0e1e7 100644
--- a/src/bookmarkeditdialog.c
+++ b/src/bookmarkeditdialog.c
@@ -765,7 +765,7 @@ static void update_bookmark(GigoloBookmarkEditDialog *dialog)
 	if (*tmp)	/* the name might be empty if the dialog is used as a Connect dialog */
 		gigolo_bookmark_set_name(priv->bookmark_update, tmp);
 	else
-		gigolo_bookmark_set_name(priv->bookmark_update, "none");
+		gigolo_bookmark_set_name(priv->bookmark_update, GIGOLO_BOOKMARK_NAME_NONE);
 
 	if (idx == -1)
 		idx = 0;
diff --git a/src/common.h b/src/common.h
index 24a4e8e..cd01a4b 100644
--- a/src/common.h
+++ b/src/common.h
@@ -43,6 +43,9 @@ void debug(gchar const *format, ...) G_GNUC_PRINTF (1, 2);
 # define debug(...)
 #endif
 
+#define GIGOLO_BOOKMARK_NAME_NONE "none"
+
+
 void verbose(gchar const *format, ...) G_GNUC_PRINTF (1, 2);
 
 
diff --git a/src/window.c b/src/window.c
index 284e6c6..1dc1944 100644
--- a/src/window.c
+++ b/src/window.c
@@ -250,7 +250,11 @@ void gigolo_window_mount_from_bookmark(GigoloWindow *window, GigoloBookmark *boo
 	if (show_dialog)
 	{
 		const gchar *name = gigolo_bookmark_get_name(bookmark);
-		gchar *label = g_strdup_printf(_("Connecting to \"%s\""), (name != NULL) ? name : uri);
+		gchar *label;
+
+		if (name == NULL || gigolo_str_equal(name, GIGOLO_BOOKMARK_NAME_NONE))
+			name = uri;
+		label = g_strdup_printf(_("Connecting to \"%s\""), name);
 
 		dialog = gigolo_mount_dialog_new(GTK_WINDOW(window), label);
 		gtk_widget_show_all(dialog);



More information about the Xfce4-commits mailing list