]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
few bug with the new "page" function
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Wed, 3 Jun 2015 12:08:56 +0000 (14:08 +0200)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Wed, 3 Jun 2015 12:08:56 +0000 (14:08 +0200)
mainwindow.cpp

index 44cef52af1c47d696f165f8efe2de3ce54ae7b12..2ba9746a1dd5f845d24387984a0ad702ab677cd7 100644 (file)
@@ -172,15 +172,10 @@ int unsigned MainWindow::addWidget(const QString &key, const CLabel *a){
     grid->addWidget(a, c/maxc, c%maxc, 1, 1, Qt::AlignJustify| Qt::AlignVCenter | Qt::AlignHCenter);
     QObject::connect(a, SIGNAL(released()), signalmap, SLOT(map()));
     signalmap->setMapping(a, key);
-    //if(c==(maxc*maxl)-1)return 1;
+    if(c==(maxc*maxl)-2)return 1;
 
     //(p-1)*(ml*mc)+c nombre de boutons en tout osef,
-    if((c==((maxc*maxl)-1))&&(!np)){
-        np=1;
-        CLabel * next=new CLabel(QString("Next page"), *conf);
-        addWidget(QString("nextpage"), next);
-        return 1;
-    }
+
 
     return 0;
 }
@@ -696,6 +691,7 @@ void MainWindow::get(const QString & d, const QString &b){
     QList<QString> tmp({x, c});
     label->setText(a);
     exec(tmp);
+    page=0;
     //while(q->next()){
          printItem();
     //}
@@ -1162,10 +1158,14 @@ bool MainWindow::printItem(){
     qDebug()<<"printItem()";
     if(page){
         addWidget(QString("prevpage"), new CLabel(trUtf8("Prev."), *conf));
+
     };
     while(q->next()){
         int tmp=addWidget(q->value(actCol).toString(), new CLabel(q->value(labCol).toString(), *conf));
-        if(tmp==1)return 1;
+        if(tmp==1){
+            addWidget(QString("nextpage"), new CLabel(trUtf8("Next."), *conf));
+            break;
+        };
         i++;
     };
     //grid->update();