--- a/QTfrontend/pagetraining.cpp Sun Jun 12 14:45:26 2011 -0400
+++ b/QTfrontend/pagetraining.cpp Sun Jun 12 21:06:48 2011 -0400
@@ -35,10 +35,21 @@
CBSelect = new QComboBox(this);
QDir tmpdir;
+ tmpdir.cd(cfgdir->absolutePath());
+ tmpdir.cd("Data/Missions/Training");
+ tmpdir.setFilter(QDir::Files);
+ QStringList userlist = tmpdir.entryList(QStringList("*.lua")).replaceInStrings(QRegExp("^(.*)\\.lua"), "\\1");
+ CBSelect->addItems(userlist);
+
tmpdir.cd(datadir->absolutePath());
tmpdir.cd("Missions/Training");
tmpdir.setFilter(QDir::Files);
- CBSelect->addItems(tmpdir.entryList(QStringList("*.lua")).replaceInStrings(QRegExp("^(.*)\\.lua"), "\\1"));
+ QStringList tmplist = tmpdir.entryList(QStringList("*.lua")).replaceInStrings(QRegExp("^(.*)\\.lua"), "\\1");
+ QStringList datalist;
+ for (QStringList::Iterator it = tmplist.begin(); it != tmplist.end(); ++it)
+ if (!userlist.contains(*it,Qt::CaseInsensitive)) datalist.append(*it);
+ CBSelect->addItems(datalist);
+
for(int i = 0; i < CBSelect->count(); i++)
{
CBSelect->setItemData(i, CBSelect->itemText(i));