mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Replaced unix basename() with boost::filesystem::basename(),
as various unices define basename() differently.
This commit is contained in:
parent
791f487c76
commit
704e10c55a
1 changed files with 3 additions and 8 deletions
|
@ -21,6 +21,7 @@ GUID WceusbshGUID = { 0x25dbce51, 0x6c8f, 0x4a72,
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
#include <boost/filesystem/convenience.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
@ -321,14 +322,8 @@ void RemovableDriveManager::inspect_file(const std::string &path, const std::str
|
||||||
uid_t uid = buf.st_uid;
|
uid_t uid = buf.st_uid;
|
||||||
std::string username(std::getenv("USER"));
|
std::string username(std::getenv("USER"));
|
||||||
struct passwd *pw = getpwuid(uid);
|
struct passwd *pw = getpwuid(uid);
|
||||||
if(pw != 0)
|
if (pw != 0 && pw->pw_name == username)
|
||||||
{
|
m_current_drives.push_back(DriveData(boost::filesystem::basename(boost::filesystem::path(path)), path));
|
||||||
if(pw->pw_name == username)
|
|
||||||
{
|
|
||||||
std::string name = basename(path.data());
|
|
||||||
m_current_drives.push_back(DriveData(name,path));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue