diff options
Diffstat (limited to 'kioslave/http')
-rw-r--r-- | kioslave/http/http.cc | 744 | ||||
-rw-r--r-- | kioslave/http/http.h | 162 | ||||
-rw-r--r-- | kioslave/http/http_cache_cleaner.cpp | 40 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookiejar.cpp | 254 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookiejar.h | 100 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookieserver.cpp | 138 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookieserver.h | 42 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookiewin.cpp | 124 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookiewin.h | 10 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/main.cpp | 32 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/tests/kcookiejartest.cpp | 88 |
11 files changed, 867 insertions, 867 deletions
diff --git a/kioslave/http/http.cc b/kioslave/http/http.cc index 5d9fa2eb7..e28e482bf 100644 --- a/kioslave/http/http.cc +++ b/kioslave/http/http.cc @@ -40,11 +40,11 @@ #include <sys/wait.h> */ -#include <qdom.h> -#include <qfile.h> -#include <qregexp.h> -#include <qdatetime.h> -#include <qstringlist.h> +#include <tqdom.h> +#include <tqfile.h> +#include <tqregexp.h> +#include <tqdatetime.h> +#include <tqstringlist.h> #include <kurl.h> #include <kidna.h> @@ -121,7 +121,7 @@ static char * trimLead (char *orig_string) return orig_string; } -static bool isCrossDomainRequest( const QString& fqdn, const QString& originURL ) +static bool isCrossDomainRequest( const TQString& fqdn, const TQString& originURL ) { if (originURL == "true") // Backwards compatibility return true; @@ -129,16 +129,16 @@ static bool isCrossDomainRequest( const QString& fqdn, const QString& originURL KURL url ( originURL ); // Document Origin domain - QString a = url.host(); + TQString a = url.host(); // Current request domain - QString b = fqdn; + TQString b = fqdn; if (a == b) return false; - QStringList l1 = QStringList::split('.', a); - QStringList l2 = QStringList::split('.', b); + TQStringList l1 = TQStringList::split('.', a); + TQStringList l2 = TQStringList::split('.', b); while(l1.count() > l2.count()) l1.pop_front(); @@ -161,14 +161,14 @@ static bool isCrossDomainRequest( const QString& fqdn, const QString& originURL /* Eliminates any custom header that could potentically alter the request */ -static QString sanitizeCustomHTTPHeader(const QString& _header) +static TQString sanitizeCustomHTTPHeader(const TQString& _header) { - QString sanitizedHeaders; - QStringList headers = QStringList::split(QRegExp("[\r\n]"), _header); + TQString sanitizedHeaders; + TQStringList headers = TQStringList::split(TQRegExp("[\r\n]"), _header); - for(QStringList::Iterator it = headers.begin(); it != headers.end(); ++it) + for(TQStringList::Iterator it = headers.begin(); it != headers.end(); ++it) { - QString header = (*it).lower(); + TQString header = (*it).lower(); // Do not allow Request line to be specified and ignore // the other HTTP headers. if (header.find(':') == -1 || @@ -195,8 +195,8 @@ static QString sanitizeCustomHTTPHeader(const QString& _header) /************************************** HTTPProtocol **********************************************/ -HTTPProtocol::HTTPProtocol( const QCString &protocol, const QCString &pool, - const QCString &app ) +HTTPProtocol::HTTPProtocol( const TQCString &protocol, const TQCString &pool, + const TQCString &app ) :TCPSlaveBase( 0, protocol , pool, app, (protocol == "https" || protocol == "webdavs") ) { @@ -232,8 +232,8 @@ void HTTPProtocol::reparseConfiguration() { kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::reparseConfiguration" << endl; - m_strProxyRealm = QString::null; - m_strProxyAuthorization = QString::null; + m_strProxyRealm = TQString::null; + m_strProxyAuthorization = TQString::null; ProxyAuthentication = AUTH_None; m_bUseProxy = false; @@ -266,8 +266,8 @@ void HTTPProtocol::resetResponseSettings() m_responseHeader.clear(); m_qContentEncodings.clear(); m_qTransferEncodings.clear(); - m_sContentMD5 = QString::null; - m_strMimeType = QString::null; + m_sContentMD5 = TQString::null; + m_strMimeType = TQString::null; setMetaData("request-id", m_request.id); } @@ -308,7 +308,7 @@ void HTTPProtocol::resetSessionSettings() kdDebug(7113) << "(" << m_pid << ") ssl_was_in_use = " << metaData ("ssl_was_in_use") << endl; - m_request.referrer = QString::null; + m_request.referrer = TQString::null; if ( config()->readBoolEntry("SendReferrer", true) && (m_protocol == "https" || m_protocol == "webdavs" || metaData ("ssl_was_in_use") != "TRUE" ) ) @@ -317,7 +317,7 @@ void HTTPProtocol::resetSessionSettings() if (referrerURL.isValid()) { // Sanitize - QString protocol = referrerURL.protocol(); + TQString protocol = referrerURL.protocol(); if (protocol.startsWith("webdav")) { protocol.replace(0, 6, "http"); @@ -326,9 +326,9 @@ void HTTPProtocol::resetSessionSettings() if (protocol.startsWith("http")) { - referrerURL.setRef(QString::null); - referrerURL.setUser(QString::null); - referrerURL.setPass(QString::null); + referrerURL.setRef(TQString::null); + referrerURL.setUser(TQString::null); + referrerURL.setPass(TQString::null); m_request.referrer = referrerURL.url(); } } @@ -345,12 +345,12 @@ void HTTPProtocol::resetSessionSettings() } else { - m_request.charsets = QString::null; - m_request.languages = QString::null; + m_request.charsets = TQString::null; + m_request.languages = TQString::null; } // Adjust the offset value based on the "resume" meta-data. - QString resumeOffset = metaData("resume"); + TQString resumeOffset = metaData("resume"); if ( !resumeOffset.isEmpty() ) m_request.offset = resumeOffset.toInt(); // TODO: Convert to 64 bit else @@ -364,7 +364,7 @@ void HTTPProtocol::resetSessionSettings() if ( config()->readBoolEntry("SendUserAgent", true) ) m_request.userAgent = metaData("UserAgent"); else - m_request.userAgent = QString::null; + m_request.userAgent = TQString::null; // Deal with cache cleaning. // TODO: Find a smarter way to deal with cleaning the @@ -384,14 +384,14 @@ void HTTPProtocol::resetSessionSettings() else { m_bNeedTunnel = false; - setRealHost( QString::null); + setRealHost( TQString::null); } m_responseCode = 0; m_prevResponseCode = 0; - m_strRealm = QString::null; - m_strAuthorization = QString::null; + m_strRealm = TQString::null; + m_strAuthorization = TQString::null; Authentication = AUTH_None; // Obtain the proxy and remote server timeout values @@ -423,8 +423,8 @@ void HTTPProtocol::resetSessionSettings() m_bFirstRequest = false; } -void HTTPProtocol::setHost( const QString& host, int port, - const QString& user, const QString& pass ) +void HTTPProtocol::setHost( const TQString& host, int port, + const TQString& user, const TQString& pass ) { // Reset the webdav-capable flags for this host if ( m_request.hostname != host ) @@ -607,7 +607,7 @@ void HTTPProtocol::stat(const KURL& url) if ( m_protocol != "webdav" && m_protocol != "webdavs" ) { - QString statSide = metaData(QString::fromLatin1("statSide")); + TQString statSide = metaData(TQString::fromLatin1("statSide")); if ( statSide != "source" ) { // When uploading we assume the file doesn't exit @@ -654,7 +654,7 @@ void HTTPProtocol::listDir( const KURL& url ) davStatList( url, false ); } -void HTTPProtocol::davSetRequest( const QCString& requestXML ) +void HTTPProtocol::davSetRequest( const TQCString& requestXML ) { // insert the document into the POST buffer, kill trailing zero byte m_bufPOST = requestXML; @@ -673,10 +673,10 @@ void HTTPProtocol::davStatList( const KURL& url, bool stat ) return; // Maybe it's a disguised SEARCH... - QString query = metaData("davSearchQuery"); + TQString query = metaData("davSearchQuery"); if ( !query.isEmpty() ) { - QCString request = "<?xml version=\"1.0\"?>\r\n"; + TQCString request = "<?xml version=\"1.0\"?>\r\n"; request.append( "<D:searchrequest xmlns:D=\"DAV:\">\r\n" ); request.append( query.utf8() ); request.append( "</D:searchrequest>\r\n" ); @@ -684,7 +684,7 @@ void HTTPProtocol::davStatList( const KURL& url, bool stat ) davSetRequest( request ); } else { // We are only after certain features... - QCString request; + TQCString request; request = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" "<D:propfind xmlns:D=\"DAV:\">"; @@ -715,7 +715,7 @@ void HTTPProtocol::davStatList( const KURL& url, bool stat ) // WebDAV Stat or List... m_request.method = query.isEmpty() ? DAV_PROPFIND : DAV_SEARCH; - m_request.query = QString::null; + m_request.query = TQString::null; m_request.cache = CC_Reload; m_request.doProxy = m_bUseProxy; m_request.davData.depth = stat ? 0 : 1; @@ -730,26 +730,26 @@ void HTTPProtocol::davStatList( const KURL& url, bool stat ) return; } - QDomDocument multiResponse; + TQDomDocument multiResponse; multiResponse.setContent( m_bufWebDavData, true ); bool hasResponse = false; - for ( QDomNode n = multiResponse.documentElement().firstChild(); + for ( TQDomNode n = multiResponse.documentElement().firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement thisResponse = n.toElement(); + TQDomElement thisResponse = n.toElement(); if (thisResponse.isNull()) continue; hasResponse = true; - QDomElement href = thisResponse.namedItem( "href" ).toElement(); + TQDomElement href = thisResponse.namedItem( "href" ).toElement(); if ( !href.isNull() ) { entry.clear(); - QString urlStr = href.text(); + TQString urlStr = href.text(); int encoding = remoteEncoding()->encodingMib(); if ((encoding == 106) && (!KStringHandler::isUtf8(KURL::decode_string(urlStr, 4).latin1()))) encoding = 4; // Use latin1 if the file is not actually utf-8 @@ -771,7 +771,7 @@ void HTTPProtocol::davStatList( const KURL& url, bool stat ) entry.append( atom ); - QDomNodeList propstats = thisResponse.elementsByTagName( "propstat" ); + TQDomNodeList propstats = thisResponse.elementsByTagName( "propstat" ); davParsePropstats( propstats, entry ); @@ -819,23 +819,23 @@ void HTTPProtocol::davGeneric( const KURL& url, KIO::HTTP_METHOD method ) // WebDAV method m_request.method = method; - m_request.query = QString::null; + m_request.query = TQString::null; m_request.cache = CC_Reload; m_request.doProxy = m_bUseProxy; retrieveContent( false ); } -int HTTPProtocol::codeFromResponse( const QString& response ) +int HTTPProtocol::codeFromResponse( const TQString& response ) { int firstSpace = response.find( ' ' ); int secondSpace = response.find( ' ', firstSpace + 1 ); return response.mid( firstSpace + 1, secondSpace - firstSpace - 1 ).toInt(); } -void HTTPProtocol::davParsePropstats( const QDomNodeList& propstats, UDSEntry& entry ) +void HTTPProtocol::davParsePropstats( const TQDomNodeList& propstats, UDSEntry& entry ) { - QString mimeType; + TQString mimeType; UDSAtom atom; bool foundExecutable = false; bool isDirectory = false; @@ -844,9 +844,9 @@ void HTTPProtocol::davParsePropstats( const QDomNodeList& propstats, UDSEntry& e for ( uint i = 0; i < propstats.count(); i++) { - QDomElement propstat = propstats.item(i).toElement(); + TQDomElement propstat = propstats.item(i).toElement(); - QDomElement status = propstat.namedItem( "status" ).toElement(); + TQDomElement status = propstat.namedItem( "status" ).toElement(); if ( status.isNull() ) { // error, no status code in this propstat @@ -862,7 +862,7 @@ void HTTPProtocol::davParsePropstats( const QDomNodeList& propstats, UDSEntry& e continue; } - QDomElement prop = propstat.namedItem( "prop" ).toElement(); + TQDomElement prop = propstat.namedItem( "prop" ).toElement(); if ( prop.isNull() ) { kdDebug(7113) << "Error: no prop segment in this propstat." << endl; @@ -872,15 +872,15 @@ void HTTPProtocol::davParsePropstats( const QDomNodeList& propstats, UDSEntry& e if ( hasMetaData( "davRequestResponse" ) ) { atom.m_uds = KIO::UDS_XML_PROPERTIES; - QDomDocument doc; + TQDomDocument doc; doc.appendChild(prop); atom.m_str = doc.toString(); entry.append( atom ); } - for ( QDomNode n = prop.firstChild(); !n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = prop.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement property = n.toElement(); + TQDomElement property = n.toElement(); if (property.isNull()) continue; @@ -912,7 +912,7 @@ void HTTPProtocol::davParsePropstats( const QDomNodeList& propstats, UDSEntry& e else if ( property.tagName() == "source" ) { // Source template location - QDomElement source = property.namedItem( "link" ).toElement() + TQDomElement source = property.namedItem( "link" ).toElement() .namedItem( "dst" ).toElement(); if ( !source.isNull() ) setMetaData( "davSource", source.text() ); @@ -959,22 +959,22 @@ void HTTPProtocol::davParsePropstats( const QDomNodeList& propstats, UDSEntry& e else if ( property.tagName() == "supportedlock" ) { // Supported locking specifications - for ( QDomNode n2 = property.firstChild(); !n2.isNull(); n2 = n2.nextSibling() ) + for ( TQDomNode n2 = property.firstChild(); !n2.isNull(); n2 = n2.nextSibling() ) { - QDomElement lockEntry = n2.toElement(); + TQDomElement lockEntry = n2.toElement(); if ( lockEntry.tagName() == "lockentry" ) { - QDomElement lockScope = lockEntry.namedItem( "lockscope" ).toElement(); - QDomElement lockType = lockEntry.namedItem( "locktype" ).toElement(); + TQDomElement lockScope = lockEntry.namedItem( "lockscope" ).toElement(); + TQDomElement lockType = lockEntry.namedItem( "locktype" ).toElement(); if ( !lockScope.isNull() && !lockType.isNull() ) { // Lock type was properly specified supportedLockCount++; - QString scope = lockScope.firstChild().toElement().tagName(); - QString type = lockType.firstChild().toElement().tagName(); + TQString scope = lockScope.firstChild().toElement().tagName(); + TQString type = lockType.firstChild().toElement().tagName(); - setMetaData( QString("davSupportedLockScope%1").arg(supportedLockCount), scope ); - setMetaData( QString("davSupportedLockType%1").arg(supportedLockCount), type ); + setMetaData( TQString("davSupportedLockScope%1").arg(supportedLockCount), scope ); + setMetaData( TQString("davSupportedLockType%1").arg(supportedLockCount), type ); } } } @@ -1000,8 +1000,8 @@ void HTTPProtocol::davParsePropstats( const QDomNodeList& propstats, UDSEntry& e } } - setMetaData( "davLockCount", QString("%1").arg(lockCount) ); - setMetaData( "davSupportedLockCount", QString("%1").arg(supportedLockCount) ); + setMetaData( "davLockCount", TQString("%1").arg(lockCount) ); + setMetaData( "davSupportedLockCount", TQString("%1").arg(supportedLockCount) ); atom.m_uds = KIO::UDS_FILE_TYPE; atom.m_long = isDirectory ? S_IFDIR : S_IFREG; @@ -1029,52 +1029,52 @@ void HTTPProtocol::davParsePropstats( const QDomNodeList& propstats, UDSEntry& e } } -void HTTPProtocol::davParseActiveLocks( const QDomNodeList& activeLocks, +void HTTPProtocol::davParseActiveLocks( const TQDomNodeList& activeLocks, uint& lockCount ) { for ( uint i = 0; i < activeLocks.count(); i++ ) { - QDomElement activeLock = activeLocks.item(i).toElement(); + TQDomElement activeLock = activeLocks.item(i).toElement(); lockCount++; // required - QDomElement lockScope = activeLock.namedItem( "lockscope" ).toElement(); - QDomElement lockType = activeLock.namedItem( "locktype" ).toElement(); - QDomElement lockDepth = activeLock.namedItem( "depth" ).toElement(); + TQDomElement lockScope = activeLock.namedItem( "lockscope" ).toElement(); + TQDomElement lockType = activeLock.namedItem( "locktype" ).toElement(); + TQDomElement lockDepth = activeLock.namedItem( "depth" ).toElement(); // optional - QDomElement lockOwner = activeLock.namedItem( "owner" ).toElement(); - QDomElement lockTimeout = activeLock.namedItem( "timeout" ).toElement(); - QDomElement lockToken = activeLock.namedItem( "locktoken" ).toElement(); + TQDomElement lockOwner = activeLock.namedItem( "owner" ).toElement(); + TQDomElement lockTimeout = activeLock.namedItem( "timeout" ).toElement(); + TQDomElement lockToken = activeLock.namedItem( "locktoken" ).toElement(); if ( !lockScope.isNull() && !lockType.isNull() && !lockDepth.isNull() ) { // lock was properly specified lockCount++; - QString scope = lockScope.firstChild().toElement().tagName(); - QString type = lockType.firstChild().toElement().tagName(); - QString depth = lockDepth.text(); + TQString scope = lockScope.firstChild().toElement().tagName(); + TQString type = lockType.firstChild().toElement().tagName(); + TQString depth = lockDepth.text(); - setMetaData( QString("davLockScope%1").arg( lockCount ), scope ); - setMetaData( QString("davLockType%1").arg( lockCount ), type ); - setMetaData( QString("davLockDepth%1").arg( lockCount ), depth ); + setMetaData( TQString("davLockScope%1").arg( lockCount ), scope ); + setMetaData( TQString("davLockType%1").arg( lockCount ), type ); + setMetaData( TQString("davLockDepth%1").arg( lockCount ), depth ); if ( !lockOwner.isNull() ) - setMetaData( QString("davLockOwner%1").arg( lockCount ), lockOwner.text() ); + setMetaData( TQString("davLockOwner%1").arg( lockCount ), lockOwner.text() ); if ( !lockTimeout.isNull() ) - setMetaData( QString("davLockTimeout%1").arg( lockCount ), lockTimeout.text() ); + setMetaData( TQString("davLockTimeout%1").arg( lockCount ), lockTimeout.text() ); if ( !lockToken.isNull() ) { - QDomElement tokenVal = lockScope.namedItem( "href" ).toElement(); + TQDomElement tokenVal = lockScope.namedItem( "href" ).toElement(); if ( !tokenVal.isNull() ) - setMetaData( QString("davLockToken%1").arg( lockCount ), tokenVal.text() ); + setMetaData( TQString("davLockToken%1").arg( lockCount ), tokenVal.text() ); } } } } -long HTTPProtocol::parseDateTime( const QString& input, const QString& type ) +long HTTPProtocol::parseDateTime( const TQString& input, const TQString& type ) { if ( type == "dateTime.tz" ) { @@ -1093,26 +1093,26 @@ long HTTPProtocol::parseDateTime( const QString& input, const QString& type ) return KRFCDate::parseDateISO8601( input ); } -QString HTTPProtocol::davProcessLocks() +TQString HTTPProtocol::davProcessLocks() { if ( hasMetaData( "davLockCount" ) ) { - QString response("If:"); + TQString response("If:"); int numLocks; numLocks = metaData( "davLockCount" ).toInt(); bool bracketsOpen = false; for ( int i = 0; i < numLocks; i++ ) { - if ( hasMetaData( QString("davLockToken%1").arg(i) ) ) + if ( hasMetaData( TQString("davLockToken%1").arg(i) ) ) { - if ( hasMetaData( QString("davLockURL%1").arg(i) ) ) + if ( hasMetaData( TQString("davLockURL%1").arg(i) ) ) { if ( bracketsOpen ) { response += ")"; bracketsOpen = false; } - response += " <" + metaData( QString("davLockURL%1").arg(i) ) + ">"; + response += " <" + metaData( TQString("davLockURL%1").arg(i) ) + ">"; } if ( !bracketsOpen ) @@ -1125,10 +1125,10 @@ QString HTTPProtocol::davProcessLocks() response += " "; } - if ( hasMetaData( QString("davLockNot%1").arg(i) ) ) + if ( hasMetaData( TQString("davLockNot%1").arg(i) ) ) response += "Not "; - response += "<" + metaData( QString("davLockToken%1").arg(i) ) + ">"; + response += "<" + metaData( TQString("davLockToken%1").arg(i) ) + ">"; } } @@ -1139,7 +1139,7 @@ QString HTTPProtocol::davProcessLocks() return response; } - return QString::null; + return TQString::null; } bool HTTPProtocol::davHostOk() @@ -1164,7 +1164,7 @@ bool HTTPProtocol::davHostOk() // query the server's capabilities generally, not for a specific URL m_request.path = "*"; - m_request.query = QString::null; + m_request.query = TQString::null; m_request.cache = CC_Reload; m_request.doProxy = m_bUseProxy; @@ -1214,7 +1214,7 @@ void HTTPProtocol::mkdir( const KURL& url, int ) m_request.method = DAV_MKCOL; m_request.path = url.path(); - m_request.query = QString::null; + m_request.query = TQString::null; m_request.cache = CC_Reload; m_request.doProxy = m_bUseProxy; @@ -1238,7 +1238,7 @@ void HTTPProtocol::get( const KURL& url ) m_request.path = url.path(); m_request.query = url.query(); - QString tmp = metaData("cache"); + TQString tmp = metaData("cache"); if (!tmp.isEmpty()) m_request.cache = parseCacheControl(tmp); else @@ -1265,7 +1265,7 @@ void HTTPProtocol::put( const KURL &url, int, bool overwrite, bool) if ( !davHostOk() ) return; - QCString request; + TQCString request; request = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" "<D:propfind xmlns:D=\"DAV:\"><D:prop>" "<D:creationdate/>" @@ -1278,7 +1278,7 @@ void HTTPProtocol::put( const KURL &url, int, bool overwrite, bool) // WebDAV Stat or List... m_request.method = DAV_PROPFIND; - m_request.query = QString::null; + m_request.query = TQString::null; m_request.cache = CC_Reload; m_request.doProxy = m_bUseProxy; m_request.davData.depth = 0; @@ -1286,7 +1286,7 @@ void HTTPProtocol::put( const KURL &url, int, bool overwrite, bool) retrieveContent(true); if (m_responseCode == 207) { - error(ERR_FILE_ALREADY_EXIST, QString::null); + error(ERR_FILE_ALREADY_EXIST, TQString::null); return; } @@ -1295,7 +1295,7 @@ void HTTPProtocol::put( const KURL &url, int, bool overwrite, bool) m_request.method = HTTP_PUT; m_request.path = url.path(); - m_request.query = QString::null; + m_request.query = TQString::null; m_request.cache = CC_Reload; m_request.doProxy = m_bUseProxy; @@ -1334,7 +1334,7 @@ void HTTPProtocol::copy( const KURL& src, const KURL& dest, int, bool overwrite m_request.path = src.path(); m_request.davData.desturl = newDest.url(); m_request.davData.overwrite = overwrite; - m_request.query = QString::null; + m_request.query = TQString::null; m_request.cache = CC_Reload; m_request.doProxy = m_bUseProxy; @@ -1366,7 +1366,7 @@ void HTTPProtocol::rename( const KURL& src, const KURL& dest, bool overwrite ) m_request.path = src.path(); m_request.davData.desturl = newDest.url(); m_request.davData.overwrite = overwrite; - m_request.query = QString::null; + m_request.query = TQString::null; m_request.cache = CC_Reload; m_request.doProxy = m_bUseProxy; @@ -1390,7 +1390,7 @@ void HTTPProtocol::rename( const KURL& src, const KURL& dest, bool overwrite ) m_request.path = m_redirectLocation.path(); m_request.davData.desturl = newDest.url(); m_request.davData.overwrite = overwrite; - m_request.query = QString::null; + m_request.query = TQString::null; m_request.cache = CC_Reload; m_request.doProxy = m_bUseProxy; @@ -1413,7 +1413,7 @@ void HTTPProtocol::del( const KURL& url, bool ) m_request.method = HTTP_DELETE; m_request.path = url.path(); - m_request.query = QString::null; + m_request.query = TQString::null; m_request.cache = CC_Reload; m_request.doProxy = m_bUseProxy; @@ -1444,8 +1444,8 @@ void HTTPProtocol::post( const KURL& url ) retrieveContent(); } -void HTTPProtocol::davLock( const KURL& url, const QString& scope, - const QString& type, const QString& owner ) +void HTTPProtocol::davLock( const KURL& url, const TQString& scope, + const TQString& type, const TQString& owner ) { kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::davLock " << url.prettyURL() << endl; @@ -1455,31 +1455,31 @@ void HTTPProtocol::davLock( const KURL& url, const QString& scope, m_request.method = DAV_LOCK; m_request.path = url.path(); - m_request.query = QString::null; + m_request.query = TQString::null; m_request.cache = CC_Reload; m_request.doProxy = m_bUseProxy; /* Create appropriate lock XML request. */ - QDomDocument lockReq; + TQDomDocument lockReq; - QDomElement lockInfo = lockReq.createElementNS( "DAV:", "lockinfo" ); + TQDomElement lockInfo = lockReq.createElementNS( "DAV:", "lockinfo" ); lockReq.appendChild( lockInfo ); - QDomElement lockScope = lockReq.createElement( "lockscope" ); + TQDomElement lockScope = lockReq.createElement( "lockscope" ); lockInfo.appendChild( lockScope ); lockScope.appendChild( lockReq.createElement( scope ) ); - QDomElement lockType = lockReq.createElement( "locktype" ); + TQDomElement lockType = lockReq.createElement( "locktype" ); lockInfo.appendChild( lockType ); lockType.appendChild( lockReq.createElement( type ) ); if ( !owner.isNull() ) { - QDomElement ownerElement = lockReq.createElement( "owner" ); + TQDomElement ownerElement = lockReq.createElement( "owner" ); lockReq.appendChild( ownerElement ); - QDomElement ownerHref = lockReq.createElement( "href" ); + TQDomElement ownerHref = lockReq.createElement( "href" ); ownerElement.appendChild( ownerHref ); ownerHref.appendChild( lockReq.createTextNode( owner ) ); @@ -1492,17 +1492,17 @@ void HTTPProtocol::davLock( const KURL& url, const QString& scope, if ( m_responseCode == 200 ) { // success - QDomDocument multiResponse; + TQDomDocument multiResponse; multiResponse.setContent( m_bufWebDavData, true ); - QDomElement prop = multiResponse.documentElement().namedItem( "prop" ).toElement(); + TQDomElement prop = multiResponse.documentElement().namedItem( "prop" ).toElement(); - QDomElement lockdiscovery = prop.namedItem( "lockdiscovery" ).toElement(); + TQDomElement lockdiscovery = prop.namedItem( "lockdiscovery" ).toElement(); uint lockCount = 0; davParseActiveLocks( lockdiscovery.elementsByTagName( "activelock" ), lockCount ); - setMetaData( "davLockCount", QString("%1").arg( lockCount ) ); + setMetaData( "davLockCount", TQString("%1").arg( lockCount ) ); finished(); @@ -1520,7 +1520,7 @@ void HTTPProtocol::davUnlock( const KURL& url ) m_request.method = DAV_UNLOCK; m_request.path = url.path(); - m_request.query = QString::null; + m_request.query = TQString::null; m_request.cache = CC_Reload; m_request.doProxy = m_bUseProxy; @@ -1532,7 +1532,7 @@ void HTTPProtocol::davUnlock( const KURL& url ) davError(); } -QString HTTPProtocol::davError( int code /* = -1 */, QString url ) +TQString HTTPProtocol::davError( int code /* = -1 */, TQString url ) { bool callError = false; if ( code == -1 ) { @@ -1546,11 +1546,11 @@ QString HTTPProtocol::davError( int code /* = -1 */, QString url ) if ( !url.isNull() ) url = m_request.url.url(); - QString action, errorString; + TQString action, errorString; KIO::Error kError; // for 412 Precondition Failed - QString ow = i18n( "Otherwise, the request would have succeeded." ); + TQString ow = i18n( "Otherwise, the request would have succeeded." ); switch ( m_request.method ) { case DAV_PROPFIND: @@ -1615,29 +1615,29 @@ QString HTTPProtocol::davError( int code /* = -1 */, QString url ) // there was an error retrieving the XML document. // ironic, eh? if ( !readBody( true ) && m_bError ) - return QString::null; + return TQString::null; - QStringList errors; - QDomDocument multiResponse; + TQStringList errors; + TQDomDocument multiResponse; multiResponse.setContent( m_bufWebDavData, true ); - QDomElement multistatus = multiResponse.documentElement().namedItem( "multistatus" ).toElement(); + TQDomElement multistatus = multiResponse.documentElement().namedItem( "multistatus" ).toElement(); - QDomNodeList responses = multistatus.elementsByTagName( "response" ); + TQDomNodeList responses = multistatus.elementsByTagName( "response" ); for (uint i = 0; i < responses.count(); i++) { int errCode; - QString errUrl; + TQString errUrl; - QDomElement response = responses.item(i).toElement(); - QDomElement code = response.namedItem( "status" ).toElement(); + TQDomElement response = responses.item(i).toElement(); + TQDomElement code = response.namedItem( "status" ).toElement(); if ( !code.isNull() ) { errCode = codeFromResponse( code.text() ); - QDomElement href = response.namedItem( "href" ).toElement(); + TQDomElement href = response.namedItem( "href" ).toElement(); if ( !href.isNull() ) errUrl = href.text(); errors << davError( errCode, errUrl ); @@ -1648,7 +1648,7 @@ QString HTTPProtocol::davError( int code /* = -1 */, QString url ) errorString = i18n("An error occurred while attempting to %1, %2. A " "summary of the reasons is below.<ul>").arg( action ).arg( url ); - for ( QStringList::Iterator it = errors.begin(); it != errors.end(); ++it ) + for ( TQStringList::Iterator it = errors.begin(); it != errors.end(); ++it ) errorString += "<li>" + *it + "</li>"; errorString += "</ul>"; @@ -1735,7 +1735,7 @@ QString HTTPProtocol::davError( int code /* = -1 */, QString url ) void HTTPProtocol::httpError() { - QString action, errorString; + TQString action, errorString; KIO::Error kError; switch ( m_request.method ) { @@ -1799,18 +1799,18 @@ bool HTTPProtocol::isOffline(const KURL &url) { const int NetWorkStatusUnknown = 1; const int NetWorkStatusOnline = 8; - QCString replyType; - QByteArray params; - QByteArray reply; + TQCString replyType; + TQByteArray params; + TQByteArray reply; - QDataStream stream(params, IO_WriteOnly); + TQDataStream stream(params, IO_WriteOnly); stream << url.url(); - if ( dcopClient()->call( "kded", "networkstatus", "status(QString)", + if ( dcopClient()->call( "kded", "networkstatus", "status(TQString)", params, replyType, reply ) && (replyType == "int") ) { int result; - QDataStream stream2( reply, IO_ReadOnly ); + TQDataStream stream2( reply, IO_ReadOnly ); stream2 >> result; kdDebug(7113) << "(" << m_pid << ") networkstatus status = " << result << endl; return (result != NetWorkStatusUnknown) && (result != NetWorkStatusOnline); @@ -1819,9 +1819,9 @@ bool HTTPProtocol::isOffline(const KURL &url) return false; // On error, assume we are online } -void HTTPProtocol::multiGet(const QByteArray &data) +void HTTPProtocol::multiGet(const TQByteArray &data) { - QDataStream stream(data, IO_ReadOnly); + TQDataStream stream(data, IO_ReadOnly); Q_UINT32 n; stream >> n; @@ -1845,7 +1845,7 @@ void HTTPProtocol::multiGet(const QByteArray &data) m_request.method = HTTP_GET; m_request.path = url.path(); m_request.query = url.query(); - QString tmp = metaData("cache"); + TQString tmp = metaData("cache"); if (!tmp.isEmpty()) m_request.cache = parseCacheControl(tmp); else @@ -2043,7 +2043,7 @@ void HTTPProtocol::httpCheckConnection() bool HTTPProtocol::httpOpenConnection() { int errCode; - QString errMsg; + TQString errMsg; kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::httpOpenConnection" << endl; @@ -2053,7 +2053,7 @@ bool HTTPProtocol::httpOpenConnection() if ( m_state.doProxy ) { - QString proxy_host = m_proxyURL.host(); + TQString proxy_host = m_proxyURL.host(); int proxy_port = m_proxyURL.port(); kdDebug(7113) << "(" << m_pid << ") Connecting to proxy server: " @@ -2222,8 +2222,8 @@ bool HTTPProtocol::httpOpen() } } - QString header; - QString davHeader; + TQString header; + TQString davHeader; bool moreData = false; bool davData = false; @@ -2239,7 +2239,7 @@ bool HTTPProtocol::httpOpen() setEnableSSLTunnel( true ); // We send a HTTP 1.0 header since some proxies refuse HTTP 1.1 and we don't // need any HTTP 1.1 capabilities for CONNECT - Waba - header = QString("CONNECT %1:%2 HTTP/1.0" + header = TQString("CONNECT %1:%2 HTTP/1.0" "\r\n").arg( m_request.encoded_hostname).arg(m_request.port); // Identify who you are to the proxy server! @@ -2250,7 +2250,7 @@ bool HTTPProtocol::httpOpen() header += "Host: " + m_state.encoded_hostname; if (m_state.port != m_iDefaultPort) - header += QString(":%1").arg(m_state.port); + header += TQString(":%1").arg(m_state.port); header += "\r\n"; header += proxyAuthenticationHeader(); @@ -2298,7 +2298,7 @@ bool HTTPProtocol::httpOpen() if ( m_request.davData.depth == 2 ) davHeader += "infinity"; else - davHeader += QString("%1").arg( m_request.davData.depth ); + davHeader += TQString("%1").arg( m_request.davData.depth ); } davHeader += "\r\n"; m_request.bCachedWrite = false; // Do not put any result in the cache @@ -2333,7 +2333,7 @@ bool HTTPProtocol::httpOpen() if ( timeout == 0 ) davHeader += "Infinite"; else - davHeader += QString("Seconds-%1").arg(timeout); + davHeader += TQString("Seconds-%1").arg(timeout); } davHeader += "\r\n"; m_request.bCachedWrite = false; // Do not put any result in the cache @@ -2362,7 +2362,7 @@ bool HTTPProtocol::httpOpen() m_request.bCachedWrite = false; break; default: - error (ERR_UNSUPPORTED_ACTION, QString::null); + error (ERR_UNSUPPORTED_ACTION, TQString::null); return false; } // DAV_POLL; DAV_NOTIFY @@ -2416,7 +2416,7 @@ bool HTTPProtocol::httpOpen() if ( m_request.offset > 0 ) { - header += QString("Range: bytes=%1-\r\n").arg(KIO::number(m_request.offset)); + header += TQString("Range: bytes=%1-\r\n").arg(KIO::number(m_request.offset)); kdDebug(7103) << "kio_http : Range = " << KIO::number(m_request.offset) << endl; } @@ -2437,7 +2437,7 @@ bool HTTPProtocol::httpOpen() } header += "Accept: "; - QString acceptHeader = metaData("accept"); + TQString acceptHeader = metaData("accept"); if (!acceptHeader.isEmpty()) header += acceptHeader; else @@ -2460,11 +2460,11 @@ bool HTTPProtocol::httpOpen() header += "Host: " + m_state.encoded_hostname; if (m_state.port != m_iDefaultPort) - header += QString(":%1").arg(m_state.port); + header += TQString(":%1").arg(m_state.port); header += "\r\n"; - QString cookieStr; - QString cookieMode = metaData("cookies").lower(); + TQString cookieStr; + TQString cookieMode = metaData("cookies").lower(); if (cookieMode == "none") { m_request.cookieMode = HTTPRequest::CookiesNone; @@ -2484,7 +2484,7 @@ bool HTTPProtocol::httpOpen() if (!cookieStr.isEmpty()) header += cookieStr + "\r\n"; - QString customHeader = metaData( "customHTTPHeader" ); + TQString customHeader = metaData( "customHTTPHeader" ); if (!customHeader.isEmpty()) { header += sanitizeCustomHTTPHeader(customHeader); @@ -2574,7 +2574,7 @@ bool HTTPProtocol::httpOpen() header += davProcessLocks(); // add extra webdav headers, if supplied - QString davExtraHeader = metaData("davHeader"); + TQString davExtraHeader = metaData("davHeader"); if ( !davExtraHeader.isEmpty() ) davHeader += davExtraHeader; @@ -2590,8 +2590,8 @@ bool HTTPProtocol::httpOpen() kdDebug(7103) << "(" << m_pid << ") ============ Sending Header:" << endl; - QStringList headerOutput = QStringList::split("\r\n", header); - QStringList::Iterator it = headerOutput.begin(); + TQStringList headerOutput = TQStringList::split("\r\n", header); + TQStringList::Iterator it = headerOutput.begin(); for (; it != headerOutput.end(); it++) kdDebug(7103) << "(" << m_pid << ") " << (*it) << endl; @@ -2679,7 +2679,7 @@ try_again: return false; } - m_strMimeType = QString::fromUtf8( buffer).stripWhiteSpace(); + m_strMimeType = TQString::fromUtf8( buffer).stripWhiteSpace(); kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::readHeader: cached " << "data mimetype: " << m_strMimeType << endl; @@ -2693,11 +2693,11 @@ try_again: return false; } - m_request.strCharset = QString::fromUtf8( buffer).stripWhiteSpace().lower(); + m_request.strCharset = TQString::fromUtf8( buffer).stripWhiteSpace().lower(); setMetaData("charset", m_request.strCharset); if (!m_request.lastModified.isEmpty()) setMetaData("modified", m_request.lastModified); - QString tmp; + TQString tmp; tmp.setNum(m_request.expireDate); setMetaData("expire-date", tmp); tmp.setNum(m_request.creationDate); @@ -2707,16 +2707,16 @@ try_again: return true; } - QCString locationStr; // In case we get a redirect. - QCString cookieStr; // In case we get a cookie. + TQCString locationStr; // In case we get a redirect. + TQCString cookieStr; // In case we get a cookie. - QString dispositionType; // In case we get a Content-Disposition type - QString dispositionFilename; // In case we get a Content-Disposition filename + TQString dispositionType; // In case we get a Content-Disposition type + TQString dispositionFilename; // In case we get a Content-Disposition filename - QString mediaValue; - QString mediaAttribute; + TQString mediaValue; + TQString mediaAttribute; - QStringList upgradeOffers; + TQStringList upgradeOffers; bool upgradeRequired = false; // Server demands that we upgrade to something // This is also true if we ask to upgrade and @@ -2725,9 +2725,9 @@ try_again: bool canUpgrade = false; // The server offered an upgrade - m_request.etag = QString::null; - m_request.lastModified = QString::null; - m_request.strCharset = QString::null; + m_request.etag = TQString::null; + m_request.lastModified = TQString::null; + m_request.strCharset = TQString::null; time_t dateHeader = 0; time_t expireDate = 0; // 0 = no info, 1 = already expired, > 1 = actual date @@ -2779,7 +2779,7 @@ try_again: // by assuming that they will be sending html. kdDebug(7113) << "(" << m_pid << ") HTTPPreadHeader: HEAD -> returned " << "mimetype: " << DEFAULT_MIME_TYPE << endl; - mimeType(QString::fromLatin1(DEFAULT_MIME_TYPE)); + mimeType(TQString::fromLatin1(DEFAULT_MIME_TYPE)); return true; } @@ -2840,7 +2840,7 @@ try_again: // Store the the headers so they can be passed to the // calling application later - m_responseHeader << QString::fromLatin1(buf); + m_responseHeader << TQString::fromLatin1(buf); if ((strncasecmp(buf, "HTTP", 4) == 0) || (strncasecmp(buf, "ICY ", 4) == 0)) // Shoutcast support @@ -3022,13 +3022,13 @@ try_again: } // Keep Alive else if (strncasecmp(buf, "Keep-Alive:", 11) == 0) { - QStringList options = QStringList::split(',', - QString::fromLatin1(trimLead(buf+11))); - for(QStringList::ConstIterator it = options.begin(); + TQStringList options = TQStringList::split(',', + TQString::fromLatin1(trimLead(buf+11))); + for(TQStringList::ConstIterator it = options.begin(); it != options.end(); it++) { - QString option = (*it).stripWhiteSpace().lower(); + TQString option = (*it).stripWhiteSpace().lower(); if (option.startsWith("timeout=")) { m_keepAliveTimeout = option.mid(8).toInt(); @@ -3038,13 +3038,13 @@ try_again: // Cache control else if (strncasecmp(buf, "Cache-Control:", 14) == 0) { - QStringList cacheControls = QStringList::split(',', - QString::fromLatin1(trimLead(buf+14))); - for(QStringList::ConstIterator it = cacheControls.begin(); + TQStringList cacheControls = TQStringList::split(',', + TQString::fromLatin1(trimLead(buf+14))); + for(TQStringList::ConstIterator it = cacheControls.begin(); it != cacheControls.end(); it++) { - QString cacheControl = (*it).stripWhiteSpace(); + TQString cacheControl = (*it).stripWhiteSpace(); if (strncasecmp(cacheControl.latin1(), "no-cache", 8) == 0) { m_request.bCachedWrite = false; // Don't put in cache @@ -3057,7 +3057,7 @@ try_again: } else if (strncasecmp(cacheControl.latin1(), "max-age=", 8) == 0) { - QString age = cacheControl.mid(8).stripWhiteSpace(); + TQString age = cacheControl.mid(8).stripWhiteSpace(); if (!age.isNull()) maxAge = STRTOLL(age.latin1(), 0, 10); } @@ -3074,7 +3074,7 @@ try_again: else if (strncasecmp(buf, "Content-location:", 17) == 0) { setMetaData ("content-location", - QString::fromLatin1(trimLead(buf+17)).stripWhiteSpace()); + TQString::fromLatin1(trimLead(buf+17)).stripWhiteSpace()); } // what type of data do we have? @@ -3086,7 +3086,7 @@ try_again: while ( *pos && *pos != ';' ) pos++; // Assign the mime-type. - m_strMimeType = QString::fromLatin1(start, pos-start).stripWhiteSpace().lower(); + m_strMimeType = TQString::fromLatin1(start, pos-start).stripWhiteSpace().lower(); kdDebug(7113) << "(" << m_pid << ") Content-type: " << m_strMimeType << endl; // If we still have text, then it means we have a mime-type with a @@ -3101,8 +3101,8 @@ try_again: if (*pos) { - mediaAttribute = QString::fromLatin1(start, pos-start).stripWhiteSpace().lower(); - mediaValue = QString::fromLatin1(pos+1, end-pos-1).stripWhiteSpace(); + mediaAttribute = TQString::fromLatin1(start, pos-start).stripWhiteSpace().lower(); + mediaValue = TQString::fromLatin1(pos+1, end-pos-1).stripWhiteSpace(); pos = end; if (mediaValue.length() && (mediaValue[0] == '"') && @@ -3146,7 +3146,7 @@ try_again: // Cache management else if (strncasecmp(buf, "Last-Modified:", 14) == 0) { - m_request.lastModified = (QString::fromLatin1(trimLead(buf+14))).stripWhiteSpace(); + m_request.lastModified = (TQString::fromLatin1(trimLead(buf+14))).stripWhiteSpace(); } // whoops.. we received a warning @@ -3158,7 +3158,7 @@ try_again: // Cache management (HTTP 1.0) else if (strncasecmp(buf, "Pragma:", 7) == 0) { - QCString pragma = QCString(trimLead(buf+7)).stripWhiteSpace().lower(); + TQCString pragma = TQCString(trimLead(buf+7)).stripWhiteSpace().lower(); if (pragma == "no-cache") { m_request.bCachedWrite = false; // Don't put in cache @@ -3170,14 +3170,14 @@ try_again: // The deprecated Refresh Response else if (strncasecmp(buf,"Refresh:", 8) == 0) { mayCache = false; // Do not cache page as it defeats purpose of Refresh tag! - setMetaData( "http-refresh", QString::fromLatin1(trimLead(buf+8)).stripWhiteSpace() ); + setMetaData( "http-refresh", TQString::fromLatin1(trimLead(buf+8)).stripWhiteSpace() ); } // In fact we should do redirection only if we got redirection code else if (strncasecmp(buf, "Location:", 9) == 0) { // Redirect only for 3xx status code, will ya! Thanks, pal! if ( m_responseCode > 299 && m_responseCode < 400 ) - locationStr = QCString(trimLead(buf+9)).stripWhiteSpace(); + locationStr = TQCString(trimLead(buf+9)).stripWhiteSpace(); } // Check for cookies @@ -3198,8 +3198,8 @@ try_again: else if (strncasecmp(buf, "Upgrade:", 8) == 0) { // Now we have to check to see what is offered for the upgrade - QString offered = &(buf[8]); - upgradeOffers = QStringList::split(QRegExp("[ \n,\r\t]"), offered); + TQString offered = &(buf[8]); + upgradeOffers = TQStringList::split(TQRegExp("[ \n,\r\t]"), offered); } // content? @@ -3247,7 +3247,7 @@ try_again: dispositionBuf--; if ( dispositionBuf > bufStart ) - dispositionFilename = QString::fromLatin1( bufStart, dispositionBuf-bufStart ); + dispositionFilename = TQString::fromLatin1( bufStart, dispositionBuf-bufStart ); break; } @@ -3260,7 +3260,7 @@ try_again: dispositionBuf++; if ( dispositionBuf > bufStart ) - dispositionType = QString::fromLatin1( bufStart, dispositionBuf-bufStart ).stripWhiteSpace(); + dispositionType = TQString::fromLatin1( bufStart, dispositionBuf-bufStart ).stripWhiteSpace(); while ( *dispositionBuf == ';' || *dispositionBuf == ' ' ) dispositionBuf++; @@ -3281,7 +3281,7 @@ try_again: } } else if(strncasecmp(buf, "Content-Language:", 17) == 0) { - QString language = QString::fromLatin1(trimLead(buf+17)).stripWhiteSpace(); + TQString language = TQString::fromLatin1(trimLead(buf+17)).stripWhiteSpace(); if (!language.isEmpty()) setMetaData("content-language", language); } @@ -3294,43 +3294,43 @@ try_again: } else if (strncasecmp(buf, "Link:", 5) == 0) { // We only support Link: <url>; rel="type" so far - QStringList link = QStringList::split(";", QString(buf) - .replace(QRegExp("^Link:[ ]*"), + TQStringList link = TQStringList::split(";", TQString(buf) + .replace(TQRegExp("^Link:[ ]*"), "")); if (link.count() == 2) { - QString rel = link[1].stripWhiteSpace(); + TQString rel = link[1].stripWhiteSpace(); if (rel.startsWith("rel=\"")) { rel = rel.mid(5, rel.length() - 6); if (rel.lower() == "pageservices") { - QString url = link[0].replace(QRegExp("[<>]"),"").stripWhiteSpace(); + TQString url = link[0].replace(TQRegExp("[<>]"),"").stripWhiteSpace(); setMetaData("PageServices", url); } } } } else if (strncasecmp(buf, "P3P:", 4) == 0) { - QString p3pstr = buf; + TQString p3pstr = buf; p3pstr = p3pstr.mid(4).simplifyWhiteSpace(); - QStringList policyrefs, compact; - QStringList policyfields = QStringList::split(QRegExp(",[ ]*"), p3pstr); - for (QStringList::Iterator it = policyfields.begin(); + TQStringList policyrefs, compact; + TQStringList policyfields = TQStringList::split(TQRegExp(",[ ]*"), p3pstr); + for (TQStringList::Iterator it = policyfields.begin(); it != policyfields.end(); ++it) { - QStringList policy = QStringList::split("=", *it); + TQStringList policy = TQStringList::split("=", *it); if (policy.count() == 2) { if (policy[0].lower() == "policyref") { - policyrefs << policy[1].replace(QRegExp("[\"\']"), "") + policyrefs << policy[1].replace(TQRegExp("[\"\']"), "") .stripWhiteSpace(); } else if (policy[0].lower() == "cp") { // We convert to cp\ncp\ncp\n[...]\ncp to be consistent with // other metadata sent in strings. This could be a bit more // efficient but I'm going for correctness right now. - QStringList cps = QStringList::split(" ", - policy[1].replace(QRegExp("[\"\']"), "") + TQStringList cps = TQStringList::split(" ", + policy[1].replace(TQRegExp("[\"\']"), "") .simplifyWhiteSpace()); - for (QStringList::Iterator j = cps.begin(); j != cps.end(); ++j) + for (TQStringList::Iterator j = cps.begin(); j != cps.end(); ++j) compact << *j; } } @@ -3374,17 +3374,17 @@ try_again: // md5 signature else if (strncasecmp(buf, "Content-MD5:", 12) == 0) { - m_sContentMD5 = QString::fromLatin1(trimLead(buf + 12)); + m_sContentMD5 = TQString::fromLatin1(trimLead(buf + 12)); } // *** Responses to the HTTP OPTIONS method follow // WebDAV capabilities else if (strncasecmp(buf, "DAV:", 4) == 0) { if (m_davCapabilities.isEmpty()) { - m_davCapabilities << QString::fromLatin1(trimLead(buf + 4)); + m_davCapabilities << TQString::fromLatin1(trimLead(buf + 4)); } else { - m_davCapabilities << QString::fromLatin1(trimLead(buf + 4)); + m_davCapabilities << TQString::fromLatin1(trimLead(buf + 4)); } } // *** Responses to the HTTP OPTIONS method finished @@ -3410,7 +3410,7 @@ try_again: } while (!m_bEOF && (len || noHeader) && (headerSize < maxHeaderSize) && (gets(buffer, sizeof(buffer)-1))); // Now process the HTTP/1.1 upgrade - QStringList::Iterator opt = upgradeOffers.begin(); + TQStringList::Iterator opt = upgradeOffers.begin(); for( ; opt != upgradeOffers.end(); ++opt) { if (*opt == "TLS/1.0") { if(upgradeRequired) { @@ -3488,7 +3488,7 @@ try_again: if ((m_request.cookieMode == HTTPRequest::CookiesAuto) && m_request.bUseCookiejar) { // Give cookies to the cookiejar. - QString domain = config()->readEntry("cross-domain"); + TQString domain = config()->readEntry("cross-domain"); if (!domain.isEmpty() && isCrossDomainRequest(m_request.url.host(), domain)) cookieStr = "Cross-Domain\n" + cookieStr; addCookies( m_request.url.url(), cookieStr ); @@ -3660,14 +3660,14 @@ try_again: if (m_strMimeType == "application/x-tar") { m_qContentEncodings.remove(m_qContentEncodings.fromLast()); - m_strMimeType = QString::fromLatin1("application/x-tgz"); + m_strMimeType = TQString::fromLatin1("application/x-tgz"); } else if (m_strMimeType == "application/postscript") { // LEONB: Adding another exception for psgz files. // Could we use the mimelnk files instead of hardcoding all this? m_qContentEncodings.remove(m_qContentEncodings.fromLast()); - m_strMimeType = QString::fromLatin1("application/x-gzpostscript"); + m_strMimeType = TQString::fromLatin1("application/x-gzpostscript"); } else if ( m_request.allowCompressedPage && m_strMimeType != "application/x-tgz" && @@ -3676,7 +3676,7 @@ try_again: m_request.url.path().right(6) == ".ps.gz" ) { m_qContentEncodings.remove(m_qContentEncodings.fromLast()); - m_strMimeType = QString::fromLatin1("application/x-gzpostscript"); + m_strMimeType = TQString::fromLatin1("application/x-gzpostscript"); } else if ( (m_request.allowCompressedPage && m_strMimeType == "text/html") @@ -3693,7 +3693,7 @@ try_again: else { m_qContentEncodings.remove(m_qContentEncodings.fromLast()); - m_strMimeType = QString::fromLatin1("application/x-gzip"); + m_strMimeType = TQString::fromLatin1("application/x-gzip"); } } @@ -3706,34 +3706,34 @@ try_again: if (m_qContentEncodings.last() == "bzip2") { m_qContentEncodings.remove(m_qContentEncodings.fromLast()); - m_strMimeType = QString::fromLatin1("application/x-bzip2"); + m_strMimeType = TQString::fromLatin1("application/x-bzip2"); } // Convert some common mimetypes to standard KDE mimetypes if (m_strMimeType == "application/x-targz") - m_strMimeType = QString::fromLatin1("application/x-tgz"); + m_strMimeType = TQString::fromLatin1("application/x-tgz"); else if (m_strMimeType == "application/zip") - m_strMimeType = QString::fromLatin1("application/x-zip"); + m_strMimeType = TQString::fromLatin1("application/x-zip"); else if (m_strMimeType == "image/x-png") - m_strMimeType = QString::fromLatin1("image/png"); + m_strMimeType = TQString::fromLatin1("image/png"); else if (m_strMimeType == "image/bmp") - m_strMimeType = QString::fromLatin1("image/x-bmp"); + m_strMimeType = TQString::fromLatin1("image/x-bmp"); else if (m_strMimeType == "audio/mpeg" || m_strMimeType == "audio/x-mpeg" || m_strMimeType == "audio/mp3") - m_strMimeType = QString::fromLatin1("audio/x-mp3"); + m_strMimeType = TQString::fromLatin1("audio/x-mp3"); else if (m_strMimeType == "audio/microsoft-wave") - m_strMimeType = QString::fromLatin1("audio/x-wav"); + m_strMimeType = TQString::fromLatin1("audio/x-wav"); else if (m_strMimeType == "audio/midi") - m_strMimeType = QString::fromLatin1("audio/x-midi"); + m_strMimeType = TQString::fromLatin1("audio/x-midi"); else if (m_strMimeType == "image/x-xpixmap") - m_strMimeType = QString::fromLatin1("image/x-xpm"); + m_strMimeType = TQString::fromLatin1("image/x-xpm"); else if (m_strMimeType == "application/rtf") - m_strMimeType = QString::fromLatin1("text/rtf"); + m_strMimeType = TQString::fromLatin1("text/rtf"); // Crypto ones.... else if (m_strMimeType == "application/pkix-cert" || m_strMimeType == "application/binary-certificate") { - m_strMimeType = QString::fromLatin1("application/x-x509-ca-cert"); + m_strMimeType = TQString::fromLatin1("application/x-x509-ca-cert"); } // Prefer application/x-tgz or x-gzpostscript over application/x-gzip. @@ -3741,25 +3741,25 @@ try_again: { if ((m_request.url.path().right(7) == ".tar.gz") || (m_request.url.path().right(4) == ".tar")) - m_strMimeType = QString::fromLatin1("application/x-tgz"); + m_strMimeType = TQString::fromLatin1("application/x-tgz"); if ((m_request.url.path().right(6) == ".ps.gz")) - m_strMimeType = QString::fromLatin1("application/x-gzpostscript"); + m_strMimeType = TQString::fromLatin1("application/x-gzpostscript"); } // Some webservers say "text/plain" when they mean "application/x-bzip2" else if ((m_strMimeType == "text/plain") || (m_strMimeType == "application/octet-stream")) { - QString ext = m_request.url.path().right(4).upper(); + TQString ext = m_request.url.path().right(4).upper(); if (ext == ".BZ2") - m_strMimeType = QString::fromLatin1("application/x-bzip2"); + m_strMimeType = TQString::fromLatin1("application/x-bzip2"); else if (ext == ".PEM") - m_strMimeType = QString::fromLatin1("application/x-x509-ca-cert"); + m_strMimeType = TQString::fromLatin1("application/x-x509-ca-cert"); else if (ext == ".SWF") - m_strMimeType = QString::fromLatin1("application/x-shockwave-flash"); + m_strMimeType = TQString::fromLatin1("application/x-shockwave-flash"); else if (ext == ".PLS") - m_strMimeType = QString::fromLatin1("audio/x-scpls"); + m_strMimeType = TQString::fromLatin1("audio/x-scpls"); else if (ext == ".WMV") - m_strMimeType = QString::fromLatin1("video/x-ms-wmv"); + m_strMimeType = TQString::fromLatin1("video/x-ms-wmv"); } #if 0 @@ -3798,7 +3798,7 @@ try_again: } else { - QString tmp; + TQString tmp; tmp.setNum(expireDate); setMetaData("expire-date", tmp); tmp.setNum(time(0)); // Cache entry will be created shortly. @@ -3824,7 +3824,7 @@ try_again: // Do we want to cache this request? if (m_request.bUseCache) { - ::unlink( QFile::encodeName(m_request.cef)); + ::unlink( TQFile::encodeName(m_request.cef)); if ( m_request.bCachedWrite && !m_strMimeType.isEmpty() ) { // Check... @@ -3849,7 +3849,7 @@ try_again: } -void HTTPProtocol::addEncoding(QString encoding, QStringList &encs) +void HTTPProtocol::addEncoding(TQString encoding, TQStringList &encs) { encoding = encoding.stripWhiteSpace().lower(); // Identity is the same as no encoding @@ -3864,11 +3864,11 @@ void HTTPProtocol::addEncoding(QString encoding, QStringList &encs) //if ( m_cmd != CMD_COPY ) m_iSize = NO_SIZE; } else if ((encoding == "x-gzip") || (encoding == "gzip")) { - encs.append(QString::fromLatin1("gzip")); + encs.append(TQString::fromLatin1("gzip")); } else if ((encoding == "x-bzip2") || (encoding == "bzip2")) { - encs.append(QString::fromLatin1("bzip2")); // Not yet supported! + encs.append(TQString::fromLatin1("bzip2")); // Not yet supported! } else if ((encoding == "x-deflate") || (encoding == "deflate")) { - encs.append(QString::fromLatin1("deflate")); + encs.append(TQString::fromLatin1("deflate")); } else { kdDebug(7113) << "(" << m_pid << ") Unknown encoding encountered. " << "Please write code. Encoding = \"" << encoding @@ -3897,7 +3897,7 @@ bool HTTPProtocol::sendBody() { kdDebug(7113) << "(" << m_pid << ") POST'ing live data..." << endl; - QByteArray buffer; + TQByteArray buffer; int old_size; m_bufPOST.resize(0); @@ -3924,7 +3924,7 @@ bool HTTPProtocol::sendBody() infoMessage( i18n( "Sending data to %1" ).arg( m_request.hostname ) ); - QString size = QString ("Content-Length: %1\r\n\r\n").arg(length); + TQString size = TQString ("Content-Length: %1\r\n\r\n").arg(length); kdDebug( 7113 ) << "(" << m_pid << ")" << size << endl; // Send the content length... @@ -3938,7 +3938,7 @@ bool HTTPProtocol::sendBody() } // Send the data... - // kdDebug( 7113 ) << "(" << m_pid << ") POST DATA: " << QCString(m_bufPOST) << endl; + // kdDebug( 7113 ) << "(" << m_pid << ") POST DATA: " << TQCString(m_bufPOST) << endl; sendOk = (write(m_bufPOST.data(), m_bufPOST.size()) == (ssize_t) m_bufPOST.size()); if (!sendOk) { @@ -3961,8 +3961,8 @@ void HTTPProtocol::httpClose( bool keepAlive ) m_request.fcache = 0; if (m_request.bCachedWrite) { - QString filename = m_request.cef + ".new"; - ::unlink( QFile::encodeName(filename) ); + TQString filename = m_request.cef + ".new"; + ::unlink( TQFile::encodeName(filename) ); } } @@ -3979,8 +3979,8 @@ void HTTPProtocol::httpClose( bool keepAlive ) m_keepAliveTimeout = 2*DEFAULT_KEEP_ALIVE_TIMEOUT; kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::httpClose: keep alive (" << m_keepAliveTimeout << ")" << endl; - QByteArray data; - QDataStream stream( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream stream( data, IO_WriteOnly ); stream << int(99); // special: Close connection setTimeoutSpecialCommand(m_keepAliveTimeout, data); return; @@ -4034,12 +4034,12 @@ void HTTPProtocol::mimetype( const KURL& url ) << endl; } -void HTTPProtocol::special( const QByteArray &data ) +void HTTPProtocol::special( const TQByteArray &data ) { kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::special" << endl; int tmp; - QDataStream stream(data, IO_ReadOnly); + TQDataStream stream(data, IO_ReadOnly); stream >> tmp; switch (tmp) { @@ -4062,7 +4062,7 @@ void HTTPProtocol::special( const QByteArray &data ) case 5: // WebDAV lock { KURL url; - QString scope, type, owner; + TQString scope, type, owner; stream >> url >> scope >> type >> owner; davLock( url, scope, type, owner ); break; @@ -4212,7 +4212,7 @@ int HTTPProtocol::readUnlimited() return 0; } -void HTTPProtocol::slotData(const QByteArray &_d) +void HTTPProtocol::slotData(const TQByteArray &_d) { if (!_d.size()) { @@ -4228,7 +4228,7 @@ void HTTPProtocol::slotData(const QByteArray &_d) m_iContentLeft = NO_SIZE; } - QByteArray d = _d; + TQByteArray d = _d; if ( !m_dataInternal ) { // If a broken server does not send the mime-type, @@ -4263,7 +4263,7 @@ void HTTPProtocol::slotData(const QByteArray &_d) if ( m_strMimeType.isEmpty() ) { - m_strMimeType = QString::fromLatin1( DEFAULT_MIME_TYPE ); + m_strMimeType = TQString::fromLatin1( DEFAULT_MIME_TYPE ); kdDebug(7113) << "(" << m_pid << ") Using default mimetype: " << m_strMimeType << endl; } @@ -4277,7 +4277,7 @@ void HTTPProtocol::slotData(const QByteArray &_d) if ( m_cpMimeBuffer ) { - // Do not make any assumption about the state of the QByteArray we received. + // Do not make any assumption about the state of the TQByteArray we received. // Fix the crash described by BR# 130104. d.detach(); d.resize(0); @@ -4380,7 +4380,7 @@ bool HTTPProtocol::readBody( bool dataInternal /* = false */ ) if ( !dataInternal ) { processedSize( sz ); - data( QByteArray() ); + data( TQByteArray() ); } return true; @@ -4408,15 +4408,15 @@ bool HTTPProtocol::readBody( bool dataInternal /* = false */ ) HTTPFilterChain chain; - QObject::connect(&chain, SIGNAL(output(const QByteArray &)), - this, SLOT(slotData(const QByteArray &))); - QObject::connect(&chain, SIGNAL(error(int, const QString &)), - this, SLOT(error(int, const QString &))); + TQObject::connect(&chain, TQT_SIGNAL(output(const TQByteArray &)), + this, TQT_SLOT(slotData(const TQByteArray &))); + TQObject::connect(&chain, TQT_SIGNAL(error(int, const TQString &)), + this, TQT_SLOT(error(int, const TQString &))); // decode all of the transfer encodings while (!m_qTransferEncodings.isEmpty()) { - QString enc = m_qTransferEncodings.last(); + TQString enc = m_qTransferEncodings.last(); m_qTransferEncodings.remove(m_qTransferEncodings.fromLast()); if ( enc == "gzip" ) chain.addFilter(new HTTPFilterGZip); @@ -4447,7 +4447,7 @@ bool HTTPProtocol::readBody( bool dataInternal /* = false */ ) // WB: They shouldn't do that. We can work around that though... while (!m_qContentEncodings.isEmpty()) { - QString enc = m_qContentEncodings.last(); + TQString enc = m_qContentEncodings.last(); m_qContentEncodings.remove(m_qContentEncodings.fromLast()); if ( enc == "gzip" ) chain.addFilter(new HTTPFilterGZip); @@ -4518,11 +4518,11 @@ bool HTTPProtocol::readBody( bool dataInternal /* = false */ ) break; } } - chain.slotInput(QByteArray()); // Flush chain. + chain.slotInput(TQByteArray()); // Flush chain. if ( useMD5 ) { - QString calculatedMD5 = md5Filter->md5(); + TQString calculatedMD5 = md5Filter->md5(); if ( m_sContentMD5 == calculatedMD5 ) kdDebug(7113) << "(" << m_pid << ") MD5 checksum MATCHED!!" << endl; @@ -4556,13 +4556,13 @@ bool HTTPProtocol::readBody( bool dataInternal /* = false */ ) } if (!dataInternal) - data( QByteArray() ); + data( TQByteArray() ); return true; } -void HTTPProtocol::error( int _err, const QString &_text ) +void HTTPProtocol::error( int _err, const TQString &_text ) { httpClose(false); @@ -4585,50 +4585,50 @@ void HTTPProtocol::error( int _err, const QString &_text ) } -void HTTPProtocol::addCookies( const QString &url, const QCString &cookieHeader ) +void HTTPProtocol::addCookies( const TQString &url, const TQCString &cookieHeader ) { long windowId = m_request.window.toLong(); - QByteArray params; - QDataStream stream(params, IO_WriteOnly); + TQByteArray params; + TQDataStream stream(params, IO_WriteOnly); stream << url << cookieHeader << windowId; kdDebug(7113) << "(" << m_pid << ") " << cookieHeader << endl; kdDebug(7113) << "(" << m_pid << ") " << "Window ID: " << windowId << ", for host = " << url << endl; - if ( !dcopClient()->send( "kded", "kcookiejar", "addCookies(QString,QCString,long int)", params ) ) + if ( !dcopClient()->send( "kded", "kcookiejar", "addCookies(TQString,TQCString,long int)", params ) ) { kdWarning(7113) << "(" << m_pid << ") Can't communicate with kded_kcookiejar!" << endl; } } -QString HTTPProtocol::findCookies( const QString &url) +TQString HTTPProtocol::findCookies( const TQString &url) { - QCString replyType; - QByteArray params; - QByteArray reply; - QString result; + TQCString replyType; + TQByteArray params; + TQByteArray reply; + TQString result; long windowId = m_request.window.toLong(); - result = QString::null; - QDataStream stream(params, IO_WriteOnly); + result = TQString::null; + TQDataStream stream(params, IO_WriteOnly); stream << url << windowId; - if ( !dcopClient()->call( "kded", "kcookiejar", "findCookies(QString,long int)", + if ( !dcopClient()->call( "kded", "kcookiejar", "findCookies(TQString,long int)", params, replyType, reply ) ) { kdWarning(7113) << "(" << m_pid << ") Can't communicate with kded_kcookiejar!" << endl; return result; } - if ( replyType == "QString" ) + if ( replyType == "TQString" ) { - QDataStream stream2( reply, IO_ReadOnly ); + TQDataStream stream2( reply, IO_ReadOnly ); stream2 >> result; } else { kdError(7113) << "(" << m_pid << ") DCOP function findCookies(...) returns " - << replyType << ", expected QString" << endl; + << replyType << ", expected TQString" << endl; } return result; } @@ -4653,7 +4653,7 @@ void HTTPProtocol::cacheUpdate( const KURL& url, bool no_cache, time_t expireDat { fclose(m_request.fcache); m_request.fcache = 0; - ::unlink( QFile::encodeName(m_request.cef) ); + ::unlink( TQFile::encodeName(m_request.cef) ); } } else @@ -4669,9 +4669,9 @@ void HTTPProtocol::cacheUpdate( const KURL& url, bool no_cache, time_t expireDat FILE* HTTPProtocol::checkCacheEntry( bool readWrite) { - const QChar separator = '_'; + const TQChar separator = '_'; - QString CEF = m_request.path; + TQString CEF = m_request.path; int p = CEF.find('/'); @@ -4681,10 +4681,10 @@ FILE* HTTPProtocol::checkCacheEntry( bool readWrite) p = CEF.find('/', p); } - QString host = m_request.hostname.lower(); + TQString host = m_request.hostname.lower(); CEF = host + CEF + '_'; - QString dir = m_strCacheDir; + TQString dir = m_strCacheDir; if (dir[dir.length()-1] != '/') dir += "/"; @@ -4701,13 +4701,13 @@ FILE* HTTPProtocol::checkCacheEntry( bool readWrite) dir += "0"; unsigned long hash = 0x00000000; - QCString u = m_request.url.url().latin1(); + TQCString u = m_request.url.url().latin1(); for(int i = u.length(); i--;) { hash = (hash * 12211 + u[i]) % 2147483563; } - QString hashString; + TQString hashString; hashString.sprintf("%08lx", hash); CEF = CEF + hashString; @@ -4718,7 +4718,7 @@ FILE* HTTPProtocol::checkCacheEntry( bool readWrite) const char *mode = (readWrite ? "r+" : "r"); - FILE *fs = fopen( QFile::encodeName(CEF), mode); // Open for reading and writing + FILE *fs = fopen( TQFile::encodeName(CEF), mode); // Open for reading and writing if (!fs) return 0; @@ -4788,7 +4788,7 @@ FILE* HTTPProtocol::checkCacheEntry( bool readWrite) ok = false; if (ok) { - m_request.etag = QString(buffer).stripWhiteSpace(); + m_request.etag = TQString(buffer).stripWhiteSpace(); } // Last-Modified @@ -4796,14 +4796,14 @@ FILE* HTTPProtocol::checkCacheEntry( bool readWrite) ok = false; if (ok) { - m_request.lastModified = QString(buffer).stripWhiteSpace(); + m_request.lastModified = TQString(buffer).stripWhiteSpace(); } if (ok) return fs; fclose(fs); - unlink( QFile::encodeName(CEF)); + unlink( TQFile::encodeName(CEF)); return 0; } @@ -4814,7 +4814,7 @@ void HTTPProtocol::updateExpireDate(time_t expireDate, bool updateCreationDate) FILE *fs = checkCacheEntry(true); if (fs) { - QString date; + TQString date; char buffer[401]; time_t creationDate; @@ -4834,7 +4834,7 @@ void HTTPProtocol::updateExpireDate(time_t expireDate, bool updateCreationDate) { if (!ok || fseek(fs, cacheCreationDateOffset, SEEK_SET)) return; - QString date; + TQString date; date.setNum( time(0) ); date = date.leftJustify(16); fputs(date.latin1(), fs); // Creation date @@ -4865,21 +4865,21 @@ void HTTPProtocol::updateExpireDate(time_t expireDate, bool updateCreationDate) } } -void HTTPProtocol::createCacheEntry( const QString &mimetype, time_t expireDate) +void HTTPProtocol::createCacheEntry( const TQString &mimetype, time_t expireDate) { - QString dir = m_request.cef; + TQString dir = m_request.cef; int p = dir.findRev('/'); if (p == -1) return; // Error. dir.truncate(p); // Create file - (void) ::mkdir( QFile::encodeName(dir), 0700 ); + (void) ::mkdir( TQFile::encodeName(dir), 0700 ); - QString filename = m_request.cef + ".new"; // Create a new cache entryexpireDate + TQString filename = m_request.cef + ".new"; // Create a new cache entryexpireDate // kdDebug( 7103 ) << "creating new cache entry: " << filename << endl; - m_request.fcache = fopen( QFile::encodeName(filename), "w"); + m_request.fcache = fopen( TQFile::encodeName(filename), "w"); if (!m_request.fcache) { kdWarning(7113) << "(" << m_pid << ")createCacheEntry: opening " << filename << " failed." << endl; @@ -4891,7 +4891,7 @@ void HTTPProtocol::createCacheEntry( const QString &mimetype, time_t expireDate) fputs(m_request.url.url().latin1(), m_request.fcache); // Url fputc('\n', m_request.fcache); - QString date; + TQString date; m_request.creationDate = time(0); date.setNum( m_request.creationDate ); date = date.leftJustify(16); @@ -4931,8 +4931,8 @@ void HTTPProtocol::writeCacheEntry( const char *buffer, int nbytes) kdWarning(7113) << "(" << m_pid << ") writeCacheEntry: writing " << nbytes << " bytes failed." << endl; fclose(m_request.fcache); m_request.fcache = 0; - QString filename = m_request.cef + ".new"; - ::unlink( QFile::encodeName(filename) ); + TQString filename = m_request.cef + ".new"; + ::unlink( TQFile::encodeName(filename) ); return; } long file_pos = ftell( m_request.fcache ) / 1024; @@ -4942,20 +4942,20 @@ void HTTPProtocol::writeCacheEntry( const char *buffer, int nbytes) << "Kb, exceeds cache limits. (" << m_maxCacheSize << "Kb)" << endl; fclose(m_request.fcache); m_request.fcache = 0; - QString filename = m_request.cef + ".new"; - ::unlink( QFile::encodeName(filename) ); + TQString filename = m_request.cef + ".new"; + ::unlink( TQFile::encodeName(filename) ); return; } } void HTTPProtocol::closeCacheEntry() { - QString filename = m_request.cef + ".new"; + TQString filename = m_request.cef + ".new"; int result = fclose( m_request.fcache); m_request.fcache = 0; if (result == 0) { - if (::rename( QFile::encodeName(filename), QFile::encodeName(m_request.cef)) == 0) + if (::rename( TQFile::encodeName(filename), TQFile::encodeName(m_request.cef)) == 0) return; // Success kdWarning(7113) << "(" << m_pid << ") closeCacheEntry: error renaming " @@ -4971,17 +4971,17 @@ void HTTPProtocol::cleanCache() { const time_t maxAge = DEFAULT_CLEAN_CACHE_INTERVAL; // 30 Minutes. bool doClean = false; - QString cleanFile = m_strCacheDir; + TQString cleanFile = m_strCacheDir; if (cleanFile[cleanFile.length()-1] != '/') cleanFile += "/"; cleanFile += "cleaned"; struct stat stat_buf; - int result = ::stat(QFile::encodeName(cleanFile), &stat_buf); + int result = ::stat(TQFile::encodeName(cleanFile), &stat_buf); if (result == -1) { - int fd = creat( QFile::encodeName(cleanFile), 0600); + int fd = creat( TQFile::encodeName(cleanFile), 0600); if (fd != -1) { doClean = true; @@ -4997,7 +4997,7 @@ void HTTPProtocol::cleanCache() if (doClean) { // Touch file. - utime(QFile::encodeName(cleanFile), 0); + utime(TQFile::encodeName(cleanFile), 0); KApplication::startServiceByDesktopPath("http_cache_cleaner.desktop"); } } @@ -5106,19 +5106,19 @@ void HTTPProtocol::configAuth( char *p, bool isForProxy ) if ( strncasecmp( p, "realm=", 6 ) == 0 ) { //for sites like lib.homelinux.org - QTextCodec* oldCodec=QTextCodec::codecForCStrings(); + TQTextCodec* oldCodec=TQTextCodec::codecForCStrings(); if (KGlobal::locale()->language().contains("ru")) - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("CP1251")); + TQTextCodec::setCodecForCStrings(TQTextCodec::codecForName("CP1251")); p += 6; if (*p == '"') p++; while( p[i] && p[i] != '"' ) i++; if( isForProxy ) - m_strProxyRealm = QString::fromAscii( p, i ); + m_strProxyRealm = TQString::fromAscii( p, i ); else - m_strRealm = QString::fromAscii( p, i ); + m_strRealm = TQString::fromAscii( p, i ); - QTextCodec::setCodecForCStrings(oldCodec); + TQTextCodec::setCodecForCStrings(oldCodec); if (!p[i]) break; } @@ -5128,19 +5128,19 @@ void HTTPProtocol::configAuth( char *p, bool isForProxy ) if( isForProxy ) { ProxyAuthentication = f; - m_strProxyAuthorization = QString::fromLatin1( strAuth ); + m_strProxyAuthorization = TQString::fromLatin1( strAuth ); } else { Authentication = f; - m_strAuthorization = QString::fromLatin1( strAuth ); + m_strAuthorization = TQString::fromLatin1( strAuth ); } } bool HTTPProtocol::retryPrompt() { - QString prompt; + TQString prompt; switch ( m_responseCode ) { case 401: @@ -5217,7 +5217,7 @@ bool HTTPProtocol::getAuthorization() bool repeatFailure = (m_prevResponseCode == m_responseCode); - QString errorMsg; + TQString errorMsg; if (repeatFailure) { @@ -5225,7 +5225,7 @@ bool HTTPProtocol::getAuthorization() if ( Authentication == AUTH_Digest || ProxyAuthentication == AUTH_Digest ) { bool isStaleNonce = false; - QString auth = ( m_responseCode == 401 ) ? m_strAuthorization : m_strProxyAuthorization; + TQString auth = ( m_responseCode == 401 ) ? m_strAuthorization : m_strProxyAuthorization; int pos = auth.find("stale", 0, false); if ( pos != -1 ) { @@ -5262,7 +5262,7 @@ bool HTTPProtocol::getAuthorization() if ( Authentication == AUTH_NTLM || ProxyAuthentication == AUTH_NTLM ) { - QString auth = ( m_responseCode == 401 ) ? m_strAuthorization : m_strProxyAuthorization; + TQString auth = ( m_responseCode == 401 ) ? m_strAuthorization : m_strProxyAuthorization; kdDebug(7113) << "auth: " << auth << endl; if ( auth.length() > 4 ) { @@ -5344,7 +5344,7 @@ bool HTTPProtocol::getAuthorization() if ( Authentication == AUTH_Digest ) { - QString auth; + TQString auth; if (m_responseCode == 401) auth = m_strAuthorization; @@ -5417,7 +5417,7 @@ bool HTTPProtocol::getAuthorization() if (m_request.bErrorPage) errorPage(); else - error( ERR_USER_CANCELED, QString::null ); + error( ERR_USER_CANCELED, TQString::null ); return false; } @@ -5448,14 +5448,14 @@ void HTTPProtocol::saveAuthorization() } #ifdef HAVE_LIBGSSAPI -QCString HTTPProtocol::gssError( int major_status, int minor_status ) +TQCString HTTPProtocol::gssError( int major_status, int minor_status ) { OM_uint32 new_status; OM_uint32 msg_ctx = 0; gss_buffer_desc major_string; gss_buffer_desc minor_string; OM_uint32 ret; - QCString errorstr; + TQCString errorstr; errorstr = ""; @@ -5471,11 +5471,11 @@ QCString HTTPProtocol::gssError( int major_status, int minor_status ) return errorstr; } -QString HTTPProtocol::createNegotiateAuth() +TQString HTTPProtocol::createNegotiateAuth() { - QString auth; - QCString servicename; - QByteArray input; + TQString auth; + TQCString servicename; + TQByteArray input; OM_uint32 major_status, minor_status; OM_uint32 req_flags = 0; gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER; @@ -5527,8 +5527,8 @@ QString HTTPProtocol::createNegotiateAuth() if (GSS_ERROR(major_status)) { kdDebug(7113) << "(" << m_pid << ") gss_import_name failed: " << gssError(major_status, minor_status) << endl; // reset the auth string so that subsequent methods aren't confused - m_strAuthorization = QString::null; - return QString::null; + m_strAuthorization = TQString::null; + return TQString::null; } major_status = gss_init_sec_context(&minor_status, GSS_C_NO_CREDENTIAL, @@ -5547,8 +5547,8 @@ QString HTTPProtocol::createNegotiateAuth() ctx = GSS_C_NO_CONTEXT; } // reset the auth string so that subsequent methods aren't confused - m_strAuthorization = QString::null; - return QString::null; + m_strAuthorization = TQString::null; + return TQString::null; } input.duplicate((const char *)output_token.value, output_token.length); @@ -5569,24 +5569,24 @@ QString HTTPProtocol::createNegotiateAuth() #else // Dummy -QCString HTTPProtocol::gssError( int, int ) +TQCString HTTPProtocol::gssError( int, int ) { return ""; } // Dummy -QString HTTPProtocol::createNegotiateAuth() +TQString HTTPProtocol::createNegotiateAuth() { - return QString::null; + return TQString::null; } #endif -QString HTTPProtocol::createNTLMAuth( bool isForProxy ) +TQString HTTPProtocol::createNTLMAuth( bool isForProxy ) { uint len; - QString auth, user, domain, passwd; - QCString strauth; - QByteArray buf; + TQString auth, user, domain, passwd; + TQCString strauth; + TQByteArray buf; if ( isForProxy ) { @@ -5612,12 +5612,12 @@ QString HTTPProtocol::createNTLMAuth( bool isForProxy ) kdDebug(7113) << "(" << m_pid << ") NTLM length: " << len << endl; if ( user.isEmpty() || passwd.isEmpty() || len < 4 ) - return QString::null; + return TQString::null; if ( len > 4 ) { // create a response - QByteArray challenge; + TQByteArray challenge; KCodecs::base64Decode( strauth.right( len - 5 ), challenge ); KNTLM::getAuth( buf, challenge, user, passwd, domain, KNetwork::KResolver::localHostName(), false, false ); @@ -5639,10 +5639,10 @@ QString HTTPProtocol::createNTLMAuth( bool isForProxy ) return auth; } -QString HTTPProtocol::createBasicAuth( bool isForProxy ) +TQString HTTPProtocol::createBasicAuth( bool isForProxy ) { - QString auth; - QCString user, passwd; + TQString auth; + TQCString user, passwd; if ( isForProxy ) { auth = "Proxy-Authorization: Basic "; @@ -5669,14 +5669,14 @@ QString HTTPProtocol::createBasicAuth( bool isForProxy ) return auth; } -void HTTPProtocol::calculateResponse( DigestAuthInfo& info, QCString& Response ) +void HTTPProtocol::calculateResponse( DigestAuthInfo& info, TQCString& Response ) { KMD5 md; - QCString HA1; - QCString HA2; + TQCString HA1; + TQCString HA2; // Calculate H(A1) - QCString authStr = info.username; + TQCString authStr = info.username; authStr += ':'; authStr += info.realm; authStr += ':'; @@ -5736,13 +5736,13 @@ void HTTPProtocol::calculateResponse( DigestAuthInfo& info, QCString& Response ) << Response << endl; } -QString HTTPProtocol::createDigestAuth ( bool isForProxy ) +TQString HTTPProtocol::createDigestAuth ( bool isForProxy ) { const char *p; - QString auth; - QCString opaque; - QCString Response; + TQString auth; + TQCString opaque; + TQCString Response; DigestAuthInfo info; @@ -5762,12 +5762,12 @@ QString HTTPProtocol::createDigestAuth ( bool isForProxy ) p = m_strAuthorization.latin1(); } if (!p || !*p) - return QString::null; + return TQString::null; p += 6; // Skip "Digest" if ( info.username.isEmpty() || info.password.isEmpty() || !p ) - return QString::null; + return TQString::null; // info.entityBody = p; // FIXME: send digest of data for POST action ?? info.realm = ""; @@ -5847,21 +5847,21 @@ QString HTTPProtocol::createDigestAuth ( bool isForProxy ) p+=6; while ( *p == '"' ) p++; // Go past any number of " mark(s) first while ( p[i] != '"' ) i++; // Read everything until the last " mark - info.realm = QCString( p, i+1 ); + info.realm = TQCString( p, i+1 ); } else if (strncasecmp(p, "algorith=", 9)==0) { p+=9; while ( *p == '"' ) p++; // Go past any number of " mark(s) first while ( ( p[i] != '"' ) && ( p[i] != ',' ) && ( p[i] != '\0' ) ) i++; - info.algorithm = QCString(p, i+1); + info.algorithm = TQCString(p, i+1); } else if (strncasecmp(p, "algorithm=", 10)==0) { p+=10; while ( *p == '"' ) p++; // Go past any " mark(s) first while ( ( p[i] != '"' ) && ( p[i] != ',' ) && ( p[i] != '\0' ) ) i++; - info.algorithm = QCString(p,i+1); + info.algorithm = TQCString(p,i+1); } else if (strncasecmp(p, "domain=", 7)==0) { @@ -5870,7 +5870,7 @@ QString HTTPProtocol::createDigestAuth ( bool isForProxy ) while ( p[i] != '"' ) i++; // Read everything until the last " mark int pos; int idx = 0; - QCString uri = QCString(p,i+1); + TQCString uri = TQCString(p,i+1); do { pos = uri.find( ' ', idx ); @@ -5894,27 +5894,27 @@ QString HTTPProtocol::createDigestAuth ( bool isForProxy ) p+=6; while ( *p == '"' ) p++; // Go past any " mark(s) first while ( p[i] != '"' ) i++; // Read everything until the last " mark - info.nonce = QCString(p,i+1); + info.nonce = TQCString(p,i+1); } else if (strncasecmp(p, "opaque=", 7)==0) { p+=7; while ( *p == '"' ) p++; // Go past any " mark(s) first while ( p[i] != '"' ) i++; // Read everything until the last " mark - opaque = QCString(p,i+1); + opaque = TQCString(p,i+1); } else if (strncasecmp(p, "qop=", 4)==0) { p+=4; while ( *p == '"' ) p++; // Go past any " mark(s) first while ( p[i] != '"' ) i++; // Read everything until the last " mark - info.qop = QCString(p,i+1); + info.qop = TQCString(p,i+1); } p+=(i+1); } if (info.realm.isEmpty() || info.nonce.isEmpty()) - return QString::null; + return TQString::null; // If the "domain" attribute was not specified and the current response code // is authentication needed, add the current request url to the list over which @@ -5928,7 +5928,7 @@ QString HTTPProtocol::createDigestAuth ( bool isForProxy ) bool send = true; // Determine the path of the request url... - QString requestPath = m_request.url.directory(false, false); + TQString requestPath = m_request.url.directory(false, false); if (requestPath.isEmpty()) requestPath = "/"; @@ -5944,7 +5944,7 @@ QString HTTPProtocol::createDigestAuth ( bool isForProxy ) if (m_request.port > 0 && u.port() > 0) send &= (m_request.port == u.port()); - QString digestPath = u.directory (false, false); + TQString digestPath = u.directory (false, false); if (digestPath.isEmpty()) digestPath = "/"; @@ -5958,7 +5958,7 @@ QString HTTPProtocol::createDigestAuth ( bool isForProxy ) "authentication credential test: " << send << endl; if (!send) - return QString::null; + return TQString::null; } kdDebug(7113) << "(" << m_pid << ") RESULT OF PARSING:" << endl; @@ -6010,9 +6010,9 @@ QString HTTPProtocol::createDigestAuth ( bool isForProxy ) return auth; } -QString HTTPProtocol::proxyAuthenticationHeader() +TQString HTTPProtocol::proxyAuthenticationHeader() { - QString header; + TQString header; // We keep proxy authentication locally until they are changed. // Thus, no need to check with the password manager for every diff --git a/kioslave/http/http.h b/kioslave/http/http.h index ea2e68a8a..24f041cb4 100644 --- a/kioslave/http/http.h +++ b/kioslave/http/http.h @@ -30,9 +30,9 @@ #include <stdio.h> #include <time.h> -#include <qptrlist.h> -#include <qstrlist.h> -#include <qstringlist.h> +#include <tqptrlist.h> +#include <tqstrlist.h> +#include <tqstringlist.h> #include <kurl.h> #include "kio/tcpslavebase.h" @@ -46,12 +46,12 @@ namespace KIO { class AuthInfo; } -class HTTPProtocol : public QObject, public KIO::TCPSlaveBase +class HTTPProtocol : public TQObject, public KIO::TCPSlaveBase { Q_OBJECT public: - HTTPProtocol( const QCString &protocol, const QCString &pool, - const QCString &app ); + HTTPProtocol( const TQCString &protocol, const TQCString &pool, + const TQCString &app ); virtual ~HTTPProtocol(); /** HTTP version **/ @@ -75,11 +75,11 @@ public: doProxy = false; } - QString hostname; - QString encoded_hostname; + TQString hostname; + TQString encoded_hostname; short unsigned int port; - QString user; - QString passwd; + TQString user; + TQString passwd; bool doProxy; }; @@ -92,7 +92,7 @@ public: depth = 0; } - QString desturl; + TQString desturl; bool overwrite; int depth; }; @@ -121,44 +121,44 @@ public: creationDate = 0; } - QString hostname; - QString encoded_hostname; + TQString hostname; + TQString encoded_hostname; short unsigned int port; - QString user; - QString passwd; - QString path; - QString query; + TQString user; + TQString passwd; + TQString path; + TQString query; KIO::HTTP_METHOD method; KIO::CacheControl cache; KIO::filesize_t offset; bool doProxy; KURL url; - QString window; // Window Id this request is related to. - QString referrer; - QString charsets; - QString languages; + TQString window; // Window Id this request is related to. + TQString referrer; + TQString charsets; + TQString languages; bool allowCompressedPage; bool disablePassDlg; - QString userAgent; - QString id; + TQString userAgent; + TQString id; DAVRequest davData; bool bNoAuth; // Do not authenticate // Cache related - QString cef; // Cache Entry File belonging to this URL. + TQString cef; // Cache Entry File belonging to this URL. bool bUseCache; // Whether the cache is active bool bCachedRead; // Whether the file is to be read from m_fcache. bool bCachedWrite; // Whether the file is to be written to m_fcache. FILE* fcache; // File stream of a cache entry - QString etag; // ETag header. - QString lastModified; // Last modified. + TQString etag; // ETag header. + TQString lastModified; // Last modified. bool bMustRevalidate; // Cache entry is expired. long cacheExpireDateOffset; // Position in the cache entry where the // 16 byte expire date is stored. time_t expireDate; // Date when the cache entry will expire time_t creationDate; // Date when the cache entry was created - QString strCharset; // Charset + TQString strCharset; // Charset // Indicates whether an error-page or error-msg should is preferred. bool bErrorPage; @@ -170,22 +170,22 @@ public: struct DigestAuthInfo { - QCString nc; - QCString qop; - QCString realm; - QCString nonce; - QCString method; - QCString cnonce; - QCString username; - QCString password; - QStrList digestURI; - QCString algorithm; - QCString entityBody; + TQCString nc; + TQCString qop; + TQCString realm; + TQCString nonce; + TQCString method; + TQCString cnonce; + TQCString username; + TQCString password; + TQStrList digestURI; + TQCString algorithm; + TQCString entityBody; }; //---------------------- Re-implemented methods ---------------- - virtual void setHost(const QString& host, int port, const QString& user, - const QString& pass); + virtual void setHost(const TQString& host, int port, const TQString& user, + const TQString& pass); virtual void slave_status(); @@ -208,15 +208,15 @@ public: void davGeneric( const KURL& url, KIO::HTTP_METHOD method ); // Send requests to lock and unlock resources - void davLock( const KURL& url, const QString& scope, - const QString& type, const QString& owner ); + void davLock( const KURL& url, const TQString& scope, + const TQString& type, const TQString& owner ); void davUnlock( const KURL& url ); // Calls httpClose() and finished() void davFinished(); // Handle error conditions - QString davError( int code = -1, QString url = QString::null ); + TQString davError( int code = -1, TQString url = TQString::null ); //---------------------------- End WebDAV ----------------------- /** @@ -228,7 +228,7 @@ public: * 5 - DAV LOCK (see * 6 - DAV UNLOCK README.webdav) */ - virtual void special( const QByteArray &data ); + virtual void special( const TQByteArray &data ); virtual void mimetype( const KURL& url); @@ -239,7 +239,7 @@ public: virtual void closeConnection(); // Forced close of connection void post( const KURL& url ); - void multiGet(const QByteArray &data); + void multiGet(const TQByteArray &data); bool checkRequestURL( const KURL& ); void cacheUpdate( const KURL &url, bool nocache, time_t expireDate); @@ -248,8 +248,8 @@ public: bool isOffline(const KURL &url); // Check network status protected slots: - void slotData(const QByteArray &); - void error( int _errid, const QString &_text ); + void slotData(const TQByteArray &); + void error( int _errid, const TQString &_text ); protected: int readChunked(); // Read a chunk @@ -281,7 +281,7 @@ protected: * is nececesary because transfer encodings and * content encodings must be handled separately. */ - void addEncoding(QString, QStringList &); + void addEncoding(TQString, TQStringList &); void configAuth( char *, bool ); @@ -305,37 +305,37 @@ protected: /** * Performs a WebDAV stat or list */ - void davSetRequest( const QCString& requestXML ); + void davSetRequest( const TQCString& requestXML ); void davStatList( const KURL& url, bool stat = true ); - void davParsePropstats( const QDomNodeList& propstats, KIO::UDSEntry& entry ); - void davParseActiveLocks( const QDomNodeList& activeLocks, + void davParsePropstats( const TQDomNodeList& propstats, KIO::UDSEntry& entry ); + void davParseActiveLocks( const TQDomNodeList& activeLocks, uint& lockCount ); /** * Parses a date & time string */ - long parseDateTime( const QString& input, const QString& type ); + long parseDateTime( const TQString& input, const TQString& type ); /** * Returns the error code from a "HTTP/1.1 code Code Name" string */ - int codeFromResponse( const QString& response ); + int codeFromResponse( const TQString& response ); /** * Extracts locks from metadata * Returns the appropriate If: header */ - QString davProcessLocks(); + TQString davProcessLocks(); /** * Send a cookie to the cookiejar */ - void addCookies( const QString &url, const QCString &cookieHeader); + void addCookies( const TQString &url, const TQCString &cookieHeader); /** * Look for cookies in the cookiejar */ - QString findCookies( const QString &url); + TQString findCookies( const TQString &url); /** * Do a cache lookup for the current url. (m_state.url) @@ -355,7 +355,7 @@ protected: * * Set the contents type of the cache entry to 'mimetype'. */ - void createCacheEntry(const QString &mimetype, time_t expireDate); + void createCacheEntry(const TQString &mimetype, time_t expireDate); /** * Write data to cache. @@ -413,7 +413,7 @@ protected: * Returns any pre-cached proxy authentication info * info in HTTP header format. */ - QString proxyAuthenticationHeader(); + TQString proxyAuthenticationHeader(); /** * Retrieves authorization info from cache or user. @@ -428,32 +428,32 @@ protected: /** * Creates the entity-header for Basic authentication. */ - QString createBasicAuth( bool isForProxy = false ); + TQString createBasicAuth( bool isForProxy = false ); /** * Creates the entity-header for Digest authentication. */ - QString createDigestAuth( bool isForProxy = false ); + TQString createDigestAuth( bool isForProxy = false ); /** * Creates the entity-header for NTLM authentication. */ - QString createNTLMAuth( bool isForProxy = false ); + TQString createNTLMAuth( bool isForProxy = false ); /** * Creates the entity-header for Negotiate authentication. */ - QString createNegotiateAuth(); + TQString createNegotiateAuth(); /** * create GSS error string */ - QCString gssError( int major_status, int minor_status ); + TQCString gssError( int major_status, int minor_status ); /** * Calcualtes the message digest response based on RFC 2617. */ - void calculateResponse( DigestAuthInfo &info, QCString &Response ); + void calculateResponse( DigestAuthInfo &info, TQCString &Response ); /** * Prompts the user for authorization retry. @@ -468,14 +468,14 @@ protected: protected: HTTPState m_state; HTTPRequest m_request; - QPtrList<HTTPRequest> m_requestQueue; + TQPtrList<HTTPRequest> m_requestQueue; bool m_bBusy; // Busy handling request queue. bool m_bEOF; bool m_bEOD; //--- Settings related to a single response only - QStringList m_responseHeader; // All headers + TQStringList m_responseHeader; // All headers KURL m_redirectLocation; bool m_bRedirect; // Indicates current request is a redirection @@ -484,7 +484,7 @@ protected: KIO::filesize_t m_iSize; // Expected size of message KIO::filesize_t m_iBytesLeft; // # of bytes left to receive in this message. KIO::filesize_t m_iContentLeft; // # of content bytes left - QByteArray m_bufReceive; // Receive buffer + TQByteArray m_bufReceive; // Receive buffer bool m_dataInternal; // Data is for internal consumption char m_lineBuf[1024]; char m_rewindBuf[8192]; @@ -497,19 +497,19 @@ protected: // Mimetype determination bool m_cpMimeBuffer; - QByteArray m_mimeTypeBuffer; + TQByteArray m_mimeTypeBuffer; // Language/Encoding related - QStringList m_qTransferEncodings; - QStringList m_qContentEncodings; - QString m_sContentMD5; - QString m_strMimeType; + TQStringList m_qTransferEncodings; + TQStringList m_qContentEncodings; + TQString m_sContentMD5; + TQString m_strMimeType; //--- WebDAV // Data structure to hold data which will be passed to an internal func. - QByteArray m_bufWebDavData; - QStringList m_davCapabilities; + TQByteArray m_bufWebDavData; + TQStringList m_davCapabilities; bool m_davHostOk; bool m_davHostUnsupported; @@ -518,12 +518,12 @@ protected: // Holds the POST data so it won't get lost on if we // happend to get a 401/407 response when submitting, // a form. - QByteArray m_bufPOST; + TQByteArray m_bufPOST; // Cache related int m_maxCacheAge; // Maximum age of a cache entry. long m_maxCacheSize; // Maximum cache size in Kb. - QString m_strCacheDir; // Location of the cache. + TQString m_strCacheDir; // Location of the cache. @@ -534,15 +534,15 @@ protected: bool m_bProxyAuthValid; int m_iProxyPort; KURL m_proxyURL; - QString m_strProxyRealm; + TQString m_strProxyRealm; // Operation mode - QCString m_protocol; + TQCString m_protocol; // Authentication - QString m_strRealm; - QString m_strAuthorization; - QString m_strProxyAuthorization; + TQString m_strRealm; + TQString m_strAuthorization; + TQString m_strProxyAuthorization; HTTP_AUTH Authentication; HTTP_AUTH ProxyAuthentication; bool m_bUnauthorized; diff --git a/kioslave/http/http_cache_cleaner.cpp b/kioslave/http/http_cache_cleaner.cpp index f7406bcc1..74b0b8102 100644 --- a/kioslave/http/http_cache_cleaner.cpp +++ b/kioslave/http/http_cache_cleaner.cpp @@ -28,9 +28,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <time.h> #include <stdlib.h> -#include <qdir.h> -#include <qstring.h> -#include <qptrlist.h> +#include <tqdir.h> +#include <tqstring.h> +#include <tqptrlist.h> #include <kinstance.h> #include <klocale.h> @@ -61,18 +61,18 @@ static const KCmdLineOptions options[] = }; struct FileInfo { - QString name; + TQString name; int size; // Size in Kb. int age; }; -template class QPtrList<FileInfo>; +template class TQPtrList<FileInfo>; -class FileInfoList : public QPtrList<FileInfo> +class FileInfoList : public TQPtrList<FileInfo> { public: - FileInfoList() : QPtrList<FileInfo>() { } - int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2) + FileInfoList() : TQPtrList<FileInfo>() { } + int compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2) { return ((FileInfo *)item1)->age - ((FileInfo *)item2)->age; } }; @@ -80,9 +80,9 @@ public: // Keep the following in sync with the cache code in http.cc #define CACHE_REVISION "7\n" -FileInfo *readEntry( const QString &filename) +FileInfo *readEntry( const TQString &filename) { - QCString CEF = QFile::encodeName(filename); + TQCString CEF = TQFile::encodeName(filename); FILE *fs = fopen( CEF.data(), "r"); if (!fs) return 0; @@ -161,16 +161,16 @@ FileInfo *readEntry( const QString &filename) // Keep the above in sync with the cache code in http.cc // !END OF SYNC! -void scanDirectory(FileInfoList &fileEntries, const QString &name, const QString &strDir) +void scanDirectory(FileInfoList &fileEntries, const TQString &name, const TQString &strDir) { - QDir dir(strDir); + TQDir dir(strDir); if (!dir.exists()) return; QFileInfoList *newEntries = (QFileInfoList *) dir.entryInfoList(); if (!newEntries) return; // Directory not accessible ?? - for(QFileInfo *qFileInfo = newEntries->first(); + for(TQFileInfo *qFileInfo = newEntries->first(); qFileInfo; qFileInfo = newEntries->next()) { @@ -205,7 +205,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) if (!deleteAll) { DCOPClient *dcop = new DCOPClient(); - QCString name = dcop->registerAs(appName, false); + TQCString name = dcop->registerAs(appName, false); if (!name.isEmpty() && (name != appName)) { fprintf(stderr, "%s: Already running! (%s)\n", appName, name.data()); @@ -220,20 +220,20 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) if (deleteAll) m_maxCacheSize = -1; - QString strCacheDir = KGlobal::dirs()->saveLocation("cache", "http"); + TQString strCacheDir = KGlobal::dirs()->saveLocation("cache", "http"); - QDir cacheDir( strCacheDir ); + TQDir cacheDir( strCacheDir ); if (!cacheDir.exists()) { fprintf(stderr, "%s: '%s' does not exist.\n", appName, strCacheDir.ascii()); return 0; } - QStringList dirs = cacheDir.entryList( ); + TQStringList dirs = cacheDir.entryList( ); FileInfoList cachedEntries; - for(QStringList::Iterator it = dirs.begin(); + for(TQStringList::Iterator it = dirs.begin(); it != dirs.end(); it++) { @@ -253,7 +253,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) { if (fileInfo->size > maxCachedSize) { - QCString filename = QFile::encodeName( strCacheDir + "/" + fileInfo->name); + TQCString filename = TQFile::encodeName( strCacheDir + "/" + fileInfo->name); unlink(filename.data()); // kdDebug () << appName << ": Object too big, deleting '" << filename.data() << "' (" << result<< ")" << endl; } @@ -267,7 +267,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) { if ((totalSize + fileInfo->size) > m_maxCacheSize) { - QCString filename = QFile::encodeName( strCacheDir + "/" + fileInfo->name); + TQCString filename = TQFile::encodeName( strCacheDir + "/" + fileInfo->name); unlink(filename.data()); // kdDebug () << appName << ": Cache too big, deleting '" << filename.data() << "' (" << fileInfo->size << ")" << endl; } diff --git a/kioslave/http/kcookiejar/kcookiejar.cpp b/kioslave/http/kcookiejar/kcookiejar.cpp index 5b5f78f6b..909f92dcb 100644 --- a/kioslave/http/kcookiejar/kcookiejar.cpp +++ b/kioslave/http/kcookiejar/kcookiejar.cpp @@ -55,13 +55,13 @@ //#include <netinet/in.h> //#include <arpa/inet.h> -#include <qstring.h> -#include <qstrlist.h> -#include <qptrlist.h> -#include <qptrdict.h> -#include <qfile.h> -#include <qdir.h> -#include <qregexp.h> +#include <tqstring.h> +#include <tqstrlist.h> +#include <tqptrlist.h> +#include <tqptrdict.h> +#include <tqfile.h> +#include <tqdir.h> +#include <tqregexp.h> #include <kurl.h> #include <krfcdate.h> @@ -84,17 +84,17 @@ #define READ_BUFFER_SIZE 8192 #define IP_ADDRESS_EXPRESSION "(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" -// Note with respect to QString::fromLatin1( ) +// Note with respect to TQString::fromLatin1( ) // Cookies are stored as 8 bit data and passed to kio_http as // latin1 regardless of their actual encoding. // L1 is used to indicate latin1 constants -#define L1(x) QString::fromLatin1(x) +#define L1(x) TQString::fromLatin1(x) -template class QPtrList<KHttpCookie>; -template class QPtrDict<KHttpCookieList>; +template class TQPtrList<KHttpCookie>; +template class TQPtrDict<KHttpCookieList>; -QString KCookieJar::adviceToStr(KCookieAdvice _advice) +TQString KCookieJar::adviceToStr(KCookieAdvice _advice) { switch( _advice ) { @@ -105,12 +105,12 @@ QString KCookieJar::adviceToStr(KCookieAdvice _advice) } } -KCookieAdvice KCookieJar::strToAdvice(const QString &_str) +KCookieAdvice KCookieJar::strToAdvice(const TQString &_str) { if (_str.isEmpty()) return KCookieDunno; - QCString advice = _str.lower().latin1(); + TQCString advice = _str.lower().latin1(); if (advice == "accept") return KCookieAccept; @@ -128,11 +128,11 @@ KCookieAdvice KCookieJar::strToAdvice(const QString &_str) // // Cookie constructor // -KHttpCookie::KHttpCookie(const QString &_host, - const QString &_domain, - const QString &_path, - const QString &_name, - const QString &_value, +KHttpCookie::KHttpCookie(const TQString &_host, + const TQString &_domain, + const TQString &_path, + const TQString &_name, + const TQString &_value, time_t _expireDate, int _protocolVersion, bool _secure, @@ -140,7 +140,7 @@ KHttpCookie::KHttpCookie(const QString &_host, bool _explicitPath) : mHost(_host), mDomain(_domain), - mPath(_path.isEmpty() ? QString::null : _path), + mPath(_path.isEmpty() ? TQString::null : _path), mName(_name), mValue(_value), mExpireDate(_expireDate), @@ -162,9 +162,9 @@ bool KHttpCookie::isExpired(time_t currentDate) // // Returns a string for a HTTP-header // -QString KHttpCookie::cookieStr(bool useDOMFormat) +TQString KHttpCookie::cookieStr(bool useDOMFormat) { - QString result; + TQString result; if (useDOMFormat || (mProtocolVersion == 0)) { @@ -185,8 +185,8 @@ QString KHttpCookie::cookieStr(bool useDOMFormat) // // Returns whether this cookie should be send to this location. -bool KHttpCookie::match(const QString &fqdn, const QStringList &domains, - const QString &path) +bool KHttpCookie::match(const TQString &fqdn, const TQStringList &domains, + const TQString &path) { // Cookie domain match check if (mDomain.isEmpty()) @@ -200,7 +200,7 @@ bool KHttpCookie::match(const QString &fqdn, const QStringList &domains, return false; // Maybe the domain needs an extra dot. - QString domain = '.' + mDomain; + TQString domain = '.' + mDomain; if ( !domains.contains( domain ) ) if ( fqdn != mDomain ) return false; @@ -257,8 +257,8 @@ KCookieJar::KCookieJar() m_cookiesChanged = false; KConfig cfg("khtml/domain_info", true, false, "data"); - QStringList countries = cfg.readListEntry("twoLevelTLD"); - for(QStringList::ConstIterator it = countries.begin(); + TQStringList countries = cfg.readListEntry("twoLevelTLD"); + for(TQStringList::ConstIterator it = countries.begin(); it != countries.end(); ++it) { m_twoLevelTLD.replace(*it, (int *) 1); @@ -277,13 +277,13 @@ KCookieJar::~KCookieJar() static void removeDuplicateFromList(KHttpCookieList *list, KHttpCookie *cookiePtr, bool nameMatchOnly=false, bool updateWindowId=false) { - QString domain1 = cookiePtr->domain(); + TQString domain1 = cookiePtr->domain(); if (domain1.isEmpty()) domain1 = cookiePtr->host(); for ( KHttpCookiePtr cookie=list->first(); cookie != 0; ) { - QString domain2 = cookie->domain(); + TQString domain2 = cookie->domain(); if (domain2.isEmpty()) domain2 = cookie->host(); @@ -297,7 +297,7 @@ static void removeDuplicateFromList(KHttpCookieList *list, KHttpCookie *cookiePt { if (updateWindowId) { - for(QValueList<long>::ConstIterator it = cookie->windowIds().begin(); + for(TQValueList<long>::ConstIterator it = cookie->windowIds().begin(); it != cookie->windowIds().end(); ++it) { long windowId = *it; @@ -325,12 +325,12 @@ static void removeDuplicateFromList(KHttpCookieList *list, KHttpCookie *cookiePt // Returned is a string containing all appropriate cookies in a format // which can be added to a HTTP-header without any additional processing. // -QString KCookieJar::findCookies(const QString &_url, bool useDOMFormat, long windowId, KHttpCookieList *pendingCookies) +TQString KCookieJar::findCookies(const TQString &_url, bool useDOMFormat, long windowId, KHttpCookieList *pendingCookies) { - QString cookieStr; - QStringList domains; - QString fqdn; - QString path; + TQString cookieStr; + TQStringList domains; + TQString fqdn; + TQString path; KHttpCookiePtr cookie; KCookieAdvice advice = m_globalAdvice; @@ -346,7 +346,7 @@ QString KCookieJar::findCookies(const QString &_url, bool useDOMFormat, long win KHttpCookieList allCookies; - for(QStringList::ConstIterator it = domains.begin(); + for(TQStringList::ConstIterator it = domains.begin(); true; ++it) { @@ -360,7 +360,7 @@ QString KCookieJar::findCookies(const QString &_url, bool useDOMFormat, long win } else { - QString key = (*it).isNull() ? L1("") : (*it); + TQString key = (*it).isNull() ? L1("") : (*it); cookieList = m_cookieDomains[key]; if (!cookieList) continue; // No cookies for this domain @@ -437,7 +437,7 @@ QString KCookieJar::findCookies(const QString &_url, bool useDOMFormat, long win cookieStr += L1("Cookie: "); if (protVersion > 0) { - QString version; + TQString version; version.sprintf("$Version=%d; ", protVersion); // Without quotes cookieStr += version; } @@ -465,8 +465,8 @@ QString KCookieJar::findCookies(const QString &_url, bool useDOMFormat, long win // ',' - Another cookie follows // '\n' - Another header follows static const char * parseNameValue(const char *header, - QString &Name, - QString &Value, + TQString &Name, + TQString &Value, bool keepQuotes=false, bool rfcQuotes=false) { @@ -479,7 +479,7 @@ static const char * parseNameValue(const char *header, // No '=' sign -> use string as the value, name is empty // (behavior found in Mozilla and IE) Name = ""; - Value = QString::fromLatin1(header); + Value = TQString::fromLatin1(header); Value.truncate( s - header ); Value = Value.stripWhiteSpace(); return (s); @@ -516,12 +516,12 @@ static const char * parseNameValue(const char *header, if ((*s=='\0') || (*s=='\n')) { // End of Name - Value = QString::fromLatin1(header); + Value = TQString::fromLatin1(header); Value.truncate(s - header); return (s); } } - Value = QString::fromLatin1(header); + Value = TQString::fromLatin1(header); // *s == '\"'; if (keepQuotes) Value.truncate( ++s - header ); @@ -542,7 +542,7 @@ static const char * parseNameValue(const char *header, while ((*s != '\0') && (*s != ';') && (*s != '\n')) s++; // End of Name - Value = QString::fromLatin1(header); + Value = TQString::fromLatin1(header); Value.truncate( s - header ); Value = Value.stripWhiteSpace(); } @@ -550,9 +550,9 @@ static const char * parseNameValue(const char *header, } -void KCookieJar::stripDomain(const QString &_fqdn, QString &_domain) +void KCookieJar::stripDomain(const TQString &_fqdn, TQString &_domain) { - QStringList domains; + TQStringList domains; extractDomains(_fqdn, domains); if (domains.count() > 3) _domain = domains[3]; @@ -560,9 +560,9 @@ void KCookieJar::stripDomain(const QString &_fqdn, QString &_domain) _domain = domains[0]; } -QString KCookieJar::stripDomain( KHttpCookiePtr cookiePtr) +TQString KCookieJar::stripDomain( KHttpCookiePtr cookiePtr) { - QString domain; // We file the cookie under this domain. + TQString domain; // We file the cookie under this domain. if (cookiePtr->domain().isEmpty()) stripDomain( cookiePtr->host(), domain); else @@ -570,9 +570,9 @@ QString KCookieJar::stripDomain( KHttpCookiePtr cookiePtr) return domain; } -bool KCookieJar::parseURL(const QString &_url, - QString &_fqdn, - QString &_path) +bool KCookieJar::parseURL(const TQString &_url, + TQString &_fqdn, + TQString &_path) { KURL kurl(_url); if (!kurl.isValid()) @@ -600,7 +600,7 @@ bool KCookieJar::parseURL(const QString &_url, if (_path.isEmpty()) _path = L1("/"); - QRegExp exp(L1("[\\\\/]\\.\\.[\\\\/]")); + TQRegExp exp(L1("[\\\\/]\\.\\.[\\\\/]")); // Weird path, cookie stealing attempt? if (exp.search(_path) != -1) return false; // Deny everything!! @@ -608,8 +608,8 @@ bool KCookieJar::parseURL(const QString &_url, return true; } -void KCookieJar::extractDomains(const QString &_fqdn, - QStringList &_domains) +void KCookieJar::extractDomains(const TQString &_fqdn, + TQStringList &_domains) { // Return numeric IPv6 addresses as is... if (_fqdn[0] == '[') @@ -620,14 +620,14 @@ void KCookieJar::extractDomains(const QString &_fqdn, // Return numeric IPv4 addresses as is... if ((_fqdn[0] >= '0') && (_fqdn[0] <= '9')) { - if (_fqdn.find(QRegExp(IP_ADDRESS_EXPRESSION)) > -1) + if (_fqdn.find(TQRegExp(IP_ADDRESS_EXPRESSION)) > -1) { _domains.append( _fqdn ); return; } } - QStringList partList = QStringList::split('.', _fqdn, false); + TQStringList partList = TQStringList::split('.', _fqdn, false); if (partList.count()) partList.remove(partList.begin()); // Remove hostname @@ -653,12 +653,12 @@ void KCookieJar::extractDomains(const QString &_fqdn, // Catch some TLDs that we miss with the previous check // e.g. com.au, org.uk, mil.co - QCString t = partList[0].lower().utf8(); + TQCString t = partList[0].lower().utf8(); if ((t == "com") || (t == "net") || (t == "org") || (t == "gov") || (t == "edu") || (t == "mil") || (t == "int")) break; } - QString domain = partList.join(L1(".")); + TQString domain = partList.join(L1(".")); _domains.append(domain); _domains.append('.' + domain); partList.remove(partList.begin()); // Remove part @@ -681,16 +681,16 @@ void KCookieJar::extractDomains(const QString &_fqdn, to allow KRFCDate::parseDate to properly parse expiration date formats used in cookies by some servers such as amazon.com. See BR# 145244. */ -static QString fixupDateTime(const QString& dt) +static TQString fixupDateTime(const TQString& dt) { - const int index = dt.find(QRegExp("[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}")); + const int index = dt.find(TQRegExp("[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}")); if (index > -1) { - QStringList dateStrList = QStringList::split(' ', dt.mid(index)); + TQStringList dateStrList = TQStringList::split(' ', dt.mid(index)); if (dateStrList.count() > 1) { - QString date = dateStrList[0]; + TQString date = dateStrList[0]; dateStrList[0] = dateStrList[1]; dateStrList[1] = date; date = dt; @@ -709,18 +709,18 @@ static QString fixupDateTime(const QString& dt) // cookie_headers should be a concatenation of all lines of a HTTP-header // which start with "Set-Cookie". The lines should be separated by '\n's. // -KHttpCookieList KCookieJar::makeCookies(const QString &_url, - const QCString &cookie_headers, +KHttpCookieList KCookieJar::makeCookies(const TQString &_url, + const TQCString &cookie_headers, long windowId) { KHttpCookieList cookieList; KHttpCookieList cookieList2; KHttpCookiePtr lastCookie = 0; const char *cookieStr = cookie_headers.data(); - QString Name; - QString Value; - QString fqdn; - QString path; + TQString Name; + TQString Value; + TQString fqdn; + TQString path; bool crossDomain = false; if (!parseURL(_url, fqdn, path)) @@ -728,7 +728,7 @@ KHttpCookieList KCookieJar::makeCookies(const QString &_url, // Error parsing _url return KHttpCookieList(); } - QString defaultPath; + TQString defaultPath; int i = path.findRev('/'); if (i > 0) defaultPath = path.left(i); @@ -799,10 +799,10 @@ KHttpCookieList KCookieJar::makeCookies(const QString &_url, // Name-Value pair follows cookieStr = parseNameValue(cookieStr, Name, Value); - QCString cName = Name.lower().latin1(); + TQCString cName = Name.lower().latin1(); if (cName == "domain") { - QString dom = Value.lower(); + TQString dom = Value.lower(); // RFC2965 3.2.2: If an explicitly specified value does not // start with a dot, the user agent supplies a leading dot if(dom.length() && dom[0] != '.') @@ -835,7 +835,7 @@ KHttpCookieList KCookieJar::makeCookies(const QString &_url, else if (cName == "path") { if (Value.isEmpty()) - lastCookie->mPath = QString::null; // Catch "" <> QString::null + lastCookie->mPath = TQString::null; // Catch "" <> TQString::null else lastCookie->mPath = KURL::decode_string(Value); lastCookie->mExplicitPath = true; @@ -879,8 +879,8 @@ KHttpCookieList KCookieJar::makeCookies(const QString &_url, * pairs. Any whitespace before "name" or around '=' is discarded. * If no cookies are found, 0 is returned. */ -KHttpCookieList KCookieJar::makeDOMCookies(const QString &_url, - const QCString &cookie_domstring, +KHttpCookieList KCookieJar::makeDOMCookies(const TQString &_url, + const TQCString &cookie_domstring, long windowId) { // A lot copied from above @@ -888,10 +888,10 @@ KHttpCookieList KCookieJar::makeDOMCookies(const QString &_url, KHttpCookiePtr lastCookie = 0; const char *cookieStr = cookie_domstring.data(); - QString Name; - QString Value; - QString fqdn; - QString path; + TQString Name; + TQString Value; + TQString fqdn; + TQString path; if (!parseURL(_url, fqdn, path)) { @@ -907,7 +907,7 @@ KHttpCookieList KCookieJar::makeDOMCookies(const QString &_url, // Host = FQDN // Default domain = "" // Default path = "" - KHttpCookie *cookie = new KHttpCookie(fqdn, QString::null, QString::null, + KHttpCookie *cookie = new KHttpCookie(fqdn, TQString::null, TQString::null, Name, Value ); if (windowId) cookie->mWindowIds.append(windowId); @@ -946,26 +946,26 @@ static void makeRoom(KHttpCookieList *cookieList, KHttpCookiePtr &cookiePtr) // void KCookieJar::addCookie(KHttpCookiePtr &cookiePtr) { - QStringList domains; + TQStringList domains; KHttpCookieList *cookieList = 0L; // We always need to do this to make sure that the // that cookies of type hostname == cookie-domainname // are properly removed and/or updated as necessary! extractDomains( cookiePtr->host(), domains ); - for ( QStringList::ConstIterator it = domains.begin(); + for ( TQStringList::ConstIterator it = domains.begin(); (it != domains.end() && !cookieList); ++it ) { - QString key = (*it).isNull() ? L1("") : (*it); + TQString key = (*it).isNull() ? L1("") : (*it); KHttpCookieList *list= m_cookieDomains[key]; if ( !list ) continue; removeDuplicateFromList(list, cookiePtr, false, true); } - QString domain = stripDomain( cookiePtr ); - QString key = domain.isNull() ? L1("") : domain; + TQString domain = stripDomain( cookiePtr ); + TQString key = domain.isNull() ? L1("") : domain; cookieList = m_cookieDomains[ key ]; if (!cookieList) { @@ -1011,7 +1011,7 @@ KCookieAdvice KCookieJar::cookieAdvice(KHttpCookiePtr cookiePtr) if (m_rejectCrossDomainCookies && cookiePtr->isCrossDomain()) return KCookieReject; - QStringList domains; + TQStringList domains; extractDomains(cookiePtr->host(), domains); @@ -1022,7 +1022,7 @@ KCookieAdvice KCookieJar::cookieAdvice(KHttpCookiePtr cookiePtr) { if (!domains.contains(cookiePtr->domain()) && !cookiePtr->domain().endsWith("."+cookiePtr->host())) - cookiePtr->fixDomain(QString::null); + cookiePtr->fixDomain(TQString::null); } if (m_autoAcceptSessionCookies && (cookiePtr->expireDate() == 0 || @@ -1031,10 +1031,10 @@ KCookieAdvice KCookieJar::cookieAdvice(KHttpCookiePtr cookiePtr) KCookieAdvice advice = KCookieDunno; bool isFQDN = true; // First is FQDN - QStringList::Iterator it = domains.begin(); // Start with FQDN which first in the list. + TQStringList::Iterator it = domains.begin(); // Start with FQDN which first in the list. while( (advice == KCookieDunno) && (it != domains.end())) { - QString domain = *it; + TQString domain = *it; // Check if a policy for the FQDN/domain is set. if ( domain[0] == '.' || isFQDN ) { @@ -1057,7 +1057,7 @@ KCookieAdvice KCookieJar::cookieAdvice(KHttpCookiePtr cookiePtr) // This function gets the advice for all cookies originating from // _domain. // -KCookieAdvice KCookieJar::getDomainAdvice(const QString &_domain) +KCookieAdvice KCookieJar::getDomainAdvice(const TQString &_domain) { KHttpCookieList *cookieList = m_cookieDomains[_domain]; KCookieAdvice advice; @@ -1078,9 +1078,9 @@ KCookieAdvice KCookieJar::getDomainAdvice(const QString &_domain) // This function sets the advice for all cookies originating from // _domain. // -void KCookieJar::setDomainAdvice(const QString &_domain, KCookieAdvice _advice) +void KCookieJar::setDomainAdvice(const TQString &_domain, KCookieAdvice _advice) { - QString domain(_domain); + TQString domain(_domain); KHttpCookieList *cookieList = m_cookieDomains[domain]; if (cookieList) @@ -1124,7 +1124,7 @@ void KCookieJar::setDomainAdvice(const QString &_domain, KCookieAdvice _advice) // void KCookieJar::setDomainAdvice(KHttpCookiePtr cookiePtr, KCookieAdvice _advice) { - QString domain; + TQString domain; stripDomain(cookiePtr->host(), domain); // We file the cookie under this domain. setDomainAdvice(domain, _advice); @@ -1143,7 +1143,7 @@ void KCookieJar::setGlobalAdvice(KCookieAdvice _advice) // // Get a list of all domains known to the cookie jar. // -const QStringList& KCookieJar::getDomainList() +const TQStringList& KCookieJar::getDomainList() { return m_domainList; } @@ -1151,10 +1151,10 @@ const QStringList& KCookieJar::getDomainList() // // Get a list of all cookies in the cookie jar originating from _domain. // -const KHttpCookieList *KCookieJar::getCookieList(const QString & _domain, - const QString & _fqdn ) +const KHttpCookieList *KCookieJar::getCookieList(const TQString & _domain, + const TQString & _fqdn ) { - QString domain; + TQString domain; if (_domain.isEmpty()) stripDomain( _fqdn, domain ); @@ -1170,7 +1170,7 @@ const KHttpCookieList *KCookieJar::getCookieList(const QString & _domain, // void KCookieJar::eatCookie(KHttpCookiePtr cookiePtr) { - QString domain = stripDomain(cookiePtr); // We file the cookie under this domain. + TQString domain = stripDomain(cookiePtr); // We file the cookie under this domain. KHttpCookieList *cookieList = m_cookieDomains[domain]; if (cookieList) @@ -1190,7 +1190,7 @@ void KCookieJar::eatCookie(KHttpCookiePtr cookiePtr) } } -void KCookieJar::eatCookiesForDomain(const QString &domain) +void KCookieJar::eatCookiesForDomain(const TQString &domain) { KHttpCookieList *cookieList = m_cookieDomains[domain]; if (!cookieList || cookieList->isEmpty()) return; @@ -1210,23 +1210,23 @@ void KCookieJar::eatSessionCookies( long windowId ) if (!windowId) return; - QStringList::Iterator it=m_domainList.begin(); + TQStringList::Iterator it=m_domainList.begin(); for ( ; it != m_domainList.end(); ++it ) eatSessionCookies( *it, windowId, false ); } void KCookieJar::eatAllCookies() { - for ( QStringList::Iterator it=m_domainList.begin(); + for ( TQStringList::Iterator it=m_domainList.begin(); it != m_domainList.end();) { - QString domain = *it++; + TQString domain = *it++; // This might remove domain from domainList! eatCookiesForDomain(domain); } } -void KCookieJar::eatSessionCookies( const QString& fqdn, long windowId, +void KCookieJar::eatSessionCookies( const TQString& fqdn, long windowId, bool isFQDN ) { KHttpCookieList* cookieList; @@ -1234,7 +1234,7 @@ void KCookieJar::eatSessionCookies( const QString& fqdn, long windowId, cookieList = m_cookieDomains[fqdn]; else { - QString domain; + TQString domain; stripDomain( fqdn, domain ); cookieList = m_cookieDomains[domain]; } @@ -1250,7 +1250,7 @@ void KCookieJar::eatSessionCookies( const QString& fqdn, long windowId, continue; } - QValueList<long> &ids = cookie->windowIds(); + TQValueList<long> &ids = cookie->windowIds(); if (!ids.remove(windowId) || !ids.isEmpty()) { cookie = cookieList->next(); @@ -1267,7 +1267,7 @@ void KCookieJar::eatSessionCookies( const QString& fqdn, long windowId, // Saves all cookies to the file '_filename'. // On succes 'true' is returned. // On failure 'false' is returned. -bool KCookieJar::saveCookies(const QString &_filename) +bool KCookieJar::saveCookies(const TQString &_filename) { KSaveFile saveFile(_filename, 0600); @@ -1284,10 +1284,10 @@ bool KCookieJar::saveCookies(const QString &_filename) "# Host", "Domain", "Path", "Exp.date", "Prot", "Name", "Sec", "Value"); - for ( QStringList::Iterator it=m_domainList.begin(); it != m_domainList.end(); + for ( TQStringList::Iterator it=m_domainList.begin(); it != m_domainList.end(); it++ ) { - const QString &domain = *it; + const TQString &domain = *it; bool domainPrinted = false; KHttpCookieList *cookieList = m_cookieDomains[domain]; @@ -1310,10 +1310,10 @@ bool KCookieJar::saveCookies(const QString &_filename) fprintf(fStream, "[%s]\n", domain.local8Bit().data()); } // Store persistent cookies - QString path = L1("\""); + TQString path = L1("\""); path += cookie->path(); path += '"'; - QString domain = L1("\""); + TQString domain = L1("\""); domain += cookie->domain(); domain += '"'; fprintf(fStream, "%-20s %-20s %-12s %10lu %3d %-20s %-4i %s\n", @@ -1374,9 +1374,9 @@ static const char *parseField(charPtr &buffer, bool keepQuotes=false) // Reloads all cookies from the file '_filename'. // On succes 'true' is returned. // On failure 'false' is returned. -bool KCookieJar::loadCookies(const QString &_filename) +bool KCookieJar::loadCookies(const TQString &_filename) { - FILE *fStream = fopen( QFile::encodeName(_filename), "r"); + FILE *fStream = fopen( TQFile::encodeName(_filename), "r"); if (fStream == 0) { return false; @@ -1457,11 +1457,11 @@ bool KCookieJar::loadCookies(const QString &_filename) if ((expDate == 0) || (expDate < curTime)) continue; - KHttpCookie *cookie = new KHttpCookie(QString::fromLatin1(host), - QString::fromLatin1(domain), - QString::fromLatin1(path), - QString::fromLatin1(name), - QString::fromLatin1(value), + KHttpCookie *cookie = new KHttpCookie(TQString::fromLatin1(host), + TQString::fromLatin1(domain), + TQString::fromLatin1(path), + TQString::fromLatin1(name), + TQString::fromLatin1(value), expDate, protVer, secure, httpOnly, explicitPath); addCookie(cookie); @@ -1489,16 +1489,16 @@ void KCookieJar::saveConfig(KConfig *_config) _config->setGroup("Cookie Policy"); _config->writeEntry("CookieGlobalAdvice", adviceToStr( m_globalAdvice)); - QStringList domainSettings; - for ( QStringList::Iterator it=m_domainList.begin(); + TQStringList domainSettings; + for ( TQStringList::Iterator it=m_domainList.begin(); it != m_domainList.end(); it++ ) { - const QString &domain = *it; + const TQString &domain = *it; KCookieAdvice advice = getDomainAdvice( domain); if (advice != KCookieDunno) { - QString value(domain); + TQString value(domain); value += ':'; value += adviceToStr(advice); domainSettings.append(value); @@ -1524,34 +1524,34 @@ void KCookieJar::loadConfig(KConfig *_config, bool reparse ) m_preferredPolicy = _config->readNumEntry( "PreferredPolicy", 0 ); _config->setGroup("Cookie Policy"); - QStringList domainSettings = _config->readListEntry("CookieDomainAdvice"); + TQStringList domainSettings = _config->readListEntry("CookieDomainAdvice"); m_rejectCrossDomainCookies = _config->readBoolEntry( "RejectCrossDomainCookies", true ); m_autoAcceptSessionCookies = _config->readBoolEntry( "AcceptSessionCookies", true ); m_ignoreCookieExpirationDate = _config->readBoolEntry( "IgnoreExpirationDate", false ); - QString value = _config->readEntry("CookieGlobalAdvice", L1("Ask")); + TQString value = _config->readEntry("CookieGlobalAdvice", L1("Ask")); m_globalAdvice = strToAdvice(value); // Reset current domain settings first. - for ( QStringList::Iterator it=m_domainList.begin(); it != m_domainList.end(); ) + for ( TQStringList::Iterator it=m_domainList.begin(); it != m_domainList.end(); ) { // Make sure to update iterator before calling setDomainAdvice() // setDomainAdvice() might delete the domain from domainList. - QString domain = *it++; + TQString domain = *it++; setDomainAdvice(domain, KCookieDunno); } // Now apply the domain settings read from config file... - for ( QStringList::Iterator it=domainSettings.begin(); + for ( TQStringList::Iterator it=domainSettings.begin(); it != domainSettings.end(); ) { - const QString &value = *it++; + const TQString &value = *it++; int sepPos = value.findRev(':'); if (sepPos <= 0) continue; - QString domain(value.left(sepPos)); + TQString domain(value.left(sepPos)); KCookieAdvice advice = strToAdvice( value.mid(sepPos + 1) ); setDomainAdvice(domain, advice); } diff --git a/kioslave/http/kcookiejar/kcookiejar.h b/kioslave/http/kcookiejar/kcookiejar.h index c73708bea..eb64485ea 100644 --- a/kioslave/http/kcookiejar/kcookiejar.h +++ b/kioslave/http/kcookiejar/kcookiejar.h @@ -25,10 +25,10 @@ #ifndef KCOOKIEJAR_H #define KCOOKIEJAR_H -#include <qstring.h> -#include <qstringlist.h> -#include <qdict.h> -#include <qptrlist.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqdict.h> +#include <tqptrlist.h> #include <time.h> class KConfig; @@ -52,40 +52,40 @@ class KHttpCookie friend class KHttpCookieList; protected: - QString mHost; - QString mDomain; - QString mPath; - QString mName; - QString mValue; + TQString mHost; + TQString mDomain; + TQString mPath; + TQString mName; + TQString mValue; time_t mExpireDate; int mProtocolVersion; bool mSecure; bool mCrossDomain; bool mHttpOnly; bool mExplicitPath; - QValueList<long> mWindowIds; + TQValueList<long> mWindowIds; - QString cookieStr(bool useDOMFormat); + TQString cookieStr(bool useDOMFormat); public: - KHttpCookie(const QString &_host=QString::null, - const QString &_domain=QString::null, - const QString &_path=QString::null, - const QString &_name=QString::null, - const QString &_value=QString::null, + KHttpCookie(const TQString &_host=TQString::null, + const TQString &_domain=TQString::null, + const TQString &_path=TQString::null, + const TQString &_name=TQString::null, + const TQString &_value=TQString::null, time_t _expireDate=0, int _protocolVersion=0, bool _secure = false, bool _httpOnly = false, bool _explicitPath = false); - QString domain(void) { return mDomain; } - QString host(void) { return mHost; } - QString path(void) { return mPath; } - QString name(void) { return mName; } - QString value(void) { return mValue; } - QValueList<long> &windowIds(void) { return mWindowIds; } - void fixDomain(const QString &domain) { mDomain = domain; } + TQString domain(void) { return mDomain; } + TQString host(void) { return mHost; } + TQString path(void) { return mPath; } + TQString name(void) { return mName; } + TQString value(void) { return mValue; } + TQValueList<long> &windowIds(void) { return mWindowIds; } + void fixDomain(const TQString &domain) { mDomain = domain; } time_t expireDate(void) { return mExpireDate; } int protocolVersion(void) { return mProtocolVersion; } bool isSecure(void) { return mSecure; } @@ -93,13 +93,13 @@ public: bool isCrossDomain(void) { return mCrossDomain; } bool isHttpOnly(void) { return mHttpOnly; } bool hasExplicitPath(void) { return mExplicitPath; } - bool match(const QString &fqdn, const QStringList &domainList, const QString &path); + bool match(const TQString &fqdn, const TQStringList &domainList, const TQString &path); }; -class KHttpCookieList : public QPtrList<KHttpCookie> +class KHttpCookieList : public TQPtrList<KHttpCookie> { public: - KHttpCookieList() : QPtrList<KHttpCookie>(), advice( KCookieDunno ) + KHttpCookieList() : TQPtrList<KHttpCookie>(), advice( KCookieDunno ) { } virtual ~KHttpCookieList() { } @@ -136,12 +136,12 @@ public: /** * Store all the cookies in a safe(?) place */ - bool saveCookies(const QString &_filename); + bool saveCookies(const TQString &_filename); /** * Load all the cookies from file and add them to the cookie jar. */ - bool loadCookies(const QString &_filename); + bool loadCookies(const TQString &_filename); /** * Save the cookie configuration @@ -164,7 +164,7 @@ public: * approved yet by the user but that will be included in the result * none the less. */ - QString findCookies(const QString &_url, bool useDOMFormat, long windowId, KHttpCookieList *pendingCookies=0); + TQString findCookies(const TQString &_url, bool useDOMFormat, long windowId, KHttpCookieList *pendingCookies=0); /** * This function parses cookie_headers and returns a linked list of @@ -174,7 +174,7 @@ public: * cookie_headers should be a concatenation of all lines of a HTTP-header * which start with "Set-Cookie". The lines should be separated by '\n's. */ - KHttpCookieList makeCookies(const QString &_url, const QCString &cookie_headers, long windowId); + KHttpCookieList makeCookies(const TQString &_url, const TQCString &cookie_headers, long windowId); /** * This function parses cookie_headers and returns a linked list of @@ -184,7 +184,7 @@ public: * cookie_domstr should be a concatenation of "name=value" pairs, separated * by a semicolon ';'. */ - KHttpCookieList makeDOMCookies(const QString &_url, const QCString &cookie_domstr, long windowId); + KHttpCookieList makeDOMCookies(const TQString &_url, const TQCString &cookie_domstr, long windowId); /** * This function hands a KHttpCookie object over to the cookie jar. @@ -213,7 +213,7 @@ public: * - KCookieReject, reject all cookies for _domain * - KCookieAsk, the user decides what to do with cookies for _domain */ - KCookieAdvice getDomainAdvice(const QString &_domain); + KCookieAdvice getDomainAdvice(const TQString &_domain); /** * This function sets the advice for all cookies originating from @@ -225,7 +225,7 @@ public: * - KCookieReject, reject all cookies for _domain * - KCookieAsk, the user decides what to do with cookies for _domain */ - void setDomainAdvice(const QString &_domain, KCookieAdvice _advice); + void setDomainAdvice(const TQString &_domain, KCookieAdvice _advice); /** * This function sets the advice for all cookies originating from @@ -269,13 +269,13 @@ public: * - It has a cookie originating from the domain * - It has a specific advice set for the domain */ - const QStringList& getDomainList(); + const TQStringList& getDomainList(); /** * Get a list of all cookies in the cookie jar originating from _domain. */ - const KHttpCookieList *getCookieList(const QString & _domain, - const QString& _fqdn ); + const KHttpCookieList *getCookieList(const TQString & _domain, + const TQString& _fqdn ); /** * Remove & delete a cookie from the jar. @@ -289,7 +289,7 @@ public: /** * Remove & delete all cookies for @p domain. */ - void eatCookiesForDomain(const QString &domain); + void eatCookiesForDomain(const TQString &domain); /** * Remove & delete all cookies @@ -306,25 +306,25 @@ public: * Removes all end of session cookies set by the * session @p windId. */ - void eatSessionCookies( const QString& fqdn, long windowId, bool isFQDN = true ); + void eatSessionCookies( const TQString& fqdn, long windowId, bool isFQDN = true ); /** * Parses _url and returns the FQDN (_fqdn) and path (_path). */ - static bool parseURL(const QString &_url, - QString &_fqdn, - QString &_path); + static bool parseURL(const TQString &_url, + TQString &_fqdn, + TQString &_path); /** * Returns a list of domains in @p _domainList relevant for this host. * The list is sorted with the FQDN listed first and the top-most * domain listed last */ - void extractDomains(const QString &_fqdn, - QStringList &_domainList); + void extractDomains(const TQString &_fqdn, + TQStringList &_domainList); - static QString adviceToStr(KCookieAdvice _advice); - static KCookieAdvice strToAdvice(const QString &_str); + static TQString adviceToStr(KCookieAdvice _advice); + static KCookieAdvice strToAdvice(const TQString &_str); /** Returns the */ int preferredDefaultPolicy() const { return m_preferredPolicy; } @@ -344,14 +344,14 @@ public: void setShowCookieDetails (bool value) { m_showCookieDetails = value; } protected: - void stripDomain(const QString &_fqdn, QString &_domain); - QString stripDomain( KHttpCookiePtr cookiePtr); + void stripDomain(const TQString &_fqdn, TQString &_domain); + TQString stripDomain( KHttpCookiePtr cookiePtr); protected: - QStringList m_domainList; + TQStringList m_domainList; KCookieAdvice m_globalAdvice; - QDict<KHttpCookieList> m_cookieDomains; - QDict<int> m_twoLevelTLD; + TQDict<KHttpCookieList> m_cookieDomains; + TQDict<int> m_twoLevelTLD; bool m_configChanged; bool m_cookiesChanged; diff --git a/kioslave/http/kcookiejar/kcookieserver.cpp b/kioslave/http/kcookiejar/kcookieserver.cpp index 365f15e79..e6469f127 100644 --- a/kioslave/http/kcookiejar/kcookieserver.cpp +++ b/kioslave/http/kcookiejar/kcookieserver.cpp @@ -29,9 +29,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <unistd.h> -#include <qtimer.h> -#include <qptrlist.h> -#include <qfile.h> +#include <tqtimer.h> +#include <tqptrlist.h> +#include <tqfile.h> #include <dcopclient.h> @@ -46,7 +46,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "kcookieserver.h" extern "C" { - KDE_EXPORT KDEDModule *create_kcookiejar(const QCString &name) + KDE_EXPORT KDEDModule *create_kcookiejar(const TQCString &name) { return new KCookieServer(name); } @@ -62,20 +62,20 @@ class CookieRequest { public: DCOPClient *client; DCOPClientTransaction *transaction; - QString url; + TQString url; bool DOM; long windowId; }; -template class QPtrList<CookieRequest>; +template class TQPtrList<CookieRequest>; -class RequestList : public QPtrList<CookieRequest> +class RequestList : public TQPtrList<CookieRequest> { public: - RequestList() : QPtrList<CookieRequest>() { } + RequestList() : TQPtrList<CookieRequest>() { } }; -KCookieServer::KCookieServer(const QCString &name) +KCookieServer::KCookieServer(const TQCString &name) :KDEDModule(name) { mOldCookieServer = new DCOPClient(); // backwards compatibility. @@ -86,29 +86,29 @@ KCookieServer::KCookieServer(const QCString &name) mPendingCookies->setAutoDelete(true); mRequestList = new RequestList; mAdvicePending = false; - mTimer = new QTimer(); - connect( mTimer, SIGNAL( timeout()), SLOT( slotSave())); + mTimer = new TQTimer(); + connect( mTimer, TQT_SIGNAL( timeout()), TQT_SLOT( slotSave())); mConfig = new KConfig("kcookiejarrc"); mCookieJar->loadConfig( mConfig ); - QString filename = locateLocal("data", "kcookiejar/cookies"); + TQString filename = locateLocal("data", "kcookiejar/cookies"); // Stay backwards compatible! - QString filenameOld = locate("data", "kfm/cookies"); + TQString filenameOld = locate("data", "kfm/cookies"); if (!filenameOld.isEmpty()) { mCookieJar->loadCookies( filenameOld ); if (mCookieJar->saveCookies( filename)) { - unlink(QFile::encodeName(filenameOld)); // Remove old kfm cookie file + unlink(TQFile::encodeName(filenameOld)); // Remove old kfm cookie file } } else { mCookieJar->loadCookies( filename); } - connect(this, SIGNAL(windowUnregistered(long)), - this, SLOT(slotDeleteSessionCookies(long))); + connect(this, TQT_SIGNAL(windowUnregistered(long)), + this, TQT_SLOT(slotDeleteSessionCookies(long))); } KCookieServer::~KCookieServer() @@ -122,11 +122,11 @@ KCookieServer::~KCookieServer() delete mConfig; } -bool KCookieServer::cookiesPending( const QString &url, KHttpCookieList *cookieList ) +bool KCookieServer::cookiesPending( const TQString &url, KHttpCookieList *cookieList ) { - QString fqdn; - QStringList domains; - QString path; + TQString fqdn; + TQStringList domains; + TQString path; // Check whether 'url' has cookies on the pending list if (mPendingCookies->isEmpty()) return false; @@ -150,7 +150,7 @@ bool KCookieServer::cookiesPending( const QString &url, KHttpCookieList *cookieL return cookieList->isEmpty(); } -void KCookieServer::addCookies( const QString &url, const QCString &cookieHeader, +void KCookieServer::addCookies( const TQString &url, const TQCString &cookieHeader, long windowId, bool useDOMFormat ) { KHttpCookieList cookieList; @@ -216,7 +216,7 @@ void KCookieServer::checkCookies( KHttpCookieList *cookieList) KHttpCookieList currentList; currentList.append(currentCookie); - QString currentHost = currentCookie->host(); + TQString currentHost = currentCookie->host(); cookie = mPendingCookies->next(); while (cookie) @@ -275,13 +275,13 @@ void KCookieServer::checkCookies( KHttpCookieList *cookieList) { if (!cookiesPending( request->url )) { - QCString replyType; - QByteArray replyData; - QString res = mCookieJar->findCookies( request->url, request->DOM, request->windowId ); + TQCString replyType; + TQByteArray replyData; + TQString res = mCookieJar->findCookies( request->url, request->DOM, request->windowId ); - QDataStream stream2(replyData, IO_WriteOnly); + TQDataStream stream2(replyData, IO_WriteOnly); stream2 << res; - replyType = "QString"; + replyType = "TQString"; request->client->endTransaction( request->transaction, replyType, replyData); CookieRequest *tmp = request; @@ -300,7 +300,7 @@ void KCookieServer::checkCookies( KHttpCookieList *cookieList) void KCookieServer::slotSave() { - QString filename = locateLocal("data", "kcookiejar/cookies"); + TQString filename = locateLocal("data", "kcookiejar/cookies"); mCookieJar->saveCookies(filename); } @@ -312,10 +312,10 @@ void KCookieServer::saveCookieJar() mTimer->start( 1000*60*SAVE_DELAY, true ); } -void KCookieServer::putCookie( QStringList& out, KHttpCookie *cookie, - const QValueList<int>& fields ) +void KCookieServer::putCookie( TQStringList& out, KHttpCookie *cookie, + const TQValueList<int>& fields ) { - QValueList<int>::ConstIterator i = fields.begin(); + TQValueList<int>::ConstIterator i = fields.begin(); for ( ; i != fields.end(); ++i ) { switch(*i) @@ -336,23 +336,23 @@ void KCookieServer::putCookie( QStringList& out, KHttpCookie *cookie, out << cookie->value(); break; case CF_EXPIRE : - out << QString::number(cookie->expireDate()); + out << TQString::number(cookie->expireDate()); break; case CF_PROVER : - out << QString::number(cookie->protocolVersion()); + out << TQString::number(cookie->protocolVersion()); break; case CF_SECURE : - out << QString::number( cookie->isSecure() ? 1 : 0 ); + out << TQString::number( cookie->isSecure() ? 1 : 0 ); break; default : - out << QString::null; + out << TQString::null; } } } bool KCookieServer::cookieMatches( KHttpCookiePtr c, - QString domain, QString fqdn, - QString path, QString name ) + TQString domain, TQString fqdn, + TQString path, TQString name ) { if( c ) { @@ -369,14 +369,14 @@ bool KCookieServer::cookieMatches( KHttpCookiePtr c, // DCOP function QString -KCookieServer::findCookies(QString url) +KCookieServer::findCookies(TQString url) { return findCookies(url, 0); } // DCOP function QString -KCookieServer::findCookies(QString url, long windowId) +KCookieServer::findCookies(TQString url, long windowId) { if (cookiesPending(url)) { @@ -387,10 +387,10 @@ KCookieServer::findCookies(QString url, long windowId) request->DOM = false; request->windowId = windowId; mRequestList->append( request ); - return QString::null; // Talk to you later :-) + return TQString::null; // Talk to you later :-) } - QString cookies = mCookieJar->findCookies(url, false, windowId); + TQString cookies = mCookieJar->findCookies(url, false, windowId); if (mCookieJar->changed()) saveCookieJar(); @@ -402,9 +402,9 @@ KCookieServer::findCookies(QString url, long windowId) QStringList KCookieServer::findDomains() { - QStringList result; - const QStringList domains = mCookieJar->getDomainList(); - for ( QStringList::ConstIterator domIt = domains.begin(); + TQStringList result; + const TQStringList domains = mCookieJar->getDomainList(); + for ( TQStringList::ConstIterator domIt = domains.begin(); domIt != domains.end(); ++domIt ) { // Ignore domains that have policy set for but contain @@ -418,19 +418,19 @@ KCookieServer::findDomains() // DCOP function QStringList -KCookieServer::findCookies(QValueList<int> fields, - QString domain, - QString fqdn, - QString path, - QString name) +KCookieServer::findCookies(TQValueList<int> fields, + TQString domain, + TQString fqdn, + TQString path, + TQString name) { - QStringList result; + TQStringList result; bool allDomCookies = name.isEmpty(); const KHttpCookieList* list = mCookieJar->getCookieList(domain, fqdn); if ( list && !list->isEmpty() ) { - QPtrListIterator<KHttpCookie>it( *list ); + TQPtrListIterator<KHttpCookie>it( *list ); for ( ; it.current(); ++it ) { if ( !allDomCookies ) @@ -450,14 +450,14 @@ KCookieServer::findCookies(QValueList<int> fields, // DCOP function QString -KCookieServer::findDOMCookies(QString url) +KCookieServer::findDOMCookies(TQString url) { return findDOMCookies(url, 0); } // DCOP function QString -KCookieServer::findDOMCookies(QString url, long windowId) +KCookieServer::findDOMCookies(TQString url, long windowId) { // We don't wait for pending cookies because it locks up konqueror // which can cause a deadlock if it happens to have a popup-menu up. @@ -470,20 +470,20 @@ KCookieServer::findDOMCookies(QString url, long windowId) // DCOP function void -KCookieServer::addCookies(QString arg1, QCString arg2, long arg3) +KCookieServer::addCookies(TQString arg1, TQCString arg2, long arg3) { addCookies(arg1, arg2, arg3, false); } // DCOP function void -KCookieServer::deleteCookie(QString domain, QString fqdn, - QString path, QString name) +KCookieServer::deleteCookie(TQString domain, TQString fqdn, + TQString path, TQString name) { const KHttpCookieList* list = mCookieJar->getCookieList( domain, fqdn ); if ( list && !list->isEmpty() ) { - QPtrListIterator<KHttpCookie>it (*list); + TQPtrListIterator<KHttpCookie>it (*list); for ( ; it.current(); ++it ) { if( cookieMatches(it.current(), domain, fqdn, path, name) ) @@ -498,7 +498,7 @@ KCookieServer::deleteCookie(QString domain, QString fqdn, // DCOP function void -KCookieServer::deleteCookiesFromDomain(QString domain) +KCookieServer::deleteCookiesFromDomain(TQString domain) { mCookieJar->eatCookiesForDomain(domain); saveCookieJar(); @@ -521,7 +521,7 @@ KCookieServer::deleteSessionCookies( long windowId ) } void -KCookieServer::deleteSessionCookiesFor(QString fqdn, long windowId) +KCookieServer::deleteSessionCookiesFor(TQString fqdn, long windowId) { mCookieJar->eatSessionCookies( fqdn, windowId ); saveCookieJar(); @@ -537,20 +537,20 @@ KCookieServer::deleteAllCookies() // DCOP function void -KCookieServer::addDOMCookies(QString arg1, QCString arg2, long arg3) +KCookieServer::addDOMCookies(TQString arg1, TQCString arg2, long arg3) { addCookies(arg1, arg2, arg3, true); } // DCOP function void -KCookieServer::setDomainAdvice(QString url, QString advice) +KCookieServer::setDomainAdvice(TQString url, TQString advice) { - QString fqdn; - QString dummy; + TQString fqdn; + TQString dummy; if (KCookieJar::parseURL(url, fqdn, dummy)) { - QStringList domains; + TQStringList domains; mCookieJar->extractDomains(fqdn, domains); mCookieJar->setDomainAdvice(domains[domains.count() > 3 ? 3 : 0], @@ -562,17 +562,17 @@ KCookieServer::setDomainAdvice(QString url, QString advice) // DCOP function QString -KCookieServer::getDomainAdvice(QString url) +KCookieServer::getDomainAdvice(TQString url) { KCookieAdvice advice = KCookieDunno; - QString fqdn; - QString dummy; + TQString fqdn; + TQString dummy; if (KCookieJar::parseURL(url, fqdn, dummy)) { - QStringList domains; + TQStringList domains; mCookieJar->extractDomains(fqdn, domains); - QStringList::ConstIterator it = domains.begin(); + TQStringList::ConstIterator it = domains.begin(); while ( (advice == KCookieDunno) && (it != domains.end()) ) { // Always check advice in both ".domain" and "domain". Note diff --git a/kioslave/http/kcookiejar/kcookieserver.h b/kioslave/http/kcookiejar/kcookieserver.h index bcd7fa530..ac185c38d 100644 --- a/kioslave/http/kcookiejar/kcookieserver.h +++ b/kioslave/http/kcookiejar/kcookieserver.h @@ -25,7 +25,7 @@ #ifndef KCOOKIESERVER_H #define KCOOKIESERVER_H -#include <qstringlist.h> +#include <tqstringlist.h> #include <kded/kdedmodule.h> class KHttpCookieList; @@ -41,37 +41,37 @@ class KCookieServer : public KDEDModule Q_OBJECT K_DCOP public: - KCookieServer(const QCString &); + KCookieServer(const TQCString &); ~KCookieServer(); k_dcop: - QString findCookies(QString); - QString findCookies(QString, long); - QStringList findDomains(); - QStringList findCookies(QValueList<int>,QString,QString,QString,QString); - QString findDOMCookies(QString); - QString findDOMCookies(QString, long); - void addCookies(QString, QCString, long); - void deleteCookie(QString, QString, QString, QString); - void deleteCookiesFromDomain(QString); + TQString findCookies(TQString); + TQString findCookies(TQString, long); + TQStringList findDomains(); + TQStringList findCookies(TQValueList<int>,TQString,TQString,TQString,TQString); + TQString findDOMCookies(TQString); + TQString findDOMCookies(TQString, long); + void addCookies(TQString, TQCString, long); + void deleteCookie(TQString, TQString, TQString, TQString); + void deleteCookiesFromDomain(TQString); void deleteSessionCookies(long); - void deleteSessionCookiesFor(QString, long); + void deleteSessionCookiesFor(TQString, long); void deleteAllCookies(); - void addDOMCookies(QString, QCString, long); + void addDOMCookies(TQString, TQCString, long); /** * Sets the cookie policy for the domain associated with the specified URL. */ - void setDomainAdvice(QString url, QString advice); + void setDomainAdvice(TQString url, TQString advice); /** * Returns the cookie policy in effect for the specified URL. */ - QString getDomainAdvice(QString url); + TQString getDomainAdvice(TQString url); void reloadPolicy(); void shutdown(); public: - bool cookiesPending(const QString &url, KHttpCookieList *cookieList=0); - void addCookies(const QString &url, const QCString &cookieHeader, + bool cookiesPending(const TQString &url, KHttpCookieList *cookieList=0); + void addCookies(const TQString &url, const TQCString &cookieHeader, long windowId, bool useDOMFormat); void checkCookies(KHttpCookieList *cookieList); @@ -83,15 +83,15 @@ protected: KCookieJar *mCookieJar; KHttpCookieList *mPendingCookies; RequestList *mRequestList; - QTimer *mTimer; + TQTimer *mTimer; bool mAdvicePending; DCOPClient *mOldCookieServer; KConfig *mConfig; private: - virtual int newInstance(QValueList<QCString>) { return 0; } - bool cookieMatches(KHttpCookie*, QString, QString, QString, QString); - void putCookie(QStringList&, KHttpCookie*, const QValueList<int>&); + virtual int newInstance(TQValueList<TQCString>) { return 0; } + bool cookieMatches(KHttpCookie*, TQString, TQString, TQString, TQString); + void putCookie(TQStringList&, KHttpCookie*, const TQValueList<int>&); void saveCookieJar(); }; diff --git a/kioslave/http/kcookiejar/kcookiewin.cpp b/kioslave/http/kcookiejar/kcookiewin.cpp index 5c68f8c1e..2c11c33cb 100644 --- a/kioslave/http/kcookiejar/kcookiewin.cpp +++ b/kioslave/http/kcookiejar/kcookiewin.cpp @@ -30,30 +30,30 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // this file is also used in Konqueror/Embedded. One of the aims of // Konqueror/Embedded is to be a small as possible to fit on embedded // devices. For this it's also useful to strip out unneeded features of -// Qt, like for example QToolTip or QWhatsThis. The availability (or the +// Qt, like for example TQToolTip or TQWhatsThis. The availability (or the // lack thereof) can be determined using these preprocessor defines. // The same applies to the QT_NO_ACCEL ifdef below. I hope it doesn't make // too much trouble... (Simon) -#include <qhbox.h> -#include <qvbox.h> -#include <qaccel.h> -#include <qlabel.h> -#include <qwidget.h> -#include <qlayout.h> -#include <qgroupbox.h> -#include <qdatetime.h> -#include <qmessagebox.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qvbuttongroup.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqaccel.h> +#include <tqlabel.h> +#include <tqwidget.h> +#include <tqlayout.h> +#include <tqgroupbox.h> +#include <tqdatetime.h> +#include <tqmessagebox.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqvbuttongroup.h> #ifndef QT_NO_TOOLTIP -#include <qtooltip.h> +#include <tqtooltip.h> #endif #ifndef QT_NO_WHATSTHIS -#include <qwhatsthis.h> +#include <tqwhatsthis.h> #endif #include <kidna.h> @@ -72,7 +72,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "kcookiejar.h" #include "kcookiewin.h" -KCookieWin::KCookieWin( QWidget *parent, KHttpCookieList cookieList, +KCookieWin::KCookieWin( TQWidget *parent, KHttpCookieList cookieList, int defaultButton, bool showDetails ) :KDialog( parent, "cookiealert", true ) { @@ -94,42 +94,42 @@ KCookieWin::KCookieWin( QWidget *parent, KHttpCookieList cookieList, # endif #endif // Main widget's layout manager... - QVBoxLayout* vlayout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); - vlayout->setResizeMode( QLayout::Fixed ); + TQVBoxLayout* vlayout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); + vlayout->setResizeMode( TQLayout::Fixed ); // Cookie image and message to user - QHBox* hBox = new QHBox( this ); + TQHBox* hBox = new TQHBox( this ); hBox->setSpacing( KDialog::spacingHint() ); - QLabel* icon = new QLabel( hBox ); - icon->setPixmap( QMessageBox::standardIcon(QMessageBox::Warning) ); + TQLabel* icon = new TQLabel( hBox ); + icon->setPixmap( TQMessageBox::standardIcon(TQMessageBox::Warning) ); icon->setAlignment( Qt::AlignCenter ); icon->setFixedSize( 2*icon->sizeHint() ); int count = cookieList.count(); - QVBox* vBox = new QVBox( hBox ); - QString txt = i18n("You received a cookie from", + TQVBox* vBox = new TQVBox( hBox ); + TQString txt = i18n("You received a cookie from", "You received %n cookies from", count); - QLabel* lbl = new QLabel( txt, vBox ); + TQLabel* lbl = new TQLabel( txt, vBox ); lbl->setAlignment( Qt::AlignCenter ); KHttpCookiePtr cookie = cookieList.first(); - QString host (cookie->host()); + TQString host (cookie->host()); int pos = host.find(':'); if ( pos > 0 ) { - QString portNum = host.left(pos); + TQString portNum = host.left(pos); host.remove(0, pos+1); host += ':'; host += portNum; } - txt = QString("<b>%1</b>").arg( KIDNA::toUnicode(host) ); + txt = TQString("<b>%1</b>").arg( KIDNA::toUnicode(host) ); if (cookie->isCrossDomain()) txt += i18n(" <b>[Cross Domain!]</b>"); - lbl = new QLabel( txt, vBox ); + lbl = new TQLabel( txt, vBox ); lbl->setAlignment( Qt::AlignCenter ); - lbl = new QLabel( i18n("Do you want to accept or reject?"), vBox ); + lbl = new TQLabel( i18n("Do you want to accept or reject?"), vBox ); lbl->setAlignment( Qt::AlignCenter ); vlayout->addWidget( hBox, 0, Qt::AlignLeft ); @@ -140,29 +140,29 @@ KCookieWin::KCookieWin( QWidget *parent, KHttpCookieList cookieList, m_showDetails ? m_detailView->show():m_detailView->hide(); // Cookie policy choice... - m_btnGrp = new QVButtonGroup( i18n("Apply Choice To"), this ); + m_btnGrp = new TQVButtonGroup( i18n("Apply Choice To"), this ); m_btnGrp->setRadioButtonExclusive( true ); txt = (count == 1)? i18n("&Only this cookie") : i18n("&Only these cookies"); - QRadioButton* rb = new QRadioButton( txt, m_btnGrp ); + TQRadioButton* rb = new TQRadioButton( txt, m_btnGrp ); #ifndef QT_NO_WHATSTHIS - QWhatsThis::add( rb, i18n("Select this option to accept/reject only this cookie. " + TQWhatsThis::add( rb, i18n("Select this option to accept/reject only this cookie. " "You will be prompted if another cookie is received. " "<em>(see WebBrowsing/Cookies in the Control Center)</em>." ) ); #endif m_btnGrp->insert( rb ); - rb = new QRadioButton( i18n("All cookies from this do&main"), m_btnGrp ); + rb = new TQRadioButton( i18n("All cookies from this do&main"), m_btnGrp ); #ifndef QT_NO_WHATSTHIS - QWhatsThis::add( rb, i18n("Select this option to accept/reject all cookies from " + TQWhatsThis::add( rb, i18n("Select this option to accept/reject all cookies from " "this site. Choosing this option will add a new policy for " "the site this cookie originated from. This policy will be " "permanent until you manually change it from the Control Center " "<em>(see WebBrowsing/Cookies in the Control Center)</em>.") ); #endif m_btnGrp->insert( rb ); - rb = new QRadioButton( i18n("All &cookies"), m_btnGrp ); + rb = new TQRadioButton( i18n("All &cookies"), m_btnGrp ); #ifndef QT_NO_WHATSTHIS - QWhatsThis::add( rb, i18n("Select this option to accept/reject all cookies from " + TQWhatsThis::add( rb, i18n("Select this option to accept/reject all cookies from " "anywhere. Choosing this option will change the global " "cookie policy set in the Control Center for all cookies " "<em>(see WebBrowsing/Cookies in the Control Center)</em>.") ); @@ -176,29 +176,29 @@ KCookieWin::KCookieWin( QWidget *parent, KHttpCookieList cookieList, m_btnGrp->setButton( 1 ); // Accept/Reject buttons - QWidget* bbox = new QWidget( this ); - QBoxLayout* bbLay = new QHBoxLayout( bbox ); + TQWidget* bbox = new TQWidget( this ); + TQBoxLayout* bbLay = new TQHBoxLayout( bbox ); bbLay->setSpacing( KDialog::spacingHint() ); - QPushButton* btn = new QPushButton( i18n("&Accept"), bbox ); + TQPushButton* btn = new TQPushButton( i18n("&Accept"), bbox ); btn->setDefault( true ); btn->setFocus(); - connect( btn, SIGNAL(clicked()), SLOT(accept()) ); + connect( btn, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); bbLay->addWidget( btn ); - btn = new QPushButton( i18n("&Reject"), bbox ); - connect( btn, SIGNAL(clicked()), SLOT(reject()) ); + btn = new TQPushButton( i18n("&Reject"), bbox ); + connect( btn, TQT_SIGNAL(clicked()), TQT_SLOT(reject()) ); bbLay->addWidget( btn ); bbLay->addStretch( 1 ); #ifndef QT_NO_ACCEL - QAccel* a = new QAccel( this ); - a->connectItem( a->insertItem(Qt::Key_Escape), btn, SLOT(animateClick()) ); + TQAccel* a = new TQAccel( this ); + a->connectItem( a->insertItem(Qt::Key_Escape), btn, TQT_SLOT(animateClick()) ); #endif - m_button = new QPushButton( bbox ); + m_button = new TQPushButton( bbox ); m_button->setText( m_showDetails ? i18n("&Details <<"):i18n("&Details >>") ); - connect( m_button, SIGNAL(clicked()), SLOT(slotCookieDetails()) ); + connect( m_button, TQT_SIGNAL(clicked()), TQT_SLOT(slotCookieDetails()) ); bbLay->addWidget( m_button ); #ifndef QT_NO_WHATSTHIS - QWhatsThis::add( m_button, i18n("See or modify the cookie information") ); + TQWhatsThis::add( m_button, i18n("See or modify the cookie information") ); #endif @@ -236,7 +236,7 @@ KCookieAdvice KCookieWin::advice( KCookieJar *cookiejar, KHttpCookie* cookie ) cookiejar->setShowCookieDetails ( m_showDetails ); - KCookieAdvice advice = (result==QDialog::Accepted) ? KCookieAccept:KCookieReject; + KCookieAdvice advice = (result==TQDialog::Accepted) ? KCookieAccept:KCookieReject; int preferredPolicy = m_btnGrp->id( m_btnGrp->selected() ); cookiejar->setPreferredDefaultPolicy( preferredPolicy ); @@ -257,17 +257,17 @@ KCookieAdvice KCookieWin::advice( KCookieJar *cookiejar, KHttpCookie* cookie ) } KCookieDetail::KCookieDetail( KHttpCookieList cookieList, int cookieCount, - QWidget* parent, const char* name ) - :QGroupBox( parent, name ) + TQWidget* parent, const char* name ) + :TQGroupBox( parent, name ) { setTitle( i18n("Cookie Details") ); - QGridLayout* grid = new QGridLayout( this, 9, 2, + TQGridLayout* grid = new TQGridLayout( this, 9, 2, KDialog::spacingHint(), KDialog::marginHint() ); grid->addRowSpacing( 0, fontMetrics().lineSpacing() ); grid->setColStretch( 1, 3 ); - QLabel* label = new QLabel( i18n("Name:"), this ); + TQLabel* label = new TQLabel( i18n("Name:"), this ); grid->addWidget( label, 1, 0 ); m_name = new KLineEdit( this ); m_name->setReadOnly( true ); @@ -275,35 +275,35 @@ KCookieDetail::KCookieDetail( KHttpCookieList cookieList, int cookieCount, grid->addWidget( m_name, 1 ,1 ); //Add the value - label = new QLabel( i18n("Value:"), this ); + label = new TQLabel( i18n("Value:"), this ); grid->addWidget( label, 2, 0 ); m_value = new KLineEdit( this ); m_value->setReadOnly( true ); m_value->setMaximumWidth( fontMetrics().maxWidth() * 25 ); grid->addWidget( m_value, 2, 1); - label = new QLabel( i18n("Expires:"), this ); + label = new TQLabel( i18n("Expires:"), this ); grid->addWidget( label, 3, 0 ); m_expires = new KLineEdit( this ); m_expires->setReadOnly( true ); m_expires->setMaximumWidth(fontMetrics().maxWidth() * 25 ); grid->addWidget( m_expires, 3, 1); - label = new QLabel( i18n("Path:"), this ); + label = new TQLabel( i18n("Path:"), this ); grid->addWidget( label, 4, 0 ); m_path = new KLineEdit( this ); m_path->setReadOnly( true ); m_path->setMaximumWidth( fontMetrics().maxWidth() * 25 ); grid->addWidget( m_path, 4, 1); - label = new QLabel( i18n("Domain:"), this ); + label = new TQLabel( i18n("Domain:"), this ); grid->addWidget( label, 5, 0 ); m_domain = new KLineEdit( this ); m_domain->setReadOnly( true ); m_domain->setMaximumWidth( fontMetrics().maxWidth() * 25 ); grid->addWidget( m_domain, 5, 1); - label = new QLabel( i18n("Exposure:"), this ); + label = new TQLabel( i18n("Exposure:"), this ); grid->addWidget( label, 6, 0 ); m_secure = new KLineEdit( this ); m_secure->setReadOnly( true ); @@ -312,12 +312,12 @@ KCookieDetail::KCookieDetail( KHttpCookieList cookieList, int cookieCount, if ( cookieCount > 1 ) { - QPushButton* btnNext = new QPushButton( i18n("Next cookie","&Next >>"), this ); + TQPushButton* btnNext = new TQPushButton( i18n("Next cookie","&Next >>"), this ); btnNext->setFixedSize( btnNext->sizeHint() ); grid->addMultiCellWidget( btnNext, 8, 8, 0, 1 ); - connect( btnNext, SIGNAL(clicked()), SLOT(slotNextCookie()) ); + connect( btnNext, TQT_SIGNAL(clicked()), TQT_SLOT(slotNextCookie()) ); #ifndef QT_NO_TOOLTIP - QToolTip::add( btnNext, i18n("Show details of the next cookie") ); + TQToolTip::add( btnNext, i18n("Show details of the next cookie") ); #endif } m_cookieList = cookieList; @@ -354,13 +354,13 @@ void KCookieDetail::slotNextCookie() else m_domain->setText( m_cookie->domain() ); m_path->setText( m_cookie->path() ); - QDateTime cookiedate; + TQDateTime cookiedate; cookiedate.setTime_t( m_cookie->expireDate() ); if ( m_cookie->expireDate() ) m_expires->setText( KGlobal::locale()->formatDateTime(cookiedate) ); else m_expires->setText( i18n("End of Session") ); - QString sec; + TQString sec; if (m_cookie->isSecure()) { if (m_cookie->isHttpOnly()) diff --git a/kioslave/http/kcookiejar/kcookiewin.h b/kioslave/http/kcookiejar/kcookiewin.h index 30e92e7e0..926964dec 100644 --- a/kioslave/http/kcookiejar/kcookiewin.h +++ b/kioslave/http/kcookiejar/kcookiewin.h @@ -27,7 +27,7 @@ #ifndef _KCOOKIEWIN_H_ #define _KCOOKIEWIN_H_ -#include <qgroupbox.h> +#include <tqgroupbox.h> #include <kdialog.h> #include "kcookiejar.h" @@ -42,7 +42,7 @@ class KCookieDetail : public QGroupBox Q_OBJECT public : - KCookieDetail( KHttpCookieList cookieList, int cookieCount, QWidget *parent=0, + KCookieDetail( KHttpCookieList cookieList, int cookieCount, TQWidget *parent=0, const char *name=0 ); ~KCookieDetail(); @@ -66,15 +66,15 @@ class KCookieWin : public KDialog Q_OBJECT public : - KCookieWin( QWidget *parent, KHttpCookieList cookieList, int defaultButton=0, + KCookieWin( TQWidget *parent, KHttpCookieList cookieList, int defaultButton=0, bool showDetails=false ); ~KCookieWin(); KCookieAdvice advice( KCookieJar *cookiejar, KHttpCookie* cookie ); private : - QPushButton* m_button; - QVButtonGroup* m_btnGrp; + TQPushButton* m_button; + TQVButtonGroup* m_btnGrp; KCookieDetail* m_detailView; bool m_showDetails; diff --git a/kioslave/http/kcookiejar/main.cpp b/kioslave/http/kcookiejar/main.cpp index 1e943b939..1a47b398e 100644 --- a/kioslave/http/kcookiejar/main.cpp +++ b/kioslave/http/kcookiejar/main.cpp @@ -53,39 +53,39 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) kapp->dcopClient()->attach(); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - QCString replyType; - QByteArray replyData; + TQCString replyType; + TQByteArray replyData; if (args->isSet("remove-all")) { - kapp->dcopClient()->call( "kded", "kcookiejar", "deleteAllCookies()", QByteArray(), replyType, replyData); + kapp->dcopClient()->call( "kded", "kcookiejar", "deleteAllCookies()", TQByteArray(), replyType, replyData); } if (args->isSet("remove")) { - QString domain = args->getOption("remove"); - QByteArray params; - QDataStream stream(params, IO_WriteOnly); + TQString domain = args->getOption("remove"); + TQByteArray params; + TQDataStream stream(params, IO_WriteOnly); stream << domain; - kapp->dcopClient()->call( "kded", "kcookiejar", "deleteCookiesFromDomain(QString)", params, replyType, replyData); + kapp->dcopClient()->call( "kded", "kcookiejar", "deleteCookiesFromDomain(TQString)", params, replyType, replyData); } if (args->isSet("shutdown")) { - QCString module = "kcookiejar"; - QByteArray params; - QDataStream stream(params, IO_WriteOnly); + TQCString module = "kcookiejar"; + TQByteArray params; + TQDataStream stream(params, IO_WriteOnly); stream << module; - kapp->dcopClient()->call( "kded", "kded", "unloadModule(QCString)", params, replyType, replyData); + kapp->dcopClient()->call( "kded", "kded", "unloadModule(TQCString)", params, replyType, replyData); } else if(args->isSet("reload-config")) { - kapp->dcopClient()->call( "kded", "kcookiejar", "reloadPolicy()", QByteArray(), replyType, replyData); + kapp->dcopClient()->call( "kded", "kcookiejar", "reloadPolicy()", TQByteArray(), replyType, replyData); } else { - QCString module = "kcookiejar"; - QByteArray params; - QDataStream stream(params, IO_WriteOnly); + TQCString module = "kcookiejar"; + TQByteArray params; + TQDataStream stream(params, IO_WriteOnly); stream << module; - kapp->dcopClient()->call( "kded", "kded", "loadModule(QCString)", params, replyType, replyData); + kapp->dcopClient()->call( "kded", "kded", "loadModule(TQCString)", params, replyType, replyData); } return 0; diff --git a/kioslave/http/kcookiejar/tests/kcookiejartest.cpp b/kioslave/http/kcookiejar/tests/kcookiejartest.cpp index f196f1820..0ad238ab7 100644 --- a/kioslave/http/kcookiejar/tests/kcookiejartest.cpp +++ b/kioslave/http/kcookiejar/tests/kcookiejartest.cpp @@ -21,8 +21,8 @@ #include <stdio.h> #include <stdlib.h> -#include <qdatetime.h> -#include <qstring.h> +#include <tqdatetime.h> +#include <tqstring.h> #include <kapplication.h> #include <kaboutdata.h> @@ -34,8 +34,8 @@ static const char *description = "KCookiejar regression test"; static KCookieJar *jar; -static QCString *lastYear; -static QCString *nextYear; +static TQCString *lastYear; +static TQCString *nextYear; static KConfig *config = 0; @@ -45,13 +45,13 @@ static KCmdLineOptions options[] = KCmdLineLastOption }; -static void FAIL(const QString &msg) +static void FAIL(const TQString &msg) { qWarning("%s", msg.local8Bit().data()); exit(1); } -static void popArg(QCString &command, QCString & line) +static void popArg(TQCString &command, TQCString & line) { int i = line.find(' '); if (i != -1) @@ -67,17 +67,17 @@ static void popArg(QCString &command, QCString & line) } -static void popArg(QString &command, QCString & line) +static void popArg(TQString &command, TQCString & line) { int i = line.find(' '); if (i != -1) { - command = QString::fromLatin1(line.left(i)); + command = TQString::fromLatin1(line.left(i)); line = line.mid(i+1); } else { - command = QString::fromLatin1(line); + command = TQString::fromLatin1(line); line = 0; } } @@ -85,8 +85,8 @@ static void popArg(QString &command, QCString & line) static void clearConfig() { delete config; - QString file = locateLocal("config", "kcookiejar-testconfig"); - QFile::remove(file); + TQString file = locateLocal("config", "kcookiejar-testconfig"); + TQFile::remove(file); config = new KConfig(file); config->setGroup("Cookie Policy"); config->writeEntry("RejectCrossDomainCookies", false); @@ -103,8 +103,8 @@ static void clearCookies() static void saveCookies() { - QString file = locateLocal("config", "kcookiejar-testcookies"); - QFile::remove(file); + TQString file = locateLocal("config", "kcookiejar-testcookies"); + TQFile::remove(file); jar->saveCookies(file); delete jar; jar = new KCookieJar(); @@ -112,21 +112,21 @@ static void saveCookies() jar->loadCookies(file); } -static void processCookie(QCString &line) +static void processCookie(TQCString &line) { - QString policy; + TQString policy; popArg(policy, line); KCookieAdvice expectedAdvice = KCookieJar::strToAdvice(policy); if (expectedAdvice == KCookieDunno) - FAIL(QString("Unknown accept policy '%1'").arg(policy)); + FAIL(TQString("Unknown accept policy '%1'").arg(policy)); - QString urlStr; + TQString urlStr; popArg(urlStr, line); KURL url(urlStr); if (!url.isValid()) - FAIL(QString("Invalid URL '%1'").arg(urlStr)); + FAIL(TQString("Invalid URL '%1'").arg(urlStr)); if (url.isEmpty()) - FAIL(QString("Missing URL")); + FAIL(TQString("Missing URL")); line.replace("%LASTYEAR%", *lastYear); line.replace("%NEXTYEAR%", *nextYear); @@ -134,62 +134,62 @@ static void processCookie(QCString &line) KHttpCookieList list = jar->makeCookies(urlStr, line, 0); if (list.isEmpty()) - FAIL(QString("Failed to make cookies from: '%1'").arg(line)); + FAIL(TQString("Failed to make cookies from: '%1'").arg(line)); for(KHttpCookie *cookie = list.first(); cookie; cookie = list.next()) { KCookieAdvice cookieAdvice = jar->cookieAdvice(cookie); if (cookieAdvice != expectedAdvice) - FAIL(urlStr+QString("\n'%2'\nGot advice '%3' expected '%4'").arg(line) + FAIL(urlStr+TQString("\n'%2'\nGot advice '%3' expected '%4'").arg(line) .arg(KCookieJar::adviceToStr(cookieAdvice)) .arg(KCookieJar::adviceToStr(expectedAdvice))); jar->addCookie(cookie); } } -static void processCheck(QCString &line) +static void processCheck(TQCString &line) { - QString urlStr; + TQString urlStr; popArg(urlStr, line); KURL url(urlStr); if (!url.isValid()) - FAIL(QString("Invalid URL '%1'").arg(urlStr)); + FAIL(TQString("Invalid URL '%1'").arg(urlStr)); if (url.isEmpty()) - FAIL(QString("Missing URL")); + FAIL(TQString("Missing URL")); - QString expectedCookies = QString::fromLatin1(line); + TQString expectedCookies = TQString::fromLatin1(line); - QString cookies = jar->findCookies(urlStr, false, 0, 0).stripWhiteSpace(); + TQString cookies = jar->findCookies(urlStr, false, 0, 0).stripWhiteSpace(); if (cookies != expectedCookies) - FAIL(urlStr+QString("\nGot '%1' expected '%2'") + FAIL(urlStr+TQString("\nGot '%1' expected '%2'") .arg(cookies, expectedCookies)); } -static void processClear(QCString &line) +static void processClear(TQCString &line) { if (line == "CONFIG") clearConfig(); else if (line == "COOKIES") clearCookies(); else - FAIL(QString("Unknown command 'CLEAR %1'").arg(line)); + FAIL(TQString("Unknown command 'CLEAR %1'").arg(line)); } -static void processConfig(QCString &line) +static void processConfig(TQCString &line) { - QCString key; + TQCString key; popArg(key, line); if (key.isEmpty()) - FAIL(QString("Missing Key")); + FAIL(TQString("Missing Key")); config->setGroup("Cookie Policy"); config->writeEntry(key.data(), line.data()); jar->loadConfig(config, false); } -static void processLine(QCString line) +static void processLine(TQCString line) { if (line.isEmpty()) return; @@ -201,7 +201,7 @@ static void processLine(QCString line) return; } - QCString command; + TQCString command; popArg(command, line); if (command.isEmpty()) return; @@ -217,14 +217,14 @@ static void processLine(QCString line) else if (command == "SAVE") saveCookies(); else - FAIL(QString("Unknown command '%1'").arg(command)); + FAIL(TQString("Unknown command '%1'").arg(command)); } -static void runRegression(const QString &filename) +static void runRegression(const TQString &filename) { FILE *file = fopen(filename.local8Bit(), "r"); if (!file) - FAIL(QString("Can't open '%1'").arg(filename)); + FAIL(TQString("Can't open '%1'").arg(filename)); char buf[4096]; while (fgets(buf, sizeof(buf), file)) @@ -242,12 +242,12 @@ static void runRegression(const QString &filename) int main(int argc, char *argv[]) { - QString arg1; - QCString arg2; - QString result; + TQString arg1; + TQCString arg2; + TQString result; - lastYear = new QCString(QString("Fri, 04-May-%1 01:00:00 GMT").arg(QDate::currentDate().year()-1).utf8()); - nextYear = new QCString(QString(" expires=Fri, 04-May-%1 01:00:00 GMT").arg(QDate::currentDate().year()+1).utf8()); + lastYear = new TQCString(TQString("Fri, 04-May-%1 01:00:00 GMT").arg(TQDate::currentDate().year()-1).utf8()); + nextYear = new TQCString(TQString(" expires=Fri, 04-May-%1 01:00:00 GMT").arg(TQDate::currentDate().year()+1).utf8()); KAboutData about("kcookietest", "kcookietest", "1.0", description, KAboutData::License_GPL, "(C) 2004 Waldo Bastian"); KCmdLineArgs::init( argc, argv, &about); @@ -264,7 +264,7 @@ int main(int argc, char *argv[]) clearConfig(); - QString file = args->url(0).path(); + TQString file = args->url(0).path(); runRegression(file); return 0; } |