From 6c0bab611a86f2f9ddf85311aa251403b971ab46 Mon Sep 17 00:00:00 2001 From: darealshinji Date: Wed, 1 Jan 2025 14:45:30 +0100 Subject: [PATCH] convert paths to string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes error: cannot convert ‘std::filesystem::__cxx11::path’ to ‘const agi::fs::path&’ --- libaegisub/unix/path.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libaegisub/unix/path.cpp b/libaegisub/unix/path.cpp index 41d4066d2e..05ee922e6f 100644 --- a/libaegisub/unix/path.cpp +++ b/libaegisub/unix/path.cpp @@ -23,7 +23,7 @@ namespace sfs = std::filesystem; namespace { -std::string home_dir() { +sfs::path home_dir() { const char *env = getenv("HOME"); if (env) return env; @@ -55,20 +55,20 @@ sfs::path data_dir() { namespace agi { void Path::FillPlatformSpecificPaths() { - sfs::path home = home_dir(); - SetToken("?user", home/".aegisub"); - SetToken("?local", home/".aegisub"); + sfs::path dotdir = home_dir()/".aegisub"; + SetToken("?user", dotdir.string()); + SetToken("?local", dotdir.string()); #ifdef APPIMAGE_BUILD sfs::path data = data_dir(); - if (data == "") data = home/".aegisub"; - SetToken("?data", data); + if (data == "") data = dotdir.string(); + SetToken("?data", data.string()); SetToken("?dictionary", Decode("?data/dictionaries")); #else SetToken("?data", P_DATA); SetToken("?dictionary", "/usr/share/hunspell"); #endif - SetToken("?temp", sfs::temp_directory_path()); + SetToken("?temp", sfs::temp_directory_path().string()); } }