From 1d25201a12cce36b55ad6268ac491d4fcbda5a33 Mon Sep 17 00:00:00 2001
From: David Kocik <kocikdav@gmail.com>
Date: Wed, 11 Dec 2019 18:30:03 +0100
Subject: [PATCH] linux eject

---
 src/slic3r/GUI/GUI_App.cpp               | 6 +++---
 src/slic3r/GUI/RemovableDriveManager.cpp | 9 ++++-----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp
index b83ecbedc..c9ed88f84 100644
--- a/src/slic3r/GUI/GUI_App.cpp
+++ b/src/slic3r/GUI/GUI_App.cpp
@@ -274,9 +274,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.
diff --git a/src/slic3r/GUI/RemovableDriveManager.cpp b/src/slic3r/GUI/RemovableDriveManager.cpp
index ab2dd10eb..d5f224409 100644
--- a/src/slic3r/GUI/RemovableDriveManager.cpp
+++ b/src/slic3r/GUI/RemovableDriveManager.cpp
@@ -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)