Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kocik <kocikdav@gmail.com>2019-12-11 14:28:51 +0300
committerDavid Kocik <kocikdav@gmail.com>2019-12-13 15:51:46 +0300
commitf5e3750d233d1f9687fa9c906b39150df1eca609 (patch)
treedcfbcfdd9bdd62fbc1adfccb3a04f3449d78a2b8 /src/slic3r/GUI/RemovableDriveManager.cpp
parent01f1bed0605662e8520f24c5db8c8bdac5f7eb4e (diff)
eject button functionality
Diffstat (limited to 'src/slic3r/GUI/RemovableDriveManager.cpp')
-rw-r--r--src/slic3r/GUI/RemovableDriveManager.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/slic3r/GUI/RemovableDriveManager.cpp b/src/slic3r/GUI/RemovableDriveManager.cpp
index 164b6e38a..1a964f889 100644
--- a/src/slic3r/GUI/RemovableDriveManager.cpp
+++ b/src/slic3r/GUI/RemovableDriveManager.cpp
@@ -395,9 +395,9 @@ std::string RemovableDriveManager::get_drive_from_path(const std::string& path)
RemovableDriveManager::RemovableDriveManager():
m_drives_count(0),
m_last_update(0),
- m_last_save_path(""),
+ m_last_save_path("")
#if __APPLE__
- m_rdmmm(new RDMMMWrapper())
+ , m_rdmmm(new RDMMMWrapper())
#endif
{}
@@ -411,7 +411,7 @@ void RemovableDriveManager::init()
#endif
update();
}
-bool RemovableDriveManager::update(const long time)
+bool RemovableDriveManager::update(const long time, bool check)
{
if(time != 0) //time = 0 is forced update
{
@@ -425,7 +425,7 @@ bool RemovableDriveManager::update(const long time)
}
}
search_for_drives();
- check_and_notify();
+ if(check)check_and_notify();
return !m_current_drives.empty();
}
@@ -444,13 +444,7 @@ bool RemovableDriveManager::is_drive_mounted(const std::string &path)
std::string RemovableDriveManager::get_last_drive_path()
{
- if (!m_current_drives.empty())
- {
- if (m_last_save_path != "")
- return m_last_save_path;
- return m_current_drives.back().path;
- }
- return "";
+ return m_last_save_path;
}
std::vector<DriveData> RemovableDriveManager::get_all_drives()
{
@@ -495,11 +489,13 @@ bool RemovableDriveManager::is_last_drive_removed()
{
return true;
}
- return !is_drive_mounted(m_last_save_path);
+ bool r = !is_drive_mounted(m_last_save_path);
+ if (r) reset_last_save_path();
+ return r;
}
bool RemovableDriveManager::is_last_drive_removed_with_update(const long time)
{
- update(time);
+ update(time, false);
return is_last_drive_removed();
}
void RemovableDriveManager::reset_last_save_path()