X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fclient%2Fcoreaccountmodel.cpp;h=04ee15f566ce28564b7c2d42254daa967b90cb1f;hb=fcacaaf16551524c7ebb6114254d005274cc3d63;hp=0e323bb48f6d53333dc89963d1902d8ec1f18da8;hpb=db6e6642a43143bc45ddb0732d144815b68e37f8;p=quassel.git diff --git a/src/client/coreaccountmodel.cpp b/src/client/coreaccountmodel.cpp index 0e323bb4..04ee15f5 100644 --- a/src/client/coreaccountmodel.cpp +++ b/src/client/coreaccountmodel.cpp @@ -87,12 +87,10 @@ void CoreAccountModel::save() void CoreAccountModel::clear() { - if (rowCount()) { - beginRemoveRows(QModelIndex(), 0, rowCount()-1); - _internalAccount = 0; - _accounts.clear(); - endRemoveRows(); - } + beginResetModel(); + _internalAccount = 0; + _accounts.clear(); + endResetModel(); } @@ -252,7 +250,7 @@ QModelIndex CoreAccountModel::accountIndex(AccountId accId) const if (_accounts.at(i).accountId() == accId) return index(i, 0); } - return QModelIndex(); + return {}; }