summaryrefslogtreecommitdiff
path: root/plugins-alternative/CopyEngine/Rsync/MkPath.h
blob: 5d00d600e991edbb1c3f24dae046f9b76d54f5dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/** \file MkPath.h
\brief Make the path given as queued mkpath
\author alpha_one_x86
\version 0.3
\date 2011 */

#ifndef MKPATH_H
#define MKPATH_H

#include <QThread>
#include <QFileInfo>
#include <QString>
#include <QSemaphore>
#include <QStringList>
#include <QDir>

#include "Environment.h"

/// \brief Make the path given as queued mkpath
class MkPath : public QThread
{
	Q_OBJECT
public:
	explicit MkPath();
	~MkPath();
	/// \brief add path to make
	void addPath(const QString &path);
signals:
	void errorOnFolder(const QFileInfo &,const QString &);
	void firstFolderFinish();
	void internalStartAddPath(const QString &path);
	void internalStartDoThisPath();
	void internalStartSkip();
	void internalStartRetry();
	void debugInformation(const DebugLevel &level,const QString &fonction,const QString &text,const QString &file,const int &ligne);
public slots:
	/// \brief skip after creation error
	void skip();
	/// \brief retry after creation error
	void retry();
private:
	void run();
	bool waitAction;
	bool stopIt;
	bool skipIt;
	QStringList pathList;
	void checkIfCanDoTheNext();
	QDir dir;
private slots:
	void internalDoThisPath();
	void internalAddPath(const QString &path);
	void internalSkip();
	void internalRetry();
};

#endif // MKPATH_H