mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-28 03:41:59 +08:00
path check
This commit is contained in:
parent
79cdb0ab07
commit
fd7d75028a
@ -248,6 +248,15 @@ void RemovableDriveManager::eject_drive(const std::string &path)
|
|||||||
{
|
{
|
||||||
if((*it).path == path)
|
if((*it).path == path)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
std::string correct_path(path);
|
||||||
|
for (size_t i = 0; i < correct_path.size(); ++i)
|
||||||
|
{
|
||||||
|
if(correct_path[i]==' ')
|
||||||
|
{
|
||||||
|
correct_path = correct_path.insert(i,"\\");
|
||||||
|
}
|
||||||
|
}
|
||||||
std::cout<<"Ejecting "<<(*it).name<<" from "<< (*it).path<<"\n";
|
std::cout<<"Ejecting "<<(*it).name<<" from "<< (*it).path<<"\n";
|
||||||
std::string command = "umount ";
|
std::string command = "umount ";
|
||||||
command += (*it).path;
|
command += (*it).path;
|
||||||
@ -301,6 +310,7 @@ bool RemovableDriveManager::update(long time)
|
|||||||
}
|
}
|
||||||
search_for_drives();
|
search_for_drives();
|
||||||
check_and_notify();
|
check_and_notify();
|
||||||
|
eject_drive(m_current_drives.back().path);
|
||||||
return !m_current_drives.empty();
|
return !m_current_drives.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user