[nautilus] Don't print an example when there are no valid schemas
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Don't print an example when there are no valid schemas
- Date: Mon, 17 Sep 2012 14:22:25 +0000 (UTC)
commit d0fbf0d791e9bee266021d8b7a107ab581c39d18
Author: William Jon McCann <jmccann redhat com>
Date: Mon Sep 17 10:00:10 2012 -0400
Don't print an example when there are no valid schemas
https://bugzilla.gnome.org/show_bug.cgi?id=684217
src/nautilus-connect-server-dialog.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/src/nautilus-connect-server-dialog.c b/src/nautilus-connect-server-dialog.c
index 21a88b1..da94d40 100644
--- a/src/nautilus-connect-server-dialog.c
+++ b/src/nautilus-connect-server-dialog.c
@@ -168,7 +168,7 @@ on_uri_entry_clear (GtkEntry *entry,
}
static const char *
-get_default_scheme (NautilusConnectServerDialog *dialog)
+get_default_schema (NautilusConnectServerDialog *dialog)
{
if (dialog->details->supported == NULL) {
return NULL;
@@ -256,11 +256,17 @@ reset_example_label (NautilusConnectServerDialog *dialog)
{
char *text;
char *uri;
+ const char *schema;
- uri = g_strdup_printf ("%s://foo.example.com", get_default_scheme (dialog));
- /* Translators: %s is a URI of the form "smb://foo.example.com" */
- text = g_strdup_printf (_("For example, %s"), uri);
- g_free (uri);
+ schema = get_default_schema (dialog);
+ if (schema != NULL) {
+ uri = g_strdup_printf ("%s://foo.example.org", schema);
+ /* Translators: %s is a URI of the form "smb://foo.example.com" */
+ text = g_strdup_printf (_("For example, %s"), uri);
+ g_free (uri);
+ } else {
+ text = g_strdup ("");
+ }
gtk_label_set_text (GTK_LABEL (dialog->details->error_label), text);
g_free (text);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]