From: Norbert Moutarde Date: Wed, 27 Jan 2016 09:55:18 +0000 (+0100) Subject: introduce a new bug (correlated to an empty "previous" buttons), but X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=7daf27e6f6c3072f07eeadcc5dcbb6c58cf1b5d6;p=diary-mobile.git introduce a new bug (correlated to an empty "previous" buttons), but next/prev page is now working ! --- diff --git a/mainwindow.cpp b/mainwindow.cpp index b5a3f22..a80b1c5 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -281,13 +281,11 @@ void MainWindow::action(const QString &a){ else if(b[0]==QString("prevpage")){ qDebug()<<"page="<<--page; bool tmp; - //int u=page-1; - int t=grid->count(); flush(); int max=conf->value(QString("maxcolumn")).toInt()*conf->value(QString("maxline")).toInt(); if(!page)tmp=q->seek(0); - else tmp=q->seek(-t-max-1,true); + else tmp=q->seek(page*(max-2)); if(deb)QMessageBox::information(this, trUtf8("result", "box title to debug prevpage"), int(tmp)); printItem(*q); @@ -1241,14 +1239,14 @@ bool MainWindow::printItem(const QSqlQuery & a){ addWidget(QString("prevpage"), new CLabel(trUtf8("Prev"), *conf)); }; - while(a.next()){ + do{ int tmp=addWidget(a.value(actCol).toString(), new CLabel(a.value(labCol).toString(), *conf)); if(tmp==1){ addWidget(QString("nextpage"), new CLabel(trUtf8("Next"), *conf)); return 1; }; i++; - }; + }while(a.next()); //grid->update(); //scroll->updateGeometry(); //screen->updateGeometry();