Changeset View
Changeset View
Standalone View
Standalone View
tests/testblockingapp.cpp
- This file was added.
1 | | ||||
---|---|---|---|---|---|
2 | #include <QApplication> | ||||
3 | #include <QObject> | ||||
4 | #include <blockingapp.h> | ||||
5 | #include <QDebug> | ||||
6 | | ||||
7 | int main(int argc, char **argv) | ||||
8 | { | ||||
9 | QApplication app(argc, argv); | ||||
10 | | ||||
11 | BlockingApp *blocking = new BlockingApp(); | ||||
12 | | ||||
13 | const QObject *test = new QObject(); | ||||
14 | test->connect(blocking, &BlockingApp::blockingAppsReady, test, [=](const QStringList &apps) { | ||||
15 | qDebug() << apps; | ||||
16 | }); | ||||
17 | | ||||
18 | // insert a filename open by tail -f for instance to test | ||||
19 | QString fileName = "/home/meven/test-file"; | ||||
20 | blocking->queryBlockingApps(fileName); | ||||
21 | | ||||
22 | return app.exec(); | ||||
23 | } |