diff options
| author | Tannin <devnull@localhost> | 2014-08-19 18:44:35 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-08-19 18:44:35 +0200 |
| commit | 02973be652a4fd1f161d62ff60509eed639f8d6a (patch) | |
| tree | 71d57346a470c05785c59a1b8442351b547f6840 /src/mainwindow.cpp | |
| parent | fc2591e028473c414049b3b16e9cd579703bb1c4 (diff) | |
- bugfix: mods were specified by internal name in archive and data tab
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ec945765..b28bb47b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1532,7 +1532,14 @@ void MainWindow::updateTo(QTreeWidgetItem *subTree, const std::wstring &director QStringList columns(fileName);
bool isArchive = false;
int originID = current->getOrigin(isArchive);
- QString source = ToQString(m_DirectoryStructure->getOriginByID(originID).getName());
+ FilesOrigin origin = m_DirectoryStructure->getOriginByID(originID);
+ QString source("data");
+ unsigned int modIndex = ModInfo::getIndex(ToQString(origin.getName()));
+ if (modIndex != UINT_MAX) {
+ ModInfo::Ptr modInfo = ModInfo::getByIndex(modIndex);
+ source = modInfo->name();
+ }
+
std::wstring archive = current->getArchive();
if (archive.length() != 0) {
source.append(" (").append(ToQString(archive)).append(")");
@@ -1970,12 +1977,18 @@ void MainWindow::refreshBSAList() int originID = iter->second->data(1, Qt::UserRole).toInt();
FilesOrigin origin = m_DirectoryStructure->getOriginByID(originID);
- QList<QTreeWidgetItem*> items = ui->bsaList->findItems(ToQString(origin.getName()), Qt::MatchFixedString);
+ QString modName("data");
+ unsigned int modIndex = ModInfo::getIndex(ToQString(origin.getName()));
+ if (modIndex != UINT_MAX) {
+ ModInfo::Ptr modInfo = ModInfo::getByIndex(modIndex);
+ modName = modInfo->name();
+ }
+ QList<QTreeWidgetItem*> items = ui->bsaList->findItems(modName, Qt::MatchFixedString);
QTreeWidgetItem *subItem = NULL;
if (items.length() > 0) {
subItem = items.at(0);
} else {
- subItem = new QTreeWidgetItem(QStringList(ToQString(origin.getName())));
+ subItem = new QTreeWidgetItem(QStringList(modName));
subItem->setFlags(subItem->flags() & ~Qt::ItemIsDragEnabled);
ui->bsaList->addTopLevelItem(subItem);
}
|
