X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fcoreaccountmodel.cpp;h=f7c77240664574ba0935a7d9fe373440707214d9;hb=c194ed5fb3d15e14b9364f9796d3521910dc72fe;hp=0d5f4d41b4f541631f80b1751352c8191a6de00c;hpb=b65b9f7615165e8700a44d59b7275a55558dd45b;p=quassel.git diff --git a/src/client/coreaccountmodel.cpp b/src/client/coreaccountmodel.cpp index 0d5f4d41..f7c77240 100644 --- a/src/client/coreaccountmodel.cpp +++ b/src/client/coreaccountmodel.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -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(); } @@ -155,6 +153,12 @@ bool CoreAccountModel::operator==(const CoreAccountModel &other) const } +bool CoreAccountModel::operator!=(const CoreAccountModel &other) const +{ + return !(*this == other); +} + + // TODO with Qt 4.6, use QAbstractItemModel move semantics to properly do this AccountId CoreAccountModel::createOrUpdateAccount(const CoreAccount &newAcc) {