diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp index 2add275cb..99a8ce7d8 100644 --- a/apps/launcher/datafilespage.cpp +++ b/apps/launcher/datafilespage.cpp @@ -129,21 +129,40 @@ void DataFilesPage::setupDataFiles() mPluginsTable->setContextMenuPolicy(Qt::CustomContextMenu); - // Some testing TODO TODO TODO + // TODO: Add a warning when a master is missing QDir dataFilesDir("data/"); if (!dataFilesDir.exists()) qWarning("Cannot find the plugin directory"); + // First we add all the master files from the plugin dir + dataFilesDir.setNameFilters((QStringList() << "*.esm")); // Only load masters + + QStringList masterFiles = dataFilesDir.entryList(); + + for (int i=0; i itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly); + + if (itemList.isEmpty()) // Master is not yet in the widget + { + mMastersWidget->insertRow(i); + QTableWidgetItem *item = new QTableWidgetItem(currentMaster); + mMastersWidget->setItem(i, 0, item); + } + } + + // Now on to the plugins dataFilesDir.setNameFilters((QStringList() << "*.esp")); // Only load plugins - QStringList dataFiles = dataFilesDir.entryList(); + QStringList pluginFiles = dataFilesDir.entryList(); - for (int i=0; i