mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-05 23:40:02 +01:00
Added meta information in session file XML, for quick access to file
info (SessionCreator::info), displayed in the user interface (list of sessions in quick access).
This commit is contained in:
@@ -98,17 +98,30 @@ std::string SystemToolkit::home_path()
|
||||
char *mHomePath;
|
||||
// try the system user info
|
||||
struct passwd* pwd = getpwuid(getuid());
|
||||
if (pwd) {
|
||||
if (pwd)
|
||||
mHomePath = pwd->pw_dir;
|
||||
}
|
||||
else {
|
||||
else
|
||||
// try the $HOME environment variable
|
||||
mHomePath = getenv("HOME");
|
||||
}
|
||||
|
||||
return string(mHomePath) + PATH_SEP;
|
||||
}
|
||||
|
||||
std::string SystemToolkit::username()
|
||||
{
|
||||
// 1. find home
|
||||
char *user;
|
||||
// try the system user info
|
||||
struct passwd* pwd = getpwuid(getuid());
|
||||
if (pwd)
|
||||
user = pwd->pw_name;
|
||||
else
|
||||
// try the $USER environment variable
|
||||
user = getenv("USER");
|
||||
|
||||
return string(user);
|
||||
}
|
||||
|
||||
bool create_directory(const string& path)
|
||||
{
|
||||
return !mkdir(path.c_str(), 0755) || errno == EEXIST;
|
||||
@@ -140,7 +153,6 @@ string SystemToolkit::settings_path()
|
||||
// fallback to home if settings path does not exists
|
||||
return home;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
string SystemToolkit::full_filename(const std::string& path, const string &filename)
|
||||
|
||||
Reference in New Issue
Block a user