Author: mir3x
Date: Sat Dec 31 10:13:05 2016
New Revision: 34751

URL: http://svn.gna.org/viewcvs/freeciv?rev=34751&view=rev
Log:
Qt client - fixed current theme not set as current in options

See bug #25404


Modified:
    branches/S2_6/client/gui-qt/themes.cpp

Modified: branches/S2_6/client/gui-qt/themes.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/themes.cpp?rev=34751&r1=34750&r2=34751&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/themes.cpp      (original)
+++ branches/S2_6/client/gui-qt/themes.cpp      Sat Dec 31 10:13:05 2016
@@ -67,7 +67,7 @@
   f.setFileName(name);
 
   if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
-    if (QString(theme_name) != QString("NightStalker")) {
+    if (QString(theme_name) != QString(FC_QT_DEFAULT_THEME_NAME)) {
       qtg_gui_clear_theme();
     }
     return;
@@ -105,7 +105,7 @@
   str = QString("themes") + DIR_SEPARATOR + "gui-qt" + DIR_SEPARATOR;
   name = fileinfoname(get_data_dirs(), str.toLocal8Bit().data());
   qtg_gui_load_theme(name.toLocal8Bit().data(),
-                     "NightStalker");
+                     FC_QT_DEFAULT_THEME_NAME);
 }
 
 /*****************************************************************************
@@ -139,6 +139,7 @@
   QByteArray qba;;
   QString str;
   QString name;
+  QString qtheme_name;
   QDir dir;
   QFile f;
 
@@ -156,7 +157,13 @@
     }
     theme_list << str;
   }
-  
+
+  qtheme_name = gui_options.gui_qt_default_theme_name;
+  /* move current theme on first position */
+  if (theme_list.contains(qtheme_name)) {
+    theme_list.removeAll(qtheme_name);
+    theme_list.prepend(qtheme_name);
+  }
   array = new char *[theme_list.count()];
   *count = theme_list.count();
 
@@ -166,6 +173,6 @@
     strcpy(data, theme_list[i].toLocal8Bit().data());
     array[i] = data;
   }
-  
+
   return array;
 }


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

Reply via email to