mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
refactoring
This commit is contained in:
@@ -15,7 +15,7 @@ struct DriveData
|
||||
class RemovableDriveManager
|
||||
{
|
||||
public:
|
||||
static RemovableDriveManager& getInstance()
|
||||
static RemovableDriveManager& get_instance()
|
||||
{
|
||||
static RemovableDriveManager instance;
|
||||
return instance;
|
||||
@@ -24,24 +24,24 @@ public:
|
||||
void operator=(RemovableDriveManager const&) = delete;
|
||||
|
||||
//update() searches for removable devices, returns false if empty.
|
||||
static bool update(long time = 0); //time = 0 is forced update
|
||||
static bool is_drive_mounted(const std::string &path);
|
||||
static void eject_drive(const std::string &path);
|
||||
static std::string get_last_drive_path();
|
||||
static std::vector<DriveData> get_all_drives();
|
||||
static bool is_path_on_removable_drive(const std::string &path);
|
||||
static void add_callback(std::function<void()> callback);
|
||||
static void print();
|
||||
bool update(long time = 0); //time = 0 is forced update
|
||||
bool is_drive_mounted(const std::string &path);
|
||||
void eject_drive(const std::string &path);
|
||||
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);
|
||||
void print();
|
||||
private:
|
||||
RemovableDriveManager(){}
|
||||
static void search_for_drives();
|
||||
static void check_and_notify();
|
||||
static std::vector<DriveData> m_current_drives;
|
||||
static std::vector<std::function<void()>> m_callbacks;
|
||||
void search_for_drives();
|
||||
void check_and_notify();
|
||||
std::vector<DriveData> m_current_drives;
|
||||
std::vector<std::function<void()>> m_callbacks;
|
||||
#if _WIN32
|
||||
static void register_window();
|
||||
void register_window();
|
||||
#else
|
||||
static void search_path(const std::string &path, const dev_t &parentDevID);
|
||||
void search_path(const std::string &path, const dev_t &parentDevID);
|
||||
#endif
|
||||
};
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user