mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-13 15:08:10 +08:00
callback only for used device
This commit is contained in:
parent
66f203379c
commit
6396ec571a
@ -479,7 +479,7 @@ void RemovableDriveManager::check_and_notify()
|
||||
if(m_drives_count != m_current_drives.size())
|
||||
{
|
||||
//std::cout<<" vs "<< m_current_drives.size();
|
||||
if(m_drives_count > m_current_drives.size())
|
||||
if(m_drives_count > m_current_drives.size() && m_last_save_path != "" && !is_drive_mounted(m_last_save_path))
|
||||
{
|
||||
for (auto it = m_callbacks.begin(); it != m_callbacks.end(); ++it)
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
std::string get_last_drive_path();
|
||||
std::vector<DriveData> get_all_drives();
|
||||
bool is_path_on_removable_drive(const std::string &path);
|
||||
void add_callback(std::function<void()> callback); // callback will notify every drive removal. to see if it was last used drive call is_last_drive_removed()
|
||||
void add_callback(std::function<void()> callback); // callback will notify only if device with last save path was removed
|
||||
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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user