summaryrefslogtreecommitdiffstats
path: root/kio/misc/kpac
diff options
context:
space:
mode:
Diffstat (limited to 'kio/misc/kpac')
-rw-r--r--kio/misc/kpac/discovery.cpp16
-rw-r--r--kio/misc/kpac/discovery.h6
-rw-r--r--kio/misc/kpac/downloader.cpp18
-rw-r--r--kio/misc/kpac/downloader.h18
-rw-r--r--kio/misc/kpac/proxyscout.cpp32
-rw-r--r--kio/misc/kpac/proxyscout.h14
-rw-r--r--kio/misc/kpac/script.cpp24
-rw-r--r--kio/misc/kpac/script.h12
8 files changed, 70 insertions, 70 deletions
diff --git a/kio/misc/kpac/discovery.cpp b/kio/misc/kpac/discovery.cpp
index 06709241b..7a84958f7 100644
--- a/kio/misc/kpac/discovery.cpp
+++ b/kio/misc/kpac/discovery.cpp
@@ -39,7 +39,7 @@
#include <resolv.h>
#include <sys/utsname.h>
-#include <qtimer.h>
+#include <tqtimer.h>
#include <klocale.h>
#include <kprocio.h>
@@ -49,16 +49,16 @@
namespace KPAC
{
- Discovery::Discovery( QObject* parent )
+ Discovery::Discovery( TQObject* parent )
: Downloader( parent ),
m_helper( new KProcIO )
{
- connect( m_helper, SIGNAL( readReady( KProcIO* ) ), SLOT( helperOutput() ) );
- connect( m_helper, SIGNAL( processExited( KProcess* ) ), SLOT( failed() ) );
+ connect( m_helper, TQT_SIGNAL( readReady( KProcIO* ) ), TQT_SLOT( helperOutput() ) );
+ connect( m_helper, TQT_SIGNAL( processExited( KProcess* ) ), TQT_SLOT( failed() ) );
*m_helper << "kpac_dhcp_helper";
if ( !m_helper->start() )
- QTimer::singleShot( 0, this, SLOT( failed() ) );
+ TQTimer::singleShot( 0, this, TQT_SLOT( failed() ) );
}
bool Discovery::initHostName()
@@ -69,7 +69,7 @@ namespace KPAC
{
struct hostent *hent = gethostbyname (uts.nodename);
if (hent != 0)
- m_hostname = QString::fromLocal8Bit( hent->h_name );
+ m_hostname = TQString::fromLocal8Bit( hent->h_name );
}
// If no hostname, try gethostname as a last resort.
@@ -79,7 +79,7 @@ namespace KPAC
if (gethostname (buf, sizeof(buf)) == 0)
{
buf[255] = '\0';
- m_hostname = QString::fromLocal8Bit( buf );
+ m_hostname = TQString::fromLocal8Bit( buf );
}
}
return !m_hostname.isEmpty();
@@ -138,7 +138,7 @@ namespace KPAC
void Discovery::helperOutput()
{
m_helper->disconnect( this );
- QString line;
+ TQString line;
m_helper->readln( line );
download( KURL( line.stripWhiteSpace() ) );
}
diff --git a/kio/misc/kpac/discovery.h b/kio/misc/kpac/discovery.h
index b9c657924..a1443ad8c 100644
--- a/kio/misc/kpac/discovery.h
+++ b/kio/misc/kpac/discovery.h
@@ -21,7 +21,7 @@
#ifndef KPAC_DISCOVERY_H
#define KPAC_DISCOVERY_H
-#include <qobject.h>
+#include <tqobject.h>
#include "downloader.h"
@@ -33,7 +33,7 @@ namespace KPAC
{
Q_OBJECT
public:
- Discovery( QObject* );
+ Discovery( TQObject* );
protected slots:
virtual void failed();
@@ -46,7 +46,7 @@ namespace KPAC
bool checkDomain() const;
KProcIO* m_helper;
- QString m_hostname;
+ TQString m_hostname;
};
}
diff --git a/kio/misc/kpac/downloader.cpp b/kio/misc/kpac/downloader.cpp
index 6d4e62409..6f419f5f5 100644
--- a/kio/misc/kpac/downloader.cpp
+++ b/kio/misc/kpac/downloader.cpp
@@ -21,7 +21,7 @@
#include <cstdlib>
#include <cstring>
-#include <qtextcodec.h>
+#include <tqtextcodec.h>
#include <kcharsets.h>
#include <kglobal.h>
@@ -32,21 +32,21 @@
namespace KPAC
{
- Downloader::Downloader( QObject* parent )
- : QObject( parent )
+ Downloader::Downloader( TQObject* parent )
+ : TQObject( parent )
{
}
void Downloader::download( const KURL& url )
{
m_data.resize( 0 );
- m_script = QString::null;
+ m_script = TQString::null;
m_scriptURL = url;
KIO::TransferJob* job = KIO::get( url, false, false );
- connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ),
- SLOT( data( KIO::Job*, const QByteArray& ) ) );
- connect( job, SIGNAL( result( KIO::Job* ) ), SLOT( result( KIO::Job* ) ) );
+ connect( job, TQT_SIGNAL( data( KIO::Job*, const TQByteArray& ) ),
+ TQT_SLOT( data( KIO::Job*, const TQByteArray& ) ) );
+ connect( job, TQT_SIGNAL( result( KIO::Job* ) ), TQT_SLOT( result( KIO::Job* ) ) );
}
void Downloader::failed()
@@ -54,12 +54,12 @@ namespace KPAC
emit result( false );
}
- void Downloader::setError( const QString& error )
+ void Downloader::setError( const TQString& error )
{
m_error = error;
}
- void Downloader::data( KIO::Job*, const QByteArray& data )
+ void Downloader::data( KIO::Job*, const TQByteArray& data )
{
unsigned offset = m_data.size();
m_data.resize( offset + data.size() );
diff --git a/kio/misc/kpac/downloader.h b/kio/misc/kpac/downloader.h
index 7869d7102..05d8569cc 100644
--- a/kio/misc/kpac/downloader.h
+++ b/kio/misc/kpac/downloader.h
@@ -21,7 +21,7 @@
#ifndef KPAC_DOWNLOADER_H
#define KPAC_DOWNLOADER_H
-#include <qobject.h>
+#include <tqobject.h>
#include <kurl.h>
@@ -33,29 +33,29 @@ namespace KPAC
{
Q_OBJECT
public:
- Downloader( QObject* );
+ Downloader( TQObject* );
void download( const KURL& );
const KURL& scriptURL() { return m_scriptURL; }
- const QString& script() { return m_script; }
- const QString& error() { return m_error; }
+ const TQString& script() { return m_script; }
+ const TQString& error() { return m_error; }
signals:
void result( bool );
protected:
virtual void failed();
- void setError( const QString& );
+ void setError( const TQString& );
private slots:
- void data( KIO::Job*, const QByteArray& );
+ void data( KIO::Job*, const TQByteArray& );
void result( KIO::Job* );
private:
- QByteArray m_data;
+ TQByteArray m_data;
KURL m_scriptURL;
- QString m_script;
- QString m_error;
+ TQString m_script;
+ TQString m_error;
};
}
diff --git a/kio/misc/kpac/proxyscout.cpp b/kio/misc/kpac/proxyscout.cpp
index 06d860615..6cba79db6 100644
--- a/kio/misc/kpac/proxyscout.cpp
+++ b/kio/misc/kpac/proxyscout.cpp
@@ -39,7 +39,7 @@ namespace KPAC
{
}
- ProxyScout::ProxyScout( const QCString& name )
+ ProxyScout::ProxyScout( const TQCString& name )
: KDEDModule( name ),
m_instance( new KInstance( "proxyscout" ) ),
m_downloader( 0 ),
@@ -54,7 +54,7 @@ namespace KPAC
delete m_instance;
}
- QString ProxyScout::proxyForURL( const KURL& url )
+ TQString ProxyScout::proxyForURL( const KURL& url )
{
if ( m_suspendTime )
{
@@ -70,12 +70,12 @@ namespace KPAC
if ( m_downloader || startDownload() )
{
m_requestQueue.append( url );
- return QString::null;
+ return TQString::null;
}
else return "DIRECT";
}
- ASYNC ProxyScout::blackListProxy( const QString& proxy )
+ ASYNC ProxyScout::blackListProxy( const TQString& proxy )
{
m_blackList[ proxy ] = std::time( 0 );
}
@@ -105,8 +105,8 @@ namespace KPAC
default:
return false;
}
- connect( m_downloader, SIGNAL( result( bool ) ),
- SLOT( downloadResult( bool ) ) );
+ connect( m_downloader, TQT_SIGNAL( result( bool ) ),
+ TQT_SLOT( downloadResult( bool ) ) );
return true;
}
@@ -130,11 +130,11 @@ namespace KPAC
for ( RequestQueue::ConstIterator it = m_requestQueue.begin();
it != m_requestQueue.end(); ++it )
{
- QCString type = "QString";
- QByteArray data;
- QDataStream ds( data, IO_WriteOnly );
+ TQCString type = "TQString";
+ TQByteArray data;
+ TQDataStream ds( data, IO_WriteOnly );
if ( success ) ds << handleRequest( ( *it ).url );
- else ds << QString( "DIRECT" );
+ else ds << TQString( "DIRECT" );
kapp->dcopClient()->endTransaction( ( *it ).transaction, type, data );
}
m_requestQueue.clear();
@@ -144,16 +144,16 @@ namespace KPAC
if ( !success ) m_suspendTime = std::time( 0 );
}
- QString ProxyScout::handleRequest( const KURL& url )
+ TQString ProxyScout::handleRequest( const KURL& url )
{
try
{
- QString result = m_script->evaluate( url );
- QStringList proxies = QStringList::split( ';', result );
- for ( QStringList::ConstIterator it = proxies.begin();
+ TQString result = m_script->evaluate( url );
+ TQStringList proxies = TQStringList::split( ';', result );
+ for ( TQStringList::ConstIterator it = proxies.begin();
it != proxies.end(); ++it )
{
- QString proxy = ( *it ).stripWhiteSpace();
+ TQString proxy = ( *it ).stripWhiteSpace();
if ( proxy.left( 5 ) == "PROXY" )
{
KURL proxyURL( proxy = proxy.mid( 5 ).stripWhiteSpace() );
@@ -187,7 +187,7 @@ namespace KPAC
return "DIRECT";
}
- extern "C" KDE_EXPORT KDEDModule* create_proxyscout( const QCString& name )
+ extern "C" KDE_EXPORT KDEDModule* create_proxyscout( const TQCString& name )
{
return new ProxyScout( name );
}
diff --git a/kio/misc/kpac/proxyscout.h b/kio/misc/kpac/proxyscout.h
index afd7968ab..c18e5173d 100644
--- a/kio/misc/kpac/proxyscout.h
+++ b/kio/misc/kpac/proxyscout.h
@@ -21,7 +21,7 @@
#ifndef KPAC_PROXYSCOUT_H
#define KPAC_PROXYSCOUT_H
-#include <qmap.h>
+#include <tqmap.h>
#include <kdedmodule.h>
#include <kurl.h>
@@ -41,12 +41,12 @@ namespace KPAC
Q_OBJECT
K_DCOP
public:
- ProxyScout( const QCString& );
+ ProxyScout( const TQCString& );
virtual ~ProxyScout();
k_dcop:
- QString proxyForURL( const KURL& url );
- ASYNC blackListProxy( const QString& proxy );
+ TQString proxyForURL( const KURL& url );
+ ASYNC blackListProxy( const TQString& proxy );
ASYNC reset();
private slots:
@@ -54,7 +54,7 @@ namespace KPAC
private:
bool startDownload();
- QString handleRequest( const KURL& url );
+ TQString handleRequest( const KURL& url );
KInstance* m_instance;
Downloader* m_downloader;
@@ -68,10 +68,10 @@ namespace KPAC
DCOPClientTransaction* transaction;
KURL url;
};
- typedef QValueList< QueuedRequest > RequestQueue;
+ typedef TQValueList< QueuedRequest > RequestQueue;
RequestQueue m_requestQueue;
- typedef QMap< QString, time_t > BlackList;
+ typedef TQMap< TQString, time_t > BlackList;
BlackList m_blackList;
time_t m_suspendTime;
};
diff --git a/kio/misc/kpac/script.cpp b/kio/misc/kpac/script.cpp
index 39d6d3f8e..55faef8a1 100644
--- a/kio/misc/kpac/script.cpp
+++ b/kio/misc/kpac/script.cpp
@@ -30,8 +30,8 @@
#include <arpa/inet.h>
#include <unistd.h>
-#include <qregexp.h>
-#include <qstring.h>
+#include <tqregexp.h>
+#include <tqstring.h>
#include <kurl.h>
#include <kjs/object.h>
@@ -41,12 +41,12 @@
using namespace KJS;
-QString UString::qstring() const
+TQString UString::qstring() const
{
- return QString( reinterpret_cast< const QChar* >( data() ), size() );
+ return TQString( reinterpret_cast< const TQChar* >( data() ), size() );
}
-UString::UString( const QString &s )
+UString::UString( const TQString &s )
{
UChar* data = new UChar[ s.length() ];
std::memcpy( data, s.unicode(), s.length() * sizeof( UChar ) );
@@ -72,7 +72,7 @@ namespace
operator String() const { return String( m_address.ipAddress().toString() ); }
private:
- Address( const QString& host, bool numeric )
+ Address( const TQString& host, bool numeric )
{
int flags = 0;
@@ -80,7 +80,7 @@ namespace
flags = KNetwork::KResolver::NoResolve;
KNetwork::KResolverResults addresses =
- KNetwork::KResolver::resolve( host, QString::null, flags,
+ KNetwork::KResolver::resolve( host, TQString::null, flags,
KNetwork::KResolver::IPv4Family );
if ( addresses.isEmpty() )
@@ -140,8 +140,8 @@ namespace
virtual Value call( ExecState* exec, Object&, const List& args )
{
if ( args.size() != 2 ) return Undefined();
- QString host = args[ 0 ].toString( exec ).qstring().lower();
- QString domain = args[ 1 ].toString( exec ).qstring().lower();
+ TQString host = args[ 0 ].toString( exec ).qstring().lower();
+ TQString domain = args[ 1 ].toString( exec ).qstring().lower();
return Boolean( host.endsWith( domain ) );
}
};
@@ -243,7 +243,7 @@ namespace
virtual Value call( ExecState* exec, Object&, const List& args )
{
if ( args.size() != 2 ) return Undefined();
- QRegExp pattern( args[ 1 ].toString( exec ).qstring(), true, true );
+ TQRegExp pattern( args[ 1 ].toString( exec ).qstring(), true, true );
return Boolean( pattern.exactMatch(args[ 0 ].toString( exec ).qstring()) );
}
};
@@ -427,7 +427,7 @@ namespace
namespace KPAC
{
- Script::Script( const QString& code )
+ Script::Script( const TQString& code )
{
ExecState* exec = m_interpreter.globalExec();
Object global = m_interpreter.globalObject();
@@ -438,7 +438,7 @@ namespace KPAC
throw Error( result.value().toString( exec ).qstring() );
}
- QString Script::evaluate( const KURL& url )
+ TQString Script::evaluate( const KURL& url )
{
ExecState *exec = m_interpreter.globalExec();
Value findFunc = m_interpreter.globalObject().get( exec, "FindProxyForURL" );
diff --git a/kio/misc/kpac/script.h b/kio/misc/kpac/script.h
index 2f5314e9a..49ba0b6a3 100644
--- a/kio/misc/kpac/script.h
+++ b/kio/misc/kpac/script.h
@@ -21,7 +21,7 @@
#ifndef KPAC_SCRIPT_H
#define KPAC_SCRIPT_H
-#include <qstring.h>
+#include <tqstring.h>
#include <kjs/interpreter.h>
@@ -35,16 +35,16 @@ namespace KPAC
class Error
{
public:
- Error( const QString& message )
+ Error( const TQString& message )
: m_message( message ) {}
- const QString& message() const { return m_message; }
+ const TQString& message() const { return m_message; }
private:
- QString m_message;
+ TQString m_message;
};
- Script( const QString& code );
- QString evaluate( const KURL& );
+ Script( const TQString& code );
+ TQString evaluate( const KURL& );
private:
KJS::Interpreter m_interpreter;