Merge pull request #864 from ubports/desktop-subdir-env
Add ANBOX_NO_DESKTOP_SUBDIR env
This commit is contained in:
commit
385150ab6b
3 changed files with 12 additions and 2 deletions
|
|
@ -39,8 +39,15 @@ LauncherStorage::LauncherStorage(const fs::path &path) :
|
||||||
LauncherStorage::~LauncherStorage() {}
|
LauncherStorage::~LauncherStorage() {}
|
||||||
|
|
||||||
void LauncherStorage::reset() {
|
void LauncherStorage::reset() {
|
||||||
if (fs::exists(path_))
|
if (fs::exists(path_)) {
|
||||||
fs::remove_all(path_);
|
for(auto & p : boost::filesystem::directory_iterator(path_)) {
|
||||||
|
if (fs::is_regular_file(p)){
|
||||||
|
auto str = p.path().filename().string();
|
||||||
|
if (boost::starts_with(str, "anbox-"))
|
||||||
|
fs::remove(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string LauncherStorage::clean_package_name(const std::string &package_name) {
|
std::string LauncherStorage::clean_package_name(const std::string &package_name) {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
#include <boost/algorithm/string/predicate.hpp>
|
||||||
|
|
||||||
namespace anbox {
|
namespace anbox {
|
||||||
namespace application {
|
namespace application {
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,8 @@ std::string anbox::SystemConfiguration::input_device_dir() const {
|
||||||
|
|
||||||
std::string anbox::SystemConfiguration::application_item_dir() const {
|
std::string anbox::SystemConfiguration::application_item_dir() const {
|
||||||
static auto dir = xdg::data().home() / "applications" / "anbox";
|
static auto dir = xdg::data().home() / "applications" / "anbox";
|
||||||
|
if (anbox::utils::get_env_value("ANBOX_NO_DESKTOP_SUBDIR").length() > 0)
|
||||||
|
dir = xdg::data().home() / "applications";
|
||||||
return dir.string();
|
return dir.string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue