From 5695e8ac6de6027c79ef91f088611ab280f173ca Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Jun 2017 10:26:01 +0200 Subject: [PATCH] feat(src/components/core/CoreManager): log database paths --- src/components/core/CoreManager.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/core/CoreManager.cpp b/src/components/core/CoreManager.cpp index 86b2513df..ecb385664 100644 --- a/src/components/core/CoreManager.cpp +++ b/src/components/core/CoreManager.cpp @@ -100,12 +100,24 @@ void CoreManager::forceRefreshRegisters () { // ----------------------------------------------------------------------------- +#define SET_DATABASE_PATH(DATABASE, PATH) \ + do { \ + qInfo() << QStringLiteral("Set `%1` path: `%2`") \ + .arg( # DATABASE) \ + .arg(::Utils::coreStringToAppString(PATH)); \ + mCore->set ## DATABASE ## DatabasePath(PATH); \ + } while (0); + void CoreManager::setDatabasesPaths () { - mCore->setFriendsDatabasePath(Paths::getFriendsListFilePath()); - mCore->setCallLogsDatabasePath(Paths::getCallHistoryFilePath()); - mCore->setChatDatabasePath(Paths::getMessageHistoryFilePath()); + SET_DATABASE_PATH(Friends, Paths::getFriendsListFilePath()); + SET_DATABASE_PATH(CallLogs, Paths::getCallHistoryFilePath()); + SET_DATABASE_PATH(Chat, Paths::getMessageHistoryFilePath()); } +#undef SET_DATABASE_PATH + +// ----------------------------------------------------------------------------- + void CoreManager::setOtherPaths () { if (mCore->getZrtpSecretsFile().empty() || !Paths::filePathExists(mCore->getZrtpSecretsFile())) { mCore->setZrtpSecretsFile(Paths::getZrtpSecretsFilePath());