|
Last change
on this file since 3 was 2, checked in by dmik, 19 years ago |
|
Imported original Psi 0.10 sources from Affinix
|
|
File size:
745 bytes
|
| Line | |
|---|
| 1 | #include"dwtest.h"
|
|---|
| 2 |
|
|---|
| 3 | #include<qapplication.h>
|
|---|
| 4 | #include<qfile.h>
|
|---|
| 5 |
|
|---|
| 6 | DwTest::DwTest(const QStringList &dirs)
|
|---|
| 7 | {
|
|---|
| 8 | for(QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) {
|
|---|
| 9 | DirWatch *dw = new DirWatch(*it, this);
|
|---|
| 10 | connect(dw, SIGNAL(changed()), SLOT(dw_changed()));
|
|---|
| 11 | }
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | void DwTest::dw_changed()
|
|---|
| 15 | {
|
|---|
| 16 | DirWatch *dw = (DirWatch *)sender();
|
|---|
| 17 | printf("[%s] changed\n", dw->dir().latin1());
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | int main(int argc, char **argv)
|
|---|
| 22 | {
|
|---|
| 23 | QApplication app(argc, argv);
|
|---|
| 24 |
|
|---|
| 25 | if(argc < 2) {
|
|---|
| 26 | printf("usage: dwtest dir1 dir2 ...\n\n");
|
|---|
| 27 | return 0;
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | QStringList dirList;
|
|---|
| 31 | for(int n = 1; n < argc; ++n) {
|
|---|
| 32 | QString dir = QFile::decodeName(argv[n]);
|
|---|
| 33 | dirList += dir;
|
|---|
| 34 | }
|
|---|
| 35 |
|
|---|
| 36 | DwTest *test = new DwTest(dirList);
|
|---|
| 37 | app.exec();
|
|---|
| 38 | delete test;
|
|---|
| 39 |
|
|---|
| 40 | return 0;
|
|---|
| 41 | }
|
|---|
| 42 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.