qDebug()<<"createDB()";
exec(QList<QString>({"create table ui(keyword text, label text, action text);"}));
exec(QList<QString>({"create table raw(date timestamp, texte text);"}));
- exec(QList<QString>({"insert into ui (keyword, label, action) values ('begin', 'new', 'new')"}));
}
void MainWindow::addButtonDB(){
qDebug()<<"addButtonDB()";
QUrl update(conf->value(QString("update")).toString());
m = new FileDownloader(update, this);
connect(m, SIGNAL(downloaded()), SLOT(writeUpdate()));
-
+ start();
}
void MainWindow::writeUpdate(){
qDebug()<<"downloaded : "<<m->downloadedData().size()<<" byte";
/* put newly downloaded sql file into database */
- //int nb=m->downloadedData().count(";");
int a=m->downloadedData().count(';');
for(int i=0; i<a; i++){
qDebug()<<"q->prepare("<<i<<") : "<< q->prepare(m->downloadedData().split(';').at(i));
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
+INSERT INTO "ui" (keyword, label, action) VALUES('begin','new', 'new');
INSERT INTO "ui" (keyword, label, action) VALUES('begin','fille','fille');
INSERT INTO "ui" (keyword, label, action) VALUES('fille','aurelie','f-aurelie');
INSERT INTO "ui" (keyword, label, action) VALUES('fill-aurelie','discours','f-a-discours');
INSERT INTO "ui" (keyword, label, action) VALUES('lie-odysseum','oliver''s pub','lie-odysseu-oliver');
INSERT INTO "ui" (keyword, label, action) VALUES('lie-odysseu-oliver','valentine','l-o-opub-val');
INSERT INTO "ui" (keyword, label, action) VALUES('lie-odysseu-opub-val','s''enerve quand je lui demande ce qu''elle veut','begin');
-INSERT INTO "ui" (keyword, label, action) VALUES('begin','olìver'' s','begi-oliver ');
+INSERT INTO "ui" (keyword, label, action) VALUES('begin','oliver'' s','begi-oliver ');
INSERT INTO "ui" (keyword, label, action) VALUES('begi-oliver','audrey','begi-olive-audrey');
INSERT INTO "ui" (keyword, label, action) VALUES('begi-olive-audrey','Pourquoi vous me prenez pour un perver ?','begi-olive-audre-perver');
INSERT INTO "ui" (keyword, label, action) VALUES('begi-olive-audre-perver','"On ne te prends pas pour un perver."','begi-olive-audre-perve-non');