X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcommon%2Fdirs.cpp;h=63232c087c572a86685411918c28b86f02242be2;hp=e0e651097d0ba6188e8993594f902ed3a02163c8;hb=f69e09d827e06435ea94bb73aa71ab5f9d5c035b;hpb=52df70c4f06fed2a15922b4a28519ebd62cf7105 diff --git a/source/common/dirs.cpp b/source/common/dirs.cpp index e0e6510..63232c0 100644 --- a/source/common/dirs.cpp +++ b/source/common/dirs.cpp @@ -168,6 +168,57 @@ wxString GetAccountDir(wxString AccName, bool ServerCert) } +std::string GetAccountDir(std::string AccName, bool ServerCert) +{ + + // Get the account directory. + + std::string AccountDir; + +#if defined(__HAIKU__) + +#elif defined(__WIN32__) + + AccountDir.clear(); + AccountDir.append(getenv("APPDATA")); + AccountDir.append("\\Xestia\\Address Book\\accounts\\"); + AccountDir.append(AccName); + AccountDir.append("\\"); + + if (ServerCert == true){ + AccountDir.append("server.crt"); + } + +#elif defined(__APPLE__) + + AccountDir.clear(); + AccountDir.append(getenv("HOME")); + AccountDir.append("/Library/Preferences/Xestia/Address Book/accounts/"); + AccountDir.append(AccName); + AccountDir.append("/"); + + if (ServerCert == true){ + AccountDir.append("server.crt"); + } + +#else + + AccountDir.clear(); + AccountDir.append(getenv("HOME")); + AccountDir.append("/.xestiaab/accounts/"); + AccountDir.append(AccName); + AccountDir.append("/"); + + if (ServerCert == true){ + AccountDir.append("server.crt"); + } + +#endif + + return AccountDir; + +} + wxString GetAccountsFile() {