[ui] Add auto-mount on first launch functionality #52
This commit is contained in:
@@ -180,11 +180,12 @@ auto convert_to_uint64(const pthread_t &thread) -> std::uint64_t {
|
||||
#endif // !defined(__APPLE__)
|
||||
|
||||
#if defined(__linux__)
|
||||
auto create_autostart_entry(create_autostart_opts opts) -> bool {
|
||||
auto create_autostart_entry(create_autostart_opts opts, bool overwrite_existing)
|
||||
-> bool {
|
||||
REPERTORY_USES_FUNCTION_NAME();
|
||||
|
||||
auto file = desktop_file_path_for(opts.app_name);
|
||||
if (utils::file::file{file}.exists()) {
|
||||
if (utils::file::file{file}.exists() && not overwrite_existing) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -248,8 +249,6 @@ auto create_autostart_entry(create_autostart_opts opts) -> bool {
|
||||
chmod(file.c_str(), 0644);
|
||||
#endif // defined(__linux__) || defined(__APPLE__)
|
||||
|
||||
utils::error::handle_info(
|
||||
function_name, fmt::format("created auto-start entry|path|{}", file));
|
||||
return true;
|
||||
}
|
||||
#endif // defined(__linux__)
|
||||
@@ -283,13 +282,7 @@ auto remove_autostart_entry(std::string_view name) -> bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto ret = utils::file::file{file}.remove();
|
||||
if (ret) {
|
||||
utils::error::handle_info(
|
||||
function_name, fmt::format("removed auto-start entry|path|{}", file));
|
||||
}
|
||||
|
||||
return ret;
|
||||
return utils::file::file{file}.remove();
|
||||
}
|
||||
#endif // defined(__linux__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user