summaryrefslogtreecommitdiffstats
path: root/ksquirrel/sq_downloader.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-22 19:31:25 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-22 19:31:25 +0000
commit6afd9d8dddbe9e450690e05d498a503c00333a5e (patch)
treeee3eaca74e8e33dd66f24f5fb6c1431d7a9ff429 /ksquirrel/sq_downloader.h
downloadksquirrel-6afd9d8dddbe9e450690e05d498a503c00333a5e.tar.gz
ksquirrel-6afd9d8dddbe9e450690e05d498a503c00333a5e.zip
Added KDE3 version of ksquirrel photo manager
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ksquirrel@1094446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksquirrel/sq_downloader.h')
-rw-r--r--ksquirrel/sq_downloader.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/ksquirrel/sq_downloader.h b/ksquirrel/sq_downloader.h
new file mode 100644
index 0000000..a51649f
--- /dev/null
+++ b/ksquirrel/sq_downloader.h
@@ -0,0 +1,73 @@
+/***************************************************************************
+ sq_downloader.h - description
+ -------------------
+ begin : Fri Jun 07 2007
+ copyright : (C) 2007 by Baryshev Dmitry
+ email : ksquirrel.iv@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef SQ_DOWNLOADER_H
+#define SQ_DOWNLOADER_H
+
+#include <qobject.h>
+#include <qdatetime.h>
+
+#include <kurl.h>
+
+class KFileItem;
+class KTempFile;
+
+namespace KIO { class Job; }
+
+class SQ_Downloader : public QObject
+{
+ Q_OBJECT
+
+ public:
+ SQ_Downloader(QObject *parent = 0, const char *name = 0);
+ ~SQ_Downloader();
+
+ void start(KFileItem *fi);
+
+ bool error() const;
+
+ void clean();
+
+ void kill();
+
+ signals:
+ void result(const KURL &);
+ void percents(int);
+
+ private slots:
+ void slotData(KIO::Job *job, const QByteArray &data);
+ void slotDataResult(KIO::Job *);
+
+ private:
+ KIO::Job *job;
+ KURL mEmptyURL, mURL;
+ KTempFile *tmp;
+ KIO::filesize_t totalSize, size;
+ bool continueDownload;
+ bool nomime;
+ bool m_error, m_lightmode;
+ QTime startTime;
+ bool emitPercents;
+};
+
+inline
+bool SQ_Downloader::error() const
+{
+ return m_error;
+}
+
+#endif