From b04f2d4c45264e448fe7b506756d65f67e6170d0 Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 20 Nov 2013 01:23:15 +1000 Subject: [PATCH] Hide account path in friendly path. There is limited space to print out a full path. --- file/path.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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()))