diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 35c11f021..10eb4ab59 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -270,7 +270,7 @@ bool GUI_App::on_init_inner() this->obj_manipul()->update_if_dirty(); - RemovableDriveManager::getInstance().update(wxGetLocalTime()); + RemovableDriveManager::get_instance().update(wxGetLocalTime()); // Preset updating & Configwizard are done after the above initializations, // and after MainFrame is created & shown. // The extra CallAfter() is needed because of Mac, where this is the only way diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index bbfa9d932..74b2d1239 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -4550,11 +4550,11 @@ void Plater::export_gcode() } default_output_file = fs::path(Slic3r::fold_utf8_to_ascii(default_output_file.string())); auto start_dir = wxGetApp().app_config->get_last_output_dir(default_output_file.parent_path().string()); - if (GUI::RemovableDriveManager::getInstance().update()) + if (GUI::RemovableDriveManager::get_instance().update()) { - if (!RemovableDriveManager::getInstance().is_path_on_removable_drive(start_dir)) + if (!RemovableDriveManager::get_instance().is_path_on_removable_drive(start_dir)) { - start_dir = RemovableDriveManager::getInstance().get_last_drive_path(); + start_dir = RemovableDriveManager::get_instance().get_last_drive_path(); } } wxFileDialog dlg(this, (printer_technology() == ptFFF) ? _(L("Save G-code file as:")) : _(L("Save SL1 file as:")), diff --git a/src/slic3r/GUI/RemovableDriveManager.cpp b/src/slic3r/GUI/RemovableDriveManager.cpp index a1a5d7dd9..777085165 100644 --- a/src/slic3r/GUI/RemovableDriveManager.cpp +++ b/src/slic3r/GUI/RemovableDriveManager.cpp @@ -22,8 +22,8 @@ DEFINE_GUID(GUID_DEVINTERFACE_USB_DEVICE, namespace Slic3r { namespace GUI { -std::vector RemovableDriveManager::m_current_drives; -std::vector> RemovableDriveManager::m_callbacks; +//std::vector RemovableDriveManager::m_current_drives; +//std::vector> RemovableDriveManager::m_callbacks; #if _WIN32 @@ -242,7 +242,7 @@ bool RemovableDriveManager::update(long time) if(last_update == 0) { //add_callback(std::bind(&RemovableDriveManager::print, RemovableDriveManager::getInstance())); - add_callback([](void) { print(); }); + add_callback([](void) { RemovableDriveManager::get_instance().print(); }); #if _WIN32 register_window(); #endif diff --git a/src/slic3r/GUI/RemovableDriveManager.hpp b/src/slic3r/GUI/RemovableDriveManager.hpp index 9f3ebf326..f3abc4207 100644 --- a/src/slic3r/GUI/RemovableDriveManager.hpp +++ b/src/slic3r/GUI/RemovableDriveManager.hpp @@ -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 get_all_drives(); - static bool is_path_on_removable_drive(const std::string &path); - static void add_callback(std::function 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 get_all_drives(); + bool is_path_on_removable_drive(const std::string &path); + void add_callback(std::function callback); + void print(); private: RemovableDriveManager(){} - static void search_for_drives(); - static void check_and_notify(); - static std::vector m_current_drives; - static std::vector> m_callbacks; + void search_for_drives(); + void check_and_notify(); + std::vector m_current_drives; + std::vector> 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 }; }}