updateUi();
conf->setValue(QString("first"), 2);
};
- QFile sav(conf->value(QString("buttonfile")).toString());
- if((sav.exists())&&(conf->value(QString("first")).toInt()!=1)){
- sav.open(QIODevice::ReadOnly);
- data=sav.readAll();
- sav.close();
- }
statusBar()->addPermanentWidget(label);
menuBar()->setVisible(conf->value(QString("menu")).toBool());
start();
conf->setValue(QString("buttonfile"), QVariant("ui.sql"));
conf->setValue(QString("maxcolumn"), QVariant(2));
conf->setValue(QString("maxline"), QVariant(5));
- conf->setValue(QString("SQLsettings"), QVariant("requiressl=1 connect_timeout=10000"));
+ conf->setValue(QString("SQLsettings"), QVariant("connect_timeout=10000"));
conf->setValue(QString("button"), QVariant("background-color: red;border-style: outset;border-width: 7px;border-radius: 10px;border-color: beige;font: bold 15px;padding: 6px;"));
conf->setValue(QString("menu"), QVariant(1));
conf->setValue(QString("download"), QVariant("https://raw.github.com/Nothing2Do/diary-mobile-android/master/ui.sql"));
QFile fichier(conf->value(QString("file")).toString());
fichier.open(QIODevice::Append | QIODevice::Text);
QTextStream flux(&fichier);
- flux << label << entry << endl;
+ flux << time << c << endl;
fichier.close();
- QList<QString> d({"INSERT INTO raw (date, texte) VALUES (:date, :txt);", time, entry});
+ QList<QString> d({"INSERT INTO raw (date, texte) VALUES (:date, :txt);", time, c});
exec(d);
QSqlError b=q->lastError();
if (b.isValid())qDebug()<<"q->lastError():"<<b.text();
if ((a=="")||(ok==0))return;
cmd.append(a);
exec(cmd);
- data.append(c).append('$').append(b).append('$').append(a).append('\n');
+ //data.append(c).append('$').append(b).append('$').append(a).append('\n');
//savButtons();
return;
}
net=new QNetworkAccessManager(this);
QFile b(conf->value(QString("database")).toString());
b.open(QIODevice::ReadOnly);
+ //QDataStream c(b.readAll());
rep=net->put(QNetworkRequest(upload), b.readAll());
- qDebug()<<"net->put : "<<rep;
+ qDebug()<<"net->put : "<<rep<< " upload : "<<upload.url();
//rep=net->put(QNetworkRequest(upload),data);
connect(rep, SIGNAL(finished()), this, SLOT(datasend()));
}
};
db.commit();
- data=in;
emit datafilled();
}
void MainWindow::datasend(){
qDebug()<<"datasend";
- QString texte="Upload finish"/*, s=m->downloadedData().size()*/;
- //texte=texte+s.toInt()+" byte)";
+ QString texte="Upload finish : ";
+ texte=texte+conf->value(QString("upload")).toString();
qDebug()<<"texte : "<<texte;
QMessageBox::information(this, "upload", texte);