From: Norbert Moutarde Date: Sat, 12 Mar 2016 20:23:04 +0000 (+0100) Subject: I've added setUserName and setPassword to download (because X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=a8b984ec02d319db1096b0374c48a5be8e0b3998;p=diary-mobile.git I've added setUserName and setPassword to download (because user:pass@host is no longer supported) --- diff --git a/mainwindow.cpp b/mainwindow.cpp index eb9857f..5dc7ea0 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -23,7 +23,6 @@ // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED // OF THE POSSIBILITY OF SUCH DAMAGE. -#include "mainwindow.h" //#include "ui_mainwindow.h" #include "mainwindow.h" #include @@ -640,7 +639,10 @@ void MainWindow::firstrun(){ conf->setValue(QString("buttonsbefore"), QVariant("background-color: red;")); conf->setValue(QString("buttonsafter"), QVariant("background-color: blue;")); conf->setValue(QString("menu"), QVariant(1)); - conf->setValue(QString("download"), QVariant("http://www.nothing2do.eu/"+conf->value(QString("filebuttons")).toString())); + conf->setValue(QString("download"), QVariant("http:////"+conf->value(QString("filebuttons")).toString())); + conf->setValue(QString("downloaduser"), QVariant("")); + conf->setValue(QString("downloadpass"), QVariant("")); + conf->setValue(QString("init"), QVariant("http://www.nothing2do.eu/init")); conf->setValue(QString("userftp"), QVariant("")); conf->setValue(QString("hostftp"), QVariant("")); @@ -1025,12 +1027,16 @@ void MainWindow::writeDB(){ void MainWindow::download(const QString & a){//keep downloaded data into m->downloadedData(). You've to connect(m, SIGNAL(downloaded()), target,SLOT(targetFunc())); qDebug()<<"download() : "<value(QString("downloaduser")).toString()); + url.setPassword(conf->value(QString("downloadpass")).toString()); m = new FileDownloader(url, this); } void MainWindow::download(const QString & a, const QString & b){//write downloaded data from "a" into "b" qDebug()<<"download("<value(QString("downloaduser")).toString()); + url.setPassword(conf->value(QString("downloadpass")).toString()); m = new FileDownloader(url, this); file=b; connect(m, SIGNAL(downloaded()), this, SLOT(writeFile()));