From: Norbert Moutarde Date: Mon, 17 Aug 2015 10:21:54 +0000 (+0200) Subject: val is now useable (but "val list" is inherently false) X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=0d1223aa7de539c5a3a77be2a88ae1d7aaf40213;p=diary-mobile.git val is now useable (but "val list" is inherently false) --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 0f1e862..4660929 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -165,8 +165,12 @@ int unsigned MainWindow::addWidget(const QString &key, const CLabel *a){ if(key.contains(QString("idem"))){ key.replace(QString("idem"), a->text()); } - for(QMap::iterator b=valeur->begin();b!=valeur->end();++b){ - if(key.contains(b.key()))key.replace(b.key(), b.value()); + for(QMap::iterator b=valeur->begin();b!=valeur->end();b++){ + if(key.contains(b.key())){//key.replace(b.key(), b.value()); + QString keybefore=key; + QString keyafter=key.replace(b.key(), b.value()); + if(deb)QMessageBox::information(this, trUtf8("valeur replace", "box title to debug valeur replace"), QString(keybefore+"->"+keyafter)); + } } int c=grid->count(), maxc=conf->value(QString("maxcolumn")).toInt(), maxl=conf->value(QString("maxline")).toInt(); grid->addWidget(a, c/maxc, c%maxc, 1, 1, Qt::AlignJustify| Qt::AlignVCenter | Qt::AlignHCenter); @@ -277,7 +281,7 @@ void MainWindow::action(const QString &a){ 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,true); + else tmp=q->seek(-t-max-1,true); if(deb)QMessageBox::information(this, trUtf8("result", "box title to debug prevpage"), int(tmp)); printItem(); @@ -438,8 +442,8 @@ void MainWindow::action(const QString &a){ QList tmpkeys=valeur->keys(); QList tmpvalues=valeur->values(); for(int a=0;asize();a++){ - addWidget(tmpkeys[a], new CLabel(tmpvalues[a], *conf)); - if(deb)QMessageBox::information(this, QString("val"), QString("list val")); + addWidget(QString("box "+tmpkeys[a]), new CLabel(tmpvalues[a], *conf)); + if(deb)QMessageBox::information(this, QString("val"), QString(tmpkeys[a]+"=="+tmpvalues[a])); } }else{ for(int a=0;a<((bs-1)/2); a++){ @@ -456,7 +460,7 @@ void MainWindow::action(const QString &a){ else if(b[0]==QString("add")){ addDB(c); } - else if (b[0]==QString("hack")){ + else if (b[0]==QString("hac")){ if (c=="")action(); else action(c); }