summaryrefslogtreecommitdiffstats
path: root/src/gvcore/thumbnailloadjob.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-26 21:04:57 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-26 21:04:57 +0000
commitbf7f88413be3831a9372d323d02fc0335b9f9188 (patch)
tree516fdef9206245b40a14f99b4e3d9ef9289196e0 /src/gvcore/thumbnailloadjob.h
parente238aa77b1fb3c2f55aef2ef2c91ce52166d2cc8 (diff)
downloadgwenview-bf7f88413be3831a9372d323d02fc0335b9f9188.tar.gz
gwenview-bf7f88413be3831a9372d323d02fc0335b9f9188.zip
TQt4 port Gwenview
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/gwenview@1233720 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gvcore/thumbnailloadjob.h')
-rw-r--r--src/gvcore/thumbnailloadjob.h70
1 files changed, 36 insertions, 34 deletions
diff --git a/src/gvcore/thumbnailloadjob.h b/src/gvcore/thumbnailloadjob.h
index fd7791e..fc33fdf 100644
--- a/src/gvcore/thumbnailloadjob.h
+++ b/src/gvcore/thumbnailloadjob.h
@@ -1,6 +1,6 @@
// 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 class is based on the ImagePreviewJob class from Konqueror.
Original copyright follows.
*/
@@ -25,11 +25,11 @@
#ifndef THUMBNAILLOADJOB_H
#define THUMBNAILLOADJOB_H
-// Qt
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qvaluelist.h>
-#include <qvaluevector.h>
+// TQt
+#include <tqimage.h>
+#include <tqpixmap.h>
+#include <tqvaluelist.h>
+#include <tqvaluevector.h>
// KDE
#include <kio/job.h>
@@ -42,39 +42,40 @@
class KConfig;
class KFileItem;
-typedef QPtrList<KFileItem> KFileItemList;
+typedef TQPtrList<KFileItem> KFileItemList;
namespace Gwenview {
class ThumbnailThread : public TSThread {
Q_OBJECT
+ TQ_OBJECT
public:
void load(
- const QString& originalURI,
+ const TQString& originalURI,
time_t originalTime,
int originalSize,
- const QString& originalMimeType,
- const QString& pixPath,
- const QString& thumbnailPath,
+ const TQString& originalMimeType,
+ const TQString& pixPath,
+ const TQString& thumbnailPath,
int size,
bool storeThumbnail);
protected:
virtual void run();
signals:
- void done( const QImage&, const QSize&);
+ void done( const TQImage&, const TQSize&);
private:
bool isJPEG();
bool loadJPEG();
void loadThumbnail();
- QImage mImage;
- QString mPixPath;
- QString mThumbnailPath;
- QString mOriginalURI;
+ TQImage mImage;
+ TQString mPixPath;
+ TQString mThumbnailPath;
+ TQString mOriginalURI;
time_t mOriginalTime;
int mOriginalSize;
- QString mOriginalMimeType;
+ TQString mOriginalMimeType;
int mOriginalWidth;
int mOriginalHeight;
- QMutex mMutex;
+ TQMutex mMutex;
TSWaitCondition mCond;
int mThumbnailSize;
bool mStoreThumbnailsInCache;
@@ -85,11 +86,12 @@ private:
*/
class LIBGWENVIEW_EXPORT ThumbnailLoadJob : public KIO::Job {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Create a job for determining the pixmaps of the images in the @p itemList
*/
- ThumbnailLoadJob(const QValueVector<const KFileItem*>* itemList, int size);
+ ThumbnailLoadJob(const TQValueVector<const KFileItem*>* itemList, int size);
virtual ~ThumbnailLoadJob();
/**
@@ -128,12 +130,12 @@ public:
/**
* Returns the thumbnail base dir, independent of the thumbnail size
*/
- static QString thumbnailBaseDir();
+ static TQString thumbnailBaseDir();
/**
* Returns the thumbnail base dir, for the @p size
*/
- static QString thumbnailBaseDir(int size);
+ static TQString thumbnailBaseDir(int size);
/**
@@ -145,21 +147,21 @@ signals:
/**
* Emitted when the thumbnail for the @p item has been loaded
*/
- void thumbnailLoaded(const KFileItem* item, const QPixmap&, const QSize&);
+ void thumbnailLoaded(const KFileItem* item, const TQPixmap&, const TQSize&);
private slots:
void slotResult( KIO::Job *job );
- void slotGotPreview(const KFileItem*, const QPixmap&);
+ void slotGotPreview(const KFileItem*, const TQPixmap&);
void checkThumbnail();
- void thumbnailReady(const QImage& im, const QSize&);
+ void thumbnailReady(const TQImage& im, const TQSize&);
void emitThumbnailLoadingFailed();
private:
enum { STATE_STATORIG, STATE_DOWNLOADORIG, STATE_PREVIEWJOB, STATE_NEXTTHUMB } mState;
- QValueList<const KFileItem*> mItems;
- QValueVector<const KFileItem* > mAllItems;
- QValueVector< bool > mProcessedState;
+ TQValueList<const KFileItem*> mItems;
+ TQValueVector<const KFileItem* > mAllItems;
+ TQValueVector< bool > mProcessedState;
const KFileItem *mCurrentItem;
int thumbnailIndex( const KFileItem* item ) const;
void updateItemsOrder();
@@ -171,37 +173,37 @@ private:
KURL mCurrentURL;
// The URI of the original image (might be different from mCurrentURL.url())
- QString mOriginalURI;
+ TQString mOriginalURI;
// The modification time of the original image
time_t mOriginalTime;
// The thumbnail path
- QString mThumbnailPath;
+ TQString mThumbnailPath;
// The temporary path for remote urls
- QString mTempPath;
+ TQString mTempPath;
// Thumbnail size
int mThumbnailSize;
- QPixmap mBrokenPixmap;
+ TQPixmap mBrokenPixmap;
bool mSuspended;
ThumbnailThread mThumbnailThread;
void determineNextIcon();
- void startCreatingThumbnail(const QString& path);
+ void startCreatingThumbnail(const TQString& path);
- void emitThumbnailLoaded(const QImage& img, QSize size);
+ void emitThumbnailLoaded(const TQImage& img, TQSize size);
void updateItemsOrderHelper( int forward, int backward, int first, int last );
};
inline
int ThumbnailLoadJob::thumbnailIndex( const KFileItem* item ) const {
- QValueVector<const KFileItem* >::ConstIterator pos = qFind( mAllItems.begin(), mAllItems.end(), item );
+ TQValueVector<const KFileItem* >::ConstIterator pos = tqFind( mAllItems.begin(), mAllItems.end(), item );
if( pos != mAllItems.end()) return pos - mAllItems.begin();
return -1;
}