clang-tidy: Don't call virtual methods from CoreAccountModel's ctor
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 4 Sep 2018 22:36:11 +0000 (00:36 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
src/client/coreaccountmodel.cpp

index 0e323bb..f7c7724 100644 (file)
@@ -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();
 }