Skip to content
Extraits de code Groupes Projets
Vérifiée Valider a2011a08 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

[log & misc] Correct sett of data folder and shorten filenames for log macros

parent a711aaef
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -19,8 +19,9 @@ AM_SILENT_RULES([yes]) ...@@ -19,8 +19,9 @@ AM_SILENT_RULES([yes])
########################## ##########################
AEGISUB_PATH_SOURCE="$(dirname $(readlink -f "$0"))" AEGISUB_PATH_SOURCE="$(dirname $(readlink -f "$0"))"
AEGISUB_PATH_BUILD="$(pwd)" AEGISUB_PATH_BUILD="$(pwd)"
AS_IF([! test "$AEGISUB_PATH_BUILD" = "$AEGISUB_PATH_BUILD"], AS_IF([! test "$AEGISUB_PATH_SOURCE" = "$AEGISUB_PATH_BUILD"],
[AC_MSG_ERROR([The build directory must be the same as the source directory])]) [AC_MSG_ERROR([The build directory must be the same as the source directory])])
AC_DEFINE_UNQUOTED([AEGISUB_PATH_SOURCE], ["$AEGISUB_PATH_SOURCE"], [Path to the root sources folder])
################### ###################
# Required packages # Required packages
......
...@@ -91,6 +91,11 @@ decltype(LogSink::messages) LogSink::GetMessages() const ...@@ -91,6 +91,11 @@ decltype(LogSink::messages) LogSink::GetMessages() const
Message::Message(const char *section, Severity severity, const char *file, const char *func, int line) Message::Message(const char *section, Severity severity, const char *file, const char *func, int line)
: msg(buffer, sizeof buffer) : msg(buffer, sizeof buffer)
{ {
/* Crop the __FILE__ to be relative to the source folder. Doing it to have
* more place on the screen and don't leak build folder paths. */
for (int i = 0; file && file[0] == AEGISUB_PATH_SOURCE[i]; ++i) ++file;
if (file[0] && file[0] == '/') ++file;
using namespace std::chrono; using namespace std::chrono;
sm.section = section; sm.section = section;
sm.severity = severity; sm.severity = severity;
......
...@@ -50,16 +50,6 @@ void Path::FillPlatformSpecificPaths() ...@@ -50,16 +50,6 @@ void Path::FillPlatformSpecificPaths()
agi::fs::path home = home_dir(); agi::fs::path home = home_dir();
SetToken("?user", home / ".aegisub"); SetToken("?user", home / ".aegisub");
SetToken("?local", home / ".aegisub"); SetToken("?local", home / ".aegisub");
SetToken("?data", P_DATA);
SetToken("?dictionary", "/usr/share/hunspell");
#else /* Now __APPLE__ is defined */
agi::fs::path app_support = agi::util::GetApplicationSupportDirectory();
SetToken("?user", app_support / "Aegisub");
SetToken("?local", app_support / "Aegisub");
SetToken("?data", agi::util::GetBundleSharedSupportDirectory());
SetToken("?dictionary", agi::util::GetBundleSharedSupportDirectory() + "/dictionaries");
#endif /* __APPLE__ */
SetToken("?temp", boost::filesystem::temp_directory_path());
#ifdef AEGISUB_LINUX #ifdef AEGISUB_LINUX
char *P_EXEC = getenv("P_EXEC"); char *P_EXEC = getenv("P_EXEC");
if (P_EXEC && P_EXEC[0] != '\0' && std::string(P_EXEC).rfind("/tmp/.mount_") == 0) { if (P_EXEC && P_EXEC[0] != '\0' && std::string(P_EXEC).rfind("/tmp/.mount_") == 0) {
...@@ -70,7 +60,21 @@ void Path::FillPlatformSpecificPaths() ...@@ -70,7 +60,21 @@ void Path::FillPlatformSpecificPaths()
std::string p_data = (p_exec.parent_path().parent_path() / "share/aegisub").string(); std::string p_data = (p_exec.parent_path().parent_path() / "share/aegisub").string();
SetToken("?data", p_data); SetToken("?data", p_data);
} }
else {
SetToken("?data", P_DATA);
}
#else
SetToken("?data", P_DATA);
#endif /* AEGISUB_LINUX */ #endif /* AEGISUB_LINUX */
SetToken("?dictionary", "/usr/share/hunspell");
#else /* Now __APPLE__ is defined */
agi::fs::path app_support = agi::util::GetApplicationSupportDirectory();
SetToken("?user", app_support / "Aegisub");
SetToken("?local", app_support / "Aegisub");
SetToken("?data", agi::util::GetBundleSharedSupportDirectory());
SetToken("?dictionary", agi::util::GetBundleSharedSupportDirectory() + "/dictionaries");
#endif /* __APPLE__ */
SetToken("?temp", boost::filesystem::temp_directory_path());
} }
} }
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter