Author: mir3x
Date: Fri Nov 20 17:22:33 2015
New Revision: 30718

URL: http://svn.gna.org/viewcvs/freeciv?rev=30718&view=rev
Log:
Information about other players technologies could be wrong in qt-client. 
Fixed.

See bug #24095


Modified:
    trunk/client/gui-qt/plrdlg.cpp
    trunk/client/gui-qt/plrdlg.h

Modified: trunk/client/gui-qt/plrdlg.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/plrdlg.cpp?rev=30718&r1=30717&r2=30718&view=diff
==============================================================================
--- trunk/client/gui-qt/plrdlg.cpp      (original)
+++ trunk/client/gui-qt/plrdlg.cpp      Fri Nov 20 17:22:33 2015
@@ -470,12 +470,12 @@
         tech_id = advance_number(padvance);
         if (research_invention_state(my_research, tech_id) == TECH_KNOWN
             && (research_invention_state(research, tech_id) 
-                == TECH_UNKNOWN)) {
+                != TECH_KNOWN)) {
           a++;
           sorted_list_a << research_advance_name_translation(research,
                                                              tech_id);
         }
-        if (research_invention_state(my_research, tech_id) == TECH_UNKNOWN
+        if (research_invention_state(my_research, tech_id) != TECH_KNOWN
             && (research_invention_state(research, tech_id) == TECH_KNOWN)) {
           b++;
           sorted_list_b << research_advance_name_translation(research,
@@ -521,7 +521,7 @@
                     + QString("</i>") + sp;
     }
   }
-  plr->update_report();
+  plr->update_report(false);
 }
 
 /**************************************************************************
@@ -644,8 +644,20 @@
 /**************************************************************************
   Updates widget
 **************************************************************************/
-void plr_report::update_report()
-{
+void plr_report::update_report(bool update_selection)
+{
+  QModelIndex qmi;
+
+  /* Force updating selected player information */
+  if (update_selection == true) {
+    if (qmi.isValid()){
+      plr_wdg->clearSelection();
+      plr_wdg->setCurrentIndex(qmi);
+    }
+    plr_wdg->clearSelection();
+    plr_wdg->setCurrentIndex(qmi);
+  }
+
   meet_but->setDisabled(true);
   cancel_but->setDisabled(true);
   withdraw_but->setDisabled(true);

Modified: trunk/client/gui-qt/plrdlg.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/plrdlg.h?rev=30718&r1=30717&r2=30718&view=diff
==============================================================================
--- trunk/client/gui-qt/plrdlg.h        (original)
+++ trunk/client/gui-qt/plrdlg.h        Fri Nov 20 17:22:33 2015
@@ -151,7 +151,7 @@
 public:
   plr_report();
   ~plr_report();
-  void update_report();
+  void update_report(bool update_selection = true);
   void init();
 private:
   struct player *other_player;


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

Reply via email to