Oops, fix the build
authorunc0rr
Fri, 12 Jan 2007 16:04:45 +0000
changeset 321 1148eeb0557e
parent 320 1ee7f087195a
child 322 e7175ae57945
Oops, fix the build
QTfrontend/gameuiconfig.cpp
QTfrontend/gameuiconfig.h
QTfrontend/hwconsts.h.in
QTfrontend/main.cpp.in
--- a/QTfrontend/gameuiconfig.cpp	Fri Jan 12 15:23:16 2007 +0000
+++ b/QTfrontend/gameuiconfig.cpp	Fri Jan 12 16:04:45 2007 +0000
@@ -17,7 +17,6 @@
  */
 
 #include <QMessageBox>
-#include <QTextStream>
 #include "gameuiconfig.h"
 #include "hwform.h"
 #include "pages.h"
--- a/QTfrontend/gameuiconfig.h	Fri Jan 12 15:23:16 2007 +0000
+++ b/QTfrontend/gameuiconfig.h	Fri Jan 12 16:04:45 2007 +0000
@@ -20,7 +20,6 @@
 #define GAMECONFIG_H
 
 #include <QSettings>
-#include <QDir>
 #include <QStringList>
 
 class HWForm;
--- a/QTfrontend/hwconsts.h.in	Fri Jan 12 15:23:16 2007 +0000
+++ b/QTfrontend/hwconsts.h.in	Fri Jan 12 16:04:45 2007 +0000
@@ -28,5 +28,6 @@
 extern QDir * cfgdir;
 extern QDir * datadir;
 extern QDir * bindir;
+extern QStringList * Themes;
 
 const QString cProtoVer("${HEDGEWARS_PROTO_VER}");
--- a/QTfrontend/main.cpp.in	Fri Jan 12 15:23:16 2007 +0000
+++ b/QTfrontend/main.cpp.in	Fri Jan 12 16:04:45 2007 +0000
@@ -22,12 +22,14 @@
 #include <QMessageBox>
 #include <QFileInfo>
 #include <QDateTime>
+#include <QTextStream>
 #include "hwform.h"
 #include "hwconsts.h"
 
 QDir * bindir;
 QDir * cfgdir;
 QDir * datadir;
+QStringList * Themes;
 
 bool checkForDir(const QString & dir)
 {
@@ -80,6 +82,20 @@
 		return 1;
 	}
 
+	Themes = new QStringList();
+	QFile themesfile(datadir->absolutePath() + "/Themes/themes.cfg");
+	if (themesfile.open(QIODevice::ReadOnly)) {
+		QTextStream stream(&themesfile);
+		QString str;
+		while (!stream.atEnd())
+		{
+			Themes->append(stream.readLine());
+		}
+		themesfile.close();
+	} else {
+		QMessageBox::critical(0, "Error", "Cannot access themes.cfg", "OK");
+	}
+
 	HWForm *Form = new HWForm();
 	Form->show();
 	return app.exec();