~ubuntu-branches/ubuntu/edgy/psi/edgy

« back to all changes in this revision

Viewing changes to cutestuff/dwtest.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2005-09-14 16:33:49 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050914163349-3zacov4afysz5cw5
Tags: 0.9.3-2ubuntu1
* Sync with debian
* Applied patch to psi.desktop to start psi without gpg-agent use (known
  issue)
* Updated README.Debian

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