X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcommon%2Fdirs.cpp;h=3baf5418c8ebd22dd286788a43b78768a89028c1;hp=e0e651097d0ba6188e8993594f902ed3a02163c8;hb=3d39423f5efef65eacf666dabd7d1c6e9ba13083;hpb=b1467ce3cde3c61f79030bf4329f7037904043e1 diff --git a/source/common/dirs.cpp b/source/common/dirs.cpp index e0e6510..3baf541 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(wxT("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() {