X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fcoreaccountmodel.cpp;h=a7a2f017333c0d132584c58bab910bda7e663436;hp=1ab159c89c22e6365b6f98c5447e2decc079e794;hb=86bd6b1ffb870e65af6d830a2ea16471c348ed5a;hpb=e472996a053e11d21ffef4a30f7d37461239cdab diff --git a/src/client/coreaccountmodel.cpp b/src/client/coreaccountmodel.cpp index 1ab159c8..a7a2f017 100644 --- a/src/client/coreaccountmodel.cpp +++ b/src/client/coreaccountmodel.cpp @@ -39,11 +39,13 @@ CoreAccountModel::CoreAccountModel(const CoreAccountModel *other, QObject *paren void CoreAccountModel::update(const CoreAccountModel *other) { clear(); - beginInsertRows(QModelIndex(), 0, other->_accounts.count() -1); + if (other->_accounts.count() > 0) { + beginInsertRows(QModelIndex(), 0, other->_accounts.count() -1); + _accounts = other->_accounts; + endInsertRows(); + } _internalAccount = other->internalAccount(); - _accounts = other->_accounts; _removedAccounts = other->_removedAccounts; - endInsertRows(); } void CoreAccountModel::load() {