summaryrefslogtreecommitdiff
path: root/src/profile.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-07-21 19:14:24 +0200
committerTannin <devnull@localhost>2014-07-21 19:14:24 +0200
commit0050cb07409d775efe14e728c1cef4a2c33aa1db (patch)
treeed3eb9363aa35617f0dd92c4746bf14e032d010f /src/profile.cpp
parentf6ef5477e718b14af99bd22436f66dee0b9d22cd (diff)
- download-list will no longer show a file as having incomplete data if there is no file version
- added a new mod column with icons displaying the content of the mod - MO now differentiates between mods using an internal name that disambiguates between foreign and regular mods
Diffstat (limited to 'src/profile.cpp')
-rw-r--r--src/profile.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/profile.cpp b/src/profile.cpp
index fbfb3266..ca47d327 100644
--- a/src/profile.cpp
+++ b/src/profile.cpp
@@ -265,22 +265,23 @@ void Profile::refreshModStatus()
modName = QString::fromUtf8(line.trimmed().constData());
}
if (modName.size() > 0) {
- if (namesRead.find(modName) != namesRead.end()) {
+ QString lookupName = modName + (line.at(0) == '*' ? ModInfoForeign::INT_IDENTIFIER : "");
+ if (namesRead.find(lookupName) != namesRead.end()) {
continue;
} else {
- namesRead.insert(modName);
+ namesRead.insert(lookupName);
}
- unsigned int modindex = ModInfo::getIndex(modName);
- if (modindex != UINT_MAX) {
- ModInfo::Ptr info = ModInfo::getByIndex(modindex);
- if ((modindex < m_ModStatus.size())
+ unsigned int modIndex = ModInfo::getIndex(lookupName);
+ if (modIndex != UINT_MAX) {
+ ModInfo::Ptr info = ModInfo::getByIndex(modIndex);
+ if ((modIndex < m_ModStatus.size())
&& (info->getFixedPriority() == INT_MIN)) {
- m_ModStatus[modindex].m_Enabled = enabled || info->alwaysEnabled();
- if (m_ModStatus[modindex].m_Priority == -1) {
+ m_ModStatus[modIndex].m_Enabled = enabled || info->alwaysEnabled();
+ if (m_ModStatus[modIndex].m_Priority == -1) {
if (static_cast<size_t>(index) >= m_ModStatus.size()) {
throw MyException(tr("invalid index %1").arg(index));
}
- m_ModStatus[modindex].m_Priority = index++;
+ m_ModStatus[modIndex].m_Priority = index++;
}
} else {
qDebug("mod \"%s\" (profile \"%s\") not found",
@@ -381,7 +382,7 @@ std::vector<std::tuple<QString, QString, int> > Profile::getActiveMods()
iter != m_ModIndexByPriority.end(); ++iter) {
if ((*iter != UINT_MAX) && m_ModStatus[*iter].m_Enabled) {
ModInfo::Ptr modInfo = ModInfo::getByIndex(*iter);
- result.push_back(std::make_tuple(modInfo->name(), modInfo->absolutePath(), m_ModStatus[*iter].m_Priority));
+ result.push_back(std::make_tuple(modInfo->internalName(), modInfo->absolutePath(), m_ModStatus[*iter].m_Priority));
}
}