-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwidget.cpp
44 lines (38 loc) · 1.08 KB
/
widget.cpp
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
#include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
fileTransfer = new filetranser();
connect(&filewatch, SIGNAL(doFileAdded(QString)),
this, SLOT(doFileAdded(QString)));
connect(&filewatch, SIGNAL(doFileRemoved(QString)),
this, SLOT(doFileRemoved(QString)));
connect(&filewatch, SIGNAL(doFileChanged(QString)),
this, SLOT(doFileChanged(QString)));
connect(&filewatch, SIGNAL(doFileRename(QString,QString)),
this, SLOT(doFileRename(QString,QString)));
filewatch.setWatchPath("C:Users/Administrator/Desktop/test");
}
Widget::~Widget()
{
delete ui;
}
void Widget::doFileAdded(const QString &file)
{
fileTransfer->sendFile(file);
}
void Widget::doFileRemoved(const QString &file)
{
fileTransfer->sendDeleteFile(file);
}
void Widget::doFileChanged(const QString &file)
{
fileTransfer->sendFile(file);
}
void Widget::doFileRename(const QString &file, const QString &file1)
{
fileTransfer->sendRenameFile(file, file1);
}