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/knarticlefactory.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/knarticlefactory.cpp')
-rw-r--r-- | knode/knarticlefactory.cpp | 164 |
1 files changed, 82 insertions, 82 deletions
diff --git a/knode/knarticlefactory.cpp b/knode/knarticlefactory.cpp index 3c072887b..410c2bf40 100644 --- a/knode/knarticlefactory.cpp +++ b/knode/knarticlefactory.cpp @@ -12,9 +12,9 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US */ -#include <qlayout.h> -#include <qlabel.h> -#include <qvbox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqvbox.h> #include <klocale.h> #include <kmessagebox.h> @@ -35,15 +35,15 @@ #include "resource.h" -KNArticleFactory::KNArticleFactory(QObject *p, const char *n) - : QObject(p, n), s_endErrDlg(0) +KNArticleFactory::KNArticleFactory(TQObject *p, const char *n) + : TQObject(p, n), s_endErrDlg(0) { } KNArticleFactory::~KNArticleFactory() { - for ( QValueList<KNComposer*>::Iterator it = mCompList.begin(); it != mCompList.end(); ++it ) + for ( TQValueList<KNComposer*>::Iterator it = mCompList.begin(); it != mCompList.end(); ++it ) delete (*it); delete s_endErrDlg; } @@ -54,7 +54,7 @@ void KNArticleFactory::createPosting(KNNntpAccount *a) if(!a) return; - QString sig; + TQString sig; KNLocalArticle *art=newArticle(a, sig, knGlobals.configManager()->postNewsTechnical()->charset()); if(!art) return; @@ -63,9 +63,9 @@ void KNArticleFactory::createPosting(KNNntpAccount *a) art->setDoPost(true); art->setDoMail(false); - KNComposer *c = new KNComposer( art, QString::null, sig, QString::null, true ); + KNComposer *c = new KNComposer( art, TQString::null, sig, TQString::null, true ); mCompList.append( c ); - connect(c, SIGNAL(composerDone(KNComposer*)), this, SLOT(slotComposerDone(KNComposer*))); + connect(c, TQT_SIGNAL(composerDone(KNComposer*)), this, TQT_SLOT(slotComposerDone(KNComposer*))); c->show(); } @@ -75,13 +75,13 @@ void KNArticleFactory::createPosting(KNGroup *g) if(!g) return; - QCString chset; + TQCString chset; if (g->useCharset()) chset = g->defaultCharset(); else chset = knGlobals.configManager()->postNewsTechnical()->charset(); - QString sig; + TQString sig; KNLocalArticle *art=newArticle(g, sig, chset); if(!art) @@ -92,21 +92,21 @@ void KNArticleFactory::createPosting(KNGroup *g) art->setDoMail(false); art->newsgroups()->fromUnicodeString(g->groupname(), art->defaultCharset()); - KNComposer *c=new KNComposer(art, QString::null, sig, QString::null, true); + KNComposer *c=new KNComposer(art, TQString::null, sig, TQString::null, true); mCompList.append( c ); - connect(c, SIGNAL(composerDone(KNComposer*)), this, SLOT(slotComposerDone(KNComposer*))); + connect(c, TQT_SIGNAL(composerDone(KNComposer*)), this, TQT_SLOT(slotComposerDone(KNComposer*))); c->show(); } -void KNArticleFactory::createReply(KNRemoteArticle *a, QString selectedText, bool post, bool mail) +void KNArticleFactory::createReply(KNRemoteArticle *a, TQString selectedText, bool post, bool mail) { if(!a) return; KNGroup *g=static_cast<KNGroup*>(a->collection()); - QCString chset; + TQCString chset; if (knGlobals.configManager()->postNewsTechnical()->useOwnCharset()) { if (g->useCharset()) chset = g->defaultCharset(); @@ -116,7 +116,7 @@ void KNArticleFactory::createReply(KNRemoteArticle *a, QString selectedText, boo chset = knGlobals.configManager()->postNewsTechnical()->findComposerCharset(a->contentType()->charset()); //create new article - QString sig; + TQString sig; KNLocalArticle *art=newArticle(g, sig, chset, true, a); if(!art) return; @@ -128,7 +128,7 @@ void KNArticleFactory::createReply(KNRemoteArticle *a, QString selectedText, boo //------------------------- <Headers> ---------------------------- //subject - QString subject=a->subject()->asUnicodeString(); + TQString subject=a->subject()->asUnicodeString(); if(subject.left(3).upper()!="RE:") subject.prepend("Re: "); art->subject()->fromUnicodeString(subject, a->subject()->rfc2047Charset()); @@ -140,7 +140,7 @@ void KNArticleFactory::createReply(KNRemoteArticle *a, QString selectedText, boo if( post && // user wanted to reply by public posting? // ask the user if she wants to ignore this F'up-To: poster ( KMessageBox::Yes != KMessageBox::questionYesNo(knGlobals.topWidget, - i18n("The author has requested a reply by email instead\nof a followup to the newsgroup. (Followup-To: poster)\nDo you want to reply in public anyway?"), QString::null, i18n("Reply Public"), i18n("Reply by Email")) )) + i18n("The author has requested a reply by email instead\nof a followup to the newsgroup. (Followup-To: poster)\nDo you want to reply in public anyway?"), TQString::null, i18n("Reply Public"), i18n("Reply by Email")) )) { art->setDoPost(false); art->setDoMail(true); @@ -173,7 +173,7 @@ void KNArticleFactory::createReply(KNRemoteArticle *a, QString selectedText, boo //References KMime::Headers::References *references=a->references(false); - QCString refs; + TQCString refs; if (references) refs=references->as7BitString(false); else @@ -192,7 +192,7 @@ void KNArticleFactory::createReply(KNRemoteArticle *a, QString selectedText, boo authorWantsMailCopies = mailCopiesTo->alwaysCopy(); if (authorWantsMailCopies) // warn the user KMessageBox::information(knGlobals.topWidget,i18n("The author requested a mail copy of your reply. (Mail-Copies-To header)"), - QString::null,"mailCopiesToWarning"); + TQString::null,"mailCopiesToWarning"); if (authorWantsMailCopies && mailCopiesTo->hasEmail()) { address.setName(mailCopiesTo->name()); address.setEmail(mailCopiesTo->email()); @@ -206,22 +206,22 @@ void KNArticleFactory::createReply(KNRemoteArticle *a, QString selectedText, boo //--------------------------- <Body> ----------------------------- // attribution line - QString attribution=knGlobals.configManager()->postNewsComposer()->intro(); - QString name(a->from()->name()); + TQString attribution=knGlobals.configManager()->postNewsComposer()->intro(); + TQString name(a->from()->name()); if (name.isEmpty()) - name = QString::fromLatin1(a->from()->email()); - attribution.replace(QRegExp("%NAME"),name); - attribution.replace(QRegExp("%EMAIL"),QString::fromLatin1(a->from()->email())); - attribution.replace(QRegExp("%DATE"),KGlobal::locale()->formatDateTime(a->date()->qdt(),false)); - attribution.replace(QRegExp("%MSID"),a->messageID()->asUnicodeString()); - attribution.replace(QRegExp("%GROUP"),g->groupname()); - attribution.replace(QRegExp("%L"),"\n"); + name = TQString::fromLatin1(a->from()->email()); + attribution.replace(TQRegExp("%NAME"),name); + attribution.replace(TQRegExp("%EMAIL"),TQString::fromLatin1(a->from()->email())); + attribution.replace(TQRegExp("%DATE"),KGlobal::locale()->formatDateTime(a->date()->qdt(),false)); + attribution.replace(TQRegExp("%MSID"),a->messageID()->asUnicodeString()); + attribution.replace(TQRegExp("%GROUP"),g->groupname()); + attribution.replace(TQRegExp("%L"),"\n"); attribution+="\n\n"; - QString quoted=attribution; - QString notRewraped=QString::null; - QStringList text; - QStringList::Iterator line; + TQString quoted=attribution; + TQString notRewraped=TQString::null; + TQStringList text; + TQStringList::Iterator line; bool incSig=knGlobals.configManager()->postNewsComposer()->includeSignature(); if (selectedText.isEmpty()) { @@ -230,7 +230,7 @@ void KNArticleFactory::createReply(KNRemoteArticle *a, QString selectedText, boo tc->decodedText(text, true, knGlobals.configManager()->readNewsViewer()->removeTrailingNewlines()); } else - text = QStringList::split('\n',selectedText,true); + text = TQStringList::split('\n',selectedText,true); for(line=text.begin(); line!=text.end(); ++line) { if(!incSig && (*line)=="-- ") @@ -264,7 +264,7 @@ void KNArticleFactory::createReply(KNRemoteArticle *a, QString selectedText, boo //open composer KNComposer *c=new KNComposer(art, quoted, sig, notRewraped, true, authorDislikesMailCopies, authorWantsMailCopies); mCompList.append( c ); - connect(c, SIGNAL(composerDone(KNComposer*)), this, SLOT(slotComposerDone(KNComposer*))); + connect(c, TQT_SIGNAL(composerDone(KNComposer*)), this, TQT_SLOT(slotComposerDone(KNComposer*))); c->show(); } @@ -275,11 +275,11 @@ void KNArticleFactory::createForward(KNArticle *a) return; KMime::Headers::ContentType *ct=a->contentType(); - QCString chset; + TQCString chset; bool incAtt = ( !knGlobals.configManager()->postNewsTechnical()->useExternalMailer() && ct->isMultipart() && ct->isSubtype("mixed") && KMessageBox::Yes == KMessageBox::questionYesNo(knGlobals.topWidget, - i18n("This article contains attachments. Do you want them to be forwarded as well?"), QString::null, i18n("Forward"), i18n("Do Not Forward")) + i18n("This article contains attachments. Do you want them to be forwarded as well?"), TQString::null, i18n("Forward"), i18n("Do Not Forward")) ); if (knGlobals.configManager()->postNewsTechnical()->useOwnCharset()) @@ -288,7 +288,7 @@ void KNArticleFactory::createForward(KNArticle *a) chset = knGlobals.configManager()->postNewsTechnical()->findComposerCharset(a->contentType()->charset()); //create new article - QString sig; + TQString sig; KNLocalArticle *art=newArticle(knGlobals.groupManager()->currentGroup(), sig, chset); if(!art) return; @@ -299,14 +299,14 @@ void KNArticleFactory::createForward(KNArticle *a) //------------------------- <Headers> ---------------------------- //subject - QString subject=("Fwd: "+a->subject()->asUnicodeString()); + TQString subject=("Fwd: "+a->subject()->asUnicodeString()); art->subject()->fromUnicodeString(subject, a->subject()->rfc2047Charset()); //------------------------- </Headers> --------------------------- //--------------------------- <Body> ----------------------------- - QString fwd = QString("\n--------------- %1\n\n").arg(i18n("Forwarded message (begin)")); + TQString fwd = TQString("\n--------------- %1\n\n").arg(i18n("Forwarded message (begin)")); fwd+=( i18n("Subject") + ": " + a->subject()->asUnicodeString() + "\n" ); fwd+=( i18n("From") + ": " + a->from()->asUnicodeString() + "\n" ); @@ -315,13 +315,13 @@ void KNArticleFactory::createForward(KNArticle *a) KMime::Content *text=a->textContent(); if(text) { - QStringList decodedLines; + TQStringList decodedLines; text->decodedText( decodedLines, false, false ); - for(QStringList::Iterator it=decodedLines.begin(); it!=decodedLines.end(); ++it) + for(TQStringList::Iterator it=decodedLines.begin(); it!=decodedLines.end(); ++it) fwd += (*it) + "\n"; } - fwd += QString("\n--------------- %1\n").arg(i18n("Forwarded message (end)")); + fwd += TQString("\n--------------- %1\n").arg(i18n("Forwarded message (end)")); //--------------------------- </Body> ---------------------------- @@ -341,15 +341,15 @@ void KNArticleFactory::createForward(KNArticle *a) if (knGlobals.configManager()->postNewsTechnical()->useExternalMailer()) { - sendMailExternal(QString::null, subject, fwd); + sendMailExternal(TQString::null, subject, fwd); delete art; return; } //open composer - KNComposer *c=new KNComposer(art, fwd, sig, QString::null, true); + KNComposer *c=new KNComposer(art, fwd, sig, TQString::null, true); mCompList.append( c ); - connect(c, SIGNAL(composerDone(KNComposer*)), this, SLOT(slotComposerDone(KNComposer*))); + connect(c, TQT_SIGNAL(composerDone(KNComposer*)), this, TQT_SLOT(slotComposerDone(KNComposer*))); c->show(); } @@ -360,7 +360,7 @@ void KNArticleFactory::createCancel(KNArticle *a) return; if(KMessageBox::No==KMessageBox::questionYesNo(knGlobals.topWidget, - i18n("Do you really want to cancel this article?"), QString::null, i18n("Cancel Article"), KStdGuiItem::cancel())) + i18n("Do you really want to cancel this article?"), TQString::null, i18n("Cancel Article"), KStdGuiItem::cancel())) return; bool sendNow; @@ -390,7 +390,7 @@ void KNArticleFactory::createCancel(KNArticle *a) grp=knGlobals.groupManager()->group(a->newsgroups()->firstGroup(), nntp); - QString sig; + TQString sig; KNLocalArticle *art=newArticle(grp, sig, "us-ascii", false); if(!art) return; @@ -404,7 +404,7 @@ void KNArticleFactory::createCancel(KNArticle *a) //subject KMime::Headers::MessageID *msgId=a->messageID(); - QCString tmp; + TQCString tmp; tmp="cancel of "+msgId->as7BitString(false); art->subject()->from7BitString(tmp); @@ -419,7 +419,7 @@ void KNArticleFactory::createCancel(KNArticle *a) art->lines()->setNumberOfLines(1); //body - art->fromUnicodeString(QString::fromLatin1("cancel by original author\n")); + art->fromUnicodeString(TQString::fromLatin1("cancel by original author\n")); //assemble art->assemble(); @@ -440,7 +440,7 @@ void KNArticleFactory::createSupersede(KNArticle *a) return; if(KMessageBox::No==KMessageBox::questionYesNo(knGlobals.topWidget, - i18n("Do you really want to supersede this article?"), QString::null, i18n("Supersede"), KStdGuiItem::cancel())) + i18n("Do you really want to supersede this article?"), TQString::null, i18n("Supersede"), KStdGuiItem::cancel())) return; KNGroup *grp; @@ -464,7 +464,7 @@ void KNArticleFactory::createSupersede(KNArticle *a) grp=knGlobals.groupManager()->group(a->newsgroups()->firstGroup(), nntp); //new article - QString sig; + TQString sig; KNLocalArticle *art=newArticle(grp, sig, knGlobals.configManager()->postNewsTechnical()->findComposerCharset(a->contentType()->charset())); if(!art) return; @@ -492,7 +492,7 @@ void KNArticleFactory::createSupersede(KNArticle *a) art->supersedes()->from7BitString(a->messageID()->as7BitString(false)); //Body - QString text; + TQString text; KMime::Content *textContent=a->textContent(); if(textContent) textContent->decodedText(text); @@ -500,7 +500,7 @@ void KNArticleFactory::createSupersede(KNArticle *a) //open composer KNComposer *c=new KNComposer(art, text, sig); mCompList.append( c ); - connect(c, SIGNAL(composerDone(KNComposer*)), this, SLOT(slotComposerDone(KNComposer*))); + connect(c, TQT_SIGNAL(composerDone(KNComposer*)), this, TQT_SLOT(slotComposerDone(KNComposer*))); c->show(); } @@ -513,7 +513,7 @@ void KNArticleFactory::createMail(KMime::Headers::AddressField *address) } //create new article - QString sig; + TQString sig; KNLocalArticle *art=newArticle(knGlobals.groupManager()->currentGroup(), sig, knGlobals.configManager()->postNewsTechnical()->charset()); if(!art) return; @@ -523,18 +523,18 @@ void KNArticleFactory::createMail(KMime::Headers::AddressField *address) art->to()->addAddress((*address)); //open composer - KNComposer *c=new KNComposer(art, QString::null, sig, QString::null, true); + KNComposer *c=new KNComposer(art, TQString::null, sig, TQString::null, true); mCompList.append( c ); - connect(c, SIGNAL(composerDone(KNComposer*)), this, SLOT(slotComposerDone(KNComposer*))); + connect(c, TQT_SIGNAL(composerDone(KNComposer*)), this, TQT_SLOT(slotComposerDone(KNComposer*))); c->show(); } -void KNArticleFactory::sendMailExternal(const QString &address, const QString &subject, const QString &body) +void KNArticleFactory::sendMailExternal(const TQString &address, const TQString &subject, const TQString &body) { KURL mailtoURL; - QStringList queries; - QString query=QString::null; + TQStringList queries; + TQString query=TQString::null; mailtoURL.setProtocol("mailto"); if (!address.isEmpty()) @@ -546,7 +546,7 @@ void KNArticleFactory::sendMailExternal(const QString &address, const QString &s if (queries.count() > 0) { query = "?"; - for ( QStringList::Iterator it = queries.begin(); it != queries.end(); ++it ) { + for ( TQStringList::Iterator it = queries.begin(); it != queries.end(); ++it ) { if (it != queries.begin()) query.append("&"); query.append((*it)); @@ -596,7 +596,7 @@ void KNArticleFactory::edit(KNLocalArticle *a) knGlobals.articleManager()->loadArticle(a); //open composer - com=new KNComposer(a, QString::null, id->getSignature()); + com=new KNComposer(a, TQString::null, id->getSignature()); if(id->useSigGenerator() && !id->getSigGeneratorStdErr().isEmpty()) KMessageBox::information(knGlobals.topWidget, i18n("<qt>The signature generator program produced the " @@ -604,7 +604,7 @@ void KNArticleFactory::edit(KNLocalArticle *a) .arg(id->getSigGeneratorStdErr())); mCompList.append( com ); - connect(com, SIGNAL(composerDone(KNComposer*)), this, SLOT(slotComposerDone(KNComposer*))); + connect(com, TQT_SIGNAL(composerDone(KNComposer*)), this, TQT_SLOT(slotComposerDone(KNComposer*))); com->show(); } @@ -682,7 +682,7 @@ void KNArticleFactory::sendOutbox() bool KNArticleFactory::closeComposeWindows() { while ( !mCompList.isEmpty() ) { - QValueList<KNComposer*>::Iterator it = mCompList.begin(); + TQValueList<KNComposer*>::Iterator it = mCompList.begin(); if ( !(*it)->close() ) return false; } @@ -703,7 +703,7 @@ void KNArticleFactory::deleteComposerForArticle(KNLocalArticle *a) KNComposer* KNArticleFactory::findComposer(KNLocalArticle *a) { - for ( QValueList<KNComposer*>::Iterator it = mCompList.begin(); it != mCompList.end(); ++it ) + for ( TQValueList<KNComposer*>::Iterator it = mCompList.begin(); it != mCompList.end(); ++it ) if ( (*it)->article() == a ) return (*it); return 0; @@ -712,7 +712,7 @@ KNComposer* KNArticleFactory::findComposer(KNLocalArticle *a) void KNArticleFactory::configChanged() { - for ( QValueList<KNComposer*>::Iterator it = mCompList.begin(); it != mCompList.end(); ++it ) + for ( TQValueList<KNComposer*>::Iterator it = mCompList.begin(); it != mCompList.end(); ++it ) (*it)->setConfig( false ); } @@ -774,7 +774,7 @@ void KNArticleFactory::processJob(KNJobData *j) } -KNLocalArticle* KNArticleFactory::newArticle(KNCollection *col, QString &sig, QCString defChset, bool withXHeaders, KNArticle *origPost) +KNLocalArticle* KNArticleFactory::newArticle(KNCollection *col, TQString &sig, TQCString defChset, bool withXHeaders, KNArticle *origPost) { KNConfig::PostNewsTechnical *pnt=knGlobals.configManager()->postNewsTechnical(); @@ -871,19 +871,19 @@ KNLocalArticle* KNArticleFactory::newArticle(KNCollection *col, QString &sig, QC if(withXHeaders) { KNConfig::XHeaders::Iterator it; for(it=pnt->xHeaders().begin(); it!=pnt->xHeaders().end(); ++it) { - QString value = (*it).value(); + TQString value = (*it).value(); if(origPost) { - QString name(origPost->from()->name()); + TQString name(origPost->from()->name()); if (name.isEmpty()) - name = QString::fromLatin1(origPost->from()->email()); - value.replace(QRegExp("%NAME"), name); - value.replace(QRegExp("%EMAIL"), QString::fromLatin1(origPost->from()->email())); + name = TQString::fromLatin1(origPost->from()->email()); + value.replace(TQRegExp("%NAME"), name); + value.replace(TQRegExp("%EMAIL"), TQString::fromLatin1(origPost->from()->email())); } else if(value.find("%NAME") != -1 || value.find("%EMAIL") != -1) continue; - art->setHeader( new KMime::Headers::Generic( (QCString("X-")+(*it).name()), art, value, pnt->charset() ) ); + art->setHeader( new KMime::Headers::Generic( (TQCString("X-")+(*it).name()), art, value, pnt->charset() ) ); } } @@ -898,7 +898,7 @@ KNLocalArticle* KNArticleFactory::newArticle(KNCollection *col, QString &sig, QC .arg(id->getSigGeneratorStdErr())); } else - sig=QString::null; + sig=TQString::null; return art; } @@ -990,7 +990,7 @@ void KNArticleFactory::showSendErrorDialog() { if(!s_endErrDlg) { s_endErrDlg=new KNSendErrorDialog(); - connect(s_endErrDlg, SIGNAL(closeClicked()), this, SLOT(slotSendErrorDialogDone())); + connect(s_endErrDlg, TQT_SIGNAL(closeClicked()), this, TQT_SLOT(slotSendErrorDialogDone())); } s_endErrDlg->show(); } @@ -1068,16 +1068,16 @@ KNSendErrorDialog::KNSendErrorDialog() { p_ixmap=knGlobals.configManager()->appearance()->icon(KNConfig::Appearance::sendErr); - QVBox *page = makeVBoxMainWidget(); + TQVBox *page = makeVBoxMainWidget(); - new QLabel(QString("<b>%1</b><br>%2").arg(i18n("Errors occurred while sending these articles:")) + new TQLabel(TQString("<b>%1</b><br>%2").arg(i18n("Errors occurred while sending these articles:")) .arg(i18n("The unsent articles are stored in the \"Outbox\" folder.")), page); j_obs=new KNDialogListBox(true, page); - e_rror=new QLabel(QString::null, page); + e_rror=new TQLabel(TQString::null, page); - connect(j_obs, SIGNAL(highlighted(int)), this, SLOT(slotHighlighted(int))); + connect(j_obs, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotHighlighted(int))); - KNHelper::restoreWindowSize("sendDlg", this, QSize(320,250)); + KNHelper::restoreWindowSize("sendDlg", this, TQSize(320,250)); } @@ -1087,7 +1087,7 @@ KNSendErrorDialog::~KNSendErrorDialog() } -void KNSendErrorDialog::append(const QString &subject, const QString &error) +void KNSendErrorDialog::append(const TQString &subject, const TQString &error) { LBoxItem *it=new LBoxItem(error, subject, &p_ixmap); @@ -1100,7 +1100,7 @@ void KNSendErrorDialog::slotHighlighted(int idx) { LBoxItem *it=static_cast<LBoxItem*>(j_obs->item(idx)); if(it) { - QString tmp=i18n("<b>Error message:</b><br>")+it->error; + TQString tmp=i18n("<b>Error message:</b><br>")+it->error; e_rror->setText(tmp); } } |