Author: mir3x
Date: Sun Sep 14 20:08:03 2014
New Revision: 26414

URL: http://svn.gna.org/viewcvs/freeciv?rev=26414&view=rev
Log:
If there is no item selected on worklist, then it will be assumed its first 
item.

See patch #5219



Modified:
    branches/S2_5/client/gui-qt/citydlg.cpp

Modified: branches/S2_5/client/gui-qt/citydlg.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-qt/citydlg.cpp?rev=26414&r1=26413&r2=26414&view=diff
==============================================================================
--- branches/S2_5/client/gui-qt/citydlg.cpp     (original)
+++ branches/S2_5/client/gui-qt/citydlg.cpp     Sun Sep 14 20:08:03 2014
@@ -2861,7 +2861,7 @@
       break;
     case 1:                 /* Change current (selected on list)*/
       if (curr_selection < 0 || curr_selection > worklist_length(&queue)) {
-        return;
+        curr_selection = 0;
       }
       worklist_remove(&queue, curr_selection);
       worklist_insert(&queue, *target, curr_selection);
@@ -2869,7 +2869,7 @@
       break;
     case 2:                 /* Insert before */
       if (curr_selection < 0 || curr_selection > worklist_length(&queue)) {
-        return;
+        curr_selection = 0;
       }
       curr_selection--;
       curr_selection = qMax(0, curr_selection);
@@ -2878,7 +2878,7 @@
       break;
     case 3:                 /* Insert after */
       if (curr_selection < 0 || curr_selection > worklist_length(&queue)) {
-        return;
+        curr_selection = 0;
       }
       curr_selection++;
       worklist_insert(&queue, *target, curr_selection);


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to