chore: structured src/gui, run clang-format

This commit is contained in:
2025-12-18 13:23:50 +03:00
parent 613c2c80f5
commit 7641846600
55 changed files with 1647 additions and 1399 deletions

View File

@@ -1,6 +1,6 @@
#include "utils.hpp"
#include <iostream>
#include <filesystem>
#include <iostream>
namespace clrsync::core
{
@@ -14,10 +14,10 @@ void print_color_keys()
std::string get_default_config_path()
{
const char* env_path = std::getenv("CLRSYNC_CONFIG_PATH");
const char *env_path = std::getenv("CLRSYNC_CONFIG_PATH");
if (env_path && env_path[0] != '\0')
return normalize_path(env_path).string();
std::filesystem::path home = normalize_path("~");
std::filesystem::path config_path = home / ".config" / "clrsync" / "config.toml";
return config_path.string();
@@ -27,7 +27,7 @@ std::string expand_user(const std::string &path)
{
if (path.empty() || path[0] != '~')
return path;
if (path.length() == 1 || path[1] == '/' || path[1] == '\\')
{
#ifdef _WIN32
@@ -37,10 +37,10 @@ std::string expand_user(const std::string &path)
#endif
if (!home)
return path;
if (path.length() == 1)
return std::string(home);
return std::string(home) + path.substr(1);
}
return path;