Merge lp:~ken-vandine/software-center/lp_982567 into lp:software-center

Proposed by Ken VanDine
Status: Merged
Merged at revision: 3003
Proposed branch: lp:~ken-vandine/software-center/lp_982567
Merge into: lp:software-center
Diff against target: 26 lines (+12/-4)
1 file modified
softwarecenter/utils.py (+12/-4)
To merge this branch: bzr merge lp:~ken-vandine/software-center/lp_982567
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Ken VanDine Needs Resubmitting
Review via email: mp+105279@code.launchpad.net

Description of the change

Check if the proxy is enabled, if the proxy host is set but not enabled we shouldn't attempt to use the proxy (LP: #982567)

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Hey Ken, thanks a lot for your branch!

It looks fine, except that I was told that the "enabled" key is actually deprecated, i.e. dconf-editor
shows me:
Summary: Unused; ignore
Description: This key is not used; HTTP proxying is enabled when the host key is non-empty and the port is non-0.

So I wonder what s-c should do, my assumption was to follow the suggestion in dconf-editor and ignore it, but
the bugreport indicates this leads to other problems. Now I'm not sure in what situations s-c should honor it and
in which it should not. Especially since it appears that the new gnome-control-center is not actually using it
anymore.

review: Needs Information
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Oh, interesting. So gnome-control-center seems to be changing the value of org.gnome.system.proxy.mode to "none" if the proxy id disabled, I'll resubmit.

Revision history for this message
Ken VanDine (ken-vandine) wrote :

org.gnome.system.proxy.http.enabled is actually ignored, the proper key to check is actually org.gnome.system.proxy.mode (LP: #982567)

review: Needs Resubmitting
3002. By Ken VanDine

org.gnome.system.proxy.http.enabled is actually ignored, the proper key to check is actually org.gnome.system.proxy.mode (LP: #982567)

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks Ken for this update!

This looks good and works fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/utils.py'
2--- softwarecenter/utils.py 2012-04-25 08:19:42 +0000
3+++ softwarecenter/utils.py 2012-05-10 19:44:19 +0000
4@@ -241,10 +241,18 @@
5 """
6 # check if this is actually available and usable. if not
7 # well ... it segfaults (thanks pygi)
8- key = "org.gnome.system.proxy.http"
9- if not key in Gio.Settings.list_schemas():
10- raise ValueError("no key '%s'" % key)
11- settings = Gio.Settings.new(key)
12+ schemas = ["org.gnome.system.proxy", "org.gnome.system.proxy.http"]
13+ for schema in schemas:
14+ if not schema in Gio.Settings.list_schemas():
15+ raise ValueError("no schema '%s'" % schema)
16+
17+ # Check to see if proxy mode is set to none before checking for host
18+ psettings = Gio.Settings.new("org.gnome.system.proxy");
19+ if "none" in psettings.get_string("mode"):
20+ return None
21+
22+ # If proxy mode isn't "none" check to see if host and port is set
23+ settings = Gio.Settings.new("org.gnome.system.proxy.http")
24 if settings.get_string("host"):
25 authentication = ""
26 if settings.get_boolean("use-authentication"):