patch by nemo: quick change from 0 to infinite and vice versa
authorunc0rr
Thu, 12 Mar 2009 13:55:47 +0000
changeset 1886 0bb8f61e5630
parent 1885 75489216b5b0
child 1887 d68939b3f7f0
patch by nemo: quick change from 0 to infinite and vice versa
QTfrontend/itemNum.cpp
--- a/QTfrontend/itemNum.cpp	Thu Mar 12 13:54:32 2009 +0000
+++ b/QTfrontend/itemNum.cpp	Thu Mar 12 13:55:47 2009 +0000
@@ -37,16 +37,20 @@
   if(nonInteractive) return;
   if(event->button()==Qt::LeftButton) {
     event->accept();
-    if(infinityState && numItems==maxItems) {
+    if((infinityState && numItems <= maxItems) || (!infinityState && numItems < maxItems)) {
       incItems();
-    }
-    if(numItems < maxItems) {
-      incItems();
+    } else {
+      numItems = minItems+1;
+      // appears there's an emit in there
+      decItems();
     }
   } else if (event->button()==Qt::RightButton) {
     event->accept();
     if(numItems > minItems) {
       decItems();
+    } else {
+      numItems = maxItems+(infinityState?0:-1);
+      incItems();
     }
   } else {
     event->ignore();