no more multithreading; no more fallback

This commit is contained in:
Marc Wäckerlin
2009-12-14 15:30:27 +00:00
parent 0351735d6c
commit 56e2746895
3 changed files with 10 additions and 7 deletions

View File

@@ -18,4 +18,3 @@ make clean && \
./configure && \ ./configure && \
make check && \ make check && \
sudo make install sudo make install

View File

@@ -15,7 +15,7 @@
#include <QtNetwork/QSslError> #include <QtNetwork/QSslError>
#include <QtCore/QTimer> #include <QtCore/QTimer>
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QThread> // #include <QtCore/QThread>
#include <map> #include <map>
#endif #endif
@@ -77,7 +77,8 @@ namespace proxy {
@example test.cxx */ @example test.cxx */
class Interface class Interface
#ifdef QT_NETWORK_LIB #ifdef QT_NETWORK_LIB
: public QThread // : public QThread
: public QObject
#endif #endif
{ {
#ifdef QT_NETWORK_LIB #ifdef QT_NETWORK_LIB
@@ -91,8 +92,8 @@ namespace proxy {
qFatal("connect failed"); qFatal("connect failed");
if (!connect(&_timeout2, SIGNAL(timeout()), SLOT(timeout()))) if (!connect(&_timeout2, SIGNAL(timeout()), SLOT(timeout())))
qFatal("connect failed"); qFatal("connect failed");
if (!connect(this, SIGNAL(finished()), SLOT(threadFinished()))) // if (!connect(this, SIGNAL(finished()), SLOT(threadFinished())))
qFatal("connect failed"); // qFatal("connect failed");
#endif #endif
} }
virtual ~Interface() {} virtual ~Interface() {}
@@ -212,7 +213,10 @@ namespace proxy {
" try autoproxy negotiation"; " try autoproxy negotiation";
_direct = false; _direct = false;
_url = url; _url = url;
start(); // autoproxy detection in own thread /****BUGFIX****/
_proxies = proxies(_url);
threadFinished();
//start(); // autoproxy detection in own thread
} else { } else {
qDebug()<<"No proxy at all, giving up - offline?"; qDebug()<<"No proxy at all, giving up - offline?";
proxyError(QNetworkReply::TimeoutError); proxyError(QNetworkReply::TimeoutError);

View File

@@ -52,6 +52,7 @@ namespace gui {
case 0: try { case 0: try {
_url->setEnabled(false); _url->setEnabled(false);
_port->setEnabled(false); _port->setEnabled(false);
_auto.proxy(_testUrl);
type=QNetworkProxy::NoProxy; type=QNetworkProxy::NoProxy;
} catch (...) {} break; } catch (...) {} break;
case 1: type=QNetworkProxy::HttpProxy; break; case 1: type=QNetworkProxy::HttpProxy; break;
@@ -59,7 +60,6 @@ namespace gui {
} }
QNetworkProxy::setApplicationProxy QNetworkProxy::setApplicationProxy
(QNetworkProxy(type, _url->text(), _port->value())); (QNetworkProxy(type, _url->text(), _port->value()));
_auto.proxy(_testUrl);
} }
Q_SIGNALS: Q_SIGNALS: