summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl12rs <gabriel.cortesi@outlook.com>2018-09-10 05:58:24 -0500
committerLostDragonist <lost.dragonist@gmail.com>2018-12-12 20:17:07 -0600
commit40c82fc1908a8ca53abeeabdc618e81e941c987c (patch)
tree0693cd02ab8de8fd1c29f8463589001032d59800
parent57178f898838afed6e7a50413899d6082aad9989 (diff)
Fixed mainwindow.cpp so that Qt Creator does not break it anymore.
We should be able to normally use Creator now without having to worry about breaking the build. Partial fix for conflict information getting messd up after opening infodialog or disabling a mod. Icons still get messed up but conflict tab remains consistent at first inspection. Reverted main tab to plugins Changed version of Archive conflicts branch to 2.2.0 pre-alpha.
-rw-r--r--src/directoryrefresher.cpp12
-rw-r--r--src/mainwindow.cpp1
-rw-r--r--src/mainwindow.ui66
-rw-r--r--src/shared/directoryentry.cpp31
-rw-r--r--src/version.rc4
5 files changed, 68 insertions, 46 deletions
diff --git a/src/directoryrefresher.cpp b/src/directoryrefresher.cpp
index 5c789049..82eb093b 100644
--- a/src/directoryrefresher.cpp
+++ b/src/directoryrefresher.cpp
@@ -85,17 +85,17 @@ void DirectoryRefresher::addModBSAToStructure(DirectoryEntry *directoryStructure
int priority, const QString &directory, const QStringList &archives)
{
std::wstring directoryW = ToWString(QDir::toNativeSeparators(directory));
+ //QStringList loadOrder = QStringList();
+ IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
+
+ GamePlugins *gamePlugins = game->feature<GamePlugins>();
QStringList loadOrder = QStringList();
+ gamePlugins->getLoadOrder(loadOrder);
for (const QString &archive : archives) {
QFileInfo fileInfo(archive);
if (m_EnabledArchives.find(fileInfo.fileName()) != m_EnabledArchives.end()) {
- IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
-
- GamePlugins *gamePlugins = game->feature<GamePlugins>();
- QStringList loadOrder = QStringList();
- gamePlugins->getLoadOrder(loadOrder);
-
+
int order = -1;
for (auto plugin : loadOrder)
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 0d3abce5..cdd53dc9 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -313,6 +313,7 @@ MainWindow::MainWindow(QSettings &initSettings
ui->espList->setItemDelegateForColumn(PluginList::COL_FLAGS, new GenericIconDelegate(ui->espList));
ui->espList->installEventFilter(m_OrganizerCore.pluginList());
+ //bsaList converted to normal QTreeWidget since we can't sort BSAs anymore.
//ui->bsaList->setLocalMoveOnly(true);
bool pluginListAdjusted = registerWidgetState(ui->espList->objectName(), ui->espList->header(), "plugin_list_state");
diff --git a/src/mainwindow.ui b/src/mainwindow.ui
index fba246f5..eb88a855 100644
--- a/src/mainwindow.ui
+++ b/src/mainwindow.ui
@@ -1152,39 +1152,39 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_12">
- <item>
- <widget class="QCheckBox" name="conflictsCheckBox">
- <property name="toolTip">
- <string>Filters the above list so that only conflicts are displayed.</string>
- </property>
- <property name="whatsThis">
- <string>Filters the above list so that only conflicts are displayed.</string>
- </property>
- <property name="text">
- <string>Show only conflicts</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="showArchiveDataCheckBox">
- <property name="toolTip">
- <string>Filters the above list so that files from archives are not shown</string>
- </property>
- <property name="statusTip">
- <string />
- </property>
- <property name="whatsThis">
- <string>Filters the above list so that files from archives are not shown</string>
- </property>
- <property name="text">
- <string>Show files from Archives</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_12">
+ <item>
+ <widget class="QCheckBox" name="conflictsCheckBox">
+ <property name="toolTip">
+ <string>Filters the above list so that only conflicts are displayed.</string>
+ </property>
+ <property name="whatsThis">
+ <string>Filters the above list so that only conflicts are displayed.</string>
+ </property>
+ <property name="text">
+ <string>Show only conflicts</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="showArchiveDataCheckBox">
+ <property name="toolTip">
+ <string>Filters the above list so that files from archives are not shown</string>
+ </property>
+ <property name="statusTip">
+ <string/>
+ </property>
+ <property name="whatsThis">
+ <string>Filters the above list so that files from archives are not shown</string>
+ </property>
+ <property name="text">
+ <string>Show files from Archives</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<widget class="QWidget" name="savesTab">
diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp
index 477f4dad..602d58c7 100644
--- a/src/shared/directoryentry.cpp
+++ b/src/shared/directoryentry.cpp
@@ -282,12 +282,32 @@ bool FileEntry::removeOrigin(int origin)
// find alternative with the highest priority
std::vector<std::pair<int, std::pair<std::wstring, int>>>::iterator currentIter = m_Alternatives.begin();
for (std::vector<std::pair<int, std::pair<std::wstring, int>>>::iterator iter = m_Alternatives.begin(); iter != m_Alternatives.end(); ++iter) {
- if ((m_Parent->getOriginByID(iter->first).getPriority() > m_Parent->getOriginByID(currentIter->first).getPriority()) &&
- (iter->first != origin)) {
- currentIter = iter;
+ if (iter->first != origin) {
+
+ //Both files are not from archives.
+ if (!iter->second.first.size() && !currentIter->second.first.size()) {
+ if ((m_Parent->getOriginByID(iter->first).getPriority() > m_Parent->getOriginByID(currentIter->first).getPriority())) {
+ currentIter = iter;
+ }
+ }
+ else {
+ //Both files are from archives
+ if (iter->second.first.size() && currentIter->second.first.size()) {
+ if (iter->second.second > currentIter->second.second) {
+ currentIter = iter;
+ }
+ }
+ else {
+ //Only one of the two is an archive, so we change currentIter only if he is the archive one.
+ if (currentIter->second.first.size()) {
+ currentIter = iter;
+ }
+ }
+ }
}
}
int currentID = currentIter->first;
+ m_Archive = currentIter->second;
m_Alternatives.erase(currentIter);
m_Origin = currentID;
@@ -299,15 +319,16 @@ bool FileEntry::removeOrigin(int origin)
if (!::GetFileTime(file, nullptr, nullptr, &m_FileTime)) {
// maybe this file is in a bsa, but there is no easy way to find out which. User should refresh
// the view to find out
- m_Archive = std::pair<std::wstring, int>(L"bsa?", -1);
+ //m_Archive = std::pair<std::wstring, int>(L"bsa?", -1);
} else {
- m_Archive = std::pair<std::wstring, int>(L"", -1);
+ //m_Archive = std::pair<std::wstring, int>(L"", -1);
}
::CloseHandle(file);
} else {
m_Origin = -1;
+ m_Archive = std::pair<std::wstring, int>(L"", -1);
return true;
}
} else {
diff --git a/src/version.rc b/src/version.rc
index 3f2deab0..e1f80785 100644
--- a/src/version.rc
+++ b/src/version.rc
@@ -3,8 +3,8 @@
// If VS_FF_PRERELEASE is not set, MO labels the build as a release and uses VER_FILEVERSION to determine version number.
// Otherwise, if letters are used in VER_FILEVERSION_STR, uses the full MOBase::VersionInfo parser
// Otherwise, uses the numbers from VER_FILEVERSION and sets the release type as pre-alpha
-#define VER_FILEVERSION 2,1,6
-#define VER_FILEVERSION_STR "2.1.6\0"
+#define VER_FILEVERSION 2,2,0
+#define VER_FILEVERSION_STR "2.2.0\0"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION