From db9e6368bddef3dcb0036f06962a66ff11654f2f Mon Sep 17 00:00:00 2001 From: David Kocik Date: Thu, 16 Feb 2023 13:34:57 +0100 Subject: [PATCH] PrusaLink: getting storages reads also "ro" as it is used instead of "read_only" in PrusaLink 0.7.0RC2 --- src/slic3r/Utils/OctoPrint.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/slic3r/Utils/OctoPrint.cpp b/src/slic3r/Utils/OctoPrint.cpp index 568f9fe670..f769320146 100644 --- a/src/slic3r/Utils/OctoPrint.cpp +++ b/src/slic3r/Utils/OctoPrint.cpp @@ -734,11 +734,14 @@ bool PrusaLink::get_storage(wxArrayString& output) const const auto path = section.second.get_optional("path"); const auto space = section.second.get_optional("free_space"); const auto read_only = section.second.get_optional("read_only"); + const auto ro = section.second.get_optional("ro"); // In PrusaLink 0.7.0RC2 "read_only" value is stored under "ro". const auto available = section.second.get_optional("available"); if (path && (!available || *available)) { StorageInfo si; si.name = boost::nowide::widen(*path); - si.read_only = read_only ? *read_only : false; // If read_only is missing, assume it is NOT read only. + // If read_only is missing, assume it is NOT read only. + // si.read_only = read_only ? *read_only : false; // version without "ro" + si.read_only = (read_only ? *read_only : (ro ? *ro : false)); si.free_space = space ? std::stoll(*space) : 1; // If free_space is missing, assume there is free space. storage.emplace_back(std::move(si)); }