From c019e648c720f25b88ef8e5e8d69cfd997fd6f3e Mon Sep 17 00:00:00 2001 From: supermerill Date: Fri, 6 Aug 2021 11:42:42 +0200 Subject: [PATCH] datadir parameter kept when launching new instance supermerill/SuperSlicer#1450 --- src/slic3r/Utils/Process.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/slic3r/Utils/Process.cpp b/src/slic3r/Utils/Process.cpp index ab7cf2122..a97df2138 100644 --- a/src/slic3r/Utils/Process.cpp +++ b/src/slic3r/Utils/Process.cpp @@ -1,6 +1,7 @@ #include "Process.hpp" #include +#include #include "../GUI/GUI.hpp" // for file_wildcards() @@ -47,8 +48,10 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance for (const auto& file : paths_to_open) args.emplace_back(file); } - if (instance_type == NewSlicerInstanceType::Slicer && single_instance) - args.emplace_back(L"--single-instance"); + if (instance_type == NewSlicerInstanceType::Slicer && single_instance) + args.emplace_back(L"--single-instance"); + args.emplace_back(L"--datadir"); + args.emplace_back(boost::nowide::widen(Slic3r::data_dir().c_str()).c_str()); args.emplace_back(nullptr); BOOST_LOG_TRIVIAL(info) << "Trying to spawn a new slicer \"" << into_u8(path) << "\""; // Don't call with wxEXEC_HIDE_CONSOLE, PrusaSlicer in GUI mode would just show the splash screen. It would not open the main window though, it would