~ubuntu-branches/ubuntu/oneiric/psi/oneiric

« back to all changes in this revision

Viewing changes to cutestuff/dwtest.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2005-01-10 17:41:43 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050110174143-ltocv5zapl6blf5d
Tags: 0.9.3-1
* New upstream release
* Cleaned up debian/rules (some things are done by upstream Makefiles now)
* Fixed some lintian warnings:
  - removed executable bit from some .png files
  - moved psi.desktop to /usr/share/applications
* Updated menu files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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