diff --git a/file/path.h b/file/path.h index 1543262990..8d98f44439 100644 --- a/file/path.h +++ b/file/path.h @@ -1,7 +1,9 @@ #pragma once #include +#include #include +#include #include "file/file_util.h" @@ -25,6 +27,19 @@ public: } std::string GetFriendlyPath() { std::string str = GetPath(); +#if defined(BLACKBERRY) + char* home = getenv("PERIMETER_HOME"); + if (!strncmp(str.c_str(), home, strlen(home))) { + str = str.substr(strlen(home)); + str.insert(0, 1, '~'); + } +#elif defined(__linux) + char* home = getenv("HOME"); + if (!strncmp(str.c_str(), home, strlen(home))) { + str = str.substr(strlen(home)); + str.insert(0, 1, '~'); + } +#endif /* #ifdef ANDROID if (!memcmp(str.c_str(), g_Config.memCardDirectory.c_str(), g_Config.memCardDirectory.size()))