From 52cc3a41c73851d88983223361c03b800db8c2a2 Mon Sep 17 00:00:00 2001
From: isanae <14251494+isanae@users.noreply.github.com>
Date: Sun, 29 Dec 2019 07:16:09 -0500
Subject: refresh after manually unlocking the ui fixed nexus connect button
staying as "cancel" in case of errors fixed logging of duplicate dll loading
bumped to rc6
---
src/env.cpp | 1 +
src/nxmaccessmanager.cpp | 2 +-
src/organizer_en.ts | 6 +++---
src/processrunner.cpp | 56 +++++++++++++++++++++++++++++++++++++-----------
src/processrunner.h | 1 +
src/version.rc | 2 +-
6 files changed, 50 insertions(+), 18 deletions(-)
(limited to 'src')
diff --git a/src/env.cpp b/src/env.cpp
index 0098456e..4c0aeb86 100644
--- a/src/env.cpp
+++ b/src/env.cpp
@@ -101,6 +101,7 @@ void ModuleNotification::fire(QString path, std::size_t fileSize)
{
if (m_loaded.contains(path)) {
// don't notify if it's been loaded before
+ return;
}
m_loaded.insert(path);
diff --git a/src/nxmaccessmanager.cpp b/src/nxmaccessmanager.cpp
index e5f1fffe..20540593 100644
--- a/src/nxmaccessmanager.cpp
+++ b/src/nxmaccessmanager.cpp
@@ -333,8 +333,8 @@ void NexusSSOLogin::onDisconnected()
void NexusSSOLogin::onError(QAbstractSocket::SocketError e)
{
if (m_active) {
- setState(Error, m_socket.errorString());
close();
+ setState(Error, m_socket.errorString());
}
}
diff --git a/src/organizer_en.ts b/src/organizer_en.ts
index d05ada70..fe4dfd32 100644
--- a/src/organizer_en.ts
+++ b/src/organizer_en.ts
@@ -6317,9 +6317,9 @@ If the folder was still in use, restart MO and try again.
-
-
-
+
+
+ No profile set
diff --git a/src/processrunner.cpp b/src/processrunner.cpp
index 3f1e3a3b..91443750 100644
--- a/src/processrunner.cpp
+++ b/src/processrunner.cpp
@@ -795,6 +795,48 @@ std::optional ProcessRunner::runBinary()
return {};
}
+bool ProcessRunner::shouldRefresh(Results r) const
+{
+ // afterRun() is only called with the Refresh flag; it refreshes the
+ // directory structure and notifies plugins
+ //
+ // refreshing is not always required and can actually cause problems:
+ //
+ // 1) running shortcuts doesn't need refreshing because MO closes right
+ // after
+ //
+ // 2) the mod info dialog is not set up to deal with refreshes, so that
+ // it will crash because the old DirectoryEntry's are still being used
+ // in the list
+ if (!m_waitFlags.testFlag(Refresh)) {
+ log::debug("not refreshing because the flag isn't set");
+ return false;
+ }
+
+ switch (r)
+ {
+ case Completed:
+ {
+ log::debug("refreshing because the process completed");
+ return true;
+ }
+
+ case ForceUnlocked:
+ {
+ log::debug("refreshing because the ui was force unlocked");
+ return true;
+ }
+
+ case Error: // fall-through
+ case Cancelled:
+ case Running:
+ default:
+ {
+ return false;
+ }
+ }
+}
+
ProcessRunner::Results ProcessRunner::postRun()
{
const bool mustWait = (m_waitFlags & ForceWait);
@@ -841,19 +883,7 @@ ProcessRunner::Results ProcessRunner::postRun()
r = waitForProcess(m_handle.get(), &m_exitCode, ls);
});
- if (r == Completed && (m_waitFlags & Refresh)) {
- // afterRun() is only called with the Refresh flag; it refreshes the
- // directory structure and notifies plugins
- //
- // refreshing is not always required and can actually cause problems:
- //
- // 1) running shortcuts doesn't need refreshing because MO closes right
- // after
- //
- // 2) the mod info dialog is not set up to deal with refreshes, so that
- // it will crash because the old DirectoryEntry's are still being used
- // in the list
- //
+ if (shouldRefresh(r)) {
m_core.afterRun(m_sp.binary, m_exitCode);
}
diff --git a/src/processrunner.h b/src/processrunner.h
index 1bfdc465..d8ff0227 100644
--- a/src/processrunner.h
+++ b/src/processrunner.h
@@ -156,6 +156,7 @@ private:
bool shouldRunShell() const;
+ bool shouldRefresh(Results r) const;
// runs the command in m_shellOpen; returns empty if it can be waited for
//
diff --git a/src/version.rc b/src/version.rc
index 0cf44243..f7b5f0d5 100644
--- a/src/version.rc
+++ b/src/version.rc
@@ -4,7 +4,7 @@
// 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,2,2
-#define VER_FILEVERSION_STR "2.2.2rc5\0"
+#define VER_FILEVERSION_STR "2.2.2rc6\0"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
--
cgit v1.3.1