erase callbacks

This commit is contained in:
David Kocik 2019-12-06 13:21:44 +01:00
parent 0f18e7e7ec
commit 118354ecf4
2 changed files with 5 additions and 0 deletions

View file

@ -494,6 +494,10 @@ void RemovableDriveManager::add_callback(std::function<void()> 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);

View file

@ -31,6 +31,7 @@ public:
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 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()