Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

make optionsmodel query real proxy state for ::data() #1899

Merged
merged 1 commit into from

6 participants

@Diapolo
  • don't rely on the QSettings for cases ProxyUse and ProxySocksVersion and query the real values via the GetProxy() call
  • add a missing "succesful =" for case ProxyUse in ::setData()

This is based on #1859!

@TheBlueMatt

See-also: TheBlueMatt@22e96a1 which was the first commit in #1453

@laanwj
Owner

@TheBlueMatt why is that part of the windows upgrader pull? :)

@TheBlueMatt

Because there was discussion of the proxy stuff in that pull, so I coded it while I was on that branch...probably should have been separate, but...meh

@Diapolo

@TheBlueMatt I didn't know that you had worked on that part, sorry. Apart from that I think my pull is smoother in the end, as we don't need a GetProxySocksVersion() function, which is the result from a discussion with @sipa and @laanwj.

I'm currently trying to overhaul the whole proxy stuff in the core and afterwards want to extend the Qt proxy / networking options with it.

Btw. funny thing is, that the starting point for my work on that part was your issue that we miss a lock for proxy structures :-D.

@TheBlueMatt

No big deal, I just found it funny since IIRC that proxy stuff that I wrote was a result of a discussion with you on the auto-update thread.

@Diapolo

I have to admit I did not have that in my mind anymore :-/, sorry. But I want to support you, to get that Windows update stuff in before 0.8. I hope this proxy stuff get's in soon (unsure about 0.7.1 though), so you don't need to rebase too often as some other code parts that are touched by your pull have changed already.

The more time I'm working on Bitcoin-Qt and with other devs the more insight I get, which leads to question former views I had on certain pulls / ideas :).

@laanwj
Owner

@Diapolo yes we really need your help as windows dev to get that windows auto-updating stuff in :) Personally, I think that's more urgent than perfecting the settings dialog.

@Diapolo

@laanwj The current proxy related pulls are not there, only because I have some GUI ideas in my mind, they make proxy usage better and extend it with nice new stuff + fix the missing lock.

@TheBlueMatt As you opened the proxy lock issue, can you perhaps take a look at the code and ACK or give a short feedback? Can you rebase your Windows-update pull to current master or (if you want to) onto this one? I'll then try that whole stuff out in the following days :).

Edit: Btw., is the Pull tester offline?

@sipa
Owner

Didn't test, but ACK on changes to core.

@TheBlueMatt

@Diapolo Ill look at this in the next few days, and...not sure when Ill get around to updating the auto-update stuff... re: pull-tester, dont think so, but it seems like the jenkins server has mysteriously slowed down even more recently...not sure whats up with that (I chose to blame dnsseed, but I havent looked into it, so I cant blame @sipa for that)...Ive got some new hardware I may be able to throw into the mix, though, if I get the time to set up some sync mechanism...

@BitcoinPullTester

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/63275485658818fa52ae5245e9a5dfd7f87ee84c for binaries and test log.

@Diapolo Diapolo make optionsmodel query real proxy state for ::data()
- don't rely on the QSettings for cases ProxyUse and ProxySocksVersion and
  query the real values via the GetProxy() call
- add a missing "succesful =" for case ProxyUse in ::setData()
5e5c102
@BitcoinPullTester

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/5e5c102f2f901a19fda6ff877ab4195a88e4b703 for binaries and test log.

@sipa sipa merged commit e74d0ab into bitcoin:master
@luke-jr

Any reason this is a fixed value of 5 instead of nSocksVersion setting?

Because SOCKS5 is default, take a look above. The same syntax was used before for port or IP.

@luke-jr

Is this a bug fix, or a behaviour change?

It harmonizes the behaviour with what was there...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 7, 2012
  1. @Diapolo

    make optionsmodel query real proxy state for ::data()

    Diapolo authored
    - don't rely on the QSettings for cases ProxyUse and ProxySocksVersion and
      query the real values via the GetProxy() call
    - add a missing "succesful =" for case ProxyUse in ::setData()
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 5 deletions.
  1. +12 −5 src/qt/optionsmodel.cpp
View
17 src/qt/optionsmodel.cpp
@@ -142,8 +142,10 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
return settings.value("fUseUPnP", GetBoolArg("-upnp", true));
case MinimizeOnClose:
return QVariant(fMinimizeOnClose);
- case ProxyUse:
- return settings.value("fUseProxy", false);
+ case ProxyUse: {
+ proxyType proxy;
+ return QVariant(GetProxy(NET_IPV4, proxy));
+ }
case ProxyIP: {
proxyType proxy;
if (GetProxy(NET_IPV4, proxy))
@@ -158,8 +160,13 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
else
return QVariant(9050);
}
- case ProxySocksVersion:
- return settings.value("nSocksVersion", 5);
+ case ProxySocksVersion: {
+ proxyType proxy;
+ if (GetProxy(NET_IPV4, proxy))
+ return QVariant(proxy.second);
+ else
+ return QVariant(5);
+ }
case Fee:
return QVariant(nTransactionFee);
case DisplayUnit:
@@ -203,7 +210,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
break;
case ProxyUse:
settings.setValue("fUseProxy", value.toBool());
- ApplyProxySettings();
+ successful = ApplyProxySettings();
break;
case ProxyIP: {
proxyType proxy;
Something went wrong with that request. Please try again.