else if(b[0]==QString("new")){
entry(c);
}
- else if(b[0]==QString("a/b")){
- bool ok;
- QString e=QInputDialog::getItem(this, trUtf8("choice", "title of box who ask multiple choice"), trUtf8("Please choose an action.", "text to ask multiple choice"), c.split(conf->value(QString("sepchc")).toString()), 0, 0, &ok);
- if(ok)action(e);
+ else if(b[0]==QString("cmd")){
+ system(c.toStdString().c_str());
+
}
else if(b[0]==QString("sav")){
sav(c);
conf->setValue(QString("lastdownload"), QDateTime::currentDateTime().toString(Qt::ISODate));
}
void MainWindow::sendRAW(){
- //sav(QString("raw"))
+ //sav(QString("raw")), it's the new way to "sendRAW"
exec(QList<QString> ({conf->value(QString("selectraw")).toString()}));
QFile a(conf->value(QString("fileraw")).toString());
a.open(QIODevice::WriteOnly/*|QIODevice::Text*/);
system("su");
disconnect(m, SIGNAL(downloaded()));
QFile a(conf->value(QString("db")).toString());
- a.open(QIODevice::WriteOnly | QIODevice::Text);
+ a.open(QIODevice::WriteOnly);
QDataStream b(&a);
b<<m->downloadedData();
system("exit");
}
-void MainWindow::download(const QString & a){
+void MainWindow::download(const QString & a){//keep downloaded data into m->downloadedData(). You've to connect(m, SIGNAL(downloaded()), target,SLOT(targetFunc()));
qDebug()<<"download() : "<<a;
QUrl url(a);
m = new FileDownloader(url, this);
}
-void MainWindow::download(const QString & a, const QString & b){
+void MainWindow::download(const QString & a, const QString & b){//write downloaded data into "b"
qDebug()<<"download("<<a<<") in "<<b;
d.lock();
QUrl url(a);