diff options
Diffstat (limited to 'src/gvcore/filethumbnailview.cpp')
-rw-r--r-- | src/gvcore/filethumbnailview.cpp | 246 |
1 files changed, 123 insertions, 123 deletions
diff --git a/src/gvcore/filethumbnailview.cpp b/src/gvcore/filethumbnailview.cpp index 8deaf09..e9dff61 100644 --- a/src/gvcore/filethumbnailview.cpp +++ b/src/gvcore/filethumbnailview.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab: /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -19,15 +19,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Qt -#include <qframe.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qpen.h> -#include <qpixmap.h> -#include <qpushbutton.h> -#include <qtimer.h> -#include <qvaluevector.h> +// TQt +#include <tqframe.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqpen.h> +#include <tqpixmap.h> +#include <tqpushbutton.h> +#include <tqtimer.h> +#include <tqvaluevector.h> // KDE #include <kapplication.h> @@ -70,18 +70,18 @@ static const int THUMBNAIL_UPDATE_DELAY=500; static const int RIGHT_TEXT_WIDTH=128; static const int BOTTOM_MIN_TEXT_WIDTH=96; -class ProgressWidget : public QFrame { +class ProgressWidget : public TQFrame { KProgress* mProgressBar; - QPushButton* mStop; + TQPushButton* mStop; public: ProgressWidget(FileThumbnailView* view, int count) - : QFrame(view) + : TQFrame(view) { - QHBoxLayout* layout=new QHBoxLayout(this, 3, 3); - layout->setAutoAdd(true); - setFrameStyle( QFrame::StyledPanel | QFrame::Raised ); + TQHBoxLayout* tqlayout=new TQHBoxLayout(this, 3, 3); + tqlayout->setAutoAdd(true); + setFrameStyle( TQFrame::StyledPanel | TQFrame::Raised ); - mStop=new QPushButton(this); + mStop=new TQPushButton(this); mStop->setPixmap(SmallIcon("stop")); mStop->setFlat(true); @@ -92,31 +92,31 @@ public: } void polish() { - QFrame::polish(); - setMinimumWidth(layout()->minimumSize().width()); + TQFrame::polish(); + setMinimumWidth(tqlayout()->tqminimumSize().width()); //setFixedHeight( mProgressBar->height() ); setFixedHeight( mStop->height() ); } - void showEvent(QShowEvent*) { + void showEvent(TQShowEvent*) { updatePosition(); } - bool eventFilter(QObject*, QEvent* event) { - if (event->type()==QEvent::Resize) { + bool eventFilter(TQObject*, TQEvent* event) { + if (event->type()==TQEvent::Resize) { updatePosition(); } return false; } void updatePosition() { - FileThumbnailView* view=static_cast<FileThumbnailView*>(parent()); - QSize tmp=view->clipper()->size() - size(); + FileThumbnailView* view=static_cast<FileThumbnailView*>(TQT_TQWIDGET(tqparent())); + TQSize tmp=view->clipper()->size() - size(); move(tmp.width() - 2, tmp.height() - 2); } KProgress* progressBar() const { return mProgressBar; } - QPushButton* stopButton() const { return mStop; } + TQPushButton* stopButton() const { return mStop; } }; @@ -124,13 +124,13 @@ struct FileThumbnailView::Private { int mThumbnailSize; int mMarginSize; bool mUpdateThumbnailsOnNextShow; - QPixmap mWaitPixmap; // The wait pixmap (32 x 32) - QPixmap mWaitThumbnail; // The wait thumbnail (mThumbnailSize x mThumbnailSize) + TQPixmap mWaitPixmap; // The wait pixmap (32 x 32) + TQPixmap mWaitThumbnail; // The wait thumbnail (mThumbnailSize x mThumbnailSize) ProgressWidget* mProgressWidget; - QGuardedPtr<ThumbnailLoadJob> mThumbnailLoadJob; + TQGuardedPtr<ThumbnailLoadJob> mThumbnailLoadJob; - QTimer* mThumbnailUpdateTimer; + TQTimer* mThumbnailUpdateTimer; int mItemDetails; @@ -138,11 +138,11 @@ struct FileThumbnailView::Private { ThumbnailDetailsDialog* mThumbnailsDetailDialog; void updateWaitThumbnail(const FileThumbnailView* view) { - mWaitThumbnail=QPixmap(mThumbnailSize, mThumbnailSize); + mWaitThumbnail=TQPixmap(mThumbnailSize, mThumbnailSize); mWaitThumbnail.fill(view->paletteBackgroundColor()); - QPainter painter(&mWaitThumbnail); + TQPainter painter(&mWaitThumbnail); - painter.setPen(view->colorGroup().button()); + painter.setPen(view->tqcolorGroup().button()); painter.drawRect(0,0,mThumbnailSize,mThumbnailSize); painter.drawPixmap( (mThumbnailSize-mWaitPixmap.width())/2, @@ -159,24 +159,24 @@ static FileThumbnailViewItem* viewItem(const FileThumbnailView* view, const KFil } -FileThumbnailView::FileThumbnailView(QWidget* parent) -: KIconView(parent), FileViewBase() +FileThumbnailView::FileThumbnailView(TQWidget* tqparent) +: KIconView(tqparent), FileViewBase() { d=new Private; d->mUpdateThumbnailsOnNextShow=false; d->mThumbnailLoadJob=0L; - d->mWaitPixmap=QPixmap(::locate("appdata", "thumbnail/wait.png")); + d->mWaitPixmap=TQPixmap(::locate("appdata", "thumbnail/wait.png")); d->mProgressWidget=0L; - d->mThumbnailUpdateTimer=new QTimer(this); + d->mThumbnailUpdateTimer=new TQTimer(this); d->mMarginSize=FileViewConfig::thumbnailMarginSize(); d->mItemDetails=FileViewConfig::thumbnailDetails(); d->mPrefetch = NULL; d->mThumbnailSize = 0; d->mThumbnailsDetailDialog = 0; - setItemTextPos( QIconView::ItemTextPos(FileViewConfig::thumbnailTextPos()) ); + setItemTextPos( TQIconView::ItemTextPos(FileViewConfig::thumbnailTextPos()) ); setAutoArrange(true); - QIconView::setSorting(true); + TQIconView::setSorting(true); setItemsMovable(false); setResizeMode(Adjust); setShowToolTips(true); @@ -187,25 +187,25 @@ FileThumbnailView::FileThumbnailView(QWidget* parent) // item is unselected after being clicked, so we use KIconView::Select mode // and emit the execute() signal with slotClicked() ourself. setMode(KIconView::Select); - connect(this, SIGNAL(clicked(QIconViewItem*)), - this, SLOT(slotClicked(QIconViewItem*)) ); - connect(this, SIGNAL(doubleClicked(QIconViewItem*)), - this, SLOT(slotDoubleClicked(QIconViewItem*)) ); + connect(this, TQT_SIGNAL(clicked(TQIconViewItem*)), + this, TQT_SLOT(slotClicked(TQIconViewItem*)) ); + connect(this, TQT_SIGNAL(doubleClicked(TQIconViewItem*)), + this, TQT_SLOT(slotDoubleClicked(TQIconViewItem*)) ); - connect(this, SIGNAL(dropped(QDropEvent*,const QValueList<QIconDragItem>&)), - this, SLOT(slotDropped(QDropEvent*)) ); - connect(this, SIGNAL( contentsMoving( int, int )), - this, SLOT( slotContentsMoving( int, int ))); - connect(this, SIGNAL(currentChanged(QIconViewItem*)), - this, SLOT(slotCurrentChanged(QIconViewItem*)) ); + connect(this, TQT_SIGNAL(dropped(TQDropEvent*,const TQValueList<TQIconDragItem>&)), + this, TQT_SLOT(slotDropped(TQDropEvent*)) ); + connect(this, TQT_SIGNAL( contentsMoving( int, int )), + this, TQT_SLOT( slotContentsMoving( int, int ))); + connect(this, TQT_SIGNAL(currentChanged(TQIconViewItem*)), + this, TQT_SLOT(slotCurrentChanged(TQIconViewItem*)) ); - QIconView::setSelectionMode(Extended); + TQIconView::setSelectionMode(Extended); - connect(BusyLevelManager::instance(), SIGNAL(busyLevelChanged(BusyLevel)), - this, SLOT( slotBusyLevelChanged(BusyLevel))); + connect(BusyLevelManager::instance(), TQT_SIGNAL(busyLevelChanged(BusyLevel)), + this, TQT_SLOT( slotBusyLevelChanged(BusyLevel))); - connect(d->mThumbnailUpdateTimer, SIGNAL(timeout()), - this, SLOT( startThumbnailUpdate()) ); + connect(d->mThumbnailUpdateTimer, TQT_SIGNAL(timeout()), + this, TQT_SLOT( startThumbnailUpdate()) ); } @@ -226,8 +226,8 @@ void FileThumbnailView::setThumbnailSize(int value) { KFileItemListIterator it( *items() ); for ( ; it.current(); ++it ) { KFileItem *item=it.current(); - QPixmap pixmap=createItemPixmap(item); - QIconViewItem* iconItem=viewItem(this, item); + TQPixmap pixmap=createItemPixmap(item); + TQIconViewItem* iconItem=viewItem(this, item); if (iconItem) iconItem->setPixmap(pixmap); } arrangeItemsInGrid(); @@ -244,7 +244,7 @@ int FileThumbnailView::thumbnailSize() const { * Overriden to call updateGrid */ void FileThumbnailView::setItemTextPos(ItemTextPos pos) { - QIconView::setItemTextPos(pos); + TQIconView::setItemTextPos(pos); updateGrid(); } @@ -263,7 +263,7 @@ int FileThumbnailView::marginSize() const { void FileThumbnailView::setItemDetails(int details) { d->mItemDetails=details; - for (QIconViewItem* item=firstItem(); item; item=item->nextItem()) { + for (TQIconViewItem* item=firstItem(); item; item=item->nextItem()) { static_cast<FileThumbnailViewItem*>(item)->updateLines(); } arrangeItemsInGrid(); @@ -275,7 +275,7 @@ int FileThumbnailView::itemDetails() const { } -void FileThumbnailView::setThumbnailPixmap(const KFileItem* fileItem, const QPixmap& thumbnail, const QSize& size) { +void FileThumbnailView::setThumbnailPixmap(const KFileItem* fileItem, const TQPixmap& thumbnail, const TQSize& size) { FileThumbnailViewItem* iconItem=viewItem(this, fileItem); if (!iconItem) return; @@ -285,7 +285,7 @@ void FileThumbnailView::setThumbnailPixmap(const KFileItem* fileItem, const QPix if (size.isValid()) { iconItem->setImageSize(size); } - iconItem->repaint(); + iconItem->tqrepaint(); // Notify progress if (d->mProgressWidget) { @@ -305,8 +305,8 @@ void FileThumbnailView::setShownFileItem(KFileItem* fileItem) { FileThumbnailViewItem* newShownItem=viewItem(this, fileItem); FileViewBase::setShownFileItem(fileItem); - if (oldShownItem) repaintItem(oldShownItem); - if (newShownItem) repaintItem(newShownItem); + if (oldShownItem) tqrepaintItem(oldShownItem); + if (newShownItem) tqrepaintItem(newShownItem); } @@ -315,7 +315,7 @@ void FileThumbnailView::setShownFileItem(KFileItem* fileItem) { // Thumbnail code // //----------------------------------------------------------------------------- -QPixmap FileThumbnailView::createItemPixmap(const KFileItem* item) const { +TQPixmap FileThumbnailView::createItemPixmap(const KFileItem* item) const { bool isDirOrArchive=item->isDir() || Archive::fileItemIsArchive(item); if (!isDirOrArchive) { if (d->mWaitThumbnail.width()!=d->mThumbnailSize) { @@ -324,12 +324,12 @@ QPixmap FileThumbnailView::createItemPixmap(const KFileItem* item) const { return d->mWaitThumbnail; } - QPixmap thumbnail(d->mThumbnailSize, d->mThumbnailSize); + TQPixmap thumbnail(d->mThumbnailSize, d->mThumbnailSize); thumbnail.fill(paletteBackgroundColor()); - QPainter painter(&thumbnail); + TQPainter painter(&thumbnail); // Load the icon - QPixmap itemPix=item->pixmap(QMIN(d->mThumbnailSize, ThumbnailSize::NORMAL)); + TQPixmap itemPix=item->pixmap(TQMIN(d->mThumbnailSize, ThumbnailSize::NORMAL)); painter.drawPixmap( (d->mThumbnailSize-itemPix.width())/2, (d->mThumbnailSize-itemPix.height())/2, @@ -352,9 +352,9 @@ void FileThumbnailView::startThumbnailUpdate() { void FileThumbnailView::doStartThumbnailUpdate(const KFileItemList* list) { - QValueVector<const KFileItem*> imageList; + TQValueVector<const KFileItem*> imageList; imageList.reserve( list->count()); - QPtrListIterator<KFileItem> it(*list); + TQPtrListIterator<KFileItem> it(*list); for (;it.current(); ++it) { KFileItem* item=it.current(); if (!item->isDir() && !Archive::fileItemIsArchive(item)) { @@ -363,21 +363,21 @@ void FileThumbnailView::doStartThumbnailUpdate(const KFileItemList* list) { } if (imageList.empty()) return; - BusyLevelManager::instance()->setBusyLevel( this, BUSY_THUMBNAILS ); + BusyLevelManager::instance()->setBusyLevel( TQT_TQOBJECT(this), BUSY_THUMBNAILS ); Q_ASSERT(!d->mProgressWidget); d->mProgressWidget=new ProgressWidget(this, imageList.count() ); - connect(d->mProgressWidget->stopButton(), SIGNAL(clicked()), - this, SLOT(stopThumbnailUpdate()) ); + connect(d->mProgressWidget->stopButton(), TQT_SIGNAL(clicked()), + this, TQT_SLOT(stopThumbnailUpdate()) ); d->mProgressWidget->show(); d->mThumbnailLoadJob = new ThumbnailLoadJob(&imageList, d->mThumbnailSize); - connect(d->mThumbnailLoadJob, SIGNAL(thumbnailLoaded(const KFileItem*, const QPixmap&, const QSize&)), - this, SLOT(setThumbnailPixmap(const KFileItem*,const QPixmap&, const QSize&)) ); - connect(d->mThumbnailLoadJob, SIGNAL(result(KIO::Job*)), - this, SLOT(slotUpdateEnded()) ); + connect(d->mThumbnailLoadJob, TQT_SIGNAL(thumbnailLoaded(const KFileItem*, const TQPixmap&, const TQSize&)), + this, TQT_SLOT(setThumbnailPixmap(const KFileItem*,const TQPixmap&, const TQSize&)) ); + connect(d->mThumbnailLoadJob, TQT_SIGNAL(result(KIO::Job*)), + this, TQT_SLOT(slotUpdateEnded()) ); slotBusyLevelChanged( BusyLevelManager::instance()->busyLevel()); // start updating at visible position @@ -398,7 +398,7 @@ void FileThumbnailView::slotUpdateEnded() { delete d->mProgressWidget; d->mProgressWidget=0L; - BusyLevelManager::instance()->setBusyLevel( this, BUSY_NONE ); + BusyLevelManager::instance()->setBusyLevel( TQT_TQOBJECT(this), BUSY_NONE ); } @@ -437,7 +437,7 @@ void FileThumbnailView::slotBusyLevelChanged(BusyLevel level) { void FileThumbnailView::clearView() { stopThumbnailUpdate(); mShownFileItem=0L; - QIconView::clear(); + TQIconView::clear(); } @@ -445,7 +445,7 @@ void FileThumbnailView::insertItem(KFileItem* item) { if (!item) return; bool isDirOrArchive=item->isDir() || Archive::fileItemIsArchive(item); - QPixmap thumbnail=createItemPixmap(item); + TQPixmap thumbnail=createItemPixmap(item); FileThumbnailViewItem* iconItem=new FileThumbnailViewItem(this,item->text(),thumbnail,item); iconItem->setDropEnabled(isDirOrArchive); @@ -470,7 +470,7 @@ void FileThumbnailView::ensureItemVisible(const KFileItem* fileItem) { if (!fileItem) return; FileThumbnailViewItem* iconItem=viewItem(this, fileItem); - if (iconItem) QIconView::ensureItemVisible(iconItem); + if (iconItem) TQIconView::ensureItemVisible(iconItem); } @@ -478,7 +478,7 @@ void FileThumbnailView::setCurrentItem(const KFileItem* fileItem) { if (!fileItem) return; FileThumbnailViewItem* iconItem=viewItem(this, fileItem); - if (iconItem) QIconView::setCurrentItem(iconItem); + if (iconItem) TQIconView::setCurrentItem(iconItem); } @@ -486,7 +486,7 @@ void FileThumbnailView::setSelected(const KFileItem* fileItem,bool enable) { if (!fileItem) return; FileThumbnailViewItem* iconItem=viewItem(this, fileItem); - if (iconItem) QIconView::setSelected(iconItem, enable, true /* do not unselect others */); + if (iconItem) TQIconView::setSelected(iconItem, enable, true /* do not unselect others */); } @@ -536,7 +536,7 @@ KFileItem* FileThumbnailView::prevItem(const KFileItem* fileItem) const { KFileItem* FileThumbnailView::currentFileItem() const { - const QIconViewItem* iconItem=currentItem(); + const TQIconViewItem* iconItem=currentItem(); if (!iconItem) return 0L; return static_cast<const FileThumbnailViewItem*>(iconItem)->fileItem(); @@ -554,18 +554,18 @@ KFileItem* FileThumbnailView::nextItem(const KFileItem* fileItem) const { } -void FileThumbnailView::setSorting(QDir::SortSpec spec) { +void FileThumbnailView::setSorting(TQDir::SortSpec spec) { KFileView::setSorting(spec); KFileItem *item; KFileItemListIterator it( *items() ); for ( ; (item = it.current() ); ++it ) { - QIconViewItem* iconItem=viewItem(this, item); + TQIconViewItem* iconItem=viewItem(this, item); if (iconItem) setSortingKey(iconItem, item); } - KIconView::sort(! (spec & QDir::Reversed) ); + KIconView::sort(! (spec & TQDir::Reversed) ); } //-------------------------------------------------------------------------- @@ -573,22 +573,22 @@ void FileThumbnailView::setSorting(QDir::SortSpec spec) { // Drop support // //-------------------------------------------------------------------------- -void FileThumbnailView::contentsDragEnterEvent(QDragEnterEvent* event) { +void FileThumbnailView::contentsDragEnterEvent(TQDragEnterEvent* event) { return event->accept( KURLDrag::canDecode(event) ); } -void FileThumbnailView::slotDropped(QDropEvent* event) { +void FileThumbnailView::slotDropped(TQDropEvent* event) { emit dropped(event,0L); } -void FileThumbnailView::showEvent(QShowEvent* event) { +void FileThumbnailView::showEvent(TQShowEvent* event) { KIconView::showEvent(event); if (!d->mUpdateThumbnailsOnNextShow) return; d->mUpdateThumbnailsOnNextShow=false; - QTimer::singleShot(0, this, SLOT(startThumbnailUpdate())); + TQTimer::singleShot(0, this, TQT_SLOT(startThumbnailUpdate())); } @@ -605,25 +605,25 @@ void FileThumbnailView::updateGrid() { + RIGHT_TEXT_WIDTH); } else { setGridX( - QMAX(d->mThumbnailSize, BOTTOM_MIN_TEXT_WIDTH) + TQMAX(d->mThumbnailSize, BOTTOM_MIN_TEXT_WIDTH) + FileThumbnailViewItem::PADDING*2); } setSpacing(d->mMarginSize); } -void FileThumbnailView::setSortingKey(QIconViewItem *iconItem, const KFileItem *item) +void FileThumbnailView::setSortingKey(TQIconViewItem *iconItem, const KFileItem *item) { // see also setSorting() - QDir::SortSpec spec = KFileView::sorting(); + TQDir::SortSpec spec = KFileView::sorting(); bool isDirOrArchive=item->isDir() || Archive::fileItemIsArchive(item); - QString key; - if ( spec & QDir::Time ) { + TQString key; + if ( spec & TQDir::Time ) { time_t time = TimeUtils::getTime(item); key=sortingKey(time, isDirOrArchive, spec); - } else if ( spec & QDir::Size ) { + } else if ( spec & TQDir::Size ) { key=sortingKey( item->size(), isDirOrArchive, spec ); } else { @@ -640,7 +640,7 @@ void FileThumbnailView::setSortingKey(QIconViewItem *iconItem, const KFileItem * // Private slots // //-------------------------------------------------------------------------- -void FileThumbnailView::slotDoubleClicked(QIconViewItem* iconItem) { +void FileThumbnailView::slotDoubleClicked(TQIconViewItem* iconItem) { if (!iconItem) return; if (KGlobalSettings::singleClick()) return; FileThumbnailViewItem* thumbItem=static_cast<FileThumbnailViewItem*>(iconItem); @@ -653,7 +653,7 @@ void FileThumbnailView::slotDoubleClicked(QIconViewItem* iconItem) { } -void FileThumbnailView::slotClicked(QIconViewItem* iconItem) { +void FileThumbnailView::slotClicked(TQIconViewItem* iconItem) { if (!iconItem) return; if (!KGlobalSettings::singleClick()) return; FileThumbnailViewItem* thumbItem=static_cast<FileThumbnailViewItem*>(iconItem); @@ -669,12 +669,12 @@ void FileThumbnailView::slotContentsMoving( int x, int y ) { updateVisibilityInfo( x, y ); // use x,y, the signal is emitted before moving } -void FileThumbnailView::slotCurrentChanged(QIconViewItem* item ) { +void FileThumbnailView::slotCurrentChanged(TQIconViewItem* item ) { // trigger generating thumbnails from the current one updateVisibilityInfo( contentsX(), contentsY()); prefetchDone(); // if the first image is selected, no matter how, preload the next one - for( QIconViewItem* pos = item; + for( TQIconViewItem* pos = item; pos != NULL; pos = pos->nextItem()) { FileThumbnailViewItem* cur = static_cast< FileThumbnailViewItem* >( pos ); @@ -682,8 +682,8 @@ void FileThumbnailView::slotCurrentChanged(QIconViewItem* item ) { if( pos == item && pos->nextItem() != NULL ) { d->mPrefetch = ImageLoader::loader( static_cast<const FileThumbnailViewItem*>( cur->nextItem() )->fileItem()->url(), - this, BUSY_PRELOADING ); - connect( d->mPrefetch, SIGNAL( imageLoaded( bool )), SLOT( prefetchDone())); + TQT_TQOBJECT(this), BUSY_PRELOADING ); + connect( d->mPrefetch, TQT_SIGNAL( imageLoaded( bool )), TQT_SLOT( prefetchDone())); } } } @@ -696,14 +696,14 @@ void FileThumbnailView::slotCurrentChanged(QIconViewItem* item ) { void FileThumbnailView::updateVisibilityInfo( int x, int y ) { if (d->mThumbnailLoadJob.isNull()) return; - QRect rect( x, y, visibleWidth(), visibleHeight()); - FileThumbnailViewItem* first = static_cast< FileThumbnailViewItem* >( findFirstVisibleItem( rect )); + TQRect rect( x, y, visibleWidth(), visibleHeight()); + FileThumbnailViewItem* first = static_cast< FileThumbnailViewItem* >( tqfindFirstVisibleItem( rect )); if (!first) { d->mThumbnailLoadJob->setPriorityItems(NULL,NULL,NULL); return; } - FileThumbnailViewItem* last = static_cast< FileThumbnailViewItem* >( findLastVisibleItem( rect )); + FileThumbnailViewItem* last = static_cast< FileThumbnailViewItem* >( tqfindLastVisibleItem( rect )); Q_ASSERT(last); // If we get a first item, then there must be a last if (currentItem() && currentItem()->intersects(rect)) { @@ -719,16 +719,16 @@ void FileThumbnailView::updateVisibilityInfo( int x, int y ) { last->fileItem()); } -void FileThumbnailView::keyPressEvent( QKeyEvent* e ) { +void FileThumbnailView::keyPressEvent( TQKeyEvent* e ) { // When the user presses e.g. the Down key, try to preload the next image in that direction. if( e->key() != Key_Left && e->key() != Key_Right && e->key() != Key_Up && e->key() != Key_Down ) return KIconView::keyPressEvent( e ); - QIconViewItem* current = currentItem(); + TQIconViewItem* current = currentItem(); KIconView::keyPressEvent( e ); - QIconViewItem* next = NULL; + TQIconViewItem* next = NULL; if( current != currentItem() && currentItem() != NULL ) { // it actually moved switch( e->key()) { case Key_Left: @@ -757,14 +757,14 @@ void FileThumbnailView::keyPressEvent( QKeyEvent* e ) { if( next != NULL ) { d->mPrefetch = ImageLoader::loader( static_cast<const FileThumbnailViewItem*>( next )->fileItem()->url(), - this, BUSY_PRELOADING ); - connect( d->mPrefetch, SIGNAL( imageLoaded( bool )), SLOT( prefetchDone())); + TQT_TQOBJECT(this), BUSY_PRELOADING ); + connect( d->mPrefetch, TQT_SIGNAL( imageLoaded( bool )), TQT_SLOT( prefetchDone())); } } void FileThumbnailView::prefetchDone() { if( d->mPrefetch != NULL ) { - d->mPrefetch->release( this ); + d->mPrefetch->release( TQT_TQOBJECT(this) ); d->mPrefetch = NULL; } } @@ -782,11 +782,11 @@ void FileThumbnailView::startDrag() { ItemDrawer(FileThumbnailView* view) : mView(view) {} - QSize itemSize(KFileItem* fileItem) { - QPixmap* pix = pixmapFromFileItem(fileItem); - if (!pix) return QSize(); + TQSize itemSize(KFileItem* fileItem) { + TQPixmap* pix = pixmapFromFileItem(fileItem); + if (!pix) return TQSize(); - QSize size = pix->size(); + TQSize size = pix->size(); int maxWidth = mGenerator->maxWidth(); if (size.width() > maxWidth) { size.rheight() = size.height() * maxWidth / size.width(); @@ -799,28 +799,28 @@ void FileThumbnailView::startDrag() { return 2; } - void drawItem(QPainter* painter, int left, int top, KFileItem* fileItem) { - QPixmap* pix = pixmapFromFileItem(fileItem); + void drawItem(TQPainter* painter, int left, int top, KFileItem* fileItem) { + TQPixmap* pix = pixmapFromFileItem(fileItem); if (!pix) return; - QSize size = itemSize(fileItem); + TQSize size = itemSize(fileItem); left += (mGenerator->pixmapWidth() - size.width()) / 2; if (size == pix->size()) { painter->drawPixmap(left, top, *pix); return; } - QImage img = pix->convertToImage(); - img = img.smoothScale(size, QImage::ScaleMin); + TQImage img = pix->convertToImage(); + img = img.smoothScale(size, TQ_ScaleMin); painter->drawImage(left, top, img); } - QPixmap* pixmapFromFileItem(KFileItem* fileItem) { + TQPixmap* pixmapFromFileItem(KFileItem* fileItem) { FileThumbnailViewItem* iconItem = viewItem(mView, fileItem); Q_ASSERT(iconItem); if (!iconItem) return 0; - QPixmap* pix = iconItem->pixmap(); + TQPixmap* pix = iconItem->pixmap(); Q_ASSERT(pix); if (!pix) return 0; return pix; @@ -847,10 +847,10 @@ void FileThumbnailView::startDrag() { return; } - QDragObject* drag=new KURLDrag(urls, this, 0); - QPixmap dragPixmap = generator.generate(); + TQDragObject* drag=new KURLDrag(urls, this, 0); + TQPixmap dragPixmap = generator.generate(); - drag->setPixmap( dragPixmap, QPoint(generator.DRAG_OFFSET, -generator.DRAG_OFFSET)); + drag->setPixmap( dragPixmap, TQPoint(generator.DRAG_OFFSET, -generator.DRAG_OFFSET)); drag->dragCopy(); } |