Commit ad6e271b authored by Karel Slaný's avatar Karel Slaný

Merge branch 'change-account-username' into 'develop'

Allow to Change Account Username

See merge request !132
parents 7233124f 754b4199
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -39,6 +39,7 @@ Item {
property bool isNewAccount: (userName == "")
property string sLoginMethod: "pwd"
property string oldUserName
Component.onCompleted: {
if (!isNewAccount) {
......@@ -95,14 +96,28 @@ Item {
isds.doIsdsAction("addNewAccount", userNameTextField.text.toString())
}
} else {
// Update account context data.
if (accounts.updateAccount(accountModel, sLoginMethod,
accountNameTextField.text.toString(),
userNameTextField.text.toString(),
passwordTextField.text.toString(),
testAccount.checked, rememberPassword.checked,
useLS.checked, certPathLabelId.text.toString())) {
settings.saveAllSettings(accountModel)
// Change account user name.
if (userNameTextField.text.toString() !== oldUserName) {
// Create temporary account with a new user name.
if (accounts.prepareChangeUserName(accountModel, sLoginMethod,
accountNameTextField.text.toString(),
userNameTextField.text.toString(),
passwordTextField.text.toString(),
testAccount.checked, rememberPassword.checked,
useLS.checked, certPathLabelId.text.toString(), oldUserName)) {
// Login to isds with the new user name.
isds.doIsdsAction("changeUserName", userNameTextField.text.toString())
}
} else {
// Update account context data.
if (accounts.updateAccount(accountModel, sLoginMethod,
accountNameTextField.text.toString(),
userNameTextField.text.toString(),
passwordTextField.text.toString(),
testAccount.checked, rememberPassword.checked,
useLS.checked, certPathLabelId.text.toString())) {
settings.saveAllSettings(accountModel)
}
}
pageView.pop(StackView.Immediate)
}
......@@ -114,24 +129,28 @@ Item {
settings.saveAllSettings(accountModel)
pageView.pop(StackView.Immediate)
}
}
Connections {
// Connection is activated when login to new account fails.
target: isds
onUnsuccessedLoginToIsdsSig: {
if (accounts.removeAccount(accountModel, userName, false)) {
settings.saveAllSettings(accountModel)
}
}
}
Connections {
// Connection is activated when login phase was succeeded and
// try download account info.
target: isds
onRunGetAccountInfoSig: {
settings.saveAllSettings(accountModel)
isds.getAccountInfo(userName)
}
onRunChangeUserNameSig: {
// Login to isds with new user name has been succeeded.
// Get databox ID of new user name.
var dbId = isds.getAccountDbId(userName)
// Change username and rename databases.
if (accounts.changeAccountUserName(accountModel,
accountNameTextField.text.toString(),
userNameTextField.text.toString(),
useLS.checked, oldUserName, dbId)) {
settings.saveAllSettings(accountModel)
isds.getAccountInfo(userName)
}
}
}
}
}
......@@ -173,7 +192,7 @@ Item {
if (sLoginMethod === "cert") {
certificateLabel.visible = true
certPathButtonId.visible = true
certPathLabelId.visible = (certPathLabelId.text != "")
certPathLabelId.visible = (certPathLabelId.text !== "")
} else {
certificateLabel.visible = false
certPathLabelId.visible = false
......@@ -318,7 +337,7 @@ Item {
useLS.checked = storeToDisk
certPathLabelId.text = certPath
loginMethodComboBox.selectCurrentKey(loginMethod)
userNameTextField.enabled = false
oldUserName = userName
testAccount.enabled = false
headerBar.title = qsTr("Account settings")
}
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -149,6 +149,44 @@ public:
static
void loadModelCounters(AccountListModel *accountModel);
/*!
* @brief Prepare change account user name.
*
* @param[in,out] acntModelVariant QVariant holding account model.
* @param[in] loginMetod User name identifying account.
* @param[in] acntName Account name.
* @param[in] newUserName New user name identifying account.
* @param[in] pwd Password.
* @param[in] isTestAccount True if account is ISDS test environment.
* @param[in] rememberPwd True if remember password.
* @param[in] storeToDisk True if database store to local storage.
* @param[in] certPath Certificate path (can be null).
* @param[in] oldUserName Original old user name of account.
* @return True if success.
*/
Q_INVOKABLE
bool prepareChangeUserName(const QVariant &acntModelVariant,
const QString &loginMetod, const QString &acntName,
const QString &newUserName, const QString &pwd, bool isTestAccount,
bool rememberPwd, bool storeToDisk, const QString &certPath,
const QString &oldUserName);
/*!
* @brief Change account user name and store account to settings.
*
* @param[in,out] acntModelVariant QVariant holding account model.
* @param[in] acntName Account name.
* @param[in] newUserName New user name identifying account.
* @param[in] storeToDisk True if database store to local storage.
* @param[in] oldUserName Original user name of account.
* @param[in] newDbId Databox id of new user name.
* @return True if success.
*/
Q_INVOKABLE
bool changeAccountUserName(const QVariant &acntModelVariant,
const QString &acntName, const QString &newUserName,
bool storeToDisk, const QString &oldUserName, const QString &newDbId);
signals:
/*!
* @brief Send account settings to QML settings page.
......@@ -157,7 +195,7 @@ signals:
* @param[in] userName User name identifying account.
* @param[in] loginMetod User name identifying account.
* @param[in] pwd Password.
* @param[in] isTestAccount True if account is isds test enveiroment.
* @param[in] isTestAccount True if account is ISDS test environment.
* @param[in] rememberPwd True if remember password.
* @param[in] storeToDisk True if database store to local storage.
* @param[in] certPath Certificate path (can be null).
......@@ -167,9 +205,19 @@ signals:
bool rememberPwd, bool storeToDisk, QString certPath);
/*!
* @brief Remove isds context for account in the isds session.
* @brief Remove ISDS context for account in the ISDS session.
*
* @param[in] acntName Account name.
* @param[in] userName User name.
*/
void removeIsdsCtx(QString userName);
private:
/*!
* @brief Delete account from model.
*
* @param[in,out] accountModel Model whose counters should be updated.
* @param[in] userName User name identifying account.
*/
void deleteAccountFromModel(AccountListModel *accountModel,
const QString &userName);
};
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -727,24 +727,25 @@ void AccountListModel::saveAccountsToSettings(const QString &pinVal,
}
}
int AccountListModel::addAccount(const AcntData &acntData, QModelIndex *idx)
enum AccountListModel::AddAcntResult AccountListModel::addAccount(
const AcntData &acntData, QModelIndex *idx)
{
if (Q_UNLIKELY(m_accountsPtr == Q_NULLPTR)) {
Q_ASSERT(0);
return -1;
return AA_ERR;
}
const QString userName(acntData.userName());
if (userName.isEmpty()) {
Q_ASSERT(0);
return -1;
return AA_ERR;
}
if (m_accountsPtr->contains(userName)) {
logWarningNL("Account with username '%s' already exists.",
userName.toUtf8().constData());
return -2;
return AA_EXISTS;
}
Q_ASSERT(!m_userNames.contains(userName));
......@@ -761,7 +762,7 @@ int AccountListModel::addAccount(const AcntData &acntData, QModelIndex *idx)
*idx = index(m_userNames.size() - 1, 0, QModelIndex());
}
return 0;
return AA_SUCCESS;
}
void AccountListModel::deleteAccount(const QString &userName)
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -152,6 +152,15 @@ public:
};
Q_ENUM(Roles)
/*!
* @brief Return add account result.
*/
enum AddAcntResult {
AA_SUCCESS = 0, /*!< Operation was successful. */
AA_EXISTS, /*!< Account already exists in the model. */
AA_ERR /*!< Internal error. */
};
/* Don't forget to declare various properties to the QML system. */
static
void declareQML(void);
......@@ -239,12 +248,11 @@ public:
* @brief Add account.
*
* @patam[in] acntSettings Settings data to be added into the model.
* @param[out] idx Index of newly added account if specified.
* @return -2 if account already exists,
* -1 if account could not be added,
* 0 if account was added.
* @param[out] idx Index of newly added account if specified.
* @return Error state.
*/
int addAccount(const AcntData &acntData, QModelIndex *idx = Q_NULLPTR);
enum AddAcntResult addAccount(const AcntData &acntData,
QModelIndex *idx = Q_NULLPTR);
/*!
* @brief Delete account.
......
......@@ -261,6 +261,8 @@ void IsdsWrapper::doIsdsAction(const QString &isdsAction,
emit runDownloadMessageSig(userName);
} else if (isdsAction == "addNewAccount") {
emit runGetAccountInfoSig(userName);
} else if (isdsAction == "changeUserName") {
emit runChangeUserNameSig(userName);
} else if (isdsAction == "getAccountInfo") {
emit runGetAccountInfoSig(userName);
} else if (isdsAction == "syncOneAccount") {
......@@ -321,12 +323,46 @@ void IsdsWrapper::getAccountInfo(const QString &userName)
arg(userName), true, true);
TaskDownloadAccountInfo *task;
/* Last param: true = store account info into database */
task = new (std::nothrow) TaskDownloadAccountInfo(
m_isdsSession.isdsCtxMap[userName], &m_netLayer);
m_isdsSession.isdsCtxMap[userName], &m_netLayer, true);
task->setAutoDelete(true);
GlobInstcs::workPoolPtr->assignHi(task);
}
QString IsdsWrapper::getAccountDbId(const QString &userName)
{
debugFuncCall();
if (Q_UNLIKELY(GlobInstcs::workPoolPtr == Q_NULLPTR)) {
Q_ASSERT(0);
return QString();
}
QString errTxt(tr("Wrong username"));
if (userName.isEmpty()) {
Dialogues::errorMessage(Dialogues::CRITICAL,
tr("Error"), errTxt, tr("Internal error"));
return QString();
}
/* User must be logged to isds */
if (!isLoggedToIsds(userName)) {
return QString();
}
TaskDownloadAccountInfo *task;
/* Last param: false = account info won't store into database */
task = new (std::nothrow) TaskDownloadAccountInfo(
m_isdsSession.isdsCtxMap[userName], &m_netLayer, false);
task->setAutoDelete(false);
GlobInstcs::workPoolPtr->runSingle(task);
QString dbId(task->m_dbID);
delete task; task = Q_NULLPTR;
return dbId;
}
int IsdsWrapper::findDataboxFulltext(const QString &userName,
const QVariant &dbModelVariant, const QString &phrase,
const QString &searchType, const QString &searchScope, int page)
......@@ -516,7 +552,7 @@ bool IsdsWrapper::isCorrectPassword(const QString &password)
void IsdsWrapper::inputDialogCancelPostAction(const QString &isdsAction,
const QString &userName)
{
if (isdsAction == "addNewAccount") {
if (isdsAction == "addNewAccount" || isdsAction == "changeUserName") {
emit unsuccessedLoginToIsdsSig(userName);
}
}
......@@ -1124,6 +1160,14 @@ void IsdsWrapper::doLoginAction(const QString &isdsAction,
tr("ISDS returns:") + " " + m_isdsSession.isdsCtxMap[userName].last_isds_msg + "\n\n" +
tr("Check your login data and try again."));
emit unsuccessedLoginToIsdsSig(userName);
} else if (isdsAction == "changeUserName") {
Dialogues::errorMessage(Dialogues::CRITICAL,
tr("Username change: %1").arg(userName),
tr("Username could not be changed because an error occurred while trying to log in with new user name '%1'.")
.arg(userName),
tr("ISDS returns:") + " " + m_isdsSession.isdsCtxMap[userName].last_isds_msg + "\n\n" +
tr("Check your login data and try again."));
emit unsuccessedLoginToIsdsSig(userName);
} else {
/* Show error login dialogue */
Dialogues::errorMessage(Dialogues::CRITICAL,
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -130,6 +130,15 @@ public:
Q_INVOKABLE
void getAccountInfo(const QString &userName);
/*!
* @brief Get databox ID from ISDS.
*
* @param[in] userName Account username string.
* @return Return databox ID.
*/
Q_INVOKABLE
QString getAccountDbId(const QString &userName);
/*!
* @brief Downloads delivery info.
*
......@@ -347,6 +356,13 @@ signals:
*/
void downloadAccountInfoFinishedSig(QString userName);
/*!
* @brief Signal is emitted when account username can be changed.
*
* @param[in] userName Account user name string.
*/
void runChangeUserNameSig(QString userName);
/*!
* @brief Run download mesasge isds action from QML.
*
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -608,6 +608,56 @@ fail:
return Isds::DbOwnerInfo();
}
bool AccountDb::changeUserName(const QString &oldUserName,
const QString &newUserName)
{
QSqlQuery query(m_db);
QString queryStr;
if (!m_db.isOpen()) {
logErrorNL("%s", "Account database seems not to be open.");
goto fail;
}
beginTransaction();
queryStr = "UPDATE account_info "
"SET key = :newUserName WHERE key = :oldUserName";
if (!query.prepare(queryStr)) {
logErrorNL("Cannot prepare SQL query: %s",
query.lastError().text().toUtf8().constData());
goto fail;
}
query.bindValue(":oldUserName", oldUserName);
query.bindValue(":newUserName", newUserName);
if (!query.exec()) {
logErrorNL("Cannot execute SQL query: %s",
query.lastError().text().toUtf8().constData());
goto fail;
}
queryStr = "UPDATE user_info "
"SET key = :newUserName WHERE key = :oldUserName";
if (!query.prepare(queryStr)) {
logErrorNL("Cannot prepare SQL query: %s",
query.lastError().text().toUtf8().constData());
goto fail;
}
query.bindValue(":oldUserName", oldUserName);
query.bindValue(":newUserName", newUserName);
if (query.exec()) {
commitTransaction();
return true;
} else {
logErrorNL("Cannot execute SQL query: %s",
query.lastError().text().toUtf8().constData());
}
fail:
rollbackTransaction();
return false;
}
QList<class SQLiteTbl *> AccountDb::listOfTables(void) const
{
QList<class SQLiteTbl *> tables;
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -117,6 +117,16 @@ public:
*/
const Isds::DbOwnerInfo getOwnerInfo(const QString &key) const;
/*!
* @brief Change user name in account db.
*
* @param[in] oldUserName Current account user name.
* @param[in] newUserName New account user name.
* @return True on success.
*/
bool changeUserName(const QString &oldUserName,
const QString &newUserName);
protected:
/*!
* @brief Returns list of tables.
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -96,6 +96,11 @@ bool FileDb::reopenDb(const QString &newFileName)
return SQLiteDb::reopenDb(newFileName, SQLiteDb::CREATE_MISSING);
}
bool FileDb::moveDb(const QString &newFileName)
{
return SQLiteDb::moveDb(newFileName, SQLiteDb::CREATE_MISSING);
}
bool FileDb::deleteFilesFromDb(qint64 dmId)
{
QSqlQuery query(m_db);
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -67,6 +67,14 @@ public:
*/
bool reopenDb(const QString &newFileName);
/*!
* @brief Move db.
*
* @param[in] newFileName New file path.
* @return True on success.
*/
bool moveDb(const QString &newFileName);
/*!
* @brief Delete all files related to message with given id.
*
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -68,6 +68,11 @@ bool MessageDb::reopenDb(const QString &newFileName)
return SQLiteDb::reopenDb(newFileName, SQLiteDb::CREATE_MISSING);
}
bool MessageDb::moveDb(const QString &newFileName)
{
return SQLiteDb::moveDb(newFileName, SQLiteDb::CREATE_MISSING);
}
bool MessageDb::deleteMessageFromDb(qint64 msgId)
{
QSqlQuery query(m_db);
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -70,6 +70,14 @@ public:
*/
bool reopenDb(const QString &newFileName);
/*!
* @brief Move db.
*
* @param[in] newFileName New file path.
* @return True on success.
*/
bool moveDb(const QString &newFileName);
/*!
* @brief Delete message from db.
*
......
......@@ -33,16 +33,18 @@
#include "src/xml/xml_get_db_user_info.h"
TaskDownloadAccountInfo::TaskDownloadAccountInfo(IsdsSession::IsdsContext &ctx,
NetLayer *netLayer)
NetLayer *netLayer, bool storeToDb)
: m_result(DL_ERR),
m_dbID(),
m_ctx(ctx),
m_netLayer(netLayer)
m_netLayer(netLayer),
m_storeToDb(storeToDb)
{
}
void TaskDownloadAccountInfo::run(void)
{
if (Q_NULLPTR == m_netLayer) {
if (Q_UNLIKELY(Q_NULLPTR == m_netLayer)) {
Q_ASSERT(0);
return;
}
......@@ -52,13 +54,15 @@ void TaskDownloadAccountInfo::run(void)
logDebugLv0NL("%s", "--------------ACCOUNT INFO TASK---------------");
logDebugLv0NL("Starting in thread '%p'", QThread::currentThreadId());
m_result = downloadAccountInfo(m_ctx, m_netLayer);
m_result = downloadAccountInfo(m_ctx, m_netLayer, m_storeToDb, m_dbID);
if (GlobInstcs::msgProcEmitterPtr != Q_NULLPTR) {
emit GlobInstcs::msgProcEmitterPtr->downloadAccountInfoFinishedSignal(
m_ctx.username,
TaskDownloadAccountInfo::DL_SUCCESS == m_result,
m_ctx.last_isds_msg);
if (m_storeToDb) {
if (GlobInstcs::msgProcEmitterPtr != Q_NULLPTR) {
emit GlobInstcs::msgProcEmitterPtr->downloadAccountInfoFinishedSignal(
m_ctx.username,
TaskDownloadAccountInfo::DL_SUCCESS == m_result,
m_ctx.last_isds_msg);
}
}
logDebugLv0NL("Finished in thread '%p'", QThread::currentThreadId());
......@@ -68,7 +72,8 @@ void TaskDownloadAccountInfo::run(void)
}
enum TaskDownloadAccountInfo::Result TaskDownloadAccountInfo::downloadAccountInfo(
IsdsSession::IsdsContext &ctx, NetLayer *netLayer)
IsdsSession::IsdsContext &ctx, NetLayer *netLayer, bool storeToDb,
QString &dbID)
{
if (ctx.username.isEmpty()) {
logErrorNL("%s", "Account user name missing!");
......@@ -97,6 +102,12 @@ enum TaskDownloadAccountInfo::Result TaskDownloadAccountInfo::downloadAccountInf
return DL_XML_ERROR;
}
dbID = dbOwnerInfo.dbID();
if (!storeToDb) {
return DL_SUCCESS;
}
/* Store data into db */
if (!DbWrapper::insertAccountInfoToDb(ctx.username, dbOwnerInfo)) {
logErrorNL("Cannot store owner info into database: '%s'",
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -21,8 +21,7 @@
* the two.
*/
#ifndef _TASK_DOWNLOAD_ACCOUNT_INFO_H_
#define _TASK_DOWNLOAD_ACCOUNT_INFO_H_
#pragma once
#include "src/net/isds_session.h"
#include "src/net/net_layer.h"
......@@ -47,11 +46,12 @@ public:
/*!
* @brief Constructor.
*
* @param[in] ctx Account isds context (include username).
* @param[in] netLayer Pointer to network manager.
* @param[in] ctx Account isds context (include username).
* @param[in] netLayer Pointer to network manager.
* @param[in] storeToDb True if account info will store into database.
*/
explicit TaskDownloadAccountInfo(IsdsSession::IsdsContext &ctx,
NetLayer *netLayer);
NetLayer *netLayer, bool storeToDb);
/*!
* @brief Performs actual account info download.
......@@ -62,15 +62,18 @@ public:
/*!
* @brief Download account info.
*
* @param[in] ctx Account isds context (include username).
* @param[in] netLayer Pointer to network manager.
* @param[in] ctx Account isds context (include username).
* @param[in] netLayer Pointer to network manager.
* @param[in] storeToDb True if account info will store into database.
* @param[out] dbID Holds and returns databox ID.
* @return Error state.
*/
static
enum Result downloadAccountInfo(IsdsSession::IsdsContext &ctx,
NetLayer *netLayer);
NetLayer *netLayer, bool storeToDb, QString &dbID);
enum Result m_result; /*!< Return state. */
QString m_dbID; /*!< Return databox ID. */
private:
/*!
......@@ -81,6 +84,5 @@ private:
IsdsSession::IsdsContext m_ctx; /*!< Account isds context. */
NetLayer *m_netLayer; /*!< Pointer to network manager to send request. */
bool m_storeToDb; /*!< True if account info will store into database. */
};
#endif /* _TASK_DOWNLOAD_ACCOUNT_INFO_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment