diff --git a/configure.in b/configure.in index c95afda..74eccd3 100644 --- a/configure.in +++ b/configure.in @@ -28,22 +28,9 @@ AC_SUBST(MAJOR) AC_SUBST(MINOR) AC_SUBST(LEAST) -case $host in - *darwin*) - PROXYLIB="-lproxy" - ;; - *mingw*|*win*) - PROXYLIB="-lwinhttp" - ;; - *) - PROXYLIB="-lproxy" - ;; -esac -AC_SUBST(PROXYLIB) - # Qt Environment CPPFLAGS+=" -DUNICODE -DQT_NO_DEBUG" -CPPFLAGS+=" -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB" +CPPFLAGS+=" -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_WEBKIT_LIB -DQT_CORE_LIB" AC_CHECK_HEADER(QtCore/QString, [found="yes"], [found="no"]) if test "$found" == "no"; then AC_MSG_CHECKING([looking for qt headers]) @@ -60,21 +47,34 @@ if test "$found" == "no"; then AC_MSG_RESULT([$found]) fi if test "$found" == "no"; then - AC_MSG_ERROR([Qt Headers not found]) + case $host in + *darwin*) + PROXYLIB="-lproxy" + ;; + *mingw*|*win*) + PROXYLIB="-lwinhttp" + ;; + *) + PROXYLIB="-lproxy" + ;; + esac + AC_SUBST(PROXYLIB) + AC_MSG_WARN([Qt Headers not found]) +else + AC_CHECK_PROGS([MOC], [moc-qt4 moc-mac moc]) + test -n "$MOC" || AC_MSG_ERROR([moc for Qt 4 not found!]) + AC_SUBST(MOC) + AC_CHECK_PROGS([UIC], [uic-qt4 uic-mac uic]) + test -n "$UIC" || AC_MSG_ERROR([uic for Qt 4 not found!]) + AC_SUBST(UIC) + AC_CHECK_PROGS([LRELEASE], [lrelease-qt4 lrelease-mac lrelease]) + test -n "$LRELEASE" || AC_MSG_ERROR([lrelease for Qt 4 not found!]) + AC_SUBST(LRELEASE) + AC_CHECK_PROGS([LUPDATE], [lupdate-qt4 lupdate-mac lupdate]) + test -n "$LUPDATE" || AC_MSG_ERROR([lupdate for Qt 4 not found!]) + AC_SUBST(LUPDATE) + AC_ARG_VAR(LUPDATE_ARGS, [arguments for qt lupdate command, e.g. -no-obsolete]) fi -AC_CHECK_PROGS([MOC], [moc-qt4 moc-mac moc]) -test -n "$MOC" || AC_MSG_ERROR([moc for Qt 4 not found!]) -AC_SUBST(MOC) -AC_CHECK_PROGS([UIC], [uic-qt4 uic-mac uic]) -test -n "$UIC" || AC_MSG_ERROR([uic for Qt 4 not found!]) -AC_SUBST(UIC) -AC_CHECK_PROGS([LRELEASE], [lrelease-qt4 lrelease-mac lrelease]) -test -n "$LRELEASE" || AC_MSG_ERROR([lrelease for Qt 4 not found!]) -AC_SUBST(LRELEASE) -AC_CHECK_PROGS([LUPDATE], [lupdate-qt4 lupdate-mac lupdate]) -test -n "$LUPDATE" || AC_MSG_ERROR([lupdate for Qt 4 not found!]) -AC_SUBST(LUPDATE) -AC_ARG_VAR(LUPDATE_ARGS, [arguments for qt lupdate command, e.g. -no-obsolete]) AC_OUTPUT diff --git a/proxyface/autoproxy.hxx b/proxyface/autoproxy.hxx index 3191f01..78a4839 100644 --- a/proxyface/autoproxy.hxx +++ b/proxyface/autoproxy.hxx @@ -111,7 +111,7 @@ namespace proxy { @param url the url to find a proxy for @param timeout [ms] time to give up search */ void proxy(const std::string& url, - int timeout1=1000, int timeout2=30000) { + int timeout1=5000, int timeout2=30000) { qDebug()<<"Search proxy for URL, direct and default" <<"url="<error()<errorString(); - if (reply->error()!=QNetworkReply::NoError) return; // wait for timeout + if (reply->error()!=QNetworkReply::NoError) { + temporaryError(reply->error(), reply->errorString(), + toString(_requests[reply].second)); + return; // wait for timeout + } _timeout1.stop(); _timeout2.stop(); QNetworkProxy prxy(_requests[reply].second); @@ -284,18 +290,29 @@ namespace proxy { }; } -#ifdef WIN32 +/* +#ifdef QT_WEBKIT_LIB +// use plain QT implementation +# include +namespace proxy { + typedef Qt Face; +} +#else +# error no QT_WEBKIT_LIB +*/ +# ifdef WIN32 // use windoze proprietary winhttp -#include +# include namespace proxy { typedef Windoze Face; } -#else +# else // normal operating systems: use http://code.google.com/p/libproxy #include namespace proxy { typedef Unix Face; } -#endif +# endif +//#endif #endif diff --git a/proxyface/makefile.am b/proxyface/makefile.am index 5cb6eb0..e3da294 100644 --- a/proxyface/makefile.am +++ b/proxyface/makefile.am @@ -1,7 +1,7 @@ UISOURCES = proxy.ui MOCHEADER = proxy.hxx autoproxy.hxx -LANGUAGES = proxy_de.qm proxy_en.qm proxy_fr.qm proxy_it.qm \ - proxy_de.ts proxy_en.ts proxy_fr.ts proxy_it.ts +LANGUAGES = proxy_de.qm proxy_en.qm proxy_fr.qm proxy_it.qm +LANG_TS = proxy_de.ts proxy_en.ts proxy_fr.ts proxy_it.ts UIHEADER = ui_proxy.hxx MOCSOURCES = moc_proxy.cxx moc_autoproxy.cxx @@ -9,7 +9,7 @@ MOCSOURCES = moc_proxy.cxx moc_autoproxy.cxx BUILT_SOURCES = ${UIHEADER} ${MOCSOURCES} ${LANGUAGES} proxyfacedir = ${includedir}/proxyface -proxyface_HEADERS = unix.hxx windoze.hxx \ +proxyface_HEADERS = unix.hxx windoze.hxx plainqt.hxx \ ${MOCHEADER} ${UIHEADER} lib_LTLIBRARIES = libproxyface.la @@ -21,12 +21,12 @@ libproxyface_la_LDFLAGS = -version-info ${LIB_VERSION} AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir} moc_%.cxx: %.hxx - ${MOC} ${CPPFLAGS} ${AM_CPPFLAGS} -o $@ $< + ${MOC} -DMOC ${CPPFLAGS} ${AM_CPPFLAGS} -o $@ $< ui_%.hxx: %.ui ${UIC} -o $@ $< -%.ts: ${UISOURCES} ${MOCHEADER} +%.ts: ${UISOURCES} ${MOCHEADER} ${proxyface_HEADERS} ${LUPDATE} ${LUPDATE_ARGS} $^ -ts $@ %.qm: %.ts diff --git a/proxyface/plainqt.hxx b/proxyface/plainqt.hxx new file mode 100644 index 0000000..ee10b69 --- /dev/null +++ b/proxyface/plainqt.hxx @@ -0,0 +1,38 @@ +/*! @file + + @id $Id$ +*/ +// 1 2 3 4 5 6 7 8 +// 45678901234567890123456789012345678901234567890123456789012345678901234567890 + +#ifndef PROXY_QT +#define PROXY_QT + +#include + +#include + +namespace proxy { + + class Qt: public Interface { + + public: + + Qt() {} + + virtual ~Qt() {} + + //! Implements WPAD using Qt Network and Qt Webkit + virtual List proxies(const std::string& url) { + List res; + qDebug()<<"Hostname: "< + + Proxy Konfiguration Proxy Einstellungen + Typ: Typ: + direkt oder automatisch automatisch + HTTP HTTP + Socks5 Socks5 + URL: Adresse: + Port: Port: + Einstellungen lokal speichern Einstellungen lokal speichern + Speichern Speichern + Wenn Sie die Einstellungen speichern, werden sie auf diesem Computer in Ihrem Profil abgelegt. Einstellungen werden nur auf diesem Computer gespeichert. + Loeschen Entfernen diff --git a/proxyface/proxy_en.ts b/proxyface/proxy_en.ts index 29e53cf..3368eaf 100644 --- a/proxyface/proxy_en.ts +++ b/proxyface/proxy_en.ts @@ -6,56 +6,68 @@ + + Proxy Konfiguration Proxy Settings + Typ: Type: + direkt oder automatisch automatic + HTTP HTTP + Socks5 Socks5 + URL: Address: + Port: Port: + Einstellungen lokal speichern Save settings locally + Speichern Save + Wenn Sie die Einstellungen speichern, werden sie auf diesem Computer in Ihrem Profil abgelegt. Settings will be saved on this computer only. + Loeschen Remove diff --git a/proxyface/proxy_fr.ts b/proxyface/proxy_fr.ts index 36ff53c..3572fc6 100644 --- a/proxyface/proxy_fr.ts +++ b/proxyface/proxy_fr.ts @@ -6,56 +6,68 @@ + + Proxy Konfiguration Paramétrages du Proxy + Typ: Type: + direkt oder automatisch automatique + HTTP HTTP + Socks5 Socks5 + URL: Adresse: + Port: Port: + Einstellungen lokal speichern Enregistrer les paramètres localement + Speichern Salve + Wenn Sie die Einstellungen speichern, werden sie auf diesem Computer in Ihrem Profil abgelegt. Les paramètres seront enregistre seulement sur cet ordinateur. + Loeschen Enlever diff --git a/proxyface/proxy_it.ts b/proxyface/proxy_it.ts index abf6838..ce398fd 100644 --- a/proxyface/proxy_it.ts +++ b/proxyface/proxy_it.ts @@ -6,56 +6,68 @@ + + Proxy Konfiguration Impostazioni proxy + Typ: Typo: + direkt oder automatisch automatico + HTTP HTTP + Socks5 Socks5 + URL: Indirizzo: + Port: Porta: + Einstellungen lokal speichern Salvare i parametri localmente + Speichern Salve + Wenn Sie die Einstellungen speichern, werden sie auf diesem Computer in Ihrem Profil abgelegt. I parametri verranno salvati solo su questo computer. + Loeschen Eliminazione