Skip to content
Snippets Groups Projects
Commit 9b1b7d44 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Sébastien Blin
Browse files

accounts: don't return reference to string created on the stack


Change-Id: I0216f9beb141230c483271de1ebec0c90f56e438
Reviewed-by: default avatarSébastien Blin <sebastien.blin@savoirfairelinux.com>
parent 034fd313
No related branches found
No related tags found
No related merge requests found
...@@ -94,10 +94,10 @@ public: ...@@ -94,10 +94,10 @@ public:
}; };
static const std::string& getCurrAccId() { static const std::string& getCurrAccId() {
if (!instance().selectedAccountId.empty()) { if (instance().selectedAccountId.empty()) {
return instance().selectedAccountId; instance().selectedAccountId = accountModel().getAccountList().at(0);
} }
return accountModel().getAccountList()[0]; return instance().selectedAccountId;
}; };
static void setSelectedAccountId(const std::string& accountId) { static void setSelectedAccountId(const std::string& accountId) {
......
...@@ -480,6 +480,7 @@ SettingsWidget::delAccountSlot() ...@@ -480,6 +480,7 @@ SettingsWidget::delAccountSlot()
delDialog.exec(); delDialog.exec();
if (!LRCInstance::accountModel().getAccountList().size()) { if (!LRCInstance::accountModel().getAccountList().size()) {
LRCInstance::setSelectedAccountId("");
emit NavigationRequested(ScreenEnum::WizardScreen); emit NavigationRequested(ScreenEnum::WizardScreen);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment