All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Signals | Public Member Functions
QGpGuiTools::HttpProxyList Class Reference

Brief description of class still missing. More...

#include <HttpProxyList.h>

List of all members.

Signals

void ready ()

Public Member Functions

const HttpProxyat (int index)
void collect ()
int count () const
 HttpProxyList (const QString &testUrl, QObject *parent=0)
bool isReady () const
void printDebug (const QString &s, bool list=false) const
const QUrl & testUrl () const
 ~HttpProxyList ()

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

QGpGuiTools::HttpProxyList::HttpProxyList ( const QString &  testUrl,
QObject *  parent = 0 
)

testUrl is used for solving PAC scripts. It must corresponds to the expected host name of all requests to be sent to HttpAccess.

References filter(), and TRACE.

    : QObject(parent), _testUrl(testUrl)
  {
    TRACE;
    // Clean up of past releases
    QStringList filter;
    filter.append("geopsy.org.*.*.proxy.debug");
    QDir d=QDir::temp();
    QStringList files=d.entryList(filter, QDir::Files);
    foreach(QString file, files) {
      d.remove(file);
    }
  }

Description of destructor still missing

References TRACE.

  {
    TRACE;
  }

Member Function Documentation

const HttpProxy& QGpGuiTools::HttpProxyList::at ( int  index) [inline]
{return _proxies[index];}

References TRACE.

Referenced by QGpGuiTools::HttpAccess::HttpAccess().

  {
    TRACE;
    QString proxy=getenv("http_proxy");
    if(proxy.isEmpty()) {
      _proxies.append(HttpProxy());
    } else {
      _proxies.append(HttpProxy(proxy));
    }
    //printDebug("environment:\n", true);
    // TODO: check with Google Chromium for all platforms
    firefoxProxies();
    //printDebug("firefox:\n", true);
  #if defined Q_WS_X11
    kdeProxies();
    //printDebug("kde:\n", true);
  #elif defined Q_WS_WIN
    internetExplorerProxies();
    //printDebug("ie:\n", true);
  #elif defined Q_WS_MAC
    macProxies();
    //printDebug("mac:\n", true);
  #endif
    // Add other proxy sources supported directly by Qt
    systemProxies();
    //printDebug("system:\n", true);

    if(_replies.isEmpty()) { // No script or auto
      sort();
    }
  }
int QGpGuiTools::HttpProxyList::count ( ) const [inline]
{return _proxies.count();}
bool QGpGuiTools::HttpProxyList::isReady ( ) const [inline]
{return _replies.isEmpty();}
void QGpGuiTools::HttpProxyList::printDebug ( const QString &  msg,
bool  list = false 
) const

For debug, prints the list of available proxies.

References TRACE.

  {
    TRACE;
    QDir d=QDir::temp();
    QFile f(d.absoluteFilePath("geopsy.org.%1.%2.proxy.debug")
            .arg(CoreApplication::applicationName())
            .arg(QCoreApplication::applicationPid()));
    if(f.open(QIODevice::Append)) {
      QTextStream s(&f);
      s << msg;
      if(list) {
        for(QList<HttpProxy>::ConstIterator it=_proxies.begin();it!=_proxies.end();it++) {
          it->printDebug(s);
        }
      }
    }
  }
const QUrl& QGpGuiTools::HttpProxyList::testUrl ( ) const [inline]
{return _testUrl;}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines