diff options
Diffstat (limited to 'kioslave/http/kcookiejar')
-rw-r--r-- | kioslave/http/kcookiejar/kcookiejar.cpp | 56 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookiejar.h | 2 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookieserver.cpp | 14 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookiewin.cpp | 16 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/kcookiewin.h | 2 | ||||
-rw-r--r-- | kioslave/http/kcookiejar/tests/kcookiejartest.cpp | 14 |
6 files changed, 52 insertions, 52 deletions
diff --git a/kioslave/http/kcookiejar/kcookiejar.cpp b/kioslave/http/kcookiejar/kcookiejar.cpp index 909f92dcb..83c2bd0e7 100644 --- a/kioslave/http/kcookiejar/kcookiejar.cpp +++ b/kioslave/http/kcookiejar/kcookiejar.cpp @@ -84,12 +84,12 @@ #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 TQString::fromLatin1( ) +// Note with respect to TQString::tqfromLatin1( ) // 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) TQString::fromLatin1(x) +#define L1(x) TQString::tqfromLatin1(x) template class TQPtrList<KHttpCookie>; template class TQPtrDict<KHttpCookieList>; @@ -154,9 +154,9 @@ KHttpCookie::KHttpCookie(const TQString &_host, // // Checks if a cookie has been expired // -bool KHttpCookie::isExpired(time_t currentDate) +bool KHttpCookie::isExpired(time_t tqcurrentDate) { - return (mExpireDate != 0) && (mExpireDate < currentDate); + return (mExpireDate != 0) && (mExpireDate < tqcurrentDate); } // @@ -194,14 +194,14 @@ bool KHttpCookie::match(const TQString &fqdn, const TQStringList &domains, if (fqdn != mHost) return false; } - else if (!domains.contains(mDomain)) + else if (!domains.tqcontains(mDomain)) { if (mDomain[0] == '.') return false; // Maybe the domain needs an extra dot. TQString domain = '.' + mDomain; - if ( !domains.contains( domain ) ) + if ( !domains.tqcontains( domain ) ) if ( fqdn != mDomain ) return false; } @@ -261,7 +261,7 @@ KCookieJar::KCookieJar() for(TQStringList::ConstIterator it = countries.begin(); it != countries.end(); ++it) { - m_twoLevelTLD.replace(*it, (int *) 1); + m_twoLevelTLD.tqreplace(*it, (int *) 1); } } @@ -301,7 +301,7 @@ static void removeDuplicateFromList(KHttpCookieList *list, KHttpCookie *cookiePt it != cookie->windowIds().end(); ++it) { long windowId = *it; - if (windowId && (cookiePtr->windowIds().find(windowId) == cookiePtr->windowIds().end())) + if (windowId && (cookiePtr->windowIds().tqfind(windowId) == cookiePtr->windowIds().end())) { cookiePtr->windowIds().append(windowId); } @@ -337,8 +337,8 @@ TQString KCookieJar::findCookies(const TQString &_url, bool useDOMFormat, long w if (!parseURL(_url, fqdn, path)) return cookieStr; - bool secureRequest = (_url.find( L1("https://"), 0, false) == 0 || - _url.find( L1("webdavs://"), 0, false) == 0); + bool secureRequest = (_url.tqfind( L1("https://"), 0, false) == 0 || + _url.tqfind( L1("webdavs://"), 0, false) == 0); // kdDebug(7104) << "findCookies: URL= " << _url << ", secure = " << secureRequest << endl; @@ -399,7 +399,7 @@ TQString KCookieJar::findCookies(const TQString &_url, bool useDOMFormat, long w continue; } - if (windowId && (cookie->windowIds().find(windowId) == cookie->windowIds().end())) + if (windowId && (cookie->windowIds().tqfind(windowId) == cookie->windowIds().end())) { cookie->windowIds().append(windowId); } @@ -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 = TQString::fromLatin1(header); + Value = TQString::tqfromLatin1(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 = TQString::fromLatin1(header); + Value = TQString::tqfromLatin1(header); Value.truncate(s - header); return (s); } } - Value = TQString::fromLatin1(header); + Value = TQString::tqfromLatin1(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 = TQString::fromLatin1(header); + Value = TQString::tqfromLatin1(header); Value.truncate( s - header ); Value = Value.stripWhiteSpace(); } @@ -591,7 +591,7 @@ bool KCookieJar::parseURL(const TQString &_url, // Cookie spoofing protection. Since there is no way a path separator // or escape encoded character is allowed in the hostname according // to RFC 2396, reject attempts to include such things there! - if(_fqdn.find('/') > -1 || _fqdn.find('%') > -1) + if(_fqdn.tqfind('/') > -1 || _fqdn.tqfind('%') > -1) { return false; // deny everything!! } @@ -618,9 +618,9 @@ void KCookieJar::extractDomains(const TQString &_fqdn, return; } // Return numeric IPv4 addresses as is... - if ((_fqdn[0] >= '0') && (_fqdn[0] <= '9')) + if ((_fqdn.at(0) >= '0') && (_fqdn.at(0) <= '9')) { - if (_fqdn.find(TQRegExp(IP_ADDRESS_EXPRESSION)) > -1) + if (_fqdn.tqfind(TQRegExp(IP_ADDRESS_EXPRESSION)) > -1) { _domains.append( _fqdn ); return; @@ -683,7 +683,7 @@ void KCookieJar::extractDomains(const TQString &_fqdn, */ static TQString fixupDateTime(const TQString& dt) { - const int index = dt.find(TQRegExp("[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}")); + const int index = dt.tqfind(TQRegExp("[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}")); if (index > -1) { @@ -729,7 +729,7 @@ KHttpCookieList KCookieJar::makeCookies(const TQString &_url, return KHttpCookieList(); } TQString defaultPath; - int i = path.findRev('/'); + int i = path.tqfindRev('/'); if (i > 0) defaultPath = path.left(i); @@ -811,7 +811,7 @@ KHttpCookieList KCookieJar::makeCookies(const TQString &_url, if(dom.length() > 2 && dom[dom.length()-1] == '.') dom = dom.left(dom.length()-1); - if(dom.contains('.') > 1 || dom == ".local") + if(dom.tqcontains('.') > 1 || dom == ".local") lastCookie->mDomain = dom; } else if (cName == "max-age") @@ -1020,7 +1020,7 @@ KCookieAdvice KCookieJar::cookieAdvice(KHttpCookiePtr cookiePtr) // cross-site cookie injection. if (!cookiePtr->domain().isEmpty()) { - if (!domains.contains(cookiePtr->domain()) && + if (!domains.tqcontains(cookiePtr->domain()) && !cookiePtr->domain().endsWith("."+cookiePtr->host())) cookiePtr->fixDomain(TQString::null); } @@ -1457,11 +1457,11 @@ bool KCookieJar::loadCookies(const TQString &_filename) if ((expDate == 0) || (expDate < curTime)) continue; - KHttpCookie *cookie = new KHttpCookie(TQString::fromLatin1(host), - TQString::fromLatin1(domain), - TQString::fromLatin1(path), - TQString::fromLatin1(name), - TQString::fromLatin1(value), + KHttpCookie *cookie = new KHttpCookie(TQString::tqfromLatin1(host), + TQString::tqfromLatin1(domain), + TQString::tqfromLatin1(path), + TQString::tqfromLatin1(name), + TQString::tqfromLatin1(value), expDate, protVer, secure, httpOnly, explicitPath); addCookie(cookie); @@ -1546,7 +1546,7 @@ void KCookieJar::loadConfig(KConfig *_config, bool reparse ) { const TQString &value = *it++; - int sepPos = value.findRev(':'); + int sepPos = value.tqfindRev(':'); if (sepPos <= 0) continue; diff --git a/kioslave/http/kcookiejar/kcookiejar.h b/kioslave/http/kcookiejar/kcookiejar.h index eb64485ea..6d5d9f2e5 100644 --- a/kioslave/http/kcookiejar/kcookiejar.h +++ b/kioslave/http/kcookiejar/kcookiejar.h @@ -89,7 +89,7 @@ public: time_t expireDate(void) { return mExpireDate; } int protocolVersion(void) { return mProtocolVersion; } bool isSecure(void) { return mSecure; } - bool isExpired(time_t currentDate); + bool isExpired(time_t tqcurrentDate); bool isCrossDomain(void) { return mCrossDomain; } bool isHttpOnly(void) { return mHttpOnly; } bool hasExplicitPath(void) { return mExplicitPath; } diff --git a/kioslave/http/kcookiejar/kcookieserver.cpp b/kioslave/http/kcookiejar/kcookieserver.cpp index e6469f127..afd5664d8 100644 --- a/kioslave/http/kcookiejar/kcookieserver.cpp +++ b/kioslave/http/kcookiejar/kcookieserver.cpp @@ -368,14 +368,14 @@ bool KCookieServer::cookieMatches( KHttpCookiePtr c, } // DCOP function -QString +TQString KCookieServer::findCookies(TQString url) { return findCookies(url, 0); } // DCOP function -QString +TQString KCookieServer::findCookies(TQString url, long windowId) { if (cookiesPending(url)) @@ -399,7 +399,7 @@ KCookieServer::findCookies(TQString url, long windowId) } // DCOP function -QStringList +TQStringList KCookieServer::findDomains() { TQStringList result; @@ -417,7 +417,7 @@ KCookieServer::findDomains() } // DCOP function -QStringList +TQStringList KCookieServer::findCookies(TQValueList<int> fields, TQString domain, TQString fqdn, @@ -449,14 +449,14 @@ KCookieServer::findCookies(TQValueList<int> fields, } // DCOP function -QString +TQString KCookieServer::findDOMCookies(TQString url) { return findDOMCookies(url, 0); } // DCOP function -QString +TQString KCookieServer::findDOMCookies(TQString url, long windowId) { // We don't wait for pending cookies because it locks up konqueror @@ -561,7 +561,7 @@ KCookieServer::setDomainAdvice(TQString url, TQString advice) } // DCOP function -QString +TQString KCookieServer::getDomainAdvice(TQString url) { KCookieAdvice advice = KCookieDunno; diff --git a/kioslave/http/kcookiejar/kcookiewin.cpp b/kioslave/http/kcookiejar/kcookiewin.cpp index 2c11c33cb..ca8560bf0 100644 --- a/kioslave/http/kcookiejar/kcookiewin.cpp +++ b/kioslave/http/kcookiejar/kcookiewin.cpp @@ -102,8 +102,8 @@ KCookieWin::KCookieWin( TQWidget *parent, KHttpCookieList cookieList, hBox->setSpacing( KDialog::spacingHint() ); TQLabel* icon = new TQLabel( hBox ); icon->setPixmap( TQMessageBox::standardIcon(TQMessageBox::Warning) ); - icon->setAlignment( Qt::AlignCenter ); - icon->setFixedSize( 2*icon->sizeHint() ); + icon->tqsetAlignment( Qt::AlignCenter ); + icon->setFixedSize( 2*icon->tqsizeHint() ); int count = cookieList.count(); @@ -111,11 +111,11 @@ KCookieWin::KCookieWin( TQWidget *parent, KHttpCookieList cookieList, TQString txt = i18n("You received a cookie from", "You received %n cookies from", count); TQLabel* lbl = new TQLabel( txt, vBox ); - lbl->setAlignment( Qt::AlignCenter ); + lbl->tqsetAlignment( Qt::AlignCenter ); KHttpCookiePtr cookie = cookieList.first(); TQString host (cookie->host()); - int pos = host.find(':'); + int pos = host.tqfind(':'); if ( pos > 0 ) { TQString portNum = host.left(pos); @@ -128,9 +128,9 @@ KCookieWin::KCookieWin( TQWidget *parent, KHttpCookieList cookieList, if (cookie->isCrossDomain()) txt += i18n(" <b>[Cross Domain!]</b>"); lbl = new TQLabel( txt, vBox ); - lbl->setAlignment( Qt::AlignCenter ); + lbl->tqsetAlignment( Qt::AlignCenter ); lbl = new TQLabel( i18n("Do you want to accept or reject?"), vBox ); - lbl->setAlignment( Qt::AlignCenter ); + lbl->tqsetAlignment( Qt::AlignCenter ); vlayout->addWidget( hBox, 0, Qt::AlignLeft ); // Cookie Details dialog... @@ -203,7 +203,7 @@ KCookieWin::KCookieWin( TQWidget *parent, KHttpCookieList cookieList, vlayout->addWidget( bbox ); - setFixedSize( sizeHint() ); + setFixedSize( tqsizeHint() ); } KCookieWin::~KCookieWin() @@ -313,7 +313,7 @@ KCookieDetail::KCookieDetail( KHttpCookieList cookieList, int cookieCount, if ( cookieCount > 1 ) { TQPushButton* btnNext = new TQPushButton( i18n("Next cookie","&Next >>"), this ); - btnNext->setFixedSize( btnNext->sizeHint() ); + btnNext->setFixedSize( btnNext->tqsizeHint() ); grid->addMultiCellWidget( btnNext, 8, 8, 0, 1 ); connect( btnNext, TQT_SIGNAL(clicked()), TQT_SLOT(slotNextCookie()) ); #ifndef QT_NO_TOOLTIP diff --git a/kioslave/http/kcookiejar/kcookiewin.h b/kioslave/http/kcookiejar/kcookiewin.h index 369ba69b1..d739732dc 100644 --- a/kioslave/http/kcookiejar/kcookiewin.h +++ b/kioslave/http/kcookiejar/kcookiewin.h @@ -37,7 +37,7 @@ class TQPushButton; class TQVButtonGroup; class KURLLabel; -class KCookieDetail : public QGroupBox +class KCookieDetail : public TQGroupBox { Q_OBJECT diff --git a/kioslave/http/kcookiejar/tests/kcookiejartest.cpp b/kioslave/http/kcookiejar/tests/kcookiejartest.cpp index 0ad238ab7..aa51b2f91 100644 --- a/kioslave/http/kcookiejar/tests/kcookiejartest.cpp +++ b/kioslave/http/kcookiejar/tests/kcookiejartest.cpp @@ -53,7 +53,7 @@ static void FAIL(const TQString &msg) static void popArg(TQCString &command, TQCString & line) { - int i = line.find(' '); + int i = line.tqfind(' '); if (i != -1) { command = line.left(i); @@ -69,15 +69,15 @@ static void popArg(TQCString &command, TQCString & line) static void popArg(TQString &command, TQCString & line) { - int i = line.find(' '); + int i = line.tqfind(' '); if (i != -1) { - command = TQString::fromLatin1(line.left(i)); + command = TQString::tqfromLatin1(line.left(i)); line = line.mid(i+1); } else { - command = TQString::fromLatin1(line); + command = TQString::tqfromLatin1(line); line = 0; } } @@ -158,7 +158,7 @@ static void processCheck(TQCString &line) if (url.isEmpty()) FAIL(TQString("Missing URL")); - TQString expectedCookies = TQString::fromLatin1(line); + TQString expectedCookies = TQString::tqfromLatin1(line); TQString cookies = jar->findCookies(urlStr, false, 0, 0).stripWhiteSpace(); if (cookies != expectedCookies) @@ -246,8 +246,8 @@ int main(int argc, char *argv[]) TQCString arg2; TQString result; - 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()); + lastYear = new TQCString(TQString("Fri, 04-May-%1 01:00:00 GMT").arg(TQDate::tqcurrentDate().year()-1).utf8()); + nextYear = new TQCString(TQString(" expires=Fri, 04-May-%1 01:00:00 GMT").arg(TQDate::tqcurrentDate().year()+1).utf8()); KAboutData about("kcookietest", "kcookietest", "1.0", description, KAboutData::License_GPL, "(C) 2004 Waldo Bastian"); KCmdLineArgs::init( argc, argv, &about); |