diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-12-29 07:30:07 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-29 07:30:07 -0500 |
| commit | 57b049b6d7825d4de38bcbaeb6bb5efc0fba8109 (patch) | |
| tree | 294a8bd7790e8f2c976d79a8a29622e550179ab1 /src | |
| parent | dc6653e1009a8081cd4bae7ba15751b9cc6b5e4b (diff) | |
| parent | 52cc3a41c73851d88983223361c03b800db8c2a2 (diff) | |
Merge pull request #953 from isanae/rc6-fixes
rc6 fixes
Diffstat (limited to 'src')
| -rw-r--r-- | src/env.cpp | 1 | ||||
| -rw-r--r-- | src/nxmaccessmanager.cpp | 2 | ||||
| -rw-r--r-- | src/organizer_en.ts | 6 | ||||
| -rw-r--r-- | src/processrunner.cpp | 56 | ||||
| -rw-r--r-- | src/processrunner.h | 1 | ||||
| -rw-r--r-- | src/version.rc | 2 |
6 files changed, 50 insertions, 18 deletions
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.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="processrunner.cpp" line="539"/> - <location filename="processrunner.cpp" line="592"/> - <location filename="processrunner.cpp" line="738"/> + <location filename="processrunner.cpp" line="557"/> + <location filename="processrunner.cpp" line="610"/> + <location filename="processrunner.cpp" line="756"/> <source>No profile set</source> <translation type="unfinished"></translation> </message> 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::Results> 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 |
