QTfrontend/gameuiconfig.cpp
changeset 97 e7c1df9cce2c
parent 87 ff213e443336
child 111 30ca06092a64
--- a/QTfrontend/gameuiconfig.cpp	Sun Aug 06 15:47:20 2006 +0000
+++ b/QTfrontend/gameuiconfig.cpp	Sun Aug 06 15:48:48 2006 +0000
@@ -36,27 +36,14 @@
 #include "gameuiconfig.h"
 #include "hwform.h"
 #include "pages.h"
+#include "hwconsts.h"
 
 GameUIConfig::GameUIConfig(HWForm * FormWidgets)
 	: QObject()
 {
 	Form = FormWidgets;
 
-	cfgdir.setPath(cfgdir.homePath());
-	if (!cfgdir.exists(".hedgewars"))
-	{
-		if (!cfgdir.mkdir(".hedgewars"))
-		{
-			QMessageBox::critical(0,
-					tr("Error"),
-					tr("Cannot create directory %1").arg("/.hedgewars"),
-					tr("Quit"));
-			return ;
-		}
-	}
-	cfgdir.cd(".hedgewars");
-
-	QFile settings(cfgdir.absolutePath() + "/options");
+	QFile settings(cfgdir->absolutePath() + "/options");
 	if (settings.open(QIODevice::ReadOnly))
 	{
 		QTextStream stream(&settings);
@@ -90,12 +77,12 @@
 
 QStringList GameUIConfig::GetTeamsList()
 {
-	return cfgdir.entryList(QStringList("*.cfg"));
+	return cfgdir->entryList(QStringList("*.cfg"));
 }
 
 void GameUIConfig::SaveOptions()
 {
-	QFile settings(cfgdir.absolutePath() + "/options");
+	QFile settings(cfgdir->absolutePath() + "/options");
 	if (!settings.open(QIODevice::WriteOnly))
 	{
 		QMessageBox::critical(0,