diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-08-22 00:37:48 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-08-22 00:37:48 +0800 |
commit | 84e30dab1428affe335ef904377d07f8b5fdeb66 (patch) | |
tree | fee9c8ec124a2b5804f6bb4ee31772db56a6e374 /libempathy-gtk/empathy-ui-utils.c | |
parent | fd8e9c5dc2584055177c7a79021cdd53ca431c22 (diff) | |
parent | 3803736b4326d4bc00d58ccd25f910907f0b4521 (diff) | |
download | gsoc2013-empathy-84e30dab1428affe335ef904377d07f8b5fdeb66.tar gsoc2013-empathy-84e30dab1428affe335ef904377d07f8b5fdeb66.tar.gz gsoc2013-empathy-84e30dab1428affe335ef904377d07f8b5fdeb66.tar.bz2 gsoc2013-empathy-84e30dab1428affe335ef904377d07f8b5fdeb66.tar.lz gsoc2013-empathy-84e30dab1428affe335ef904377d07f8b5fdeb66.tar.xz gsoc2013-empathy-84e30dab1428affe335ef904377d07f8b5fdeb66.tar.zst gsoc2013-empathy-84e30dab1428affe335ef904377d07f8b5fdeb66.zip |
Merge back from master
Diffstat (limited to 'libempathy-gtk/empathy-ui-utils.c')
-rw-r--r-- | libempathy-gtk/empathy-ui-utils.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c index 3dcefdcfb..c12cbd1c9 100644 --- a/libempathy-gtk/empathy-ui-utils.c +++ b/libempathy-gtk/empathy-ui-utils.c @@ -1321,20 +1321,26 @@ empathy_get_toplevel_window (GtkWidget *widget) return NULL; } -/* The URL opening code can't handle schemeless strings, so we try to be +/** empathy_make_absolute_url: + * @url: an url + * + * The URL opening code can't handle schemeless strings, so we try to be * smart and add http if there is no scheme or doesn't look like a mail * address. This should work in most cases, and let us click on strings * like "www.gnome.org". + * + * Returns: a newly allocated url with proper mailto: or http:// prefix, use + * g_free when your are done with it */ -static gchar * -fixup_url (const gchar *url) +gchar * +empathy_make_absolute_url (const gchar *url) { g_return_val_if_fail (url != NULL, NULL); if (g_str_has_prefix (url, "ghelp:") || g_str_has_prefix (url, "mailto:") || strstr (url, ":/")) { - return NULL; + return g_strdup (url); } if (strstr (url, "@")) { @@ -1354,12 +1360,9 @@ empathy_url_show (GtkWidget *parent, g_return_if_fail (parent == NULL || GTK_IS_WIDGET (parent)); g_return_if_fail (url != NULL); - real_url = fixup_url (url); - if (real_url) { - url = real_url; - } + real_url = empathy_make_absolute_url (url); - gtk_show_uri (parent ? gtk_widget_get_screen (parent) : NULL, url, + gtk_show_uri (parent ? gtk_widget_get_screen (parent) : NULL, real_url, gtk_get_current_event_time (), &error); if (error) { @@ -1476,6 +1479,8 @@ empathy_send_file_with_file_chooser (EmpathyContact *contact) gtk_dialog_set_default_response (GTK_DIALOG (widget), GTK_RESPONSE_OK); + gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (widget), FALSE); + g_signal_connect (widget, "response", G_CALLBACK (file_manager_send_file_response_cb), contact); |