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 --- kmail/kmmimeparttree.cpp | 106 +++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 53 deletions(-) (limited to 'kmail/kmmimeparttree.cpp') diff --git a/kmail/kmmimeparttree.cpp b/kmail/kmmimeparttree.cpp index 606b6891d..1d32a56e8 100644 --- a/kmail/kmmimeparttree.cpp +++ b/kmail/kmmimeparttree.cpp @@ -46,16 +46,16 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include KMMimePartTree::KMMimePartTree( KMReaderWin* readerWin, - QWidget* parent, + TQWidget* parent, const char* name ) : KListView( parent, name ), mReaderWin( readerWin ), mSizeColumn(0) @@ -68,12 +68,12 @@ KMMimePartTree::KMMimePartTree( KMReaderWin* readerWin, setColumnAlignment( 3, Qt::AlignRight ); restoreLayoutIfPresent(); - connect( this, SIGNAL( clicked( QListViewItem* ) ), - this, SLOT( itemClicked( QListViewItem* ) ) ); - connect( this, SIGNAL( contextMenuRequested( QListViewItem*, - const QPoint&, int ) ), - this, SLOT( itemRightClicked( QListViewItem*, const QPoint& ) ) ); - setSelectionMode( QListView::Extended ); + connect( this, TQT_SIGNAL( clicked( TQListViewItem* ) ), + this, TQT_SLOT( itemClicked( TQListViewItem* ) ) ); + connect( this, TQT_SIGNAL( contextMenuRequested( TQListViewItem*, + const TQPoint&, int ) ), + this, TQT_SLOT( itemRightClicked( TQListViewItem*, const TQPoint& ) ) ); + setSelectionMode( TQListView::Extended ); setRootIsDecorated( false ); setAllColumnsShowFocus( true ); setShowToolTips( true ); @@ -108,7 +108,7 @@ void KMMimePartTree::restoreLayoutIfPresent() { } -void KMMimePartTree::itemClicked( QListViewItem* item ) +void KMMimePartTree::itemClicked( TQListViewItem* item ) { if ( const KMMimePartTreeItem * i = dynamic_cast( item ) ) { if( mReaderWin->mRootNode == i->node() ) @@ -120,8 +120,8 @@ void KMMimePartTree::itemClicked( QListViewItem* item ) } -void KMMimePartTree::itemRightClicked( QListViewItem* item, - const QPoint& point ) +void KMMimePartTree::itemRightClicked( TQListViewItem* item, + const TQPoint& point ) { // TODO: remove this member var? mCurrentContextMenuItem = dynamic_cast( item ); @@ -131,34 +131,34 @@ void KMMimePartTree::itemRightClicked( QListViewItem* item, else { kdDebug(5006) << "\n**\n** KMMimePartTree::itemRightClicked() **\n**" << endl; - QPopupMenu* popup = new QPopupMenu; + TQPopupMenu* popup = new QPopupMenu; if ( mCurrentContextMenuItem->node()->nodeId() > 2 && mCurrentContextMenuItem->node()->typeString() != "Multipart" ) { - popup->insertItem( SmallIcon("fileopen"), i18n("to open", "Open"), this, SLOT(slotOpen()) ); - popup->insertItem( i18n("Open With..."), this, SLOT(slotOpenWith()) ); - popup->insertItem( i18n("to view something", "View"), this, SLOT(slotView()) ); + popup->insertItem( SmallIcon("fileopen"), i18n("to open", "Open"), this, TQT_SLOT(slotOpen()) ); + popup->insertItem( i18n("Open With..."), this, TQT_SLOT(slotOpenWith()) ); + popup->insertItem( i18n("to view something", "View"), this, TQT_SLOT(slotView()) ); } - popup->insertItem( SmallIcon("filesaveas"),i18n( "Save &As..." ), this, SLOT( slotSaveAs() ) ); + popup->insertItem( SmallIcon("filesaveas"),i18n( "Save &As..." ), this, TQT_SLOT( slotSaveAs() ) ); /* * FIXME mkae optional? popup->insertItem( i18n( "Save as &Encoded..." ), this, - SLOT( slotSaveAsEncoded() ) ); + TQT_SLOT( slotSaveAsEncoded() ) ); */ popup->insertItem( i18n( "Save All Attachments..." ), this, - SLOT( slotSaveAll() ) ); + TQT_SLOT( slotSaveAll() ) ); // edit + delete only for attachments if ( mCurrentContextMenuItem->node()->nodeId() > 2 && mCurrentContextMenuItem->node()->typeString() != "Multipart" ) { - popup->insertItem( SmallIcon("editcopy"), i18n("Copy"), this, SLOT(slotCopy()) ); + popup->insertItem( SmallIcon("editcopy"), i18n("Copy"), this, TQT_SLOT(slotCopy()) ); if ( GlobalSettings::self()->allowAttachmentDeletion() ) popup->insertItem( SmallIcon("editdelete"), i18n( "Delete Attachment" ), - this, SLOT( slotDelete() ) ); + this, TQT_SLOT( slotDelete() ) ); if ( GlobalSettings::self()->allowAttachmentEditing() ) popup->insertItem( SmallIcon( "edit" ), i18n( "Edit Attachment" ), - this, SLOT( slotEdit() ) ); + this, TQT_SLOT( slotEdit() ) ); } if ( mCurrentContextMenuItem->node()->nodeId() > 0 ) - popup->insertItem( i18n("Properties"), this, SLOT(slotProperties()) ); + popup->insertItem( i18n("Properties"), this, TQT_SLOT(slotProperties()) ); popup->exec( point ); delete popup; mCurrentContextMenuItem = 0; @@ -180,14 +180,14 @@ void KMMimePartTree::slotSaveAsEncoded() //----------------------------------------------------------------------------- void KMMimePartTree::saveSelectedBodyParts( bool encoded ) { - QPtrList selected = selectedItems(); + TQPtrList selected = selectedItems(); Q_ASSERT( !selected.isEmpty() ); if ( selected.isEmpty() ) return; - QPtrListIterator it( selected ); - QPtrList parts; + TQPtrListIterator it( selected ); + TQPtrList parts; while ( it.current() ) { parts.append( static_cast(it.current())->node() ); ++it; @@ -216,9 +216,9 @@ void KMMimePartTree::setStyleDependantFrameWidth() // set the width of the frame to a reasonable value for the current GUI style int frameWidth; if( style().isA("KeramikStyle") ) - frameWidth = style().pixelMetric( QStyle::PM_DefaultFrameWidth ) - 1; + frameWidth = style().pixelMetric( TQStyle::PM_DefaultFrameWidth ) - 1; else - frameWidth = style().pixelMetric( QStyle::PM_DefaultFrameWidth ); + frameWidth = style().pixelMetric( TQStyle::PM_DefaultFrameWidth ); if ( frameWidth < 0 ) frameWidth = 0; if ( frameWidth != lineWidth() ) @@ -227,19 +227,19 @@ void KMMimePartTree::setStyleDependantFrameWidth() //----------------------------------------------------------------------------- -void KMMimePartTree::styleChange( QStyle& oldStyle ) +void KMMimePartTree::styleChange( TQStyle& oldStyle ) { setStyleDependantFrameWidth(); KListView::styleChange( oldStyle ); } //----------------------------------------------------------------------------- -void KMMimePartTree::correctSize( QListViewItem * item ) +void KMMimePartTree::correctSize( TQListViewItem * item ) { if (!item) return; KIO::filesize_t totalSize = 0; - QListViewItem * myChild = item->firstChild(); + TQListViewItem * myChild = item->firstChild(); while ( myChild ) { totalSize += static_cast(myChild)->origSize(); @@ -253,7 +253,7 @@ void KMMimePartTree::correctSize( QListViewItem * item ) void KMMimePartTree::slotDelete() { - QPtrList selected = selectedItems(); + TQPtrList selected = selectedItems(); if ( selected.count() != 1 ) return; mReaderWin->slotDeleteAttachment( static_cast( selected.first() )->node() ); @@ -261,7 +261,7 @@ void KMMimePartTree::slotDelete() void KMMimePartTree::slotEdit() { - QPtrList selected = selectedItems(); + TQPtrList selected = selectedItems(); if ( selected.count() != 1 ) return; mReaderWin->slotEditAttachment( static_cast( selected.first() )->node() ); @@ -289,16 +289,16 @@ void KMMimePartTree::slotProperties() void KMMimePartTree::startHandleAttachmentCommand(int type) { - QPtrList selected = selectedItems(); + TQPtrList selected = selectedItems(); if ( selected.count() != 1 ) return; partNode* node = static_cast( selected.first() )->node(); - QString name = mReaderWin->tempFileUrlFromPartNode( node ).path(); + TQString name = mReaderWin->tempFileUrlFromPartNode( node ).path(); KMHandleAttachmentCommand* command = new KMHandleAttachmentCommand( node, mReaderWin->message(), node->nodeId(), name, KMHandleAttachmentCommand::AttachmentAction( type ), 0, this ); - connect( command, SIGNAL( showAttachment( int, const QString& ) ), - mReaderWin, SLOT( slotAtmView( int, const QString& ) ) ); + connect( command, TQT_SIGNAL( showAttachment( int, const TQString& ) ), + mReaderWin, TQT_SLOT( slotAtmView( int, const TQString& ) ) ); command->start(); } @@ -311,18 +311,18 @@ void KMMimePartTree::slotCopy() if ( !url.isValid() ) return; urls.append( url ); KURLDrag* drag = new KURLDrag( urls, this ); - QApplication::clipboard()->setData( drag, QClipboard::Clipboard ); + TQApplication::clipboard()->setData( drag, QClipboard::Clipboard ); } //============================================================================= KMMimePartTreeItem::KMMimePartTreeItem( KMMimePartTree * parent, partNode* node, - const QString & description, - const QString & mimetype, - const QString & encoding, + const TQString & description, + const TQString & mimetype, + const TQString & encoding, KIO::filesize_t size ) - : QListViewItem( parent, description, - QString::null, // set by setIconAndTextForType() + : TQListViewItem( parent, description, + TQString::null, // set by setIconAndTextForType() encoding, KIO::convertSize( size ) ), mPartNode( node ), mOrigSize(size) @@ -336,19 +336,19 @@ KMMimePartTreeItem::KMMimePartTreeItem( KMMimePartTree * parent, KMMimePartTreeItem::KMMimePartTreeItem( KMMimePartTreeItem * parent, partNode* node, - const QString & description, - const QString & mimetype, - const QString & encoding, + const TQString & description, + const TQString & mimetype, + const TQString & encoding, KIO::filesize_t size, bool revertOrder ) - : QListViewItem( parent, description, - QString::null, // set by setIconAndTextForType() + : TQListViewItem( parent, description, + TQString::null, // set by setIconAndTextForType() encoding, KIO::convertSize( size ) ), mPartNode( node ), mOrigSize(size) { if( revertOrder && nextSibling() ){ - QListViewItem* sib = nextSibling(); + TQListViewItem* sib = nextSibling(); while( sib->nextSibling() ) sib = sib->nextSibling(); moveItem( sib ); @@ -360,9 +360,9 @@ KMMimePartTreeItem::KMMimePartTreeItem( KMMimePartTreeItem * parent, static_cast(listView())->correctSize(this); } -void KMMimePartTreeItem::setIconAndTextForType( const QString & mime ) +void KMMimePartTreeItem::setIconAndTextForType( const TQString & mime ) { - QString mimetype = mime.lower(); + TQString mimetype = mime.lower(); if ( mimetype.startsWith( "multipart/" ) ) { setText( 1, mimetype ); setPixmap( 0, SmallIcon("folder") ); -- cgit v1.2.1