From 2c8aa5a1fe4ed9a653311e3c333a010df7383005 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 6 Sep 2018 02:04:48 +0200 Subject: [PATCH] RsAccounts::getCurrentAccountId is now static --- libretroshare/src/retroshare/rsinit.h | 18 +++++++++--------- libretroshare/src/rsserver/rsinit.cc | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libretroshare/src/retroshare/rsinit.h b/libretroshare/src/retroshare/rsinit.h index 2e228dd8c..68e70fe65 100644 --- a/libretroshare/src/retroshare/rsinit.h +++ b/libretroshare/src/retroshare/rsinit.h @@ -52,14 +52,6 @@ struct RsLoginHelper; extern RsLoginHelper* rsLoginHelper; -class RsAccounts; - -/** - * Pointer to global instance of RsAccounts needed to expose JSON API - * @jsonapi{development} - */ -extern RsAccounts* rsAccounts; - /*! * Initialisation Class (not publicly disclosed to RsIFace) */ @@ -163,7 +155,7 @@ public: * @param[out] id storage for current account id * @return false if account hasn't been selected yet, true otherwise */ - bool getCurrentAccountId(RsPeerId &id); + static bool getCurrentAccountId(RsPeerId &id); /** * @brief DataDirectory @@ -224,6 +216,14 @@ private: static RsAccountsDetail* rsAccountsDetails; }; +/** + * Pointer to global instance of RsAccounts needed to expose JSON API, as all + * the members of this class are static you should call them directly without + * using this pointer in the other parts of the code + * @jsonapi{development} + */ +extern RsAccounts* rsAccounts; + /** * This helper class have been implemented because there was not reasonable way diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index a2e582606..d1ece374b 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -2029,7 +2029,7 @@ void RsLoginHelper::Location::serial_process( RS_SERIAL_PROCESS(mPpgName); } -bool RsAccounts::getCurrentAccountId(RsPeerId& id) +/*static*/ bool RsAccounts::getCurrentAccountId(RsPeerId& id) { return rsAccountsDetails->getCurrentAccountId(id); }