-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathuploadthread.h
65 lines (46 loc) · 1.14 KB
/
uploadthread.h
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
57
58
59
60
61
62
63
64
#ifndef UPLOADTHREAD_H
#define UPLOADTHREAD_H
#include <QtCore>
#include <QThread>
extern "C" {
#include <libssh2.h>
#include <libssh2_sftp.h>
}
class UploadThread : public QThread
{
Q_OBJECT
void run();
signals:
void uploadMessage(const QString &e);
void blockSent();
void nBlocks(int);
void uploadFinished();
void passwordRequested();
public slots:
void setPreferences(const QString &, const QString &,
const QString &);
void setPassword(const QString &);
public:
UploadThread(QString directory);
private:
bool processFile(LIBSSH2_SFTP *, const QString &);
bool checkDirectory(LIBSSH2_SFTP *, const QString &);
LIBSSH2_AGENT * trySshAgent(LIBSSH2_SESSION *);
LIBSSH2_AGENT * shutdownAgent(LIBSSH2_AGENT *);
/// local directory to upload
QString directory;
int buffersize;
QString server_ip;
QString server_path;
QString username;
QString server_path_user;
QString server_path_meeting;
QString password;
QWaitCondition passwordNeeded;
QMutex mutex;
};
#endif // UPLOADTHREAD_H
// Local Variables:
// mode: c++
// c-basic-offset: 4
// End: