From 118354ecf43e366f6670b0dc6c83f6882f02b472 Mon Sep 17 00:00:00 2001 From: David Kocik Date: Fri, 6 Dec 2019 13:21:44 +0100 Subject: [PATCH] erase callbacks --- src/slic3r/GUI/RemovableDriveManager.cpp | 4 ++++ src/slic3r/GUI/RemovableDriveManager.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/src/slic3r/GUI/RemovableDriveManager.cpp b/src/slic3r/GUI/RemovableDriveManager.cpp index 6581d5361..1fbc33fc5 100644 --- a/src/slic3r/GUI/RemovableDriveManager.cpp +++ b/src/slic3r/GUI/RemovableDriveManager.cpp @@ -494,6 +494,10 @@ void RemovableDriveManager::add_callback(std::function callback) { m_callbacks.push_back(callback); } +void RemovableDriveManager::erase_callbacks() +{ + m_callbacks.clear(); +} void RemovableDriveManager::set_last_save_path(const std::string& path) { std::string last_drive = get_drive_from_path(path); diff --git a/src/slic3r/GUI/RemovableDriveManager.hpp b/src/slic3r/GUI/RemovableDriveManager.hpp index 741b4424a..8d9e65c47 100644 --- a/src/slic3r/GUI/RemovableDriveManager.hpp +++ b/src/slic3r/GUI/RemovableDriveManager.hpp @@ -31,6 +31,7 @@ public: std::vector get_all_drives(); bool is_path_on_removable_drive(const std::string &path); void add_callback(std::function callback); // callback will notify only if device with last save path was removed + void erase_callbacks(); // erases all callbacks added by add_callback() void set_last_save_path(const std::string &path); bool is_last_drive_removed(); //if we dont need info about this drive, call reset_last_save_path(); bool is_last_drive_removed_with_update(const long time = 0); // param as update()