After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 619856 - Add support for using the GNOME proxy settings
Add support for using the GNOME proxy settings
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-05-27 18:04 UTC by Iain Lane
Modified: 2010-06-08 15:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add support for using the GNOME proxy settings (8.90 KB, patch)
2010-05-27 18:04 UTC, Iain Lane
needs-work Details | Review
Add support for using the GNOME proxy settings (8.48 KB, patch)
2010-05-28 21:21 UTC, Iain Lane
committed Details | Review

Description Iain Lane 2010-05-27 18:04:49 UTC
I added support for reading the GNOME proxy settings from GConf. This is tested to work reasonably reliably on my local setup. Please check in particular that the way I have called the new class is reasonable, and that the callback function that I added to GConfConfigurationClient is sensible.

Cheers.
Comment 1 Iain Lane 2010-05-27 18:04:51 UTC
Created attachment 162136 [details] [review]
Add support for using the GNOME proxy settings

Read GNOME's proxy settings from GConf and use them to make HTTP
requests. Unfortunately there doesn't seem to be a way to parse PAC
(autoconfig) files, so these aren't supported.
Comment 2 Gabriel Burt 2010-05-28 16:49:26 UTC
Review of attachment 162136 [details] [review]:

Thanks, Iain!  This looks really good.  Just a few nitpicks:

::: src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GConfProxy.cs
@@ +52,3 @@
+        public GConfProxy ()
+        {
+

remove this blank line

@@ +67,3 @@
+        }
+
+        private void OnProxyChanged(object sender, GConf.NotifyEventArgs args)

Please put a space between method names and the ( in method invocations.

::: src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GnomeService.cs
@@ +43,3 @@
         }
 
+        internal GConfProxy GConf {

Is this property used anywhere?  If not, remove it, if so, should probably rename it to Proxy or something similar
Comment 3 Gabriel Burt 2010-05-28 16:52:08 UTC
I'd thought Mono automatically respected the user's proxy settings - I guess that's not right?
Comment 4 Aaron Bockover 2010-05-28 18:32:31 UTC
Mono respects proxy settings that are properly exported into the user's environment. I'm not sure why GNOME is not doing this...
Comment 5 Aaron Bockover 2010-05-28 18:38:12 UTC
In any regard, this patch looks OK to me, and I think we need the same in MeeGo. I'm ok with this going in pending the minor syntax issues Gabriel pointed out (no space before method calls is the main problem I see).

Also, my nitpicks:

+using Banshee.Configuration;
+using Hyena;
+using System;
+using System.Net;

We tend to group imports by what's provided by Mono/.NET first, then more general namespaces/extenal (Hyena), and then Banshee-specific namespaces, with newlines in-between groups. So I'd prefer:

+using System;
+using System.Net;
+
+using Hyena;
+
+using Banshee.Configuration;

Also, please drop the (c) from your copyright declaration. It doesn't do anything :)
Comment 6 Iain Lane 2010-05-28 21:21:27 UTC
Created attachment 162240 [details] [review]
Add support for using the GNOME proxy settings

Read GNOME's proxy settings from GConf and use them to make HTTP
requests. Unfortunately there doesn't seem to be a way to parse PAC
(autoconfig) files, so these aren't supported.
Comment 7 Iain Lane 2010-05-28 21:24:40 UTC
There's a new one, thanks for your reviews! I hope it's alright now.

Aaron, it seems like almost all of the other files contain (C) too, but I dropped it at your request. :)
Comment 8 Iain Lane 2010-05-28 21:27:37 UTC
And yes, setting the environment up correctly is something GNOME should be doing. I spoke to mvo a bit about this, and there are concerns that it is less dynamic or something. But it doesn't seem sensible for every app to have to have code like this. There was an upstream bug somewhere that I could try to dig up.
Comment 9 Aaron Bockover 2010-05-28 21:46:15 UTC
Oh, true, there are a lot of (C), but that's something I've just been trying to change. I appreciate your attention to the details there. /me obsessed with style.

As for the data not being exported from gconf to the proper env variables, I'm sure a lot of back and forth can happen on that subject. But there's no way for Mono, as a platform agnostic piece to know about what isn't exported in the expected ways. Hence, your patch.

What should happen though, is that to the best of the platform's ability (GNOME), its proxy settings should be exported to the right environment variables. This is a "better than nothing" approach. I appreciate the intricacies that exist in it not being perfect though.

Luckily, Banshee is designed to integrate with various platforms. And therefore, your patch is very appreciated, and easily drops in.

I will merge this. It looks like a solid usable start. Many thanks.
Comment 10 Aaron Bockover 2010-05-28 21:57:06 UTC
Merged to master.

http://git.gnome.org/browse/banshee/commit/?id=ebb43a8a21bd8bcf37b4b9b5881cbfbf49e57887

Thanks!