]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
back now works
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Thu, 19 Jun 2014 09:12:15 +0000 (11:12 +0200)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Thu, 19 Jun 2014 09:12:15 +0000 (11:12 +0200)
mainwindow.cpp

index 37e40462317ce86188a5c3421a9774c0f47ce25b..f91a6501fdf003538d5416fa5a5f5cdfa68c47bb 100644 (file)
@@ -157,7 +157,7 @@ void MainWindow::action(const QString &a){
     if(deb)QMessageBox::information(this, trUtf8("action", "box title to debug action"), a);
     QStringList b=a.split(QString(" "));
     QString c=a;
-    bool ok;
+    bool ok=1;
     c.remove(0,4);
     int bs=b.size(), part=a.count(conf->value(QString("sepcmd")).toString());
     if(part){
@@ -227,11 +227,12 @@ void MainWindow::action(const QString &a){
         sav(c);
     }
     else if(b[0]==QString("back")){
-        if(way.size()>=1){
+        if(way.size()>1){
             int e;
-            if(bs>1)e=b[2].toInt(&ok);
+            if(bs==2)e=b[1].toInt(&ok);
             else e=1;
-            for(int bcl=1;bcl<e;bcl++){
+            if(!ok)return;
+            for(int bcl=0;bcl<e;bcl++){
                 way.removeLast();
             }
         }else{