From 84c66727bff954fd0820fc9f33833848496e9531 Mon Sep 17 00:00:00 2001 From: Tannin Date: Mon, 14 Jul 2014 21:22:44 +0200 Subject: - when highlighting a mod the overwritten and overwriting mods are now highlighted in the list - when starting an external application MO now wraps the process in a job and waits on that instead. This way MO is not unlocked early when skyrim is started through skse - mod info dialog no longer offers the esp tab for foreign mods because that caused confusion - updated translation files - download directory and mod directory are now created if necessary - bugfix: staging script created unnecessary copies of translation files - bugfix: potential invalid array access when trying to determine best mod order - bugfix: deleter file wasn't removed after esp hiding was disabled - bugfix: potential access to to un-initialized login reply - bugfix: changed the initialization order to allow more ui controls to be localized --- src/modinfo.cpp | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'src/modinfo.cpp') diff --git a/src/modinfo.cpp b/src/modinfo.cpp index 2dadf2c6..f72b5d82 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -364,8 +364,8 @@ ModInfoWithConflictInfo::EConflictType ModInfoWithConflictInfo::isConflicted() c // this is costy so cache the result QTime now = QTime::currentTime(); if (m_LastConflictCheck.isNull() || (m_LastConflictCheck.secsTo(now) > 10)) { - bool overwrite = false; - bool overwritten = false; + m_OverwriteList.clear(); + m_OverwrittenList.clear(); bool regular = false; int dataID = 0; @@ -377,26 +377,29 @@ ModInfoWithConflictInfo::EConflictType ModInfoWithConflictInfo::isConflicted() c if ((*m_DirectoryStructure)->originExists(name)) { FilesOrigin &origin = (*m_DirectoryStructure)->getOriginByName(name); std::vector files = origin.getFiles(); - for (auto iter = files.begin(); iter != files.end() && (!overwrite || !overwritten || !regular); ++iter) { + // for all files in this origin + for (auto iter = files.begin(); iter != files.end(); ++iter) { const std::vector &alternatives = (*iter)->getAlternatives(); - if (alternatives.size() == 0) { + if ((alternatives.size() == 0) + || (alternatives[0] == dataID)) { // no alternatives -> no conflict regular = true; } else { + if ((*iter)->getOrigin() != origin.getID()) { + FilesOrigin &altOrigin = (*m_DirectoryStructure)->getOriginByID((*iter)->getOrigin()); + unsigned int altIndex = ModInfo::getIndex(ToQString(altOrigin.getName())); + m_OverwrittenList.insert(altIndex); + } + // for all non-providing alternative origins for (auto altIter = alternatives.begin(); altIter != alternatives.end(); ++altIter) { - // don't treat files overwritten in data as "conflict" - if (*altIter != dataID) { - bool ignore = false; - if ((*iter)->getOrigin(ignore) == origin.getID()) { - overwrite = true; - break; + if ((*altIter != dataID) && (*altIter != origin.getID())) { + FilesOrigin &altOrigin = (*m_DirectoryStructure)->getOriginByID(*altIter); + unsigned int altIndex = ModInfo::getIndex(ToQString(altOrigin.getName())); + if (origin.getPriority() > altOrigin.getPriority()) { + m_OverwriteList.insert(altIndex); } else { - overwritten = true; - break; + m_OverwrittenList.insert(altIndex); } - } else if (alternatives.size() == 1) { - // only alternative is data -> no conflict - regular = true; } } } @@ -405,9 +408,11 @@ ModInfoWithConflictInfo::EConflictType ModInfoWithConflictInfo::isConflicted() c m_LastConflictCheck = QTime::currentTime(); - if (overwrite && overwritten) m_CurrentConflictState = CONFLICT_MIXED; - else if (overwrite) m_CurrentConflictState = CONFLICT_OVERWRITE; - else if (overwritten) { + if (!m_OverwriteList.empty() && !m_OverwrittenList.empty()) + m_CurrentConflictState = CONFLICT_MIXED; + else if (!m_OverwriteList.empty()) + m_CurrentConflictState = CONFLICT_OVERWRITE; + else if (!m_OverwrittenList.empty()) { if (!regular) { m_CurrentConflictState = CONFLICT_REDUNDANT; } else { -- cgit v1.3.1