From b9415607369d7a69772e197ac099c0ff2e8a41d5 Mon Sep 17 00:00:00 2001 From: David Kocik Date: Thu, 12 Mar 2020 11:54:27 +0100 Subject: [PATCH] RemovableDriveManager: not calling update from status() Update was called too often on main thread mostly from status() causing delays --- src/slic3r/GUI/RemovableDriveManager.cpp | 3 --- src/slic3r/GUI/RemovableDriveManager.hpp | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/RemovableDriveManager.cpp b/src/slic3r/GUI/RemovableDriveManager.cpp index 3ec27ce5b..f54935926 100644 --- a/src/slic3r/GUI/RemovableDriveManager.cpp +++ b/src/slic3r/GUI/RemovableDriveManager.cpp @@ -469,9 +469,6 @@ bool RemovableDriveManager::set_and_verify_last_save_path(const std::string &pat RemovableDriveManager::RemovableDrivesStatus RemovableDriveManager::status() { -#ifndef REMOVABLE_DRIVE_MANAGER_OS_CALLBACKS - this->update(); -#endif // REMOVABLE_DRIVE_MANAGER_OS_CALLBACKS RemovableDriveManager::RemovableDrivesStatus out; { diff --git a/src/slic3r/GUI/RemovableDriveManager.hpp b/src/slic3r/GUI/RemovableDriveManager.hpp index c12f2dd0a..2393fea22 100644 --- a/src/slic3r/GUI/RemovableDriveManager.hpp +++ b/src/slic3r/GUI/RemovableDriveManager.hpp @@ -69,6 +69,8 @@ public: // On Windows, the function does not block, and the eject is detected in the background thread. void eject_drive(); + // Status is used to retrieve info for showing UI buttons. + // Status is called every time when change of UI buttons is possible therefore should not perform update. struct RemovableDrivesStatus { bool has_removable_drives { false }; bool has_eject { false };