diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2021-01-04 20:49:05 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2021-01-04 20:49:05 -0500 |
| commit | 24a6749157c60808e6734519abefce784cbabe82 (patch) | |
| tree | f49d0d0eab8591df4c3dc367d114277445b3dc03 /src/commandline.cpp | |
| parent | 09f07ddae96c741d12e49754710369b57e8c3993 (diff) | |
fix running shortcuts with locking disabled
when a ProcessRunner gets ForceWait|PreventExit and locking is disabled, wait for the process normally but without showing the ui
changed references to UILocker::Session to pointers because they can now be null
Diffstat (limited to 'src/commandline.cpp')
| -rw-r--r-- | src/commandline.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/commandline.cpp b/src/commandline.cpp index bb9ff9b8..8c722990 100644 --- a/src/commandline.cpp +++ b/src/commandline.cpp @@ -206,9 +206,11 @@ std::optional<int> CommandLine::setupCore(OrganizerCore& organizer) const if (m_shortcut.isValid()) { if (m_shortcut.hasExecutable()) { try { + // make sure MO doesn't exit even if locking is disabled, ForceWait and + // PreventExit will do that organizer.processRunner() .setFromShortcut(m_shortcut) - .setWaitForCompletion() + .setWaitForCompletion(ProcessRunner::ForceWait, UILocker::PreventExit) .run(); return 0; @@ -229,9 +231,12 @@ std::optional<int> CommandLine::setupCore(OrganizerCore& organizer) const try { // pass the remaining parameters to the binary + // + // make sure MO doesn't exit even if locking is disabled, ForceWait and + // PreventExit will do that organizer.processRunner() .setFromFileOrExecutable(exeName, m_untouched) - .setWaitForCompletion() + .setWaitForCompletion(ProcessRunner::ForceWait, UILocker::PreventExit) .run(); return 0; |
