From e11afb46dea9765740577441a36e8c812989e92f Mon Sep 17 00:00:00 2001 From: Marius Gripsgard Date: Sat, 13 Jan 2018 07:02:52 +0100 Subject: [PATCH 1/2] Add ANBOX_NO_DESKTOP_SUBDIR env This makes anbox place applications in the main application folder This is mostly a hack for ubuntu touch --- src/anbox/system_configuration.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/anbox/system_configuration.cpp b/src/anbox/system_configuration.cpp index 4014887..d6289ea 100644 --- a/src/anbox/system_configuration.cpp +++ b/src/anbox/system_configuration.cpp @@ -99,6 +99,8 @@ std::string anbox::SystemConfiguration::input_device_dir() const { std::string anbox::SystemConfiguration::application_item_dir() const { 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(); } From 3d3055e2dec7b5ef962facf303cce4b4c03cc8f5 Mon Sep 17 00:00:00 2001 From: Marius Gripsgard Date: Sat, 13 Jan 2018 07:01:42 +0100 Subject: [PATCH 2/2] Just remove desktop/icon files starting with anbox- --- src/anbox/application/launcher_storage.cpp | 11 +++++++++-- src/anbox/application/launcher_storage.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/anbox/application/launcher_storage.cpp b/src/anbox/application/launcher_storage.cpp index 2d038dd..5bdf931 100644 --- a/src/anbox/application/launcher_storage.cpp +++ b/src/anbox/application/launcher_storage.cpp @@ -39,8 +39,15 @@ LauncherStorage::LauncherStorage(const fs::path &path) : LauncherStorage::~LauncherStorage() {} void LauncherStorage::reset() { - if (fs::exists(path_)) - fs::remove_all(path_); + if (fs::exists(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) { diff --git a/src/anbox/application/launcher_storage.h b/src/anbox/application/launcher_storage.h index d7c5e79..55cfd8a 100644 --- a/src/anbox/application/launcher_storage.h +++ b/src/anbox/application/launcher_storage.h @@ -25,6 +25,7 @@ #include #include +#include namespace anbox { namespace application {