Merge lp:~rodrigo-moya/libubuntuone/use-proxy-settings into lp:libubuntuone

Proposed by Rodrigo Moya
Status: Merged
Approved by: Rodrigo Moya
Approved revision: 70
Merged at revision: not available
Proposed branch: lp:~rodrigo-moya/libubuntuone/use-proxy-settings
Merge into: lp:libubuntuone
Diff against target: 63 lines (+8/-5)
2 files modified
configure.ac (+1/-1)
libubuntuone/u1-music-store.c (+7/-4)
To merge this branch: bzr merge lp:~rodrigo-moya/libubuntuone/use-proxy-settings
Reviewer Review Type Date Requested Status
Tim Cole (community) Approve
Review via email: mp+21920@code.launchpad.net

Commit message

Use GNOME proxy settings via libsoup

Description of the change

Use GNOME proxy settings via libsoup

To post a comment you must log in.
70. By Rodrigo Moya

Merge from trunk

Revision history for this message
Tim Cole (tcole) :
review: Approve
Revision history for this message
Tim Cole (tcole) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2010-03-22 09:04:20 +0000
3+++ configure.ac 2010-03-23 12:21:33 +0000
4@@ -30,7 +30,7 @@
5 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
6
7 dnl Look for needed modules
8-PKG_CHECK_MODULES(LIBUBUNTUONE, webkit-1.0 >= 1.1.15 gnome-keyring-1 dbus-glib-1 gconf-2.0 libxml-2.0)
9+PKG_CHECK_MODULES(LIBUBUNTUONE, webkit-1.0 >= 1.1.15 gnome-keyring-1 dbus-glib-1 gconf-2.0 libxml-2.0 libsoup-gnome-2.4)
10 AC_SUBST(LIBUBUNTUONE_CFLAGS)
11 AC_SUBST(LIBUBUNTUONE_LIBS)
12
13
14=== modified file 'libubuntuone/u1-music-store.c'
15--- libubuntuone/u1-music-store.c 2010-03-23 11:12:18 +0000
16+++ libubuntuone/u1-music-store.c 2010-03-23 12:21:33 +0000
17@@ -24,6 +24,7 @@
18 #include <libxml/HTMLparser.h>
19 #include <webkit/webkit.h>
20 #include <dbus/dbus-glib.h>
21+#include <libsoup/soup-gnome-features.h>
22 #include <gnome-keyring.h>
23 #include "oauth.h"
24 #include "u1-music-store.h"
25@@ -159,9 +160,10 @@
26
27
28 static void
29-load_internal_html_page (WebKitWebView *web_view, const gchar *file_name, gchar *reload_url)
30+load_internal_html_page (WebKitWebView *web_view, const gchar *file_name, const gchar *reload_url)
31 {
32 gchar *calculated_file_path, *calculated_file_url, *calculated_file_url_noreload;
33+
34 calculated_file_path = g_build_path ("/", U1_JAVASCRIPT_DIR, file_name, NULL);
35 if (reload_url == NULL) {
36 calculated_file_url = g_filename_to_uri (calculated_file_path, NULL, NULL);
37@@ -674,7 +676,7 @@
38 load_error_cb (WebKitWebView *web_view, WebKitWebFrame *frame, const gchar *uri, GError *error, gpointer user_data)
39 {
40 U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
41- load_internal_html_page(web_view, U1_DEFAULT_ERROR_PAGE, uri);
42+ load_internal_html_page (web_view, U1_DEFAULT_ERROR_PAGE, uri);
43
44 return TRUE;
45 }
46@@ -801,14 +803,15 @@
47 new_user_agent = g_strdup_printf ("%s U1MusicStore/" VERSION ,
48 webkit_web_settings_get_user_agent (
49 webkit_web_view_get_settings (WEBKIT_WEB_VIEW (music_store->priv->web_viewer))));
50-
51 g_object_set (G_OBJECT (webkit_web_view_get_settings (WEBKIT_WEB_VIEW (music_store->priv->web_viewer))),
52 "user-agent", new_user_agent,
53 "enable-default-context-menu", g_getenv ("U1SHOWCONTEXTMENU") != NULL,
54 NULL);
55-
56 g_free(new_user_agent);
57
58+ /* Use GNOME proxy settings */
59+ soup_session_add_feature_by_type (webkit_get_default_session (), SOUP_TYPE_PROXY_RESOLVER_GNOME);
60+
61 g_signal_connect (G_OBJECT (music_store->priv->web_viewer), "load-finished",
62 G_CALLBACK (load_finished_cb), music_store);
63 g_signal_connect (G_OBJECT (music_store->priv->web_viewer), "status-bar-text-changed",

Subscribers

People subscribed via source and target branches