linux eject

This commit is contained in:
David Kocik 2019-12-11 18:30:03 +01:00
parent c6b5253bce
commit 59fa78373b
2 changed files with 7 additions and 8 deletions

View File

@ -272,9 +272,9 @@ bool GUI_App::on_init_inner()
this->obj_manipul()->update_if_dirty();
//RemovableDriveManager::get_instance().update(wxGetLocalTime(), true);
#if __linux__
RemovableDriveManager::get_instance().update(wxGetLocalTime(), true);
#endif
// Preset updating & Configwizard are done after the above initializations,
// and after MainFrame is created & shown.

View File

@ -429,10 +429,6 @@ bool RemovableDriveManager::update(const long time, bool check)
return false; // return value shouldnt matter if update didnt run
}
}
if(check)
{
m_rdmmm->log("update");
}
search_for_drives();
if(check)check_and_notify();
return !m_current_drives.empty();
@ -474,7 +470,7 @@ void RemovableDriveManager::check_and_notify()
//std::cout<<"drives count: "<<m_drives_count;
if(m_drives_count != m_current_drives.size())
{
m_rdmmm->log("drives count not same");
//m_rdmmm->log("drives count not same");
//std::cout<<" vs "<< m_current_drives.size();
if(m_callbacks.size() != 0 && m_drives_count > m_current_drives.size() && m_last_save_path != "" && !is_drive_mounted(m_last_save_path))
{
@ -505,13 +501,16 @@ void RemovableDriveManager::set_last_save_path(const std::string& path)
}
bool RemovableDriveManager::is_last_drive_removed()
{
std::cout<<"is last: "<<m_last_save_path;
m_drives_count = m_current_drives.size();
if(m_last_save_path == "")
{
std::cout<<"\n";
return true;
}
bool r = !is_drive_mounted(m_last_save_path);
if (r) reset_last_save_path();
std::cout<<" "<< r <<"\n";
return r;
}
bool RemovableDriveManager::is_last_drive_removed_with_update(const long time)