diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
commit | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch) | |
tree | 5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kmail/kmcomposewin.cpp | |
parent | 2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff) | |
download | tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip |
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4,
however Qt3 builds are OK. Any alterations this commit makes to kdepim
behaviour under Qt3 are unintentional and should be fixed.
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/kmcomposewin.cpp')
-rw-r--r-- | kmail/kmcomposewin.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/kmail/kmcomposewin.cpp b/kmail/kmcomposewin.cpp index e6ec6f967..98a5c6e0a 100644 --- a/kmail/kmcomposewin.cpp +++ b/kmail/kmcomposewin.cpp @@ -196,7 +196,7 @@ KMComposeWin::KMComposeWin( KMMessage *aMsg, uint id ) setInstance( kmkernel->xmlGuiInstance() ); mMainWidget = new TQWidget(this); // splitter between the headers area and the actual editor - mHeadersToEditorSplitter = new TQSplitter( Qt::Vertical, mMainWidget, "mHeadersToEditorSplitter" ); + mHeadersToEditorSplitter = new TQSplitter( TQt::Vertical, mMainWidget, "mHeadersToEditorSplitter" ); mHeadersToEditorSplitter->setChildrenCollapsible( false ); mHeadersArea = new TQWidget( mHeadersToEditorSplitter ); mHeadersArea->tqsetSizePolicy( mHeadersToEditorSplitter->sizePolicy().horData(), TQSizePolicy::Maximum ); @@ -331,9 +331,9 @@ KMComposeWin::KMComposeWin( KMMessage *aMsg, uint id ) mFixedFontAction = 0; mTempDir = 0; // the attachment view is separated from the editor by a splitter - mSplitter = new TQSplitter( Qt::Vertical, mHeadersToEditorSplitter, "mSplitter" ); + mSplitter = new TQSplitter( TQt::Vertical, mHeadersToEditorSplitter, "mSplitter" ); mSplitter->setChildrenCollapsible( false ); - mSnippetSplitter = new TQSplitter( Qt::Horizontal, mSplitter, "mSnippetSplitter"); + mSnippetSplitter = new TQSplitter( TQt::Horizontal, mSplitter, "mSnippetSplitter"); mSnippetSplitter->setChildrenCollapsible( false ); TQWidget *editorAndCryptoStateIndicators = new TQWidget( mSnippetSplitter ); @@ -341,7 +341,7 @@ KMComposeWin::KMComposeWin( KMMessage *aMsg, uint id ) TQHBoxLayout *hbox = new TQHBoxLayout( vbox ); { mSignatureStateIndicator = new TQLabel( editorAndCryptoStateIndicators ); - mSignatureStateIndicator->tqsetAlignment( Qt::AlignHCenter ); + mSignatureStateIndicator->tqsetAlignment( TQt::AlignHCenter ); hbox->addWidget( mSignatureStateIndicator ); KConfigGroup reader( KMKernel::config(), "Reader" ); @@ -353,7 +353,7 @@ KMComposeWin::KMComposeWin( KMMessage *aMsg, uint id ) mSignatureStateIndicator->setPalette( p ); mEncryptionStateIndicator = new TQLabel( editorAndCryptoStateIndicators ); - mEncryptionStateIndicator->tqsetAlignment( Qt::AlignHCenter ); + mEncryptionStateIndicator->tqsetAlignment( TQt::AlignHCenter ); hbox->addWidget( mEncryptionStateIndicator ); p.setColor( TQColorGroup::Background, reader.readColorEntry( "PGPMessageEncr" , &defaultEncryptedColor ) ); mEncryptionStateIndicator->setPalette( p ); @@ -369,7 +369,7 @@ KMComposeWin::KMComposeWin( KMMessage *aMsg, uint id ) mSplitter->setOpaqueResize( true ); mEditor->initializeAutoSpellChecking(); - mEditor->setTextFormat(Qt::PlainText); + mEditor->setTextFormat(TQt::PlainText); mEditor->setAcceptDrops( true ); TQWhatsThis::add( mBtnIdentity, @@ -557,7 +557,7 @@ void KMComposeWin::addAttachmentsAndSend(const KURL::List &urls, const TQString connect(this, TQT_SIGNAL(attachmentAdded(const KURL&, bool)), TQT_SLOT(slotAttachedFile(const KURL&))); for( KURL::List::ConstIterator itr = urls.begin(); itr != urls.end(); ++itr ) { if (!addAttach( *itr )) - mAttachFilesPending.remove(mAttachFilesPending.find(*itr)); // only remove one copy of the url + mAttachFilesPending.remove(mAttachFilesPending.tqfind(*itr)); // only remove one copy of the url } if (mAttachFilesPending.isEmpty() && mAttachFilesSend == how) @@ -571,7 +571,7 @@ void KMComposeWin::slotAttachedFile(const KURL &url) { if (mAttachFilesPending.isEmpty()) return; - mAttachFilesPending.remove(mAttachFilesPending.find(url)); // only remove one copy of url + mAttachFilesPending.remove(mAttachFilesPending.tqfind(url)); // only remove one copy of url if (mAttachFilesPending.isEmpty()) { send(mAttachFilesSend); @@ -618,7 +618,7 @@ void KMComposeWin::slotAttachPNGImageData(const TQByteArray &image) { bool ok; - TQString attName = KInputDialog::getText( "KMail", i18n("Name of the attachment:"), TQString::null, &ok, this ); + TQString attName = KInputDialog::getText( "KMail", i18n("Name of the attachment:"), TQString(), &ok, this ); if ( !ok ) return; @@ -965,7 +965,7 @@ int KMComposeWin::calcColumnWidth(int which, long allShowing, int width) w->setBuddy( mEditor ); // set dummy so we don't calculate width of '&' for this label. w->adjustSize(); w->show(); - return QMAX( width, w->tqsizeHint().width() ); + return TQMAX( width, w->tqsizeHint().width() ); } void KMComposeWin::rethinkFields(bool fromSlot) @@ -1336,8 +1336,8 @@ void KMComposeWin::setupActions(void) KStdAction::pasteText (this, TQT_SLOT(slotPasteClipboard()), actionCollection()); KStdAction::selectAll (this, TQT_SLOT(slotMarkAll()), actionCollection()); - KStdAction::find (this, TQT_SLOT(slotFind()), actionCollection()); - KStdAction::tqfindNext(this, TQT_SLOT(slotSearchAgain()), actionCollection()); + KStdAction::tqfind (this, TQT_SLOT(slotFind()), actionCollection()); + KStdAction::findNext(this, TQT_SLOT(slotSearchAgain()), actionCollection()); KStdAction::tqreplace (this, TQT_SLOT(slotReplace()), actionCollection()); KStdAction::spelling (this, TQT_SLOT(slotSpellcheck()), actionCollection(), "spellcheck"); @@ -1714,7 +1714,7 @@ TQString KMComposeWin::to() const } else if ( mRecipientsEditor ) { return mRecipientsEditor->recipientString( Recipient::To ); } else { - return TQString::null; + return TQString(); } } @@ -1726,7 +1726,7 @@ TQString KMComposeWin::cc() const } else if ( mRecipientsEditor ) { return mRecipientsEditor->recipientString( Recipient::Cc ); } else { - return TQString::null; + return TQString(); } } @@ -1738,7 +1738,7 @@ TQString KMComposeWin::bcc() const } else if ( mRecipientsEditor ) { return mRecipientsEditor->recipientString( Recipient::Bcc ); } else { - return TQString::null; + return TQString(); } } @@ -1754,7 +1754,7 @@ TQString KMComposeWin::replyTo() const if ( mEdtReplyTo ) { return cleanedUpHeaderString( mEdtReplyTo->text() ); } else { - return TQString::null; + return TQString(); } } @@ -2010,7 +2010,7 @@ void KMComposeWin::setMsg(KMMessage* newMsg, bool mayAutoSign, mEditor->setText( otp.textualContent() ); mCharset = otp.textualContentCharset(); if ( partNode * n = root->findType( DwMime::kTypeText, DwMime::kSubtypeHtml ) ) - if ( partNode * p = n->parentNode() ) + if ( partNode * p = n->tqparentNode() ) if ( p->hasType( DwMime::kTypeMultipart ) && p->hasSubType( DwMime::kSubtypeAlternative ) ) if ( mMsg->headerField( "X-KMail-Markup" ) == "true" ) { @@ -2068,9 +2068,9 @@ void KMComposeWin::setMsg(KMMessage* newMsg, bool mayAutoSign, partNode *root = partNode::fromMessage( mMsg ); partNode *node = root->findType( DwMime::kTypeText, DwMime::kSubtypeHtml ); - if ( node && node->parentNode() && - node->parentNode()->hasType( DwMime::kTypeMultipart ) && - node->parentNode()->hasSubType( DwMime::kSubtypeAlternative ) ) { + if ( node && node->tqparentNode() && + node->tqparentNode()->hasType( DwMime::kTypeMultipart ) && + node->tqparentNode()->hasSubType( DwMime::kSubtypeAlternative ) ) { // we have a mp/al body part with a text and an html body kdDebug(5006) << "KMComposeWin::setMsg() : text/html found" << endl; firstAttachment = 2; @@ -2245,7 +2245,7 @@ bool KMComposeWin::queryClose () const int rc = KMessageBox::warningYesNoCancel( this, i18n("Do you want to save the message for later or discard it?"), i18n("Close Composer"), - KGuiItem(savebut, "filesave", TQString::null, savetext), + KGuiItem(savebut, "filesave", TQString(), savetext), KStdGuiItem::discard() ); if ( rc == KMessageBox::Cancel ) return false; @@ -2292,14 +2292,14 @@ bool KMComposeWin::userForgotAttachment() bool gotMatch = false; - // check whether the subject tqcontains one of the attachment key words + // check whether the subject contains one of the attachment key words // unless the message is a reply or a forwarded message TQString subj = subject(); gotMatch = ( KMMessage::stripOffPrefixes( subj ) == subj ) && ( rx.search( subj ) >= 0 ); if ( !gotMatch ) { - // check whether the non-quoted text tqcontains one of the attachment key + // check whether the non-quoted text contains one of the attachment key // words TQRegExp quotationRx ("^([ \\t]*([|>:}#]|[A-Za-z]+>))+"); for ( int i = 0; i < mEditor->numLines(); ++i ) { @@ -2751,13 +2751,13 @@ void KMComposeWin::slotAttachFile() // Handle the case where the last savedir is gone. kolab/issue4057 TQString recent; - KURL recentURL = KFileDialog::getStartURL( TQString::null, recent ); + KURL recentURL = KFileDialog::getStartURL( TQString(), recent ); if ( !recentURL.url().isEmpty() && !KIO::NetAccess::exists( recentURL, true, this ) ) { recentURL = KURL( TQDir::homeDirPath() ); } - KFileDialog fdlg( recentURL.url(), TQString::null, this, 0, true ); + KFileDialog fdlg( recentURL.url(), TQString(), this, 0, true ); fdlg.setOperationMode( KFileDialog::Other ); fdlg.setCaption( i18n( "Attach File" ) ); fdlg.okButton()->setGuiItem( KGuiItem( i18n( "&Attach" ),"fileopen" ) ); @@ -2773,7 +2773,7 @@ void KMComposeWin::slotAttachFile() //----------------------------------------------------------------------------- void KMComposeWin::slotAttachFileData(KIO::Job *job, const TQByteArray &data) { - TQMap<KIO::Job*, atmLoadData>::Iterator it = mMapAtmLoadData.find(job); + TQMap<KIO::Job*, atmLoadData>::Iterator it = mMapAtmLoadData.tqfind(job); assert(it != mMapAtmLoadData.end()); TQBuffer buff((*it).data); buff.open(IO_WriteOnly | IO_Append); @@ -2785,10 +2785,10 @@ void KMComposeWin::slotAttachFileData(KIO::Job *job, const TQByteArray &data) //----------------------------------------------------------------------------- void KMComposeWin::slotAttachFileResult(KIO::Job *job) { - TQMap<KIO::Job*, atmLoadData>::Iterator it = mMapAtmLoadData.find(job); + TQMap<KIO::Job*, atmLoadData>::Iterator it = mMapAtmLoadData.tqfind(job); assert(it != mMapAtmLoadData.end()); KURL attachURL; - TQMap<KIO::Job*, KURL>::iterator jit = mAttachJobs.find(job); + TQMap<KIO::Job*, KURL>::iterator jit = mAttachJobs.tqfind(job); bool attachURLfound = (jit != mAttachJobs.end()); if (attachURLfound) { @@ -2886,7 +2886,7 @@ void KMComposeWin::slotAttachFileResult(KIO::Job *job) !kmkernel->msgSender()->sendQuotedPrintable()); kdDebug(5006) << "autodetected cte: " << msgPart->cteStr() << endl; } - int slash = mimeType.find( '/' ); + int slash = mimeType.tqfind( '/' ); if( slash == -1 ) slash = mimeType.length(); msgPart->setTypeStr( mimeType.left( slash ).latin1() ); @@ -2938,7 +2938,7 @@ void KMComposeWin::slotAttachFileResult(KIO::Job *job) //----------------------------------------------------------------------------- void KMComposeWin::slotInsertFile() { - KFileDialog fdlg(TQString::null, TQString::null, this, 0, true); + KFileDialog fdlg(TQString(), TQString(), this, 0, true); fdlg.setOperationMode( KFileDialog::Opening ); fdlg.okButton()->setText(i18n("&Insert")); fdlg.setCaption(i18n("Insert File")); @@ -3162,7 +3162,7 @@ void KMComposeWin::slotPublicKeyExportResult( const GpgME::Error & err, const TQ // add the new attachment to the list addAttach(msgPart); - rethinkFields(); //work around initial-size bug in Qt-1.32 + rethinkFields(); //work around initial-size bug in TQt-1.32 } //----------------------------------------------------------------------------- @@ -3309,7 +3309,7 @@ void KMComposeWin::compressAttach( int idx ) zip.close(); if ( array.size() >= decoded.size() ) { if ( KMessageBox::questionYesNo( this, i18n("The compressed file is larger " - "than the original. Do you want to keep the original one?" ), TQString::null, i18n("Keep"), i18n("Compress") ) + "than the original. Do you want to keep the original one?" ), TQString(), i18n("Keep"), i18n("Compress") ) == KMessageBox::Yes ) { static_cast<KMAtmListViewItem*>( mAtmItemList.at( i ) )->setCompress( false ); return; @@ -3583,7 +3583,7 @@ void KMComposeWin::slotAttachSave() pname = msgPart->name(); if (pname.isEmpty()) pname="unnamed"; - KURL url = KFileDialog::getSaveURL(pname, TQString::null, 0, i18n("Save Attachment As")); + KURL url = KFileDialog::getSaveURL(pname, TQString(), 0, i18n("Save Attachment As")); if( url.isEmpty() ) return; @@ -3649,7 +3649,7 @@ void KMComposeWin::slotUpdateFont() TQString KMComposeWin::quotePrefixName() const { if ( !msg() ) - return TQString::null; + return TQString(); int languageNr = GlobalSettings::self()->replyCurrentLanguage(); ReplyPhrases replyPhrases( TQString::number(languageNr) ); @@ -3673,9 +3673,9 @@ void KMComposeWin::slotPasteClipboardAsQuotation() void KMComposeWin::slotPasteClipboardAsAttachment() { - KURL url( TQApplication::clipboard()->text( QClipboard::Clipboard ) ); + KURL url( TQApplication::clipboard()->text( TQClipboard::Clipboard ) ); if ( url.isValid() ) { - addAttach(TQApplication::clipboard()->text( QClipboard::Clipboard ) ); + addAttach(TQApplication::clipboard()->text( TQClipboard::Clipboard ) ); return; } @@ -3685,7 +3685,7 @@ void KMComposeWin::slotPasteClipboardAsAttachment() } else { bool ok; - TQString attName = KInputDialog::getText( "KMail", i18n("Name of the attachment:"), TQString::null, &ok, this ); + TQString attName = KInputDialog::getText( "KMail", i18n("Name of the attachment:"), TQString(), &ok, this ); if ( !ok ) return; KMMessagePart *msgPart = new KMMessagePart; @@ -3824,10 +3824,10 @@ void KMComposeWin::slotCopy() //----------------------------------------------------------------------------- void KMComposeWin::slotPasteClipboard() { - paste( QClipboard::Clipboard ); + paste( TQClipboard::Clipboard ); } -void KMComposeWin::paste( QClipboard::Mode mode ) +void KMComposeWin::paste( TQClipboard::Mode mode ) { TQWidget* fw = tqfocusWidget(); if (!fw) return; @@ -4091,7 +4091,7 @@ void KMComposeWin::slotContinuePrint( bool rc ) } //---------------------------------------------------------------------------- -bool KMComposeWin::validateAddresses( TQWidget * parent, const TQString & addresses ) +bool KMComposeWin::validateAddresses( TQWidget * tqparent, const TQString & addresses ) { TQString brokenAddress; KPIM::EmailParseResult errorCode = KMMessage::isValidEmailAddressList( KMMessage::expandAliases( addresses ), brokenAddress ); @@ -4099,7 +4099,7 @@ bool KMComposeWin::validateAddresses( TQWidget * parent, const TQString & addres TQString errorMsg( "<qt><p><b>" + brokenAddress + "</b></p><p>" + KPIM::emailParseResultToString( errorCode ) + "</p></qt>" ); - KMessageBox::sorry( parent, errorMsg, i18n("Invalid Email Address") ); + KMessageBox::sorry( tqparent, errorMsg, i18n("Invalid Email Address") ); return false; } return true; @@ -4210,11 +4210,11 @@ void KMComposeWin::doSend( KMail::MessageSender::SendMethod method, connect( this, TQT_SIGNAL( applyChangesDone( bool ) ), TQT_SLOT( slotContinueDoSend( bool ) ) ); - if ( mEditor->textFormat() == Qt::RichText ) + if ( mEditor->textFormat() == TQt::RichText ) mMsg->setHeaderField( "X-KMail-Markup", "true" ); else mMsg->removeHeaderField( "X-KMail-Markup" ); - if ( mEditor->textFormat() == Qt::RichText && inlineSigningEncryptionSelected() ) { + if ( mEditor->textFormat() == TQt::RichText && inlineSigningEncryptionSelected() ) { TQString keepBtnText = mEncryptAction->isChecked() ? mSignAction->isChecked() ? i18n( "&Keep markup, do not sign/encrypt" ) : i18n( "&Keep markup, do not encrypt" ) @@ -4625,7 +4625,7 @@ void KMComposeWin::slotCleanSpace() // show cleared text area) to get back the original, pre-cleaned text. // If you use mEditor->setText( s ) then the undo history is cleared so // that isn't a good solution either. - // TODO: is Qt4 better at handling the undo history?? + // TODO: is TQt4 better at handling the undo history?? if ( !mEditor->hasMarkedText() ) mEditor->clear(); mEditor->insert( s ); @@ -4666,7 +4666,7 @@ void KMComposeWin::toggleMarkup(bool markup) textItalicAction->setChecked(_italic); mEditor->setSelection ( paraFrom, indexFrom, paraTo, indexTo); - mEditor->setTextFormat(Qt::RichText); + mEditor->setTextFormat(TQt::RichText); mEditor->setModified(true); markupAction->setChecked(true); toolBar( "htmlToolBar" )->show(); @@ -4680,7 +4680,7 @@ void KMComposeWin::toggleMarkup(bool markup) toolBar("htmlToolBar")->hide(); if ( mUseHTMLEditor ) { // it was turned on mUseHTMLEditor = false; - mEditor->setTextFormat(Qt::PlainText); + mEditor->setTextFormat(TQt::PlainText); TQString text = mEditor->text(); mEditor->setText(text); // otherwise the text still looks formatted mEditor->setModified(true); @@ -4780,10 +4780,10 @@ void KMComposeWin::slotSpellcheckDone(int result) statusBar()->changeItem(i18n(" Spell check complete."),0); break; } - TQTimer::singleShot( 2000, this, TQT_SLOT(slotSpellcheckDoneClearStatus()) ); + TQTimer::singleShot( 2000, this, TQT_SLOT(slotSpellcheckDoneCleartqStatus()) ); } -void KMComposeWin::slotSpellcheckDoneClearStatus() +void KMComposeWin::slotSpellcheckDoneCleartqStatus() { statusBar()->changeItem("", 0); } @@ -4820,7 +4820,7 @@ void KMComposeWin::slotIdentityChanged( uint uoid ) // don't overwrite the BCC field under certain circomstances // NOT edited and preset BCC from the identity if( mEdtBcc && !mEdtBcc->edited() && !ident.bcc().isEmpty() ) { - // BCC NOT empty AND tqcontains a diff adress then the preset BCC + // BCC NOT empty AND contains a diff adress then the preset BCC // of the new identity if( !mEdtBcc->text().isEmpty() && mEdtBcc->text() != ident.bcc() && !mEdtBcc->edited() ) { mEdtBcc->setText( ident.bcc() ); @@ -4931,7 +4931,7 @@ void KMComposeWin::slotIdentityChanged( uint uoid ) } mEditor->setText( edtText ); } else { - const int pos = edtText.find( mOldSigText ); + const int pos = edtText.tqfind( mOldSigText ); if ( pos >= 0 && !mOldSigText.isEmpty() ) { const int oldLength = mOldSigText.length(); mOldSigText = "\n\n"+ ident.signature().rawText() + "\n"; // see insertSignature() |