-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (27 loc) · 718 Bytes
/
main.cpp
File metadata and controls
36 lines (27 loc) · 718 Bytes
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
#include <QApplication>
#include <capt.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Capt *c = new Capt();
QObject::connect(c, SIGNAL(exitApp()), &a, SLOT(quit()));
QString url;
QString out;
for(int i = 0; i < argc; i++){
QStringList param = QString(argv[i]).split('=');
if(param.length() == 1){
continue;
}
if(param.at(0) == "--url"){
url = param.at(1);
} else if(param.at(0) == "--out"){
out = param.at(1);
}
}
if(!url.length() or !out.length()){
qDebug("missed --out or --url params");
return 0;
}
c->save(QUrl(url), out);
return a.exec();
}