diff options
author | Arno <arno@disconnect.de> | 2016-03-04 15:20:14 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2016-03-04 15:20:14 +0100 |
commit | 793be3195e387179510b8f6fa61d9b4b79511d0d (patch) | |
tree | 7b253bad5410f17998c9e45050796d216cb8a28e /copyworker.h | |
parent | fa17037f24ec8ced526effb8226f8c27da04cfbb (diff) | |
download | SheMov-793be3195e387179510b8f6fa61d9b4b79511d0d.tar.gz SheMov-793be3195e387179510b8f6fa61d9b4b79511d0d.tar.bz2 SheMov-793be3195e387179510b8f6fa61d9b4b79511d0d.zip |
First version of CopyWorker
Preparation for archiving Movies to an USB disk:
Implement CopyWorker: a QThread for copying files in the background. It
compiles, nothing more, so expect bugs!
Diffstat (limited to 'copyworker.h')
-rw-r--r-- | copyworker.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/copyworker.h b/copyworker.h new file mode 100644 index 0000000..fed3631 --- /dev/null +++ b/copyworker.h @@ -0,0 +1,38 @@ +/* + 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 COPYWORKER_H +#define COPYWORKER_H + +#include <QThread> +#include <QString> +#include <QStringList> +#include <QMutex> + +class CopyWorker : public QThread { + Q_OBJECT + public: + CopyWorker(QObject *parent = 0); + void setDestination(const QString &destDir); + void addSource(const QString &path); + void clear(); + virtual void run(); + + signals: + void success(QString); + void bytesRead(int); + void processint(QString); + void error(QString); + + private: + QStringList mSources; + QString mDest; + QMutex mSourceMx; + int mMax; +}; + +#endif // COPYWORKER_H |