From 74d46c9f42d87fd1f17c0c02b0d4f5170a484b76 Mon Sep 17 00:00:00 2001 From: atraczyk <andreastraczyk@gmail.com> Date: Mon, 22 Aug 2016 09:48:14 -0400 Subject: [PATCH] file system: clean up after app path signal implemtation Change-Id: Idd2dfdefffd92a7a5fe189a17cce85c1fcea5b02 --- src/dring/dring.h | 3 +-- src/ring_api.cpp | 2 +- src/ringdht/ringaccount.cpp | 23 +++-------------------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/dring/dring.h b/src/dring/dring.h index f70ae30bcc..ff8b8fa550 100644 --- a/src/dring/dring.h +++ b/src/dring/dring.h @@ -46,10 +46,9 @@ const char* version() noexcept; * Initialize globals, create underlaying daemon. * * @param flags Flags to customize this initialization - * @param app_path Universal Windows Platform Application path * @returns true if initialization succeed else false. */ -bool init(enum InitFlag flags, const char* app_path = "") noexcept; +bool init(enum InitFlag flags) noexcept; /** * Start asynchronously daemon created by init(). diff --git a/src/ring_api.cpp b/src/ring_api.cpp index a2a04ae794..9e5524a9d2 100644 --- a/src/ring_api.cpp +++ b/src/ring_api.cpp @@ -42,7 +42,7 @@ namespace DRing { bool -init(enum InitFlag flags, const char* app_path) noexcept +init(enum InitFlag flags) noexcept { ::setDebugMode(flags & DRING_FLAG_DEBUG); ::setConsoleLog(flags & DRING_FLAG_CONSOLE_LOG); diff --git a/src/ringdht/ringaccount.cpp b/src/ringdht/ringaccount.cpp index cd991165b0..a91c7cca72 100644 --- a/src/ringdht/ringaccount.cpp +++ b/src/ringdht/ringaccount.cpp @@ -142,19 +142,9 @@ RingAccount::RingAccount(const std::string& accountID, bool /* presenceEnabled * #ifdef WIN32_NATIVE gnutls_global_init(); #endif -//#ifdef WIN32_NATIVE -// cachePath_ = Manager::instance().getUWPAppPath() + -// DIR_SEPARATOR_STR + std::string(".cache") + -// DIR_SEPARATOR_STR + getAccountID(); -// dataPath_ = cachePath_ + DIR_SEPARATOR_STR "values"; -// idPath_ = Manager::instance().getUWPAppPath() + -// DIR_SEPARATOR_STR + std::string(".cache") + -// DIR_SEPARATOR_STR + getAccountID(); -//#else cachePath_ = fileutils::get_cache_dir()+DIR_SEPARATOR_STR+getAccountID(); dataPath_ = cachePath_ + DIR_SEPARATOR_STR "values"; idPath_ = fileutils::get_data_dir()+DIR_SEPARATOR_STR+getAccountID(); -//#endif } RingAccount::~RingAccount() @@ -468,12 +458,8 @@ RingAccount::checkIdentityPath() return; } -//ifndef WIN32_NATIVE const auto idPath = fileutils::get_data_dir() + DIR_SEPARATOR_STR + getAccountID(); -//#else -// const auto idPath = Manager::instance().getUWPAppPath() + DIR_SEPARATOR_STR + -// std::string(".data") + DIR_SEPARATOR_STR + getAccountID(); -//#endif + tlsPrivateKeyFile_ = idPath + DIR_SEPARATOR_STR "dht.key"; tlsCertificateFile_ = idPath + DIR_SEPARATOR_STR "dht.crt"; loadIdentity(); @@ -505,12 +491,9 @@ RingAccount::loadIdentity() if (!id.first || !id.second) { throw VoipLinkException("Can't generate identity for this account."); } -//#ifndef WIN32_NATIVE + idPath_ = fileutils::get_data_dir() + DIR_SEPARATOR_STR + getAccountID(); -//#else - //idPath_ = Manager::instance().getUWPAppPath() + DIR_SEPARATOR_STR + - //std::string(".data") + DIR_SEPARATOR_STR + getAccountID(); -//#endif + fileutils::check_dir(idPath_.c_str(), 0700); fileutils::saveFile(idPath_ + DIR_SEPARATOR_STR "ca.key", ca.first->serialize(), 0600); -- GitLab