summaryrefslogtreecommitdiffstats
path: root/kmail/kmmsgpartdlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/kmmsgpartdlg.cpp')
-rw-r--r--kmail/kmmsgpartdlg.cpp148
1 files changed, 74 insertions, 74 deletions
diff --git a/kmail/kmmsgpartdlg.cpp b/kmail/kmmsgpartdlg.cpp
index 63407aeeb..921c9d55b 100644
--- a/kmail/kmmsgpartdlg.cpp
+++ b/kmail/kmmsgpartdlg.cpp
@@ -22,11 +22,11 @@
#include <kdebug.h>
// other Qt includes:
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qwhatsthis.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqwhatsthis.h>
#include <klineedit.h>
-#include <qcheckbox.h>
+#include <tqcheckbox.h>
// other includes:
#include <assert.h>
@@ -43,46 +43,46 @@ static const struct {
static const int numEncodingTypes =
sizeof encodingTypes / sizeof *encodingTypes;
-KMMsgPartDialog::KMMsgPartDialog( const QString & caption,
- QWidget * parent, const char * name )
+KMMsgPartDialog::KMMsgPartDialog( const TQString & caption,
+ TQWidget * parent, const char * name )
: KDialogBase( Plain,
caption.isEmpty() ? i18n("Message Part Properties") : caption,
Ok|Cancel|Help, Ok, parent, name, true, true)
{
// tmp vars:
- QGridLayout * glay;
- QLabel * label;
- QString msg;
+ TQGridLayout * glay;
+ TQLabel * label;
+ TQString msg;
- setHelp( QString::fromLatin1("attachments") );
+ setHelp( TQString::fromLatin1("attachments") );
for ( int i = 0 ; i < numEncodingTypes ; ++i )
mI18nizedEncodings << i18n( encodingTypes[i].displayName );
- glay = new QGridLayout( plainPage(), 9 /*rows*/, 2 /*cols*/, spacingHint() );
+ glay = new TQGridLayout( plainPage(), 9 /*rows*/, 2 /*cols*/, spacingHint() );
glay->setColStretch( 1, 1 );
glay->setRowStretch( 8, 1 );
// mimetype icon:
- mIcon = new QLabel( plainPage() );
+ mIcon = new TQLabel( plainPage() );
mIcon->setPixmap( DesktopIcon("unknown") );
glay->addMultiCellWidget( mIcon, 0, 1, 0, 0 );
// row 0: Type combobox:
mMimeType = new KComboBox( true, plainPage() );
- mMimeType->setInsertionPolicy( QComboBox::NoInsertion );
+ mMimeType->setInsertionPolicy( TQComboBox::NoInsertion );
mMimeType->setValidator( new KMimeTypeValidator( mMimeType ) );
- mMimeType->insertStringList( QStringList()
- << QString::fromLatin1("text/html")
- << QString::fromLatin1("text/plain")
- << QString::fromLatin1("image/gif")
- << QString::fromLatin1("image/jpeg")
- << QString::fromLatin1("image/png")
- << QString::fromLatin1("application/octet-stream")
- << QString::fromLatin1("application/x-gunzip")
- << QString::fromLatin1("application/zip") );
- connect( mMimeType, SIGNAL(textChanged(const QString&)),
- this, SLOT(slotMimeTypeChanged(const QString&)) );
+ mMimeType->insertStringList( TQStringList()
+ << TQString::fromLatin1("text/html")
+ << TQString::fromLatin1("text/plain")
+ << TQString::fromLatin1("image/gif")
+ << TQString::fromLatin1("image/jpeg")
+ << TQString::fromLatin1("image/png")
+ << TQString::fromLatin1("application/octet-stream")
+ << TQString::fromLatin1("application/x-gunzip")
+ << TQString::fromLatin1("application/zip") );
+ connect( mMimeType, TQT_SIGNAL(textChanged(const TQString&)),
+ this, TQT_SLOT(slotMimeTypeChanged(const TQString&)) );
glay->addWidget( mMimeType, 0, 1 );
msg = i18n("<qt><p>The <em>MIME type</em> of the file:</p>"
@@ -90,10 +90,10 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption,
"type of the file is automatically checked; but, sometimes, %1 "
"may not detect the type correctly -- here is where you can fix "
"that.</p></qt>").arg( kapp->aboutData()->programName() );
- QWhatsThis::add( mMimeType, msg );
+ TQWhatsThis::add( mMimeType, msg );
// row 1: Size label:
- mSize = new QLabel( plainPage() );
+ mSize = new TQLabel( plainPage() );
setSize( KIO::filesize_t(0) );
glay->addWidget( mSize, 1, 1 );
@@ -103,11 +103,11 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption,
"when this is the case, it will be made visible by adding "
"\"(est.)\" to the size displayed.</p></qt>")
.arg( kapp->aboutData()->programName() );
- QWhatsThis::add( mSize, msg );
+ TQWhatsThis::add( mSize, msg );
// row 2: "Name" lineedit and label:
mFileName = new KLineEdit( plainPage() );
- label = new QLabel( mFileName, i18n("&Name:"), plainPage() );
+ label = new TQLabel( mFileName, i18n("&Name:"), plainPage() );
glay->addWidget( label, 2, 0 );
glay->addWidget( mFileName, 2, 1 );
@@ -116,12 +116,12 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption,
"it does not specify the file to be attached; rather, it "
"suggests a file name to be used by the recipient's mail agent "
"when saving the part to disk.</p></qt>");
- QWhatsThis::add( label, msg );
- QWhatsThis::add( mFileName, msg );
+ TQWhatsThis::add( label, msg );
+ TQWhatsThis::add( mFileName, msg );
// row 3: "Description" lineedit and label:
mDescription = new KLineEdit( plainPage() );
- label = new QLabel( mDescription, i18n("&Description:"), plainPage() );
+ label = new TQLabel( mDescription, i18n("&Description:"), plainPage() );
glay->addWidget( label, 3, 0 );
glay->addWidget( mDescription, 3, 1 );
@@ -130,13 +130,13 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption,
"much like the Subject is for the whole message; most "
"mail agents will show this information in their message "
"previews alongside the attachment's icon.</p></qt>");
- QWhatsThis::add( label, msg );
- QWhatsThis::add( mDescription, msg );
+ TQWhatsThis::add( label, msg );
+ TQWhatsThis::add( mDescription, msg );
// row 4: "Encoding" combobox and label:
- mEncoding = new QComboBox( false, plainPage() );
+ mEncoding = new TQComboBox( false, plainPage() );
mEncoding->insertStringList( mI18nizedEncodings );
- label = new QLabel( mEncoding, i18n("&Encoding:"), plainPage() );
+ label = new TQLabel( mEncoding, i18n("&Encoding:"), plainPage() );
glay->addWidget( label, 4, 0 );
glay->addWidget( mEncoding, 4, 1 );
@@ -149,11 +149,11 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption,
"\"quoted-printable\" over the default \"base64\" will save up "
"to 25% in resulting message size.</p></qt>")
.arg( kapp->aboutData()->programName() );
- QWhatsThis::add( label, msg );
- QWhatsThis::add( mEncoding, msg );
+ TQWhatsThis::add( label, msg );
+ TQWhatsThis::add( mEncoding, msg );
// row 5: "Suggest automatic display..." checkbox:
- mInline = new QCheckBox( i18n("Suggest &automatic display"), plainPage() );
+ mInline = new TQCheckBox( i18n("Suggest &automatic display"), plainPage() );
glay->addMultiCellWidget( mInline, 5, 5, 0, 1 );
msg = i18n("<qt><p>Check this option if you want to suggest to the "
@@ -162,27 +162,27 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption,
"<p>technically, this is carried out by setting this part's "
"<em>Content-Disposition</em> header field to \"inline\" "
"instead of the default \"attachment\".</p></qt>");
- QWhatsThis::add( mInline, msg );
+ TQWhatsThis::add( mInline, msg );
// row 6: "Sign" checkbox:
- mSigned = new QCheckBox( i18n("&Sign this part"), plainPage() );
+ mSigned = new TQCheckBox( i18n("&Sign this part"), plainPage() );
glay->addMultiCellWidget( mSigned, 6, 6, 0, 1 );
msg = i18n("<qt><p>Check this option if you want this message part to be "
"signed;</p>"
"<p>the signature will be made with the key that you associated "
"with the currently-selected identity.</p></qt>");
- QWhatsThis::add( mSigned, msg );
+ TQWhatsThis::add( mSigned, msg );
// row 7: "Encrypt" checkbox:
- mEncrypted = new QCheckBox( i18n("Encr&ypt this part"), plainPage() );
+ mEncrypted = new TQCheckBox( i18n("Encr&ypt this part"), plainPage() );
glay->addMultiCellWidget( mEncrypted, 7, 7, 0, 1 );
msg = i18n("<qt><p>Check this option if you want this message part to be "
"encrypted;</p>"
"<p>the part will be encrypted for the recipients of this "
"message</p></qt>");
- QWhatsThis::add( mEncrypted, msg );
+ TQWhatsThis::add( mEncrypted, msg );
// (row 8: spacer)
}
@@ -190,13 +190,13 @@ KMMsgPartDialog::KMMsgPartDialog( const QString & caption,
KMMsgPartDialog::~KMMsgPartDialog() {}
-QString KMMsgPartDialog::mimeType() const {
+TQString KMMsgPartDialog::mimeType() const {
return mMimeType->currentText();
}
-void KMMsgPartDialog::setMimeType( const QString & mimeType ) {
+void KMMsgPartDialog::setMimeType( const TQString & mimeType ) {
int dummy = 0;
- QString tmp = mimeType; // get rid of const'ness
+ TQString tmp = mimeType; // get rid of const'ness
if ( mMimeType->validator() && mMimeType->validator()->validate( tmp, dummy ) )
for ( int i = 0 ; i < mMimeType->count() ; ++i )
if ( mMimeType->text( i ) == mimeType ) {
@@ -208,41 +208,41 @@ void KMMsgPartDialog::setMimeType( const QString & mimeType ) {
slotMimeTypeChanged( mimeType );
}
-void KMMsgPartDialog::setMimeType( const QString & type,
- const QString & subtype ) {
- setMimeType( QString::fromLatin1("%1/%2").arg(type).arg(subtype) );
+void KMMsgPartDialog::setMimeType( const TQString & type,
+ const TQString & subtype ) {
+ setMimeType( TQString::fromLatin1("%1/%2").arg(type).arg(subtype) );
}
-void KMMsgPartDialog::setMimeTypeList( const QStringList & mimeTypes ) {
+void KMMsgPartDialog::setMimeTypeList( const TQStringList & mimeTypes ) {
mMimeType->insertStringList( mimeTypes );
}
void KMMsgPartDialog::setSize( KIO::filesize_t size, bool estimated ) {
- QString text = KIO::convertSize( size );
+ TQString text = KIO::convertSize( size );
if ( estimated )
text = i18n("%1: a filesize incl. unit (e.g. \"1.3 KB\")",
"%1 (est.)").arg( text );
mSize->setText( text );
}
-QString KMMsgPartDialog::fileName() const {
+TQString KMMsgPartDialog::fileName() const {
return mFileName->text();
}
-void KMMsgPartDialog::setFileName( const QString & fileName ) {
+void KMMsgPartDialog::setFileName( const TQString & fileName ) {
mFileName->setText( fileName );
}
-QString KMMsgPartDialog::description() const {
+TQString KMMsgPartDialog::description() const {
return mDescription->text();
}
-void KMMsgPartDialog::setDescription( const QString & description ) {
+void KMMsgPartDialog::setDescription( const TQString & description ) {
mDescription->setText( description );
}
KMMsgPartDialog::Encoding KMMsgPartDialog::encoding() const {
- QString s = mEncoding->currentText();
+ TQString s = mEncoding->currentText();
for ( unsigned int i = 0 ; i < mI18nizedEncodings.count() ; ++i )
if ( s == *mI18nizedEncodings.at(i) )
return encodingTypes[i].encoding;
@@ -254,7 +254,7 @@ KMMsgPartDialog::Encoding KMMsgPartDialog::encoding() const {
void KMMsgPartDialog::setEncoding( Encoding encoding ) {
for ( int i = 0 ; i < numEncodingTypes ; ++i )
if ( encodingTypes[i].encoding == encoding ) {
- QString text = *mI18nizedEncodings.at(i);
+ TQString text = *mI18nizedEncodings.at(i);
for ( int j = 0 ; j < mEncoding->count() ; ++j )
if ( mEncoding->text(j) == text ) {
mEncoding->setCurrentItem( j );
@@ -306,7 +306,7 @@ void KMMsgPartDialog::setCanSign( bool enable ) {
mSigned->setEnabled( enable );
}
-void KMMsgPartDialog::slotMimeTypeChanged( const QString & mimeType ) {
+void KMMsgPartDialog::slotMimeTypeChanged( const TQString & mimeType ) {
// message subparts MUST have 7bit or 8bit encoding...
#if 0
// ...but until KMail can recode 8bit messages on attach, so that
@@ -320,9 +320,9 @@ void KMMsgPartDialog::slotMimeTypeChanged( const QString & mimeType ) {
#endif
// find a mimetype icon:
int dummy = 0;
- QString tmp = mimeType; // get rid of const'ness
+ TQString tmp = mimeType; // get rid of const'ness
if ( mMimeType->validator() && mMimeType->validator()->validate( tmp, dummy )
- == QValidator::Acceptable )
+ == TQValidator::Acceptable )
mIcon->setPixmap( KMimeType::mimeType( mimeType )->pixmap( KIcon::Desktop ) );
else
mIcon->setPixmap( DesktopIcon("unknown") );
@@ -331,8 +331,8 @@ void KMMsgPartDialog::slotMimeTypeChanged( const QString & mimeType ) {
-KMMsgPartDialogCompat::KMMsgPartDialogCompat( QWidget * parent, const char *, bool readOnly)
- : KMMsgPartDialog(QString::null, parent ), mMsgPart( 0 )
+KMMsgPartDialogCompat::KMMsgPartDialogCompat( TQWidget * parent, const char *, bool readOnly)
+ : KMMsgPartDialog(TQString::null, parent ), mMsgPart( 0 )
{
setShownEncodings( SevenBit|EightBit|QuotedPrintable|Base64 );
if (readOnly)
@@ -355,7 +355,7 @@ void KMMsgPartDialogCompat::setMsgPart( KMMessagePart * aMsgPart )
mMsgPart = aMsgPart;
assert( mMsgPart );
- QCString enc = mMsgPart->cteStr();
+ TQCString enc = mMsgPart->cteStr();
if ( enc == "7bit" )
setEncoding( SevenBit );
else if ( enc == "8bit" )
@@ -370,7 +370,7 @@ void KMMsgPartDialogCompat::setMsgPart( KMMessagePart * aMsgPart )
setMimeType( mMsgPart->typeStr(), mMsgPart->subtypeStr() );
setSize( mMsgPart->decodedSize() );
setInline( mMsgPart->contentDisposition()
- .find( QRegExp("^\\s*inline", false) ) >= 0 );
+ .find( TQRegExp("^\\s*inline", false) ) >= 0 );
}
@@ -381,22 +381,22 @@ void KMMsgPartDialogCompat::applyChanges()
KCursorSaver busy(KBusyPtr::busy());
// apply Content-Disposition:
- QCString cDisp;
+ TQCString cDisp;
if ( isInline() )
cDisp = "inline;";
else
cDisp = "attachment;";
- QString name = fileName();
+ TQString name = fileName();
if ( !name.isEmpty() || !mMsgPart->name().isEmpty()) {
mMsgPart->setName( name );
- QCString encoding = KMMsgBase::autoDetectCharset( mMsgPart->charset(),
+ TQCString encoding = KMMsgBase::autoDetectCharset( mMsgPart->charset(),
KMMessage::preferredCharsets(), name );
if ( encoding.isEmpty() ) encoding = "utf-8";
- QCString encName = KMMsgBase::encodeRFC2231String( name, encoding );
+ TQCString encName = KMMsgBase::encodeRFC2231String( name, encoding );
cDisp += "\n\tfilename";
- if ( name != QString( encName ) )
+ if ( name != TQString( encName ) )
cDisp += "*=" + encName;
else
cDisp += "=\"" + encName.replace( '\\', "\\\\" ).replace( '"', "\\\"" ) + '"';
@@ -404,13 +404,13 @@ void KMMsgPartDialogCompat::applyChanges()
}
// apply Content-Description"
- QString desc = description();
+ TQString desc = description();
if ( !desc.isEmpty() || !mMsgPart->contentDescription().isEmpty() )
mMsgPart->setContentDescription( desc );
// apply Content-Type:
- QCString type = mimeType().latin1();
- QCString subtype;
+ TQCString type = mimeType().latin1();
+ TQCString subtype;
int idx = type.find('/');
if ( idx < 0 )
subtype = "";
@@ -422,7 +422,7 @@ void KMMsgPartDialogCompat::applyChanges()
mMsgPart->setSubtypeStr(subtype);
// apply Content-Transfer-Encoding:
- QCString cte;
+ TQCString cte;
if (subtype == "rfc822" && type == "message")
kdWarning( encoding() != SevenBit && encoding() != EightBit, 5006 )
<< "encoding on rfc822/message must be \"7bit\" or \"8bit\"" << endl;
@@ -433,7 +433,7 @@ void KMMsgPartDialogCompat::applyChanges()
case Base64: default: cte = "base64"; break;
}
if ( cte != mMsgPart->cteStr().lower() ) {
- QByteArray body = mMsgPart->bodyDecodedBinary();
+ TQByteArray body = mMsgPart->bodyDecodedBinary();
mMsgPart->setCteStr( cte );
mMsgPart->setBodyEncodedBinary( body );
}