From 24a6749157c60808e6734519abefce784cbabe82 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Mon, 4 Jan 2021 20:49:05 -0500 Subject: 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 --- src/commandline.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/commandline.cpp') 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 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 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; -- cgit v1.3.1