diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /knode/knnntpclient.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knode/knnntpclient.cpp')
-rw-r--r-- | knode/knnntpclient.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/knode/knnntpclient.cpp b/knode/knnntpclient.cpp index 2c594be34..47942d6b3 100644 --- a/knode/knnntpclient.cpp +++ b/knode/knnntpclient.cpp @@ -16,15 +16,15 @@ #include <stdlib.h> #include <klocale.h> -#include <qtextcodec.h> -#include <qmutex.h> +#include <tqtextcodec.h> +#include <tqmutex.h> #include "kngroupmanager.h" #include "knnntpclient.h" #include "utilities.h" -KNNntpClient::KNNntpClient(int NfdPipeIn, int NfdPipeOut, QMutex& nntpMutex) +KNNntpClient::KNNntpClient(int NfdPipeIn, int NfdPipeOut, TQMutex& nntpMutex) : KNProtocolClient(NfdPipeIn,NfdPipeOut), mutex(nntpMutex) {} @@ -92,7 +92,7 @@ void KNNntpClient::doFetchGroups() return; char *s, *line; - QString name; + TQString name; KNGroup::Status status; bool subscribed; @@ -113,7 +113,7 @@ void KNNntpClient::doFetchGroups() } else { s[0] = 0; // cut string - name = QString::fromUtf8(line); + name = TQString::fromUtf8(line); if (target->subscribed.contains(name)) { target->subscribed.remove(name); // group names are unique, we wont find it again anyway... @@ -132,7 +132,7 @@ void KNNntpClient::doFetchGroups() default : status = KNGroup::unknown; } - target->groups->append(new KNGroupInfo(name,QString::null,false,subscribed,status)); + target->groups->append(new KNGroupInfo(name,TQString::null,false,subscribed,status)); } doneLines++; } @@ -158,7 +158,7 @@ void KNNntpClient::doFetchGroups() return; if (rep == 215) { // 215 informations follows - QString description; + TQString description; KNGroupInfo info; int pos; @@ -182,11 +182,11 @@ void KNNntpClient::doFetchGroups() s++; while (*s == ' ' || *s == '\t') s++; // go on to the description - name = QString::fromUtf8(line); + name = TQString::fromUtf8(line); if (target->codecForDescriptions) // some countries use local 8 bit characters in the tag line description = target->codecForDescriptions->toUnicode(s); else - description = QString::fromLocal8Bit(s); + description = TQString::fromLocal8Bit(s); info.name = name; if ((pos=tempVector.bsearch(&info))!=-1) @@ -221,15 +221,15 @@ void KNNntpClient::doCheckNewGroups() progressValue = 100; predictedLines = 30; // rule of thumb ;-) - QCString cmd; + TQCString cmd; cmd.sprintf("NEWGROUPS %.2d%.2d%.2d 000000",target->fetchSince.year()%100,target->fetchSince.month(),target->fetchSince.day()); if (!sendCommandWCheck(cmd,231)) // 231 list of new newsgroups follows return; char *s, *line; - QString name; + TQString name; KNGroup::Status status; - QSortedList<KNGroupInfo> tmpList; + TQSortedList<KNGroupInfo> tmpList; tmpList.setAutoDelete(true); while (getNextLine()) { @@ -248,7 +248,7 @@ void KNNntpClient::doCheckNewGroups() #endif } else { s[0] = 0; // cut string - name = QString::fromUtf8(line); + name = TQString::fromUtf8(line); while (s[1]!=0) s++; // the last character determines the moderation status switch (s[0]) { @@ -261,7 +261,7 @@ void KNNntpClient::doCheckNewGroups() default : status = KNGroup::unknown; } - tmpList.append(new KNGroupInfo(name,QString::null,true,false,status)); + tmpList.append(new KNGroupInfo(name,TQString::null,true,false,status)); } doneLines++; } @@ -279,7 +279,7 @@ void KNNntpClient::doCheckNewGroups() sendSignal(TSprogressUpdate); cmd = "LIST NEWSGROUPS "; - QStrList desList; + TQStrList desList; char *s; int rep; @@ -304,7 +304,7 @@ void KNNntpClient::doCheckNewGroups() if (target->codecForDescriptions) // some countries use local 8 bit characters in the tag line group->description = target->codecForDescriptions->toUnicode(s); else - group->description = QString::fromLocal8Bit(s); + group->description = TQString::fromLocal8Bit(s); } } } @@ -330,7 +330,7 @@ void KNNntpClient::doFetchNewHeaders() KNGroup* target=static_cast<KNGroup*>(job->data()); char* s; int first=0, last=0, oldlast=0, toFetch=0, rep=0; - QCString cmd; + TQCString cmd; target->setLastFetchCount(0); @@ -362,7 +362,7 @@ void KNNntpClient::doFetchNewHeaders() if (s) { last=atoi(s); } else { - QString tmp=i18n("No new articles could be retrieved.\nThe server sent a malformatted response:\n"); + TQString tmp=i18n("No new articles could be retrieved.\nThe server sent a malformatted response:\n"); tmp+=getCurrentLine(); job->setErrorString(tmp); closeConnection(); @@ -396,12 +396,12 @@ void KNNntpClient::doFetchNewHeaders() // get list of additional headers provided by the XOVER command // see RFC 2980 section 2.1.7 - QStrList headerformat; + TQStrList headerformat; cmd = "LIST OVERVIEW.FMT"; if ( sendCommand( cmd, rep ) && rep == 215 ) { - QStrList tmp; + TQStrList tmp; if (getMsg(tmp)) { - for(QCString s = tmp.first(); s; s = tmp.next()) { + for(TQCString s = tmp.first(); s; s = tmp.next()) { s = s.stripWhiteSpace(); // remove the mandatory xover header if (s == "Subject:" || s == "From:" || s == "Date:" || s == "Message-ID:" @@ -427,7 +427,7 @@ void KNNntpClient::doFetchNewHeaders() return; } - QStrList headers; + TQStrList headers; if (!getMsg(headers)) { return; } @@ -447,7 +447,7 @@ void KNNntpClient::doFetchNewHeaders() void KNNntpClient::doFetchArticle() { KNRemoteArticle *target = static_cast<KNRemoteArticle*>(job->data()); - QCString cmd; + TQCString cmd; sendSignal(TSdownloadArticle); errorPrefix = i18n("Article could not be retrieved.\nThe following error occurred:\n"); @@ -456,7 +456,7 @@ void KNNntpClient::doFetchArticle() predictedLines = target->lines()->numberOfLines()+10; if (target->collection()) { - QString groupName = static_cast<KNGroup*>(target->collection())->groupname(); + TQString groupName = static_cast<KNGroup*>(target->collection())->groupname(); if (currentGroup != groupName) { cmd="GROUP "; cmd+=groupName.utf8(); @@ -476,7 +476,7 @@ void KNNntpClient::doFetchArticle() if (!sendCommandWCheck(cmd,220)) { // 220 n <a> article retrieved - head and body follow int code = atoi(getCurrentLine()); if ( code == 430 || code == 423 ) { // 430 no such article found || 423 no such article number in this group - QString msgId = target->messageID()->as7BitString( false ); + TQString msgId = target->messageID()->as7BitString( false ); // strip of '<' and '>' msgId = msgId.mid( 1, msgId.length() - 2 ); job->setErrorString( errorPrefix + getCurrentLine() + @@ -487,7 +487,7 @@ void KNNntpClient::doFetchArticle() return; } - QStrList msg; + TQStrList msg; if (!getMsg(msg)) return; @@ -507,7 +507,7 @@ void KNNntpClient::doPostArticle() if (art->messageID(false)!=0) { int rep; - if (!sendCommand(QCString("STAT ")+art->messageID(false)->as7BitString(false),rep)) + if (!sendCommand(TQCString("STAT ")+art->messageID(false)->as7BitString(false),rep)) return; if (rep==223) { // 223 n <a> article retrieved - request text separately @@ -522,8 +522,8 @@ void KNNntpClient::doPostArticle() return; if (art->messageID(false)==0) { // article has no message ID => search for a ID in the response - QCString s = getCurrentLine(); - int start = s.findRev(QRegExp("<[^\\s]*@[^\\s]*>")); + TQCString s = getCurrentLine(); + int start = s.findRev(TQRegExp("<[^\\s]*@[^\\s]*>")); if (start != -1) { // post response includes a recommended id int end = s.find('>',start); art->messageID()->from7BitString(s.mid(start,end-start+1)); @@ -552,11 +552,11 @@ void KNNntpClient::doFetchSource() progressValue = 100; predictedLines = target->lines()->numberOfLines()+10; - QCString cmd = "ARTICLE " + target->messageID()->as7BitString(false); + TQCString cmd = "ARTICLE " + target->messageID()->as7BitString(false); if (!sendCommandWCheck(cmd,220)) // 220 n <a> article retrieved - head and body follow return; - QStrList msg; + TQStrList msg; if (!getMsg(msg)) return; @@ -569,9 +569,9 @@ void KNNntpClient::doFetchSource() bool KNNntpClient::openConnection() { - currentGroup = QString::null; + currentGroup = TQString::null; - QString oldPrefix = errorPrefix; + TQString oldPrefix = errorPrefix; errorPrefix=i18n("Unable to connect.\nThe following error occurred:\n"); if (!KNProtocolClient::openConnection()) @@ -609,7 +609,7 @@ bool KNNntpClient::openConnection() if (account.needsLogon() && !account.user().isEmpty()) { //qDebug("knode: user: %s",account.user().latin1()); - QCString command = "AUTHINFO USER "; + TQCString command = "AUTHINFO USER "; command += account.user().local8Bit(); if (!KNProtocolClient::sendCommand(command,rep)) return false; @@ -669,7 +669,7 @@ bool KNNntpClient::openConnection() // authentication on demand -bool KNNntpClient::sendCommand(const QCString &cmd, int &rep) +bool KNNntpClient::sendCommand(const TQCString &cmd, int &rep) { if (!KNProtocolClient::sendCommand(cmd,rep)) return false; @@ -686,7 +686,7 @@ bool KNNntpClient::sendCommand(const QCString &cmd, int &rep) //qDebug("knode: user: %s",account.user().data()); - QCString command = "AUTHINFO USER "; + TQCString command = "AUTHINFO USER "; command += account.user().local8Bit(); if (!KNProtocolClient::sendCommand(command,rep)) return false; |