From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ktnef/gui/attachpropertydialog.cpp | 72 ++++++++--------- ktnef/gui/attachpropertydialog.h | 14 ++-- ktnef/gui/ktnefmain.cpp | 118 ++++++++++++++-------------- ktnef/gui/ktnefmain.h | 20 ++--- ktnef/gui/ktnefview.cpp | 42 +++++----- ktnef/gui/ktnefview.h | 14 ++-- ktnef/gui/messagepropertydialog.cpp | 2 +- ktnef/gui/messagepropertydialog.h | 2 +- ktnef/gui/qwmf.cpp | 150 ++++++++++++++++++------------------ ktnef/gui/qwmf.h | 46 +++++------ ktnef/ktnef/ktnefattach.h | 26 +++---- ktnef/ktnef/ktnefdefs.h | 2 +- ktnef/ktnef/ktnefmessage.h | 8 +- ktnef/ktnef/ktnefparser.h | 20 ++--- ktnef/ktnef/ktnefproperty.h | 20 ++--- ktnef/ktnef/ktnefpropertyset.h | 28 +++---- ktnef/ktnef/ktnefwriter.h | 36 ++++----- ktnef/lib/ktnefattach.cpp | 30 ++++---- ktnef/lib/ktnefmessage.cpp | 24 +++--- ktnef/lib/ktnefparser.cpp | 130 +++++++++++++++---------------- ktnef/lib/ktnefproperty.cpp | 30 ++++---- ktnef/lib/ktnefpropertyset.cpp | 54 ++++++------- ktnef/lib/ktnefwriter.cpp | 122 ++++++++++++++--------------- ktnef/lib/lzfu.cpp | 4 +- ktnef/lib/lzfu.h | 2 +- ktnef/lib/mapi.cpp | 22 +++--- ktnef/lib/mapi.h | 6 +- ktnef/tests/parsertest.cpp | 18 ++--- 28 files changed, 531 insertions(+), 531 deletions(-) (limited to 'ktnef') diff --git a/ktnef/gui/attachpropertydialog.cpp b/ktnef/gui/attachpropertydialog.cpp index 8675b6baa..35cd65848 100644 --- a/ktnef/gui/attachpropertydialog.cpp +++ b/ktnef/gui/attachpropertydialog.cpp @@ -22,18 +22,18 @@ #include #include "qwmf.h" -#include +#include #include #include #include #include #include #include -#include -#include -#include +#include +#include +#include -AttachPropertyDialog::AttachPropertyDialog(QWidget *parent, const char *name) +AttachPropertyDialog::AttachPropertyDialog(TQWidget *parent, const char *name) : AttachPropertyDialogBase(parent, name, true) { } @@ -53,7 +53,7 @@ void AttachPropertyDialog::setAttachment(KTNEFAttach *attach) s.append(" bytes"); size_->setText(s); KMimeType::Ptr mimetype = KMimeType::mimeType(attach->mimeTag()); - QPixmap pix = loadRenderingPixmap( attach, colorGroup().background() ); + TQPixmap pix = loadRenderingPixmap( attach, colorGroup().background() ); if ( !pix.isNull() ) icon_->setPixmap( pix ); else @@ -71,74 +71,74 @@ void AttachPropertyDialog::saveClicked() saveProperty( properties_, m_attach, this ); } -void formatProperties( const QMap& props, QListView *lv, QListViewItem *item, const QString& prefix ) +void formatProperties( const TQMap& props, TQListView *lv, TQListViewItem *item, const TQString& prefix ) { - for ( QMap::ConstIterator it=props.begin(); it!=props.end(); ++it ) + for ( TQMap::ConstIterator it=props.begin(); it!=props.end(); ++it ) { - QListViewItem *newItem = 0; + TQListViewItem *newItem = 0; if ( lv ) - newItem = new QListViewItem( lv, ( *it )->keyString() ); + newItem = new TQListViewItem( lv, ( *it )->keyString() ); else if ( item ) - newItem = new QListViewItem( item, ( *it )->keyString() ); + newItem = new TQListViewItem( item, ( *it )->keyString() ); else { kdWarning() << "formatProperties() called with no listview and no item" << endl; return; } - QVariant value = ( *it )->value(); - if ( value.type() == QVariant::List ) + TQVariant value = ( *it )->value(); + if ( value.type() == TQVariant::List ) { newItem->setOpen( true ); - newItem->setText( 0, newItem->text( 0 ) + " [" + QString::number( value.asList().count() ) + "]" ); + newItem->setText( 0, newItem->text( 0 ) + " [" + TQString::number( value.asList().count() ) + "]" ); int i = 0; - for ( QValueList::ConstIterator lit=value.listBegin(); lit!=value.listEnd(); ++lit, i++ ) - new QListViewItem( newItem, "[" + QString::number( i ) + "]", KTNEFProperty::formatValue( *lit ) ); + for ( TQValueList::ConstIterator lit=value.listBegin(); lit!=value.listEnd(); ++lit, i++ ) + new TQListViewItem( newItem, "[" + TQString::number( i ) + "]", KTNEFProperty::formatValue( *lit ) ); } - else if ( value.type() == QVariant::DateTime ) + else if ( value.type() == TQVariant::DateTime ) newItem->setText( 1, value.asDateTime().toString() ); else { newItem->setText( 1, ( *it )->valueString() ); - newItem->setText( 2, prefix + "_" + QString::number( it.key() ) ); + newItem->setText( 2, prefix + "_" + TQString::number( it.key() ) ); } } } -void formatPropertySet( KTNEFPropertySet *pSet, QListView *lv ) +void formatPropertySet( KTNEFPropertySet *pSet, TQListView *lv ) { formatProperties( pSet->properties(), lv, 0, "prop" ); - QListViewItem *item = new QListViewItem( lv, i18n( "TNEF Attributes" ) ); + TQListViewItem *item = new TQListViewItem( lv, i18n( "TNEF Attributes" ) ); item->setOpen( true ); formatProperties( pSet->attributes(), 0, item, "attr" ); } -void saveProperty( QListView *lv, KTNEFPropertySet *pSet, QWidget *parent ) +void saveProperty( TQListView *lv, KTNEFPropertySet *pSet, TQWidget *parent ) { - QListViewItem *item = lv->selectedItem(); + TQListViewItem *item = lv->selectedItem(); if ( !item ) KMessageBox::error( parent, i18n( "Select an item." ) ); else if ( item->text( 2 ).isEmpty() ) KMessageBox::error( parent, i18n( "The selected item cannot be saved." ) ); else { - QString tag = item->text( 2 ); + TQString tag = item->text( 2 ); int key = tag.mid( 5 ).toInt(); - QVariant prop = ( tag.startsWith( "attr_" ) ? pSet->attribute( key ) : pSet->property( key ) ); - QString filename = KFileDialog::getSaveFileName( tag, QString::null, parent ); + TQVariant prop = ( tag.startsWith( "attr_" ) ? pSet->attribute( key ) : pSet->property( key ) ); + TQString filename = KFileDialog::getSaveFileName( tag, TQString::null, parent ); if ( !filename.isEmpty() ) { - QFile f( filename ); + TQFile f( filename ); if ( f.open( IO_WriteOnly ) ) { switch ( prop.type() ) { - case QVariant::ByteArray: + case TQVariant::ByteArray: f.writeBlock( prop.asByteArray().data(), prop.asByteArray().size() ); break; default: { - QTextStream t( &f ); + TQTextStream t( &f ); t << prop.toString(); break; } @@ -151,17 +151,17 @@ void saveProperty( QListView *lv, KTNEFPropertySet *pSet, QWidget *parent ) } } -QPixmap loadRenderingPixmap( KTNEFPropertySet *pSet, const QColor& bgColor ) +TQPixmap loadRenderingPixmap( KTNEFPropertySet *pSet, const TQColor& bgColor ) { - QPixmap pix; - QVariant rendData = pSet->attribute( attATTACHRENDDATA ), wmf = pSet->attribute( attATTACHMETAFILE ); + TQPixmap pix; + TQVariant rendData = pSet->attribute( attATTACHRENDDATA ), wmf = pSet->attribute( attATTACHMETAFILE ); if ( !rendData.isNull() && !wmf.isNull() ) { // Get rendering size - QBuffer rendBuffer( rendData.asByteArray() ); + TQBuffer rendBuffer( rendData.asByteArray() ); rendBuffer.open( IO_ReadOnly ); - QDataStream rendStream( &rendBuffer ); - rendStream.setByteOrder( QDataStream::LittleEndian ); + TQDataStream rendStream( &rendBuffer ); + rendStream.setByteOrder( TQDataStream::LittleEndian ); Q_UINT16 type, w, h; rendStream >> type >> w >> w; // read type and skip 4 bytes rendStream >> w >> h; @@ -171,9 +171,9 @@ QPixmap loadRenderingPixmap( KTNEFPropertySet *pSet, const QColor& bgColor ) { // Load WMF data QWinMetaFile wmfLoader; - QBuffer wmfBuffer( wmf.asByteArray() ); + TQBuffer wmfBuffer( wmf.asByteArray() ); wmfBuffer.open( IO_ReadOnly ); - wmfLoader.setBbox( QRect( 0, 0, w, h ) ); + wmfLoader.setBbox( TQRect( 0, 0, w, h ) ); if ( wmfLoader.load( wmfBuffer ) ) { pix.resize( w, h ); diff --git a/ktnef/gui/attachpropertydialog.h b/ktnef/gui/attachpropertydialog.h index a731572eb..b7a78bbc1 100644 --- a/ktnef/gui/attachpropertydialog.h +++ b/ktnef/gui/attachpropertydialog.h @@ -19,8 +19,8 @@ #define ATTACHPROPERTYDLG_H #include "attachpropertydialogbase.h" -#include -#include +#include +#include class KTNEFAttach; class KTNEFProperty; @@ -31,7 +31,7 @@ class QListViewItem; class AttachPropertyDialog : public AttachPropertyDialogBase { public: - AttachPropertyDialog(QWidget *parent = 0, const char *name = 0); + AttachPropertyDialog(TQWidget *parent = 0, const char *name = 0); ~AttachPropertyDialog(); void setAttachment(KTNEFAttach *attach); @@ -43,9 +43,9 @@ private: KTNEFAttach *m_attach; }; -void formatProperties( const QMap&, QListView*, QListViewItem*, const QString& = "prop" ); -void formatPropertySet( KTNEFPropertySet*, QListView* ); -void saveProperty( QListView*, KTNEFPropertySet*, QWidget* ); -QPixmap loadRenderingPixmap( KTNEFPropertySet*, const QColor& ); +void formatProperties( const TQMap&, TQListView*, TQListViewItem*, const TQString& = "prop" ); +void formatPropertySet( KTNEFPropertySet*, TQListView* ); +void saveProperty( TQListView*, KTNEFPropertySet*, TQWidget* ); +TQPixmap loadRenderingPixmap( KTNEFPropertySet*, const TQColor& ); #endif diff --git a/ktnef/gui/ktnefmain.cpp b/ktnef/gui/ktnefmain.cpp index a31d40161..4c158a21d 100644 --- a/ktnef/gui/ktnefmain.cpp +++ b/ktnef/gui/ktnefmain.cpp @@ -25,16 +25,16 @@ #include "attachpropertydialog.h" #include "messagepropertydialog.h" -#include +#include #include #include #include #include -#include +#include #include -#include +#include #include -#include +#include #include #include #include @@ -55,9 +55,9 @@ #include -#define NOT_IMPLEMENTED QMessageBox::information(this, "ktnef", "Not implemented yet", QMessageBox::Ok|QMessageBox::Default, 0) +#define NOT_IMPLEMENTED TQMessageBox::information(this, "ktnef", "Not implemented yet", TQMessageBox::Ok|TQMessageBox::Default, 0) -KTNEFMain::KTNEFMain(QWidget *parent, const char *name) +KTNEFMain::KTNEFMain(TQWidget *parent, const char *name) : KMainWindow(parent, name) { setupActions(); @@ -85,19 +85,19 @@ KTNEFMain::~KTNEFMain() void KTNEFMain::setupActions() { // File menu - KStdAction::open(this, SLOT(openFile()), actionCollection()); - KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + KStdAction::open(this, TQT_SLOT(openFile()), actionCollection()); + KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection()); // Action menu - new KAction(i18n("View"), QString("viewmag"), 0, this, SLOT(viewFile()), actionCollection(), "view_file"); - new KAction(i18n("View With..."), QString("package_applications"), 0, this, SLOT(viewFileAs()), actionCollection(), "view_file_as"); - new KAction(i18n("Extract"), 0, this, SLOT(extractFile()), actionCollection(), "extract_file"); - new KAction(i18n("Extract To..."), QString("ktnef_extract_to"), 0, this, SLOT(extractFileTo()), actionCollection(), "extract_file_to"); - new KAction(i18n("Extract All To..."), QString("ktnef_extract_all_to"), 0, this, SLOT(extractAllFiles()), actionCollection(), "extract_all_files"); - new KAction( i18n( "Message Properties" ), "help", 0, this, SLOT( slotShowMessageProperties() ), actionCollection(), "msg_properties" ); - new KAction(i18n("Properties"), QString("contents"), 0, this, SLOT(propertiesFile()), actionCollection(), "properties_file"); - new KAction( i18n( "Show Message Text" ), "mail_generic", 0, this, SLOT( slotShowMessageText() ), actionCollection(), "msg_text" ); - new KAction( i18n( "Save Message Text As..." ), "filesave", 0, this, SLOT( slotSaveMessageText() ), actionCollection(), "msg_save" ); + new KAction(i18n("View"), TQString("viewmag"), 0, this, TQT_SLOT(viewFile()), actionCollection(), "view_file"); + new KAction(i18n("View With..."), TQString("package_applications"), 0, this, TQT_SLOT(viewFileAs()), actionCollection(), "view_file_as"); + new KAction(i18n("Extract"), 0, this, TQT_SLOT(extractFile()), actionCollection(), "extract_file"); + new KAction(i18n("Extract To..."), TQString("ktnef_extract_to"), 0, this, TQT_SLOT(extractFileTo()), actionCollection(), "extract_file_to"); + new KAction(i18n("Extract All To..."), TQString("ktnef_extract_all_to"), 0, this, TQT_SLOT(extractAllFiles()), actionCollection(), "extract_all_files"); + new KAction( i18n( "Message Properties" ), "help", 0, this, TQT_SLOT( slotShowMessageProperties() ), actionCollection(), "msg_properties" ); + new KAction(i18n("Properties"), TQString("contents"), 0, this, TQT_SLOT(propertiesFile()), actionCollection(), "properties_file"); + new KAction( i18n( "Show Message Text" ), "mail_generic", 0, this, TQT_SLOT( slotShowMessageText() ), actionCollection(), "msg_text" ); + new KAction( i18n( "Save Message Text As..." ), "filesave", 0, this, TQT_SLOT( slotSaveMessageText() ), actionCollection(), "msg_save" ); actionCollection()->action("view_file")->setEnabled(false); actionCollection()->action("view_file_as")->setEnabled(false); actionCollection()->action("extract_file")->setEnabled(false); @@ -106,12 +106,12 @@ void KTNEFMain::setupActions() actionCollection()->action("properties_file")->setEnabled(false); // Option menu - new KAction(i18n("Default Folder..."), QString("folder_open"), 0, this, SLOT(optionDefaultDir()), actionCollection(), "options_default_dir"); + new KAction(i18n("Default Folder..."), TQString("folder_open"), 0, this, TQT_SLOT(optionDefaultDir()), actionCollection(), "options_default_dir"); createStandardStatusBarAction(); setStandardToolBarMenuEnabled(true); - KStdAction::configureToolbars(this, SLOT(slotEditToolbars()), actionCollection()); - KStdAction::keyBindings( this, SLOT( slotConfigureKeys() ), actionCollection() ); + KStdAction::configureToolbars(this, TQT_SLOT(slotEditToolbars()), actionCollection()); + KStdAction::keyBindings( this, TQT_SLOT( slotConfigureKeys() ), actionCollection() ); createGUI(); } @@ -135,25 +135,25 @@ void KTNEFMain::setupTNEF() parser_ = new KTNEFParser; setCentralWidget(view_); - connect(view_, SIGNAL(selectionChanged()), SLOT(viewSelectionChanged())); - connect(view_, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)), SLOT(viewRightButtonPressed(QListViewItem*,const QPoint&,int))); - connect(view_, SIGNAL(doubleClicked(QListViewItem*)), SLOT(viewDoubleClicked(QListViewItem*))); - connect(view_, SIGNAL(dragRequested(const QValueList&)), SLOT(viewDragRequested(const QValueList&))); + connect(view_, TQT_SIGNAL(selectionChanged()), TQT_SLOT(viewSelectionChanged())); + connect(view_, TQT_SIGNAL(rightButtonPressed(TQListViewItem*,const TQPoint&,int)), TQT_SLOT(viewRightButtonPressed(TQListViewItem*,const TQPoint&,int))); + connect(view_, TQT_SIGNAL(doubleClicked(TQListViewItem*)), TQT_SLOT(viewDoubleClicked(TQListViewItem*))); + connect(view_, TQT_SIGNAL(dragRequested(const TQValueList&)), TQT_SLOT(viewDragRequested(const TQValueList&))); } -void KTNEFMain::loadFile(const QString& filename) +void KTNEFMain::loadFile(const TQString& filename) { filename_ = filename; setCaption(filename_); if (!parser_->openFile(filename)) { - QMessageBox::critical(this, i18n("Error"), i18n("Unable to open file."), QMessageBox::Ok|QMessageBox::Default, 0); + TQMessageBox::critical(this, i18n("Error"), i18n("Unable to open file."), TQMessageBox::Ok|TQMessageBox::Default, 0); view_->setAttachments(0); enableExtractAll(false); } else { - QPtrList list = parser_->message()->attachmentList(); + TQPtrList list = parser_->message()->attachmentList(); QString msg; msg = i18n( "%n attachment found", "%n attachments found", list.count() ); statusBar()->changeItem(msg, 0); @@ -187,7 +187,7 @@ void KTNEFMain::viewFile() KRun::runURL(url, mimename); } -QString KTNEFMain::extractTemp(KTNEFAttach *att) +TQString KTNEFMain::extractTemp(KTNEFAttach *att) { QString dir = KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp/"; parser_->extractFileTo(att->name(), dir); @@ -225,13 +225,13 @@ void KTNEFMain::extractAllFiles() { lastdir_ = dir; dir.append("/"); - QPtrList list = parser_->message()->attachmentList(); - QPtrListIterator it(list); + TQPtrList list = parser_->message()->attachmentList(); + TQPtrListIterator it(list); for (;it.current();++it) if (!parser_->extractFileTo(it.current()->name(), dir)) { QString msg = i18n( "Unable to extract file \"%1\"" ).arg( it.current()->name() ); - QMessageBox::critical(this,i18n("Error"),msg,QMessageBox::Ok|QMessageBox::Default,0); + TQMessageBox::critical(this,i18n("Error"),msg,TQMessageBox::Ok|TQMessageBox::Default,0); return; } } @@ -258,7 +258,7 @@ void KTNEFMain::optionDefaultDir() void KTNEFMain::viewSelectionChanged() { - QPtrList *list = view_->getSelection(); + TQPtrList *list = view_->getSelection(); bool on1 = (list->count() == 1u), on2 = (list->count() > 0u); actionCollection()->action("view_file")->setEnabled(on1); actionCollection()->action("view_file_as")->setEnabled(on1); @@ -286,51 +286,51 @@ void KTNEFMain::enableSingleAction(bool on) void KTNEFMain::cleanup() { QDir d(KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp/"); - const QFileInfoList *list = d.entryInfoList(QDir::Files|QDir::Hidden,QDir::Unsorted); + const QFileInfoList *list = d.entryInfoList(TQDir::Files|TQDir::Hidden,TQDir::Unsorted); QFileInfoListIterator it(*list); for (;it.current();++it) d.remove(it.current()->absFilePath()); } -void KTNEFMain::extractTo(const QString& dirname) +void KTNEFMain::extractTo(const TQString& dirname) { QString dir = dirname; if (dir.right(1) != "/") dir.append("/"); - QPtrList *list = view_->getSelection(); - QPtrListIterator it(*list); + TQPtrList *list = view_->getSelection(); + TQPtrListIterator it(*list); for (;it.current();++it) if (!parser_->extractFileTo(it.current()->name(), dir)) { QString msg = i18n("Unable to extract file \"%1\"").arg( it.current()->name() ); - QMessageBox::critical(this,i18n("Error"),msg,QMessageBox::Ok|QMessageBox::Default,0); + TQMessageBox::critical(this,i18n("Error"),msg,TQMessageBox::Ok|TQMessageBox::Default,0); return; } } /* This breaks the saveMainWindowSettings stuff.... - void KTNEFMain::closeEvent(QCloseEvent *e) + void KTNEFMain::closeEvent(TQCloseEvent *e) { e->accept(); }*/ -void KTNEFMain::viewRightButtonPressed(QListViewItem*, const QPoint& p, int) +void KTNEFMain::viewRightButtonPressed(TQListViewItem*, const TQPoint& p, int) { - QPtrList *list = view_->getSelection(); - QPopupMenu m; + TQPtrList *list = view_->getSelection(); + TQPopupMenu m; if (list->count() > 0u) { if (list->count() == 1u) { - m.insertItem(SmallIcon("viewmag"), i18n("View"), this, SLOT(viewFile())); - m.insertItem(SmallIcon("package_applications"), i18n("View With..."), this, SLOT(viewFileAs())); + m.insertItem(SmallIcon("viewmag"), i18n("View"), this, TQT_SLOT(viewFile())); + m.insertItem(SmallIcon("package_applications"), i18n("View With..."), this, TQT_SLOT(viewFileAs())); m.insertSeparator(); } - m.insertItem(i18n("Extract"), this, SLOT(extractFile())); - m.insertItem(SmallIcon("ktnef_extract_to"), i18n("Extract To..."), this, SLOT(extractFileTo())); + m.insertItem(i18n("Extract"), this, TQT_SLOT(extractFile())); + m.insertItem(SmallIcon("ktnef_extract_to"), i18n("Extract To..."), this, TQT_SLOT(extractFileTo())); if (list->count() == 1u) { m.insertSeparator(); - m.insertItem(SmallIcon("contents"), i18n("Properties"), this, SLOT(propertiesFile())); + m.insertItem(SmallIcon("contents"), i18n("Properties"), this, TQT_SLOT(propertiesFile())); } } else if ( list->count() == 0 ) @@ -338,16 +338,16 @@ void KTNEFMain::viewRightButtonPressed(QListViewItem*, const QPoint& p, int) m.exec( p ); } -void KTNEFMain::viewDoubleClicked(QListViewItem *item) +void KTNEFMain::viewDoubleClicked(TQListViewItem *item) { if (item && item->isSelected()) viewFile(); } -void KTNEFMain::viewDragRequested( const QValueList& list ) +void KTNEFMain::viewDragRequested( const TQValueList& list ) { KURL::List urlList; - for ( QValueList::ConstIterator it=list.constBegin(); it!=list.constEnd(); ++it ) + for ( TQValueList::ConstIterator it=list.constBegin(); it!=list.constEnd(); ++it ) urlList << KURL( extractTemp( *it ) ); if ( !list.isEmpty() ) { @@ -358,16 +358,16 @@ void KTNEFMain::viewDragRequested( const QValueList& list ) void KTNEFMain::slotEditToolbars() { - saveMainWindowSettings( KGlobal::config(), QString::fromLatin1("MainWindow") ); + saveMainWindowSettings( KGlobal::config(), TQString::fromLatin1("MainWindow") ); KEditToolbar dlg(actionCollection()); - connect(&dlg, SIGNAL( newToolbarConfig() ), this, SLOT( slotNewToolbarConfig() )); + connect(&dlg, TQT_SIGNAL( newToolbarConfig() ), this, TQT_SLOT( slotNewToolbarConfig() )); dlg.exec(); } void KTNEFMain::slotNewToolbarConfig() { createGUI(); - applyMainWindowSettings( KGlobal::config(), QString::fromLatin1("MainWindow") ); + applyMainWindowSettings( KGlobal::config(), TQString::fromLatin1("MainWindow") ); } void KTNEFMain::slotShowMessageProperties() @@ -378,7 +378,7 @@ void KTNEFMain::slotShowMessageProperties() void KTNEFMain::slotShowMessageText() { - QString rtf = parser_->message()->rtfString(); + TQString rtf = parser_->message()->rtfString(); qDebug( "%s", rtf.latin1() ); KTempFile tmpFile( KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp/", "rtf"); *( tmpFile.textStream() ) << rtf; @@ -389,20 +389,20 @@ void KTNEFMain::slotShowMessageText() void KTNEFMain::slotSaveMessageText() { - QString rtf = parser_->message()->rtfString(); - QString filename = KFileDialog::getSaveFileName( QString::null, QString::null, this ); + TQString rtf = parser_->message()->rtfString(); + TQString filename = KFileDialog::getSaveFileName( TQString::null, TQString::null, this ); if ( !filename.isEmpty() ) { - QFile f( filename ); + TQFile f( filename ); if ( f.open( IO_WriteOnly ) ) { - QTextStream t( &f ); + TQTextStream t( &f ); t << rtf; } else - QMessageBox::critical( this, i18n( "Error" ), + TQMessageBox::critical( this, i18n( "Error" ), i18n( "Unable to open file for writing, check file permissions." ), - QMessageBox::Ok|QMessageBox::Default, 0); + TQMessageBox::Ok|TQMessageBox::Default, 0); } } diff --git a/ktnef/gui/ktnefmain.h b/ktnef/gui/ktnefmain.h index 30f5a171f..5f15f3d95 100644 --- a/ktnef/gui/ktnefmain.h +++ b/ktnef/gui/ktnefmain.h @@ -19,8 +19,8 @@ #define KTNEFMAIN_H #include -#include -#include +#include +#include class KTNEFView; class KTNEFParser; @@ -31,10 +31,10 @@ class KTNEFMain : public KMainWindow Q_OBJECT public: - KTNEFMain(QWidget *parent = 0, const char *name = 0); + KTNEFMain(TQWidget *parent = 0, const char *name = 0); ~KTNEFMain(); - void loadFile(const QString& filename); + void loadFile(const TQString& filename); protected slots: void openFile(); @@ -52,12 +52,12 @@ protected slots: void slotSaveMessageText(); void viewSelectionChanged(); - void viewRightButtonPressed(QListViewItem *item, const QPoint& p, int c); - void viewDoubleClicked(QListViewItem*); - void viewDragRequested( const QValueList& list ); + void viewRightButtonPressed(TQListViewItem *item, const TQPoint& p, int c); + void viewDoubleClicked(TQListViewItem*); + void viewDragRequested( const TQValueList& list ); void slotConfigureKeys(); //protected: -// void closeEvent(QCloseEvent *e); +// void closeEvent(TQCloseEvent *e); private: void setupStatusbar(); @@ -67,8 +67,8 @@ private: void enableSingleAction(bool on = true); void cleanup(); - void extractTo(const QString& dirname); - QString extractTemp(KTNEFAttach *att); + void extractTo(const TQString& dirname); + TQString extractTemp(KTNEFAttach *att); private: KTNEFView *view_; diff --git a/ktnef/gui/ktnefview.cpp b/ktnef/gui/ktnefview.cpp index abee5a73b..a77098350 100644 --- a/ktnef/gui/ktnefview.cpp +++ b/ktnef/gui/ktnefview.cpp @@ -19,9 +19,9 @@ #include #include "attachpropertydialog.h" -#include -#include -#include +#include +#include +#include #include #include @@ -33,7 +33,7 @@ class Attachment : public QListViewItem { public: - Attachment(QListView *parent, KTNEFAttach *attach); + Attachment(TQListView *parent, KTNEFAttach *attach); ~Attachment(); KTNEFAttach* getAttachment() const { return attach_; } @@ -42,14 +42,14 @@ private: KTNEFAttach *attach_; }; -Attachment::Attachment(QListView *parent, KTNEFAttach *attach) - : QListViewItem(parent, attach->name()), attach_(attach) +Attachment::Attachment(TQListView *parent, KTNEFAttach *attach) + : TQListViewItem(parent, attach->name()), attach_(attach) { - setText(2, QString::number( attach_->size() )); + setText(2, TQString::number( attach_->size() )); if (!attach_->fileName().isEmpty()) setText(0, attach_->fileName()); KMimeType::Ptr mimeType = KMimeType::mimeType( attach_->mimeTag() ); setText(1, mimeType->comment()); - QPixmap pix = loadRenderingPixmap( attach, parent->colorGroup().base() ); + TQPixmap pix = loadRenderingPixmap( attach, parent->colorGroup().base() ); if ( !pix.isNull() ) setPixmap( 0, pix ); else @@ -63,44 +63,44 @@ Attachment::~Attachment() //------------------------------------------------------------------------------------------------------ -KTNEFView::KTNEFView(QWidget *parent, const char *name) +KTNEFView::KTNEFView(TQWidget *parent, const char *name) : KListView(parent,name) { attachments_.setAutoDelete(false); addColumn(i18n("File Name")); addColumn(i18n("File Type")); addColumn(i18n("Size")); - setFrameStyle(QFrame::WinPanel|QFrame::Sunken); + setFrameStyle(TQFrame::WinPanel|TQFrame::Sunken); setLineWidth(1); - setSelectionMode(QListView::Extended); - setHScrollBarMode(QScrollView::AlwaysOff); - setVScrollBarMode(QScrollView::AlwaysOn); - QTimer::singleShot( 0, this, SLOT(adjustColumnWidth()) ); + setSelectionMode(TQListView::Extended); + setHScrollBarMode(TQScrollView::AlwaysOff); + setVScrollBarMode(TQScrollView::AlwaysOn); + TQTimer::singleShot( 0, this, TQT_SLOT(adjustColumnWidth()) ); } KTNEFView::~KTNEFView() { } -void KTNEFView::setAttachments(QPtrList *list) +void KTNEFView::setAttachments(TQPtrList *list) { clear(); if (list) { - QPtrListIterator it(*list); + TQPtrListIterator it(*list); for (;it.current();++it) new Attachment(this, it.current()); } } -void KTNEFView::resizeEvent(QResizeEvent *e) +void KTNEFView::resizeEvent(TQResizeEvent *e) { adjustColumnWidth(); resizeContents(visibleWidth(),visibleHeight()); - if (e) QListView::resizeEvent(e); + if (e) TQListView::resizeEvent(e); } -QPtrList* KTNEFView::getSelection() +TQPtrList* KTNEFView::getSelection() { attachments_.clear(); QListViewItem *item = firstChild(); @@ -114,8 +114,8 @@ QPtrList* KTNEFView::getSelection() void KTNEFView::startDrag() { - QListViewItemIterator it( this, QListViewItemIterator::Selected ); - QValueList list; + TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); + TQValueList list; while ( it.current() ) { list << static_cast( it.current() )->getAttachment(); diff --git a/ktnef/gui/ktnefview.h b/ktnef/gui/ktnefview.h index 00c49b7c7..faa3262ae 100644 --- a/ktnef/gui/ktnefview.h +++ b/ktnef/gui/ktnefview.h @@ -19,7 +19,7 @@ #define KTNEFWIDGET_H #include -#include +#include #include class KTNEFAttach; @@ -29,24 +29,24 @@ class KDE_EXPORT KTNEFView : public KListView Q_OBJECT public: - KTNEFView(QWidget *parent = 0, const char *name = 0); + KTNEFView(TQWidget *parent = 0, const char *name = 0); ~KTNEFView(); - void setAttachments(QPtrList *list); - QPtrList* getSelection(); + void setAttachments(TQPtrList *list); + TQPtrList* getSelection(); signals: - void dragRequested( const QValueList& list ); + void dragRequested( const TQValueList& list ); protected: - void resizeEvent(QResizeEvent *e); + void resizeEvent(TQResizeEvent *e); void startDrag(); private slots: void adjustColumnWidth(); private: - QPtrList attachments_; + TQPtrList attachments_; }; #endif diff --git a/ktnef/gui/messagepropertydialog.cpp b/ktnef/gui/messagepropertydialog.cpp index 0e098c35c..a2b1f75f9 100644 --- a/ktnef/gui/messagepropertydialog.cpp +++ b/ktnef/gui/messagepropertydialog.cpp @@ -22,7 +22,7 @@ #include #include -MessagePropertyDialog::MessagePropertyDialog( QWidget *parent, KTNEFMessage *msg ) +MessagePropertyDialog::MessagePropertyDialog( TQWidget *parent, KTNEFMessage *msg ) : KDialogBase( parent, "MessagePropertyDialog", true, i18n( "Message Properties" ), KDialogBase::Close|KDialogBase::User1, KDialogBase::Close, false, KStdGuiItem::save() ) diff --git a/ktnef/gui/messagepropertydialog.h b/ktnef/gui/messagepropertydialog.h index 7b357b716..7d1ee7aa6 100644 --- a/ktnef/gui/messagepropertydialog.h +++ b/ktnef/gui/messagepropertydialog.h @@ -27,7 +27,7 @@ class MessagePropertyDialog : public KDialogBase { Q_OBJECT public: - MessagePropertyDialog( QWidget *parent, KTNEFMessage *msg ); + MessagePropertyDialog( TQWidget *parent, KTNEFMessage *msg ); protected slots: void slotUser1(); diff --git a/ktnef/gui/qwmf.cpp b/ktnef/gui/qwmf.cpp index 6a10cc006..41b908d1c 100644 --- a/ktnef/gui/qwmf.cpp +++ b/ktnef/gui/qwmf.cpp @@ -19,12 +19,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include bool qwmfDebug = false; @@ -50,59 +50,59 @@ public: class WinObjHandle { public: - virtual void apply( QPainter& p ) = 0; + virtual void apply( TQPainter& p ) = 0; }; class WinObjBrushHandle: public WinObjHandle { public: - virtual void apply( QPainter& p ); - QBrush brush; + virtual void apply( TQPainter& p ); + TQBrush brush; virtual ~WinObjBrushHandle() {}; }; class WinObjPenHandle: public WinObjHandle { public: - virtual void apply( QPainter& p ); - QPen pen; + virtual void apply( TQPainter& p ); + TQPen pen; virtual ~WinObjPenHandle() {}; }; class WinObjPatternBrushHandle: public WinObjHandle { public: - virtual void apply( QPainter& p ); - QBrush brush; - QPixmap image; + virtual void apply( TQPainter& p ); + TQBrush brush; + TQPixmap image; virtual ~WinObjPatternBrushHandle() {}; }; class WinObjFontHandle: public WinObjHandle { public: - virtual void apply( QPainter& p ); - QFont font; + virtual void apply( TQPainter& p ); + TQFont font; int rotation; virtual ~WinObjFontHandle() {}; }; -void WinObjBrushHandle::apply( QPainter& p ) +void WinObjBrushHandle::apply( TQPainter& p ) { p.setBrush( brush ); } -void WinObjPenHandle::apply( QPainter& p ) +void WinObjPenHandle::apply( TQPainter& p ) { p.setPen( pen ); } -void WinObjPatternBrushHandle::apply( QPainter& p ) +void WinObjPatternBrushHandle::apply( TQPainter& p ) { p.setBrush( brush ); } -void WinObjFontHandle::apply( QPainter& p ) +void WinObjFontHandle::apply( TQPainter& p ) { p.setFont( font ); } @@ -130,34 +130,34 @@ QWinMetaFile::~QWinMetaFile() //----------------------------------------------------------------------------- -bool QWinMetaFile::load( const QString &filename ) +bool QWinMetaFile::load( const TQString &filename ) { - QFile file( filename ); + TQFile file( filename ); if ( !file.exists() ) { - kdDebug() << "File " << QFile::encodeName(filename) << " does not exist" << endl; + kdDebug() << "File " << TQFile::encodeName(filename) << " does not exist" << endl; return false; } if ( !file.open( IO_ReadOnly ) ) { - kdDebug() << "Cannot open file " << QFile::encodeName(filename) << endl; + kdDebug() << "Cannot open file " << TQFile::encodeName(filename) << endl; return false; } - QByteArray ba = file.readAll(); + TQByteArray ba = file.readAll(); file.close(); - QBuffer buffer( ba ); + TQBuffer buffer( ba ); buffer.open( IO_ReadOnly ); return load( buffer ); } //----------------------------------------------------------------------------- -bool QWinMetaFile::load( QBuffer &buffer ) +bool QWinMetaFile::load( TQBuffer &buffer ) { - QDataStream st; + TQDataStream st; WmfEnhMetaHeader eheader; WmfMetaHeader header; WmfPlaceableHeader pheader; @@ -174,7 +174,7 @@ bool QWinMetaFile::load( QBuffer &buffer ) mFirstCmd = NULL; st.setDevice( &buffer ); - st.setByteOrder( QDataStream::LittleEndian ); // Great, I love Qt ! + st.setByteOrder( TQDataStream::LittleEndian ); // Great, I love Qt ! //----- Read placeable metafile header st >> pheader.key; @@ -329,7 +329,7 @@ bool QWinMetaFile::load( QBuffer &buffer ) //----------------------------------------------------------------------------- -bool QWinMetaFile::paint( const QPaintDevice* aTarget, bool absolute ) +bool QWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) { int idx, i; WmfCmd* cmd; @@ -365,7 +365,7 @@ bool QWinMetaFile::paint( const QPaintDevice* aTarget, bool absolute ) ( this->*metaFuncTab[ idx ].method )( cmd->numParm, cmd->parm ); if ( QWMF_DEBUG ) { - QString str = "", param; + TQString str = "", param; if ( metaFuncTab[ idx ].name == NULL ) { str += "UNKNOWN "; } @@ -384,8 +384,8 @@ bool QWinMetaFile::paint( const QPaintDevice* aTarget, bool absolute ) } } /* - // TODO: cleanup this code when QPicture::setBoundingBox() is possible in KOClipart (QT31) - // because actually QPicture::boundingBox() != mBBox() + // TODO: cleanup this code when TQPicture::setBoundingBox() is possible in KOClipart (QT31) + // because actually TQPicture::boundingBox() != mBBox() mWindowsCoord += 1; if ( mWindowsCoord == 2 ) { kdDebug() << "DRAW ANGLES " << endl; @@ -405,7 +405,7 @@ bool QWinMetaFile::paint( const QPaintDevice* aTarget, bool absolute ) void QWinMetaFile::setWindowOrg( long, short* parm ) { if ( mAbsoluteCoord ) { - QRect r = mPainter.window(); + TQRect r = mPainter.window(); mPainter.setWindow( parm[ 1 ], parm[ 0 ], r.width(), r.height() ); } else { @@ -425,12 +425,12 @@ void QWinMetaFile::setWindowExt( long, short* parm ) { // negative value allowed for width and height : QABS() forbidden if ( mAbsoluteCoord ) { - QRect r = mPainter.window(); + TQRect r = mPainter.window(); mPainter.setWindow( r.left(), r.top(), parm[ 1 ], parm[ 0 ] ); } else { if ( (parm[ 0 ] != 0) && (parm[ 1 ] != 0) ) { - QRect r = mPainter.window(); + TQRect r = mPainter.window(); double dx = mInternalWorldMatrix.dx(); double dy = mInternalWorldMatrix.dy(); double sx = mInternalWorldMatrix.m11(); @@ -479,7 +479,7 @@ void QWinMetaFile::ellipse( long, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::polygon( long, short* parm ) { - QPointArray* pa; + TQPointArray* pa; pa = pointArray( parm[ 0 ], &parm[ 1 ] ); mPainter.drawPolygon( *pa, mWinding ); @@ -489,24 +489,24 @@ void QWinMetaFile::polygon( long, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::polyPolygon( long, short* parm ) { - QRegion region; + TQRegion region; int i, j, startPolygon; mPainter.save(); // define clipping region - QRect win = bbox(); + TQRect win = bbox(); startPolygon = 1+parm[ 0 ]; for ( i=0 ; i < parm[ 0 ] ; i++ ) { - QPointArray pa1( parm[ 1+i ] ); + TQPointArray pa1( parm[ 1+i ] ); for ( j=0 ; j < parm[ 1+i ] ; j++) { pa1.setPoint ( j, parm[ startPolygon ], parm[ startPolygon+1 ] ); startPolygon += 2; } - QRegion r( pa1 ); + TQRegion r( pa1 ); region = region.eor( r ); } - mPainter.setClipRegion( region, QPainter::CoordPainter ); + mPainter.setClipRegion( region, TQPainter::CoordPainter ); // fill polygons mPainter.fillRect( win.left(), win.top(), win.width(), win.height(), mPainter.brush() ); @@ -516,7 +516,7 @@ void QWinMetaFile::polyPolygon( long, short* parm ) mPainter.setClipping( false ); mPainter.setBrush( Qt::NoBrush ); - QPointArray* pa; + TQPointArray* pa; int idxPolygon = 1 + parm[ 0 ]; for ( i=0 ; i < parm[ 0 ] ; i++ ) { pa = pointArray( parm[ 1+i ], &parm[ idxPolygon ] ); @@ -532,7 +532,7 @@ void QWinMetaFile::polyPolygon( long, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::polyline( long, short* parm ) { - QPointArray* pa; + TQPointArray* pa; pa = pointArray( parm[ 0 ], &parm[ 1 ] ); mPainter.drawPolyline( *pa ); @@ -628,7 +628,7 @@ void QWinMetaFile::setBkMode( long, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::setPixel( long, short* parm ) { - QPen pen = mPainter.pen(); + TQPen pen = mPainter.pen(); mPainter.setPen( color( parm ) ); mPainter.drawPoint( parm[ 3 ], parm[ 2 ] ); mPainter.setPen( pen ); @@ -661,16 +661,16 @@ void QWinMetaFile::restoreDC( long, short *parm ) void QWinMetaFile::intersectClipRect( long, short* parm ) { /* TODO: better implementation : need QT 3.0.2 - QRegion region = mPainter.clipRegion(); + TQRegion region = mPainter.clipRegion(); if ( region.isEmpty() ) region = bbox(); */ - QRegion region( bbox() ); + TQRegion region( bbox() ); - QRegion newRegion( parm[ 3 ], parm[ 2 ], parm[ 1 ] - parm[ 3 ], parm[ 0 ] - parm[ 2 ] ); + TQRegion newRegion( parm[ 3 ], parm[ 2 ], parm[ 1 ] - parm[ 3 ], parm[ 0 ] - parm[ 2 ] ); region = region.intersect( newRegion ); - mPainter.setClipRegion( region, QPainter::CoordPainter ); + mPainter.setClipRegion( region, TQPainter::CoordPainter ); } @@ -678,16 +678,16 @@ void QWinMetaFile::intersectClipRect( long, short* parm ) void QWinMetaFile::excludeClipRect( long, short* parm ) { /* TODO: better implementation : need QT 3.0.2 - QRegion region = mPainter.clipRegion(); + TQRegion region = mPainter.clipRegion(); if ( region.isEmpty() ) region = bbox(); */ - QRegion region( bbox() ); + TQRegion region( bbox() ); - QRegion newRegion( parm[ 3 ], parm[ 2 ], parm[ 1 ] - parm[ 3 ], parm[ 0 ] - parm[ 2 ] ); + TQRegion newRegion( parm[ 3 ], parm[ 2 ], parm[ 1 ] - parm[ 3 ], parm[ 0 ] - parm[ 2 ] ); region = region.subtract( newRegion ); - mPainter.setClipRegion( region, QPainter::CoordPainter ); + mPainter.setClipRegion( region, TQPainter::CoordPainter ); } @@ -738,16 +738,16 @@ void QWinMetaFile::extTextOut( long num, short* parm ) else ptStr = (char*)&parm[ 4 ]; - QCString text( ptStr, parm[ 2 ] + 1 ); + TQCString text( ptStr, parm[ 2 ] + 1 ); - QFontMetrics fm( mPainter.font() ); + TQFontMetrics fm( mPainter.font() ); width = fm.width( text ) + fm.descent(); // because fm.width(text) isn't rigth with Italic text height = fm.height(); mPainter.save(); if ( mTextAlign & 0x01 ) { // (left, top) position = current logical position - QPoint pos = mPainter.pos(); + TQPoint pos = mPainter.pos(); x = pos.x(); y = pos.y(); } @@ -795,7 +795,7 @@ void QWinMetaFile::extTextOut( long num, short* parm ) void QWinMetaFile::dibBitBlt( long num, short* parm ) { if ( num > 9 ) { // DIB image - QImage bmpSrc; + TQImage bmpSrc; if ( dibToBmp( bmpSrc, (char*)&parm[ 8 ], (num - 8) * 2 ) ) { long raster = toDWord( parm ); @@ -805,11 +805,11 @@ void QWinMetaFile::dibBitBlt( long num, short* parm ) // wmf file allow negative width or height mPainter.save(); if ( parm[ 5 ] < 0 ) { // width < 0 => horizontal flip - QWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); + TQWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); mPainter.setWorldMatrix( m, true ); } if ( parm[ 4 ] < 0 ) { // height < 0 => vertical flip - QWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); + TQWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); mPainter.setWorldMatrix( m, true ); } mPainter.drawImage( parm[ 7 ], parm[ 6 ], bmpSrc, parm[ 3 ], parm[ 2 ], parm[ 5 ], parm[ 4 ] ); @@ -825,7 +825,7 @@ void QWinMetaFile::dibBitBlt( long num, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::dibStretchBlt( long num, short* parm ) { - QImage bmpSrc; + TQImage bmpSrc; if ( dibToBmp( bmpSrc, (char*)&parm[ 10 ], (num - 10) * 2 ) ) { long raster = toDWord( parm ); @@ -835,15 +835,15 @@ void QWinMetaFile::dibStretchBlt( long num, short* parm ) // wmf file allow negative width or height mPainter.save(); if ( parm[ 7 ] < 0 ) { // width < 0 => horizontal flip - QWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); + TQWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); mPainter.setWorldMatrix( m, true ); } if ( parm[ 6 ] < 0 ) { // height < 0 => vertical flip - QWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); + TQWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); mPainter.setWorldMatrix( m, true ); } bmpSrc = bmpSrc.copy( parm[ 5 ], parm[ 4 ], parm[ 3 ], parm[ 2 ] ); - // TODO: scale the bitmap ( QImage::scale(parm[ 7 ], parm[ 6 ]) is actually too slow ) + // TODO: scale the bitmap ( TQImage::scale(parm[ 7 ], parm[ 6 ]) is actually too slow ) mPainter.drawImage( parm[ 9 ], parm[ 8 ], bmpSrc ); mPainter.restore(); @@ -854,7 +854,7 @@ void QWinMetaFile::dibStretchBlt( long num, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::stretchDib( long num, short* parm ) { - QImage bmpSrc; + TQImage bmpSrc; if ( dibToBmp( bmpSrc, (char*)&parm[ 11 ], (num - 11) * 2 ) ) { long raster = toDWord( parm ); @@ -864,15 +864,15 @@ void QWinMetaFile::stretchDib( long num, short* parm ) // wmf file allow negative width or height mPainter.save(); if ( parm[ 8 ] < 0 ) { // width < 0 => horizontal flip - QWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); + TQWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); mPainter.setWorldMatrix( m, true ); } if ( parm[ 7 ] < 0 ) { // height < 0 => vertical flip - QWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); + TQWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); mPainter.setWorldMatrix( m, true ); } bmpSrc = bmpSrc.copy( parm[ 6 ], parm[ 5 ], parm[ 4 ], parm[ 3 ] ); - // TODO: scale the bitmap ( QImage::scale(parm[ 8 ], parm[ 7 ]) is actually too slow ) + // TODO: scale the bitmap ( TQImage::scale(parm[ 8 ], parm[ 7 ]) is actually too slow ) mPainter.drawImage( parm[ 10 ], parm[ 9 ], bmpSrc ); mPainter.restore(); @@ -885,7 +885,7 @@ void QWinMetaFile::dibCreatePatternBrush( long num, short* parm ) { WinObjPatternBrushHandle* handle = new WinObjPatternBrushHandle; addHandle( handle ); - QImage bmpSrc; + TQImage bmpSrc; if ( dibToBmp( bmpSrc, (char*)&parm[ 2 ], (num - 2) * 2 ) ) { handle->image = bmpSrc; @@ -997,7 +997,7 @@ void QWinMetaFile::createPenIndirect( long, short* parm ) // TODO : width of pen proportional to device context width // DOESN'T WORK /* - QRect devRec; + TQRect devRec; devRec = mPainter.xForm( mBBox ); width = ( parm[ 0 ] * devRec.width() ) / mBBox.width() ; kdDebug() << "CreatePenIndirect: " << endl; @@ -1015,7 +1015,7 @@ void QWinMetaFile::createFontIndirect( long , short* parm) WinObjFontHandle* handle = new WinObjFontHandle; addHandle( handle ); - QString family( (const char*)&parm[ 9 ] ); + TQString family( (const char*)&parm[ 9 ] ); mRotation = -parm[ 2 ] / 10; // text rotation (in 1/10 degree) // TODO: memorisation of rotation in object Font @@ -1074,7 +1074,7 @@ int QWinMetaFile::findFunc( unsigned short aFunc ) const } //----------------------------------------------------------------------------- -QPointArray* QWinMetaFile::pointArray( short num, short* parm ) +TQPointArray* QWinMetaFile::pointArray( short num, short* parm ) { int i; @@ -1109,7 +1109,7 @@ unsigned int QWinMetaFile::toDWord( short* parm ) //----------------------------------------------------------------------------- -QColor QWinMetaFile::color( short* parm ) +TQColor QWinMetaFile::color( short* parm ) { unsigned int colorRef; int red, green, blue; @@ -1119,7 +1119,7 @@ QColor QWinMetaFile::color( short* parm ) green = ( colorRef>>8 ) & 255; blue = ( colorRef>>16 ) & 255; - return QColor( red, green, blue ); + return TQColor( red, green, blue ); } @@ -1222,7 +1222,7 @@ Qt::RasterOp QWinMetaFile::winToQtRaster( long parm ) const } //----------------------------------------------------------------------------- -bool QWinMetaFile::dibToBmp( QImage& bmp, const char* dib, long size ) +bool QWinMetaFile::dibToBmp( TQImage& bmp, const char* dib, long size ) { typedef struct _BMPFILEHEADER { WORD bmType; @@ -1234,7 +1234,7 @@ bool QWinMetaFile::dibToBmp( QImage& bmp, const char* dib, long size ) int sizeBmp = size + 14; - QByteArray pattern( sizeBmp ); // BMP header and DIB data + TQByteArray pattern( sizeBmp ); // BMP header and DIB data pattern.fill(0); memcpy( &pattern[ 14 ], dib, size ); diff --git a/ktnef/gui/qwmf.h b/ktnef/gui/qwmf.h index b655a3fd3..051979df3 100644 --- a/ktnef/gui/qwmf.h +++ b/ktnef/gui/qwmf.h @@ -19,14 +19,14 @@ #ifndef qwmf_h #define qwmf_h -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include class QBuffer; class QString; @@ -41,7 +41,7 @@ struct WmfPlaceableHeader; * How to use QWinMetaFile : * #include "qwmf.h" * QWinMetaFile wmf; - * QPicture pic; // or QImage pic; + * TQPicture pic; // or TQImage pic; * if ( wmf.load( filename ) *   wmf.paint( &pic ); */ @@ -56,8 +56,8 @@ public: /** * Load WMF file. Returns true on success. */ - virtual bool load( const QString &fileName ); - virtual bool load( QBuffer &buffer ); + virtual bool load( const TQString &fileName ); + virtual bool load( TQBuffer &buffer ); /** * Paint metafile to given paint-device using absolute or relative coordinate. @@ -65,7 +65,7 @@ public: * relative coord. use the existing world transfomation Matrix * Returns true on success. */ - virtual bool paint( const QPaintDevice* target, bool absolute=false ); + virtual bool paint( const TQPaintDevice* target, bool absolute=false ); /** * Returns true if the metafile is placeable. @@ -80,8 +80,8 @@ public: /** * Returns bounding rectangle */ - QRect bbox( void ) const { return mBBox; } - void setBbox( QRect r ) { mBBox = r; } + TQRect bbox( void ) const { return mBBox; } + void setBbox( TQRect r ) { mBBox = r; } public: // should be protected but cannot /** Metafile painter methods */ @@ -182,10 +182,10 @@ protected: virtual int findFunc( unsigned short aFunc ) const; /** Fills given parms into mPoints. */ - QPointArray* pointArray( short num, short* parms ); + TQPointArray* pointArray( short num, short* parms ); /** Returns color given by the two parameters */ - QColor color( short* parm ); + TQColor color( short* parm ); /** Converts two parameters to long */ unsigned int toDWord( short* parm ); @@ -202,26 +202,26 @@ protected: Qt::RasterOp winToQtRaster( long parm ) const; /** Converts DIB to BMP */ - bool dibToBmp( QImage& bmp, const char* dib, long size); + bool dibToBmp( TQImage& bmp, const char* dib, long size); protected: - QPainter mPainter; + TQPainter mPainter; bool mIsPlaceable, mIsEnhanced, mValid; // coordinate system bool mAbsoluteCoord; - QWMatrix mInternalWorldMatrix; // memorisation of WMF matrix transformation - QRect mHeaderBoundingBox; - QRect mBBox; + TQWMatrix mInternalWorldMatrix; // memorisation of WMF matrix transformation + TQRect mHeaderBoundingBox; + TQRect mBBox; // informtion shared between Metafile Functions - QColor mTextColor; + TQColor mTextColor; int mTextAlign, mRotation; bool mWinding; WmfCmd* mFirstCmd; WinObjHandle** mObjHandleTab; - QPointArray mPoints; + TQPointArray mPoints; int mDpi; }; diff --git a/ktnef/ktnef/ktnefattach.h b/ktnef/ktnef/ktnefattach.h index 846c4a6b8..f7f9f0862 100644 --- a/ktnef/ktnef/ktnefattach.h +++ b/ktnef/ktnef/ktnefattach.h @@ -18,9 +18,9 @@ #ifndef KTNEFATTACH_H #define KTNEFATTACH_H -#include -#include -#include +#include +#include +#include #include #include @@ -49,18 +49,18 @@ public: void setSize(int s); int displaySize() const; void setDisplaySize(int s); - QString name() const; - void setName(const QString& str); + TQString name() const; + void setName(const TQString& str); int index() const; void setIndex(int i); - QString fileName() const; - void setFileName(const QString& str); - QString displayName() const; - void setDisplayName(const QString& str); - QString mimeTag() const; - void setMimeTag(const QString& str); - QString extension() const; - void setExtension(const QString& str); + TQString fileName() const; + void setFileName(const TQString& str); + TQString displayName() const; + void setDisplayName(const TQString& str); + TQString mimeTag() const; + void setMimeTag(const TQString& str); + TQString extension() const; + void setExtension(const TQString& str); private: class AttachPrivate; diff --git a/ktnef/ktnef/ktnefdefs.h b/ktnef/ktnef/ktnefdefs.h index 6e9e96fd8..d2e57aa58 100644 --- a/ktnef/ktnef/ktnefdefs.h +++ b/ktnef/ktnef/ktnefdefs.h @@ -85,7 +85,7 @@ #define MAPI_TAG_DATA 0x3701 #define MAPI_TAG_ATTACHENCODING 0x3702 #define MAPI_TAG_EXTENSION 0x3703 -#define MAPI_TAG_ATTACHMETHOD 0x3705 +#define MAPI_TAG_ATTACHQT_METHOD 0x3705 #define MAPI_TAG_RENDERINGPOS 0x370b #define MAPI_TAG_MIMETAG 0x370e #define MAPI_TAG_ATTACHFLAGS 0x3714 diff --git a/ktnef/ktnef/ktnefmessage.h b/ktnef/ktnef/ktnefmessage.h index efdc236a8..059c64f6d 100644 --- a/ktnef/ktnef/ktnefmessage.h +++ b/ktnef/ktnef/ktnefmessage.h @@ -19,7 +19,7 @@ #define KTNEFMESSAGE_H #include -#include +#include #include class KTNEFAttach; @@ -30,11 +30,11 @@ public: KTNEFMessage(); ~KTNEFMessage(); - const QPtrList& attachmentList() const; - KTNEFAttach* attachment( const QString& filename ) const; + const TQPtrList& attachmentList() const; + KTNEFAttach* attachment( const TQString& filename ) const; void addAttachment( KTNEFAttach* attach ); void clearAttachments(); - QString rtfString(); + TQString rtfString(); private: class MessagePrivate; diff --git a/ktnef/ktnef/ktnefparser.h b/ktnef/ktnef/ktnefparser.h index 3696cd17c..ff48ab083 100644 --- a/ktnef/ktnef/ktnefparser.h +++ b/ktnef/ktnef/ktnefparser.h @@ -18,9 +18,9 @@ #ifndef KTNEFPARSER_H #define KTNEFPARSER_H -#include -#include -#include +#include +#include +#include #include class KTNEFAttach; @@ -33,21 +33,21 @@ public: KTNEFParser(); ~KTNEFParser(); - bool openFile(const QString& filename); - bool openDevice( QIODevice *device ); - bool extractFile(const QString& filename); - bool extractFileTo(const QString& filename, const QString& dirname); + bool openFile(const TQString& filename); + bool openDevice( TQIODevice *device ); + bool extractFile(const TQString& filename); + bool extractFileTo(const TQString& filename, const TQString& dirname); bool extractAll(); - void setDefaultExtractDir(const QString& dirname); + void setDefaultExtractDir(const TQString& dirname); KTNEFMessage* message() const; private: bool decodeAttachment(); bool decodeMessage(); - bool extractAttachmentTo(KTNEFAttach *att, const QString& dirname); + bool extractAttachmentTo(KTNEFAttach *att, const TQString& dirname); bool parseDevice(); void checkCurrent(int state); - bool readMAPIProperties(QMap& pros, KTNEFAttach *attach = 0); + bool readMAPIProperties(TQMap& pros, KTNEFAttach *attach = 0); void deleteDevice(); private: diff --git a/ktnef/ktnef/ktnefproperty.h b/ktnef/ktnef/ktnefproperty.h index b56b9f802..bf5ab8a2e 100644 --- a/ktnef/ktnef/ktnefproperty.h +++ b/ktnef/ktnef/ktnefproperty.h @@ -18,8 +18,8 @@ #ifndef KTNEFPROPERTY_H #define KTNEFPROPERTY_H -#include -#include +#include +#include #include class KDE_EXPORT KTNEFProperty @@ -40,24 +40,24 @@ public: }; KTNEFProperty(); - KTNEFProperty( int key_, int type_, const QVariant& value_, const QVariant& name_ = QVariant() ); + KTNEFProperty( int key_, int type_, const TQVariant& value_, const TQVariant& name_ = TQVariant() ); KTNEFProperty( const KTNEFProperty& p ); - QString keyString(); - QString valueString(); - static QString formatValue( const QVariant& v, bool beautify=true ); + TQString keyString(); + TQString valueString(); + static TQString formatValue( const TQVariant& v, bool beautify=true ); int key() const; int type() const; - QVariant value() const; - QVariant name() const; + TQVariant value() const; + TQVariant name() const; bool isVector() const; private: int _key; int _type; - QVariant _value; - QVariant _name; + TQVariant _value; + TQVariant _name; }; #endif /* KTNEFPROPERTY_H */ diff --git a/ktnef/ktnef/ktnefpropertyset.h b/ktnef/ktnef/ktnefpropertyset.h index 387acbd3a..841cf950b 100644 --- a/ktnef/ktnef/ktnefpropertyset.h +++ b/ktnef/ktnef/ktnefpropertyset.h @@ -18,8 +18,8 @@ #ifndef KTNEFPROPERTYSET_H #define KTNEFPROPERTYSET_H -#include -#include +#include +#include #include class KTNEFProperty; @@ -31,24 +31,24 @@ public: ~KTNEFPropertySet(); /* MAPI properties interface */ - void addProperty( int key, int type, const QVariant& value, const QVariant& name = QVariant(), bool overwrite = false ); - QString findProp( int key, const QString& fallback=QString::null, bool convertToUpper=false); - QString findNamedProp(const QString& name, const QString& fallback=QString::null, bool convertToUpper=false); - QMap& properties(); - const QMap& properties() const; - QVariant property( int key ) const; + void addProperty( int key, int type, const TQVariant& value, const TQVariant& name = TQVariant(), bool overwrite = false ); + TQString findProp( int key, const TQString& fallback=TQString::null, bool convertToUpper=false); + TQString findNamedProp(const TQString& name, const TQString& fallback=TQString::null, bool convertToUpper=false); + TQMap& properties(); + const TQMap& properties() const; + TQVariant property( int key ) const; /* TNEF attributes interface */ - void addAttribute( int key, int type, const QVariant& value, bool overwrite = false ); - QMap& attributes(); - const QMap& attributes() const; - QVariant attribute( int key ) const; + void addAttribute( int key, int type, const TQVariant& value, bool overwrite = false ); + TQMap& attributes(); + const TQMap& attributes() const; + TQVariant attribute( int key ) const; void clear( bool deleteAll = false ); private: - QMap properties_; /* used to store MAPI properties */ - QMap attributes_; /* used to store TNEF attributes */ + TQMap properties_; /* used to store MAPI properties */ + TQMap attributes_; /* used to store TNEF attributes */ }; #endif /* KTNEFPROPERTYSET_H */ diff --git a/ktnef/ktnef/ktnefwriter.h b/ktnef/ktnef/ktnefwriter.h index ab04c0b37..29828c1f9 100644 --- a/ktnef/ktnef/ktnefwriter.h +++ b/ktnef/ktnef/ktnefwriter.h @@ -30,12 +30,12 @@ public: KTNEFWriter(); ~KTNEFWriter(); - void addProperty( int tag, int type, const QVariant& value ); + void addProperty( int tag, int type, const TQVariant& value ); - bool writeFile( QIODevice &file ); - bool writeFile( QDataStream &stream ); + bool writeFile( TQIODevice &file ); + bool writeFile( TQDataStream &stream ); - bool writeProperty( QDataStream &stream, int &bytes, int type); + bool writeProperty( TQDataStream &stream, int &bytes, int type); enum MessageType { Appointment, MeetingCancelled, MeetingRequest, @@ -64,24 +64,24 @@ public: }; // This set of functions sets all properties on the file you want to save - void setSender(const QString &name, const QString &email); + void setSender(const TQString &name, const TQString &email); void setMessageType(MessageType m); void setMethod( Method m ); void clearAttendees(); - void addAttendee( const QString& cn, Role r, PartStat p, bool rsvp, - const QString& mailto ); - void setOrganizer( const QString& organizer ); // Is that the same as sender??? - void setDtStart( const QDateTime& dtStart ); - void setDtEnd( const QDateTime& dtEnd ); - void setLocation( const QString& location ); - void setUID( const QString& uid ); - void setDtStamp( const QDateTime& dtStamp ); - void setCategories( const QStringList& ); - void setDescription( const QString& ); - void setSummary( const QString& ); + void addAttendee( const TQString& cn, Role r, PartStat p, bool rsvp, + const TQString& mailto ); + void setOrganizer( const TQString& organizer ); // Is that the same as sender??? + void setDtStart( const TQDateTime& dtStart ); + void setDtEnd( const TQDateTime& dtEnd ); + void setLocation( const TQString& location ); + void setUID( const TQString& uid ); + void setDtStamp( const TQDateTime& dtStamp ); + void setCategories( const TQStringList& ); + void setDescription( const TQString& ); + void setSummary( const TQString& ); void setPriority( Priority p ); - void setAlarm( const QString& description, AlarmAction action, - const QDateTime& wakeBefore ); + void setAlarm( const TQString& description, AlarmAction action, + const TQDateTime& wakeBefore ); private: class PrivateData; diff --git a/ktnef/lib/ktnefattach.cpp b/ktnef/lib/ktnefattach.cpp index 76b1aeef0..b6dad60d6 100644 --- a/ktnef/lib/ktnefattach.cpp +++ b/ktnef/lib/ktnefattach.cpp @@ -25,12 +25,12 @@ public: int size_; int offset_; int displaysize_; - QString name_; + TQString name_; int index_; - QString filename_; - QString displayname_; - QString mimetag_; - QString extension_; + TQString filename_; + TQString displayname_; + TQString mimetag_; + TQString extension_; }; KTNEFAttach::KTNEFAttach() @@ -90,10 +90,10 @@ int KTNEFAttach::displaySize() const void KTNEFAttach::setDisplaySize(int s) { d->displaysize_ = s; } -QString KTNEFAttach::name() const +TQString KTNEFAttach::name() const { return d->name_; } -void KTNEFAttach::setName(const QString& str) +void KTNEFAttach::setName(const TQString& str) { setTitleParsed(); d->name_ = str; } int KTNEFAttach::index() const @@ -102,26 +102,26 @@ int KTNEFAttach::index() const void KTNEFAttach::setIndex(int i) { setInfoParsed(); d->index_ = i; } -QString KTNEFAttach::fileName() const +TQString KTNEFAttach::fileName() const { return d->filename_; } -void KTNEFAttach::setFileName(const QString& str) +void KTNEFAttach::setFileName(const TQString& str) { d->filename_ = str; } -QString KTNEFAttach::displayName() const +TQString KTNEFAttach::displayName() const { return d->displayname_; } -void KTNEFAttach::setDisplayName(const QString& str) +void KTNEFAttach::setDisplayName(const TQString& str) { d->displayname_ = str; } -QString KTNEFAttach::mimeTag() const +TQString KTNEFAttach::mimeTag() const { return d->mimetag_; } -void KTNEFAttach::setMimeTag(const QString& str) +void KTNEFAttach::setMimeTag(const TQString& str) { d->mimetag_ = str; } -QString KTNEFAttach::extension() const +TQString KTNEFAttach::extension() const { return d->extension_; } -void KTNEFAttach::setExtension(const QString& str) +void KTNEFAttach::setExtension(const TQString& str) { d->extension_ = str; } diff --git a/ktnef/lib/ktnefmessage.cpp b/ktnef/lib/ktnefmessage.cpp index d94efb6c4..8f2648c3a 100644 --- a/ktnef/lib/ktnefmessage.cpp +++ b/ktnef/lib/ktnefmessage.cpp @@ -19,7 +19,7 @@ #include "ktnef/ktnefattach.h" #include "lzfu.h" -#include +#include class KTNEFMessage::MessagePrivate { @@ -29,7 +29,7 @@ public: attachments_.setAutoDelete( true ); } - QPtrList attachments_; + TQPtrList attachments_; }; KTNEFMessage::KTNEFMessage() @@ -42,14 +42,14 @@ KTNEFMessage::~KTNEFMessage() delete d; } -const QPtrList& KTNEFMessage::attachmentList() const +const TQPtrList& KTNEFMessage::attachmentList() const { return d->attachments_; } -KTNEFAttach* KTNEFMessage::attachment( const QString& filename ) const +KTNEFAttach* KTNEFMessage::attachment( const TQString& filename ) const { - QPtrListIterator it( d->attachments_ ); + TQPtrListIterator it( d->attachments_ ); for ( ; it.current(); ++it ) if ( it.current()->name() == filename ) return it.current(); @@ -66,17 +66,17 @@ void KTNEFMessage::clearAttachments() d->attachments_.clear(); } -QString KTNEFMessage::rtfString() +TQString KTNEFMessage::rtfString() { - QVariant prop = property( 0x1009 ); - if ( prop.isNull() || prop.type() != QVariant::ByteArray) - return QString::null; + TQVariant prop = property( 0x1009 ); + if ( prop.isNull() || prop.type() != TQVariant::ByteArray) + return TQString::null; else { - QByteArray rtf; - QBuffer input( prop.asByteArray() ), output( rtf ); + TQByteArray rtf; + TQBuffer input( prop.asByteArray() ), output( rtf ); if ( input.open( IO_ReadOnly ) && output.open( IO_WriteOnly ) ) lzfu_decompress( &input, &output ); - return QString( rtf ); + return TQString( rtf ); } } diff --git a/ktnef/lib/ktnefparser.cpp b/ktnef/lib/ktnefparser.cpp index 0c9881400..e97ec8128 100644 --- a/ktnef/lib/ktnefparser.cpp +++ b/ktnef/lib/ktnefparser.cpp @@ -24,10 +24,10 @@ #include "ktnef/ktnefproperty.h" #include "ktnef/ktnefmessage.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -42,23 +42,23 @@ typedef struct { Q_UINT16 type; Q_UINT16 tag; - QVariant value; + TQVariant value; struct { Q_UINT32 type; - QVariant value; + TQVariant value; } name; } MAPI_value; void clearMAPIName( MAPI_value& mapi ); void clearMAPIValue(MAPI_value& mapi, bool clearName = true); -QString readMAPIString( QDataStream& stream, bool isUnicode = false, bool align = true, int len = -1 ); -Q_UINT16 readMAPIValue(QDataStream& stream, MAPI_value& mapi); -QDateTime readTNEFDate( QDataStream& stream ); -QString readTNEFAddress( QDataStream& stream ); -QByteArray readTNEFData( QDataStream& stream, Q_UINT32 len ); -QVariant readTNEFAttribute( QDataStream& stream, Q_UINT16 type, Q_UINT32 len ); -QDateTime formatTime( Q_UINT32 lowB, Q_UINT32 highB ); -QString formatRecipient( const QMap& props ); +TQString readMAPIString( TQDataStream& stream, bool isUnicode = false, bool align = true, int len = -1 ); +Q_UINT16 readMAPIValue(TQDataStream& stream, MAPI_value& mapi); +TQDateTime readTNEFDate( TQDataStream& stream ); +TQString readTNEFAddress( TQDataStream& stream ); +TQByteArray readTNEFData( TQDataStream& stream, Q_UINT32 len ); +TQVariant readTNEFAttribute( TQDataStream& stream, Q_UINT16 type, Q_UINT32 len ); +TQDateTime formatTime( Q_UINT32 lowB, Q_UINT32 highB ); +TQString formatRecipient( const TQMap& props ); //------------------------------------------------------------------------------------ @@ -78,10 +78,10 @@ public: delete message_; } - QDataStream stream_; - QIODevice *device_; + TQDataStream stream_; + TQIODevice *device_; bool deleteDevice_; - QString defaultdir_; + TQString defaultdir_; KTNEFAttach *current_; KTNEFMessage *message_; }; @@ -114,7 +114,7 @@ bool KTNEFParser::decodeMessage() { Q_UINT32 i1, i2, off; Q_UINT16 u, tag, type; - QVariant value; + TQVariant value; // read (type+name) d->stream_ >> i1; @@ -162,7 +162,7 @@ bool KTNEFParser::decodeMessage() readMAPIProperties( d->message_->properties(), 0 ); d->device_->at( i2 ); kdDebug() << "Properties: " << d->message_->properties().count() << endl; - value = QString( "< %1 properties >" ).arg( d->message_->properties().count() - nProps ); + value = TQString( "< %1 properties >" ).arg( d->message_->properties().count() - nProps ); } break; case attTNEFVERSION: @@ -203,11 +203,11 @@ bool KTNEFParser::decodeMessage() case attRECIPTABLE: { Q_UINT32 rows; - QValueList recipTable; + TQValueList recipTable; d->stream_ >> rows; for ( uint i=0; i props; + TQMap props; readMAPIProperties( props, 0 ); recipTable << formatRecipient( props ); } @@ -256,8 +256,8 @@ bool KTNEFParser::decodeAttachment() { Q_UINT32 i; Q_UINT16 tag, type, u; - QVariant value; - QString str; + TQVariant value; + TQString str; d->stream_ >> i; // i <- attribute type & name tag = ( i & 0x0000FFFF ); @@ -275,7 +275,7 @@ bool KTNEFParser::decodeAttachment() d->current_->setSize( i ); d->current_->setOffset( d->device_->at() ); d->device_->at( d->device_->at() + i ); - value = QString( "< size=%1 >" ).arg( i ); + value = TQString( "< size=%1 >" ).arg( i ); kdDebug() << "Attachment Data: size=" << i << endl; break; case attATTACHMENT: // try to get attachment info @@ -292,7 +292,7 @@ bool KTNEFParser::decodeAttachment() if ( !str.isEmpty() ) d->current_->setMimeTag( str ); d->current_->setExtension( d->current_->property( MAPI_TAG_EXTENSION ).toString() ); - value = QString( "< %1 properties >" ).arg( d->current_->properties().count() ); + value = TQString( "< %1 properties >" ).arg( d->current_->properties().count() ); break; case attATTACHMODDATE: value = readTNEFDate( d->stream_ ); @@ -304,7 +304,7 @@ bool KTNEFParser::decodeAttachment() break; case attATTACHMETAFILE: kdDebug() << "Attachment Metafile: size=" << i << endl; - //value = QString( "< size=%1 >" ).arg( i ); + //value = TQString( "< size=%1 >" ).arg( i ); //d->device_->at( d->device_->at()+i ); value = readTNEFData( d->stream_, i ); break; @@ -321,7 +321,7 @@ bool KTNEFParser::decodeAttachment() return true; } -void KTNEFParser::setDefaultExtractDir(const QString& dirname) +void KTNEFParser::setDefaultExtractDir(const TQString& dirname) { d->defaultdir_ = dirname; } @@ -345,7 +345,7 @@ bool KTNEFParser::parseDevice() } d->stream_.setDevice( d->device_ ); - d->stream_.setByteOrder( QDataStream::LittleEndian ); + d->stream_.setByteOrder( TQDataStream::LittleEndian ); d->stream_ >> i; if (i == TNEF_SIGNATURE) { @@ -386,14 +386,14 @@ end: d->device_->close(); } } -bool KTNEFParser::extractFile(const QString& filename) +bool KTNEFParser::extractFile(const TQString& filename) { KTNEFAttach *att = d->message_->attachment(filename); if (!att) return false; return extractAttachmentTo(att, d->defaultdir_); } -bool KTNEFParser::extractAttachmentTo(KTNEFAttach *att, const QString& dirname) +bool KTNEFParser::extractAttachmentTo(KTNEFAttach *att, const TQString& dirname) { QString filename = dirname + "/" + att->name(); if (!d->device_->isOpen()) @@ -401,7 +401,7 @@ bool KTNEFParser::extractAttachmentTo(KTNEFAttach *att, const QString& dirname) if (!d->device_->at(att->offset())) return false; KSaveFile saveFile( filename ); - QFile *outfile = saveFile.file(); + TQFile *outfile = saveFile.file(); if ( !outfile ) return false; @@ -428,13 +428,13 @@ bool KTNEFParser::extractAttachmentTo(KTNEFAttach *att, const QString& dirname) bool KTNEFParser::extractAll() { - QPtrListIterator it(d->message_->attachmentList()); + TQPtrListIterator it(d->message_->attachmentList()); for (;it.current();++it) if (!extractAttachmentTo(it.current(),d->defaultdir_)) return false; return true; } -bool KTNEFParser::extractFileTo(const QString& filename, const QString& dirname) +bool KTNEFParser::extractFileTo(const TQString& filename, const TQString& dirname) { kdDebug() << "Extracting attachment: filename=" << filename << ", dir=" << dirname << endl; KTNEFAttach *att = d->message_->attachment(filename); @@ -442,17 +442,17 @@ bool KTNEFParser::extractFileTo(const QString& filename, const QString& dirname) return extractAttachmentTo(att, dirname); } -bool KTNEFParser::openFile(const QString& filename) +bool KTNEFParser::openFile(const TQString& filename) { deleteDevice(); delete d->message_; d->message_ = new KTNEFMessage(); - d->device_ = new QFile( filename ); + d->device_ = new TQFile( filename ); d->deleteDevice_ = true; return parseDevice(); } -bool KTNEFParser::openDevice( QIODevice *device ) +bool KTNEFParser::openDevice( TQIODevice *device ) { deleteDevice(); d->device_ = device; @@ -483,7 +483,7 @@ void KTNEFParser::checkCurrent( int key ) if ( mimetype->name() == "application/octet-stream" && d->current_->size() > 0 ) { int oldOffset = d->device_->at(); - QByteArray buffer( QMIN( 32, d->current_->size() ) ); + TQByteArray buffer( QMIN( 32, d->current_->size() ) ); d->device_->at( d->current_->offset() ); d->device_->readBlock( buffer.data(), buffer.size() ); mimetype = KMimeType::findByContent( buffer ); @@ -521,9 +521,9 @@ void clearMAPIValue(MAPI_value& mapi, bool clearName) clearMAPIName( mapi ); } -QDateTime formatTime( Q_UINT32 lowB, Q_UINT32 highB ) +TQDateTime formatTime( Q_UINT32 lowB, Q_UINT32 highB ) { - QDateTime dt; + TQDateTime dt; #if ( SIZEOF_UINT64_T == 8 ) uint64_t u64; #elif ( SIZEOF_UNSIGNED_LONG_LONG == 8 ) @@ -550,10 +550,10 @@ QDateTime formatTime( Q_UINT32 lowB, Q_UINT32 highB ) return dt; } -QString formatRecipient( const QMap& props ) +TQString formatRecipient( const TQMap& props ) { - QString s, dn, addr, t; - QMap::ConstIterator it; + TQString s, dn, addr, t; + TQMap::ConstIterator it; if ( ( it = props.find( 0x3001 ) ) != props.end() ) dn = ( *it )->valueString(); if ( ( it = props.find( 0x3003 ) ) != props.end() ) @@ -577,18 +577,18 @@ QString formatRecipient( const QMap& props ) return s.stripWhiteSpace(); } -QDateTime readTNEFDate( QDataStream& stream ) +TQDateTime readTNEFDate( TQDataStream& stream ) { // 14-bytes long Q_UINT16 y, m, d, hh, mm, ss, dm; stream >> y >> m >> d >> hh >> mm >> ss >> dm; - return QDateTime( QDate( y, m, d ), QTime( hh, mm, ss ) ); + return TQDateTime( TQDate( y, m, d ), TQTime( hh, mm, ss ) ); } -QString readTNEFAddress( QDataStream& stream ) +TQString readTNEFAddress( TQDataStream& stream ) { Q_UINT16 totalLen, strLen, addrLen; - QString s; + TQString s; stream >> totalLen >> totalLen >> strLen >> addrLen; s.append( readMAPIString( stream, false, false, strLen ) ); s.append( " <" ); @@ -600,15 +600,15 @@ QString readTNEFAddress( QDataStream& stream ) return s; } -QByteArray readTNEFData( QDataStream& stream, Q_UINT32 len ) +TQByteArray readTNEFData( TQDataStream& stream, Q_UINT32 len ) { - QByteArray array( len ); + TQByteArray array( len ); if ( len > 0 ) stream.readRawBytes( array.data(), len ); return array; } -QVariant readTNEFAttribute( QDataStream& stream, Q_UINT16 type, Q_UINT32 len ) +TQVariant readTNEFAttribute( TQDataStream& stream, Q_UINT16 type, Q_UINT32 len ) { switch ( type ) { @@ -622,7 +622,7 @@ QVariant readTNEFAttribute( QDataStream& stream, Q_UINT16 type, Q_UINT32 len ) } } -QString readMAPIString( QDataStream& stream, bool isUnicode, bool align, int len_ ) +TQString readMAPIString( TQDataStream& stream, bool isUnicode, bool align, int len_ ) { Q_UINT32 len; char *buf = 0; @@ -638,16 +638,16 @@ QString readMAPIString( QDataStream& stream, bool isUnicode, bool align, int len Q_UINT8 c; for ( uint i=len; i> c; - QString res; + TQString res; if ( isUnicode ) - res = QString::fromUcs2( ( const unsigned short* )buf ); + res = TQString::fromUcs2( ( const unsigned short* )buf ); else - res = QString::fromLocal8Bit( buf ); + res = TQString::fromLocal8Bit( buf ); delete [] buf; return res; } -Q_UINT16 readMAPIValue(QDataStream& stream, MAPI_value& mapi) +Q_UINT16 readMAPIValue(TQDataStream& stream, MAPI_value& mapi) { Q_UINT32 d; @@ -669,11 +669,11 @@ Q_UINT16 readMAPIValue(QDataStream& stream, MAPI_value& mapi) } int n = 1; - QVariant value; + TQVariant value; if ( ISVECTOR( mapi ) ) { stream >> n; - mapi.value = QValueList(); + mapi.value = TQValueList(); } for ( int i=0; i> len; - value = QByteArray( len ); + value = TQByteArray( len ); if (len > 0) { int fullLen = len; @@ -752,12 +752,12 @@ Q_UINT16 readMAPIValue(QDataStream& stream, MAPI_value& mapi) return mapi.tag; } -bool KTNEFParser::readMAPIProperties( QMap& props, KTNEFAttach *attach ) +bool KTNEFParser::readMAPIProperties( TQMap& props, KTNEFAttach *attach ) { Q_UINT32 n; MAPI_value mapi; KTNEFProperty *p; - QMap::ConstIterator it; + TQMap::ConstIterator it; bool foundAttachment = false; // some initializations @@ -788,7 +788,7 @@ bool KTNEFParser::readMAPIProperties( QMap& props, KTNEFAtta { if ( mapi.type == MAPI_TYPE_OBJECT && attach ) { - QByteArray data = mapi.value.toByteArray(); + TQByteArray data = mapi.value.toByteArray(); int len = data.size(); ALIGN( len, 4 ); d->device_->at( d->device_->at()-len ); @@ -814,20 +814,20 @@ bool KTNEFParser::readMAPIProperties( QMap& props, KTNEFAtta ALIGN( len, 4 ) attach->setSize( len ); attach->setOffset( d->device_->at() - len ); - attach->addAttribute( attATTACHDATA, atpBYTE, QString( "< size=%1 >" ).arg( len ), false ); + attach->addAttribute( attATTACHDATA, atpBYTE, TQString( "< size=%1 >" ).arg( len ), false ); } } kdDebug().form( "MAPI data: size=%d\n", mapi.value.toByteArray().size() ); break; default: { - QString mapiname = ""; + TQString mapiname = ""; if ( mapi.tag >= 0x8000 && mapi.tag <= 0xFFFE ) { if ( mapi.name.type == 0 ) - mapiname = QString().sprintf( " [name = 0x%04x]", mapi.name.value.toUInt() ); + mapiname = TQString().sprintf( " [name = 0x%04x]", mapi.name.value.toUInt() ); else - mapiname = QString( " [name = %1]" ).arg( mapi.name.value.toString() ); + mapiname = TQString( " [name = %1]" ).arg( mapi.name.value.toString() ); } switch ( mapi.type & 0x0FFF ) { @@ -867,7 +867,7 @@ bool KTNEFParser::readMAPIProperties( QMap& props, KTNEFAtta { attach->setIndex( attach->property( MAPI_TAG_INDEX ).toUInt() ); attach->setDisplaySize( attach->property( MAPI_TAG_SIZE ).toUInt() ); - QString str = attach->property( MAPI_TAG_DISPLAYNAME ).toString(); + TQString str = attach->property( MAPI_TAG_DISPLAYNAME ).toString(); if ( !str.isEmpty() ) attach->setDisplayName( str ); attach->setFileName( attach->property( MAPI_TAG_FILENAME ).toString() ); diff --git a/ktnef/lib/ktnefproperty.cpp b/ktnef/lib/ktnefproperty.cpp index 3845b8d88..df04a388d 100644 --- a/ktnef/lib/ktnefproperty.cpp +++ b/ktnef/lib/ktnefproperty.cpp @@ -17,14 +17,14 @@ #include "ktnef/ktnefproperty.h" #include "mapi.h" -#include +#include #include KTNEFProperty::KTNEFProperty() { } -KTNEFProperty::KTNEFProperty( int key_, int type_, const QVariant& value_, const QVariant& name_ ) +KTNEFProperty::KTNEFProperty( int key_, int type_, const TQVariant& value_, const TQVariant& name_ ) : _key( key_ ), _type( type_ ), _value( value_ ), _name( name_ ) { } @@ -34,11 +34,11 @@ KTNEFProperty::KTNEFProperty( const KTNEFProperty& p ) { } -QString KTNEFProperty::keyString() +TQString KTNEFProperty::keyString() { if ( _name.isValid() ) { - if ( _name.type() == QVariant::String ) + if ( _name.type() == TQVariant::String ) return _name.asString(); else return mapiNamedTagString( _name.asUInt(), _key ); @@ -47,38 +47,38 @@ QString KTNEFProperty::keyString() return mapiTagString( _key ); } -QString KTNEFProperty::formatValue( const QVariant& value, bool beautify ) +TQString KTNEFProperty::formatValue( const TQVariant& value, bool beautify ) { - if ( value.type() == QVariant::ByteArray ) + if ( value.type() == TQVariant::ByteArray ) { // check the first bytes (up to 8) if they are // printable characters - QByteArray arr = value.toByteArray(); + TQByteArray arr = value.toByteArray(); bool printable = true; for ( int i=QMIN( arr.size(), 8 )-1; i>=0 && printable; i-- ) printable = ( isprint( arr[ i ] ) != 0 ); if ( !printable ) { - QString s; + TQString s; uint i; uint txtCount = beautify ? QMIN( arr.size(), 32 ) : arr.size(); for ( i=0; i < txtCount; ++i ) { - s.append( QString().sprintf( "%02X", ( uchar )arr[ i ] ) ); + s.append( TQString().sprintf( "%02X", ( uchar )arr[ i ] ) ); if( beautify ) s.append( " " ); } if ( i < arr.size() ) - s.append( "... (size=" + QString::number( arr.size() ) + ")" ); + s.append( "... (size=" + TQString::number( arr.size() ) + ")" ); return s; } } - //else if ( value.type() == QVariant::DateTime ) + //else if ( value.type() == TQVariant::DateTime ) // return value.toDateTime().toString(); return value.toString(); } -QString KTNEFProperty::valueString() +TQString KTNEFProperty::valueString() { return formatValue( _value ); } @@ -89,11 +89,11 @@ int KTNEFProperty::key() const int KTNEFProperty::type() const { return _type; } -QVariant KTNEFProperty::value() const +TQVariant KTNEFProperty::value() const { return _value; } -QVariant KTNEFProperty::name() const +TQVariant KTNEFProperty::name() const { return _name; } bool KTNEFProperty::isVector() const -{ return ( _value.type() == QVariant::List ); } +{ return ( _value.type() == TQVariant::List ); } diff --git a/ktnef/lib/ktnefpropertyset.cpp b/ktnef/lib/ktnefpropertyset.cpp index cf35362fe..ec3ee2b51 100644 --- a/ktnef/lib/ktnefpropertyset.cpp +++ b/ktnef/lib/ktnefpropertyset.cpp @@ -28,9 +28,9 @@ KTNEFPropertySet::~KTNEFPropertySet() clear( true ); } -void KTNEFPropertySet::addProperty( int key, int type, const QVariant& value, const QVariant& name, bool overwrite ) +void KTNEFPropertySet::addProperty( int key, int type, const TQVariant& value, const TQVariant& name, bool overwrite ) { - QMap::ConstIterator it = properties_.find( key ); + TQMap::ConstIterator it = properties_.find( key ); if ( it != properties_.end() ) { if ( overwrite ) @@ -43,9 +43,9 @@ void KTNEFPropertySet::addProperty( int key, int type, const QVariant& value, co } -QString KTNEFPropertySet::findProp(int key, const QString& fallback, bool upper) +TQString KTNEFPropertySet::findProp(int key, const TQString& fallback, bool upper) { - QMap::Iterator it = properties_.find( key ); + TQMap::Iterator it = properties_.find( key ); if( properties_.end() != it ) return upper ? KTNEFProperty::formatValue( (*it)->value(), false ).upper() : KTNEFProperty::formatValue( (*it)->value(), false ); @@ -54,23 +54,23 @@ QString KTNEFPropertySet::findProp(int key, const QString& fallback, bool upper) } -QString KTNEFPropertySet::findNamedProp(const QString& name, const QString& fallback, bool upper) +TQString KTNEFPropertySet::findNamedProp(const TQString& name, const TQString& fallback, bool upper) { - for ( QMap::Iterator it = properties_.begin(); + for ( TQMap::Iterator it = properties_.begin(); it != properties_.end(); ++it ){ if ( (*it)->name().isValid() ){ - QString s; - if ( (*it)->name().type() == QVariant::String ) + TQString s; + if ( (*it)->name().type() == TQVariant::String ) s = (*it)->name().asString(); else - s = QString().sprintf( "0X%04X", (*it)->name().asUInt() ); + s = TQString().sprintf( "0X%04X", (*it)->name().asUInt() ); if( s.upper() == name.upper() ){ - QVariant value = ( *it )->value(); - if( value.type() == QVariant::List ){ + TQVariant value = ( *it )->value(); + if( value.type() == TQVariant::List ){ s = ""; - for ( QValueList::ConstIterator lit = value.listBegin(); + for ( TQValueList::ConstIterator lit = value.listBegin(); lit != value.listEnd(); ++lit ){ if( !s.isEmpty() ) @@ -88,21 +88,21 @@ QString KTNEFPropertySet::findNamedProp(const QString& name, const QString& fall } -QMap& KTNEFPropertySet::properties() +TQMap& KTNEFPropertySet::properties() { return properties_; } -const QMap& KTNEFPropertySet::properties() const +const TQMap& KTNEFPropertySet::properties() const { return properties_; } -QVariant KTNEFPropertySet::property( int key ) const +TQVariant KTNEFPropertySet::property( int key ) const { - QMap::ConstIterator it = properties_.find( key ); + TQMap::ConstIterator it = properties_.find( key ); if ( it == properties_.end() ) - return QVariant(); + return TQVariant(); else return ( *it )->value(); } @@ -111,18 +111,18 @@ void KTNEFPropertySet::clear( bool deleteAll ) { if ( deleteAll ) { - for ( QMap::ConstIterator it=properties_.begin(); it!=properties_.end(); ++it ) + for ( TQMap::ConstIterator it=properties_.begin(); it!=properties_.end(); ++it ) delete ( *it ); - for ( QMap::ConstIterator it=attributes_.begin(); it!=attributes_.end(); ++it ) + for ( TQMap::ConstIterator it=attributes_.begin(); it!=attributes_.end(); ++it ) delete ( *it ); } properties_.clear(); attributes_.clear(); } -void KTNEFPropertySet::addAttribute( int key, int type, const QVariant& value, bool overwrite ) +void KTNEFPropertySet::addAttribute( int key, int type, const TQVariant& value, bool overwrite ) { - QMap::ConstIterator it = attributes_.find( key ); + TQMap::ConstIterator it = attributes_.find( key ); if ( it != attributes_.end() ) { if ( overwrite ) @@ -130,25 +130,25 @@ void KTNEFPropertySet::addAttribute( int key, int type, const QVariant& value, b else return; } - KTNEFProperty *p = new KTNEFProperty( key, type, value, QVariant() ); + KTNEFProperty *p = new KTNEFProperty( key, type, value, TQVariant() ); attributes_[ p->key() ] = p; } -QMap& KTNEFPropertySet::attributes() +TQMap& KTNEFPropertySet::attributes() { return attributes_; } -const QMap& KTNEFPropertySet::attributes() const +const TQMap& KTNEFPropertySet::attributes() const { return attributes_; } -QVariant KTNEFPropertySet::attribute( int key ) const +TQVariant KTNEFPropertySet::attribute( int key ) const { - QMap::ConstIterator it = attributes_.find( key ); + TQMap::ConstIterator it = attributes_.find( key ); if ( it == attributes_.end() ) - return QVariant(); + return TQVariant(); else return ( *it )->value(); } diff --git a/ktnef/lib/ktnefwriter.cpp b/ktnef/lib/ktnefwriter.cpp index ce35dbd20..48734bebd 100644 --- a/ktnef/lib/ktnefwriter.cpp +++ b/ktnef/lib/ktnefwriter.cpp @@ -23,9 +23,9 @@ #include "ktnef/ktnefproperty.h" #include "ktnef/ktnefpropertyset.h" -#include -#include -#include +#include +#include +#include #include #include @@ -34,7 +34,7 @@ class KTNEFWriter::PrivateData { public: - PrivateData() { mFirstAttachNum = QDateTime::currentDateTime().toTime_t(); } + PrivateData() { mFirstAttachNum = TQDateTime::currentDateTime().toTime_t(); } KTNEFPropertySet properties; Q_UINT16 mFirstAttachNum; @@ -46,16 +46,16 @@ KTNEFWriter::KTNEFWriter() { // This is not something the user should fiddle with // First set the TNEF version - QVariant v(0x00010000); + TQVariant v(0x00010000); addProperty( attTNEFVERSION, atpDWORD, v ); // Now set the code page to something reasonable. TODO: Use the right one - QVariant v1( (Q_UINT32)0x4e4 ); - QVariant v2( (Q_UINT32)0x0 ); - QValueList list; + TQVariant v1( (Q_UINT32)0x4e4 ); + TQVariant v2( (Q_UINT32)0x0 ); + TQValueList list; list << v1; list << v2; - v = QVariant( list ); + v = TQVariant( list ); addProperty( attOEMCODEPAGE, atpBYTE, list ); } @@ -64,7 +64,7 @@ KTNEFWriter::~KTNEFWriter() { } -void KTNEFWriter::addProperty( int tag, int type, const QVariant& value ) { +void KTNEFWriter::addProperty( int tag, int type, const TQVariant& value ) { mData->properties.addProperty( tag, type, value ); } @@ -76,13 +76,13 @@ void addToChecksum( Q_UINT32 i, Q_UINT16 &checksum ) { checksum += (i >> 24) & 0xff; } -void addToChecksum( QCString &cs, Q_UINT16 &checksum ) { +void addToChecksum( TQCString &cs, Q_UINT16 &checksum ) { int len = cs.length(); for (int i=0; i& properties = mData->properties.properties(); - QMap::Iterator it = properties.find( tag ); +bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) { + TQMap& properties = mData->properties.properties(); + TQMap::Iterator it = properties.find( tag ); if ( it == properties.end() ) return false; @@ -109,12 +109,12 @@ bool KTNEFWriter::writeProperty( QDataStream &stream, int &bytes, int tag) { Q_UINT32 i; Q_UINT16 checksum = 0; - QValueList list; - QString s; - QCString cs, cs2; - QDateTime dt; - QDate date; - QTime time; + TQValueList list; + TQString s; + TQCString cs, cs2; + TQDateTime dt; + TQDate date; + TQTime time; switch( tag ) { case attMSGSTATUS: // Q_UINT8 @@ -192,12 +192,12 @@ bool KTNEFWriter::writeProperty( QDataStream &stream, int &bytes, int tag) { break; case attFROM: - // 2 QString encoded to a TRP structure + // 2 TQString encoded to a TRP structure list = property->value().toList(); assert( list.count() == 2 ); cs = list[0].toString().local8Bit(); // Name - cs2 = (QString("smtp:") + list[1].toString()).local8Bit(); // Email address + cs2 = (TQString("smtp:") + list[1].toString()).local8Bit(); // Email address i = 18 + cs.length() + cs2.length(); // 2 * sizof(TRP) + strings + 2x'\0' stream << (Q_UINT8)LVL_MESSAGE; @@ -301,17 +301,17 @@ bool KTNEFWriter::writeProperty( QDataStream &stream, int &bytes, int tag) { } -bool KTNEFWriter::writeFile( QIODevice &file ) { +bool KTNEFWriter::writeFile( TQIODevice &file ) { if ( !file.open( IO_WriteOnly ) ) return false; - QDataStream stream( &file ); + TQDataStream stream( &file ); return writeFile( stream ); } -bool KTNEFWriter::writeFile( QDataStream &stream ) { - stream.setByteOrder( QDataStream::LittleEndian ); +bool KTNEFWriter::writeFile( TQDataStream &stream ) { + stream.setByteOrder( TQDataStream::LittleEndian ); // Start by writing the opening TNEF stuff stream << TNEF_SIGNATURE; @@ -341,18 +341,18 @@ bool KTNEFWriter::writeFile( QDataStream &stream ) { } -void KTNEFWriter::setSender(const QString &name, const QString &email) { +void KTNEFWriter::setSender(const TQString &name, const TQString &email) { assert( !name.isEmpty() ); assert( !email.isEmpty() ); - QVariant v1( name ); - QVariant v2( email ); + TQVariant v1( name ); + TQVariant v2( email ); - QValueList list; + TQValueList list; list << v1; list << v2; - QVariant v( list ); + TQVariant v( list ); addProperty( attFROM, 0, list ); // What's up with the 0 here ?? } @@ -360,31 +360,31 @@ void KTNEFWriter::setMessageType(MessageType m) { // Note that the MessageType list here is probably not long enough, // more entries are most likely needed later - QVariant v; + TQVariant v; switch( m ) { case Appointment: - v = QVariant( QString( "IPM.Appointment" ) ); + v = TQVariant( TQString( "IPM.Appointment" ) ); break; case MeetingCancelled: - v = QVariant( QString( "IPM.Schedule.Meeting.Cancelled" ) ); + v = TQVariant( TQString( "IPM.Schedule.Meeting.Cancelled" ) ); break; case MeetingRequest: - v = QVariant( QString( "IPM.Schedule.Meeting.Request" ) ); + v = TQVariant( TQString( "IPM.Schedule.Meeting.Request" ) ); break; case MeetingNo: - v = QVariant( QString( "IPM.Schedule.Meeting.Resp.Neg" ) ); + v = TQVariant( TQString( "IPM.Schedule.Meeting.Resp.Neg" ) ); break; case MeetingYes: - v = QVariant( QString( "IPM.Schedule.Meeting.Resp.Pos" ) ); + v = TQVariant( TQString( "IPM.Schedule.Meeting.Resp.Pos" ) ); break; case MeetingTent: // Tent? - v = QVariant( QString( "IPM.Schedule.Meeting.Resp.Tent" ) ); + v = TQVariant( TQString( "IPM.Schedule.Meeting.Resp.Tent" ) ); break; default: @@ -407,8 +407,8 @@ void KTNEFWriter::clearAttendees() } -void KTNEFWriter::addAttendee( const QString& /*cn*/, Role /*r*/, PartStat /*p*/, - bool /*rsvp*/, const QString& /*mailto*/ ) +void KTNEFWriter::addAttendee( const TQString& /*cn*/, Role /*r*/, PartStat /*p*/, + bool /*rsvp*/, const TQString& /*mailto*/ ) { } @@ -416,16 +416,16 @@ void KTNEFWriter::addAttendee( const QString& /*cn*/, Role /*r*/, PartStat /*p*/ // I assume this is the same as the sender? // U also assume that this is like "Name
" -void KTNEFWriter::setOrganizer( const QString& organizer ) { +void KTNEFWriter::setOrganizer( const TQString& organizer ) { int i = organizer.find( '<' ); if ( i == -1 ) return; - QString name = organizer.left( i ); + TQString name = organizer.left( i ); name.stripWhiteSpace(); - QString email = organizer.right( i+1 ); + TQString email = organizer.right( i+1 ); email = email.left( email.length()-1 ); email.stripWhiteSpace(); @@ -433,65 +433,65 @@ void KTNEFWriter::setOrganizer( const QString& organizer ) { } -void KTNEFWriter::setDtStart( const QDateTime& dtStart ) { - QVariant v( dtStart ); +void KTNEFWriter::setDtStart( const TQDateTime& dtStart ) { + TQVariant v( dtStart ); addProperty( attDATESTART, atpDATE, v ); } -void KTNEFWriter::setDtEnd( const QDateTime& dtEnd ) { - QVariant v( dtEnd ); +void KTNEFWriter::setDtEnd( const TQDateTime& dtEnd ) { + TQVariant v( dtEnd ); addProperty( attDATEEND, atpDATE, v ); } -void KTNEFWriter::setLocation( const QString& /*location*/ ) +void KTNEFWriter::setLocation( const TQString& /*location*/ ) { } -void KTNEFWriter::setUID( const QString& uid ) { - QVariant v( uid ); +void KTNEFWriter::setUID( const TQString& uid ) { + TQVariant v( uid ); addProperty( attMSGID, atpSTRING, v ); } // Date sent -void KTNEFWriter::setDtStamp( const QDateTime& dtStamp ) { - QVariant v( dtStamp ); +void KTNEFWriter::setDtStamp( const TQDateTime& dtStamp ) { + TQVariant v( dtStamp ); addProperty( attDATESENT, atpDATE, v ); } -void KTNEFWriter::setCategories( const QStringList& ) +void KTNEFWriter::setCategories( const TQStringList& ) { } // I hope this is the body -void KTNEFWriter::setDescription( const QString &body ) { - QVariant v( body ); +void KTNEFWriter::setDescription( const TQString &body ) { + TQVariant v( body ); addProperty( attBODY, atpTEXT, v ); } -void KTNEFWriter::setSummary( const QString &s ) { - QVariant v( s ); +void KTNEFWriter::setSummary( const TQString &s ) { + TQVariant v( s ); addProperty( attSUBJECT, atpSTRING, v ); } // TNEF encoding: Normal = 3, high = 2, low = 1 // MAPI encoding: Normal = -1, high = 0, low = 1 void KTNEFWriter::setPriority( Priority p ) { - QVariant v( (Q_UINT32)p ); + TQVariant v( (Q_UINT32)p ); addProperty( attMSGPRIORITY, atpSHORT, v ); } -void KTNEFWriter::setAlarm( const QString& /*description*/, AlarmAction /*action*/, - const QDateTime& /*wakeBefore*/ ) +void KTNEFWriter::setAlarm( const TQString& /*description*/, AlarmAction /*action*/, + const TQDateTime& /*wakeBefore*/ ) { } diff --git a/ktnef/lib/lzfu.cpp b/ktnef/lib/lzfu.cpp index ab4fa36a0..cc66cbbbd 100644 --- a/ktnef/lib/lzfu.cpp +++ b/ktnef/lib/lzfu.cpp @@ -24,7 +24,7 @@ #endif #include #include -#include +#include #include //#define DO_DEBUG @@ -57,7 +57,7 @@ typedef struct _lzfuheader { #define OFFSET(b) (b>>4)&0xFFF #define LENGTH(b) ((b&0xF)+2) -int lzfu_decompress(QIODevice *input, QIODevice *output) +int lzfu_decompress(TQIODevice *input, TQIODevice *output) { unsigned char window[4096]; unsigned int wlength = 0, cursor = 0, ocursor = 0; diff --git a/ktnef/lib/lzfu.h b/ktnef/lib/lzfu.h index 4f8365586..25aa65d3c 100644 --- a/ktnef/lib/lzfu.h +++ b/ktnef/lib/lzfu.h @@ -20,6 +20,6 @@ class QIODevice; -int lzfu_decompress( QIODevice *input, QIODevice *output ); +int lzfu_decompress( TQIODevice *input, TQIODevice *output ); #endif /* LZFU_H */ diff --git a/ktnef/lib/mapi.cpp b/ktnef/lib/mapi.cpp index 8122153ce..bf84f1fd7 100644 --- a/ktnef/lib/mapi.cpp +++ b/ktnef/lib/mapi.cpp @@ -16,7 +16,7 @@ */ #include "mapi.h" -#include +#include #include static struct @@ -187,36 +187,36 @@ MAPI_NamedTagStrings[] = { 0x8560, I18N_NOOP( "Reminder Next Time" ) }, { 0, 0 } }; -static QMap MAPI_TagMap; -static QMap MAPI_NamedTagMap; +static TQMap MAPI_TagMap; +static TQMap MAPI_NamedTagMap; -QString mapiTagString( int key ) +TQString mapiTagString( int key ) { if ( MAPI_TagMap.count() == 0 ) { for ( int i=0; MAPI_TagStrings[ i ].str; i++ ) MAPI_TagMap[ MAPI_TagStrings[ i ].tag ] = i18n(MAPI_TagStrings[ i ].str); } - QMap::ConstIterator it = MAPI_TagMap.find( key ); + TQMap::ConstIterator it = MAPI_TagMap.find( key ); if ( it == MAPI_TagMap.end() ) - return QString().sprintf( "0x%04X", key ); + return TQString().sprintf( "0x%04X", key ); else - return QString().sprintf( "0x%04X ________: ", key ) + *it; + return TQString().sprintf( "0x%04X ________: ", key ) + *it; } -QString mapiNamedTagString( int key, int tag ) +TQString mapiNamedTagString( int key, int tag ) { if ( MAPI_NamedTagMap.count() == 0 ) { for ( int i=0; MAPI_NamedTagStrings[ i ].str; i++ ) MAPI_NamedTagMap[ MAPI_NamedTagStrings[ i ].tag ] = i18n(MAPI_NamedTagStrings[ i ].str); } - QMap::ConstIterator it = MAPI_NamedTagMap.find( key ); + TQMap::ConstIterator it = MAPI_NamedTagMap.find( key ); if ( it == MAPI_NamedTagMap.end() ) if ( tag >= 0 ) - return QString().sprintf( "0x%04X [0x%04X]: ", tag, key ) + *it; + return TQString().sprintf( "0x%04X [0x%04X]: ", tag, key ) + *it; else - return QString().sprintf( "0x%04X ________:", key ) + *it; + return TQString().sprintf( "0x%04X ________:", key ) + *it; else return *it; } diff --git a/ktnef/lib/mapi.h b/ktnef/lib/mapi.h index fe4a37bf1..829f7d62f 100644 --- a/ktnef/lib/mapi.h +++ b/ktnef/lib/mapi.h @@ -18,9 +18,9 @@ #ifndef MAPI_H #define MAPI_H -#include +#include -QString mapiTagString( int key ); -QString mapiNamedTagString( int key, int tag = -1 ); +TQString mapiTagString( int key ); +TQString mapiNamedTagString( int key, int tag = -1 ); #endif diff --git a/ktnef/tests/parsertest.cpp b/ktnef/tests/parsertest.cpp index 2cbe11e91..9cbce6d52 100644 --- a/ktnef/tests/parsertest.cpp +++ b/ktnef/tests/parsertest.cpp @@ -33,13 +33,13 @@ void ParserTest::testSingleAttachment() KTNEFMessage *msg = parser.message(); assert( msg != 0 ); - QPtrList atts = msg->attachmentList(); + TQPtrList atts = msg->attachmentList(); assert( atts.count() == 1 ); KTNEFAttach* att = atts.first(); assert( att != 0 ); assert( att->size() == 244 ); - assert( att->name() == QString( "AUTHORS" ) ); + assert( att->name() == TQString( "AUTHORS" ) ); } void ParserTest::testTwoAttachments() @@ -50,18 +50,18 @@ void ParserTest::testTwoAttachments() KTNEFMessage *msg = parser.message(); assert( msg != 0 ); - QPtrList atts = msg->attachmentList(); + TQPtrList atts = msg->attachmentList(); assert( atts.count() == 2 ); KTNEFAttach* att = atts.at( 0 ); assert( att != 0 ); assert( att->size() == 244 ); - assert( att->name() == QString( "AUTHORS" ) ); + assert( att->name() == TQString( "AUTHORS" ) ); att = atts.at( 1 ); assert( att != 0 ); assert( att->size() == 893 ); - assert( att->name() == QString( "README" ) ); + assert( att->name() == TQString( "README" ) ); } void ParserTest::testMAPIAttachments() @@ -72,23 +72,23 @@ void ParserTest::testMAPIAttachments() KTNEFMessage *msg = parser.message(); assert( msg != 0 ); - QPtrList atts = msg->attachmentList(); + TQPtrList atts = msg->attachmentList(); assert( atts.count() == 3 ); KTNEFAttach* att = atts.at( 0 ); assert( att != 0 ); assert( att->size() == 61952 ); - assert( att->name() == QString( "VIA_Nytt_1402.doc" ) ); + assert( att->name() == TQString( "VIA_Nytt_1402.doc" ) ); att = atts.at( 1 ); assert( att != 0 ); assert( att->size() == 213688 ); - assert( att->name() == QString( "VIA_Nytt_1402.pdf" ) ); + assert( att->name() == TQString( "VIA_Nytt_1402.pdf" ) ); att = atts.at( 2 ); assert( att != 0 ); assert( att->size() == 68920 ); - assert( att->name() == QString( "VIA_Nytt_14021.htm" ) ); + assert( att->name() == TQString( "VIA_Nytt_14021.htm" ) ); } #include -- cgit v1.2.1