[GUI] Fix object update notification handling

This commit is contained in:
Nathan Hourt 2015-07-21 17:56:52 -04:00
parent f72f07b05b
commit ce84de41be
2 changed files with 9 additions and 3 deletions

View file

@ -151,7 +151,7 @@ namespace graphene { namespace app {
* *
*/ */
std::map<string,full_account> get_full_accounts(std::function<void(const variant&)> callback, std::map<string,full_account> get_full_accounts(std::function<void(const variant&)> callback,
const vector<string>& names_or_ids); const vector<string>& names_or_ids);
/** /**
* Stop receiving updates generated by get_full_accounts() * Stop receiving updates generated by get_full_accounts()

View file

@ -141,7 +141,13 @@ void ChainDataModel::getAccountImpl(QString accountIdentifier, Account* const *
try { try {
ilog("Fetching account ${acct}", ("acct", accountIdentifier.toStdString())); ilog("Fetching account ${acct}", ("acct", accountIdentifier.toStdString()));
auto result = m_db_api->get_full_accounts([this](const fc::variant& v) { auto result = m_db_api->get_full_accounts([this](const fc::variant& v) {
processUpdatedObject(v); vector<variant> updates = v.as<vector<variant>>();
for (const variant& update : updates) {
if (update.is_object())
processUpdatedObject(update);
else
elog("Handling object deletions is not yet implemented: ${update}", ("update", update));
}
}, {accountIdentifier.toStdString()}); }, {accountIdentifier.toStdString()});
fc::optional<full_account> accountPackage; fc::optional<full_account> accountPackage;