QTfrontend/hwform.cpp
changeset 44 1ef9546971ff
parent 43 e297fea1a2f3
child 45 1072e7fe85c8
equal deleted inserted replaced
43:e297fea1a2f3 44:1ef9546971ff
   113 		}
   113 		}
   114 	}
   114 	}
   115 	cfgdir.cd(".hedgewars");
   115 	cfgdir.cd(".hedgewars");
   116 
   116 
   117 	list = cfgdir.entryList(QStringList("*.cfg"));
   117 	list = cfgdir.entryList(QStringList("*.cfg"));
       
   118 
       
   119 	if(list.empty()) {
       
   120 	  HWTeam defaultTeam("DefaultTeam");
       
   121 	  defaultTeam.SetCfgDir(cfgdir.absolutePath());
       
   122 	  defaultTeam.SaveToFile();
       
   123 	  list.push_back("DefaultTeam");
       
   124 	}
       
   125 
   118 	for (QStringList::Iterator it = list.begin(); it != list.end(); ++it )
   126 	for (QStringList::Iterator it = list.begin(); it != list.end(); ++it )
   119 	{
   127 	{
   120 		ui.CBTeamName->addItem((*it).replace(QRegExp("^(.*).cfg$"), "\\1"));
   128 		ui.CBTeamName->addItem((*it).replace(QRegExp("^(.*).cfg$"), "\\1"));
   121 	}
   129 	}
   122 
       
   123 
   130 
   124 	QFile settings(cfgdir.absolutePath() + "/options");
   131 	QFile settings(cfgdir.absolutePath() + "/options");
   125 	if (settings.open(QIODevice::ReadOnly))
   132 	if (settings.open(QIODevice::ReadOnly))
   126 	{
   133 	{
   127 		QTextStream stream(&settings);
   134 		QTextStream stream(&settings);