X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcommon%2Fdirs.cpp;h=63232c087c572a86685411918c28b86f02242be2;hb=ea5f276a69989d4e5797b49083322bac2c9a820c;hp=e0e651097d0ba6188e8993594f902ed3a02163c8;hpb=52df70c4f06fed2a15922b4a28519ebd62cf7105;p=xestiaab%2F.git 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() {