diff --git a/src/account.cpp b/src/account.cpp index 1d3621df151fd2ea27e6e64dd444895364581baa..c53077982dd434f9319d287a9efae78f8c5b78e2 100644 --- a/src/account.cpp +++ b/src/account.cpp @@ -1041,9 +1041,9 @@ bool Account::exportOnRing(const QString& password) const return ConfigurationManager::instance().exportOnRing(id(), password); } -bool Account::exportToFile(const QString& destinationPath) const +bool Account::exportToFile(const QString& destinationPath, const QString& password) const { - return ConfigurationManager::instance().exportToFile(id(), destinationPath); + return ConfigurationManager::instance().exportToFile(id(), destinationPath, password); } #define CAST(item) static_cast<int>(item) diff --git a/src/account.h b/src/account.h index 5e9fb540b65a03e742312e8f969fc3156d9a9825..a5f0812a9d6ceded4f0d8b31423a2507c2515025 100644 --- a/src/account.h +++ b/src/account.h @@ -446,7 +446,7 @@ class LIB_EXPORT Account : public ItemBase { QString lastSipRegistrationStatus () const; Q_INVOKABLE bool exportOnRing (const QString& password) const; - Q_INVOKABLE bool exportToFile (const QString& destinationPath) const; + Q_INVOKABLE bool exportToFile (const QString& destinationPath, const QString& password = {}) const; Q_INVOKABLE bool registerName (const QString& password, const QString& name) const; Q_INVOKABLE bool lookupName (const QString& name ) const; Q_INVOKABLE bool lookupAddress(const QString& address ) const; diff --git a/src/api/newaccountmodel.h b/src/api/newaccountmodel.h index 9cba75a2a7b1613e328f7f1f604de910e5694cce..65347d509f46a05f363e6c4362d007ffc53476bd 100644 --- a/src/api/newaccountmodel.h +++ b/src/api/newaccountmodel.h @@ -93,9 +93,10 @@ public: * Call exportToFile from the daemon * @param accountId * @param path destination + * @param password * @return if the file is exported with success */ - bool exportToFile(const std::string& accountId, const std::string& path) const; + bool exportToFile(const std::string& accountId, const std::string& path, const std::string& password = {}) const; /** * Call exportOnRing from the daemon * @param accountId diff --git a/src/newaccountmodel.cpp b/src/newaccountmodel.cpp index 4f420dc80dc9d00efa1ac793063351bafc9755ff..9173cae68b9ec5869f5f18fe44480b6c5f6481eb 100644 --- a/src/newaccountmodel.cpp +++ b/src/newaccountmodel.cpp @@ -278,9 +278,9 @@ NewAccountModel::registerName(const std::string& accountId, const std::string& p } bool -NewAccountModel::exportToFile(const std::string& accountId, const std::string& path) const +NewAccountModel::exportToFile(const std::string& accountId, const std::string& path, const std::string& password) const { - return ConfigurationManager::instance().exportToFile(accountId.c_str(), path.c_str()); + return ConfigurationManager::instance().exportToFile(accountId.c_str(), path.c_str(), password.c_str()); } bool diff --git a/src/qtwrapper/configurationmanager_wrap.h b/src/qtwrapper/configurationmanager_wrap.h index 2df61484cafcb14aaaf9e0e6862183ab3d7a94b4..5223bc710c5d8f2cd4facea711b93755fa2fd4fe 100644 --- a/src/qtwrapper/configurationmanager_wrap.h +++ b/src/qtwrapper/configurationmanager_wrap.h @@ -190,8 +190,8 @@ public Q_SLOTS: // METHODS return DRing::exportOnRing(accountID.toStdString(), password.toStdString()); } - bool exportToFile(const QString& accountID, const QString& destinationPath) { - return DRing::exportToFile(accountID.toStdString(), destinationPath.toStdString()); + bool exportToFile(const QString& accountID, const QString& destinationPath, const QString& password = {}) { + return DRing::exportToFile(accountID.toStdString(), destinationPath.toStdString(), password.toStdString()); } MapStringString getKnownRingDevices(const QString& accountID) { diff --git a/test/mocks/configurationmanager_mock.h b/test/mocks/configurationmanager_mock.h index 392d8d6b569e9672ef04ea811ad60f78260a4e4c..6373b9710d7f81239dbec0037e165704703740df 100644 --- a/test/mocks/configurationmanager_mock.h +++ b/test/mocks/configurationmanager_mock.h @@ -144,10 +144,11 @@ public Q_SLOTS: // METHODS return false; } - bool exportToFile(const QString& accountId, const QString& destinationPath) + bool exportToFile(const QString& accountId, const QString& destinationPath, const QString& password = {}) { Q_UNUSED(accountId) Q_UNUSED(destinationPath) + Q_UNUSED(password) return false; }