27 : QAbstractListModel(parent),
34 : QAbstractListModel(parent),
45 beginInsertRows(QModelIndex(), 0, other->
_accounts.count() -1);
91 beginRemoveRows(QModelIndex(), 0,
rowCount()-1);
101 if (!index.isValid() || index.row() >=
rowCount() || index.column() >= 1)
107 case Qt::DisplayRole:
110 return QVariant::fromValue<AccountId>(acc.
accountId());
112 return acc.
uuid().toString();
131 if (idx.isValid() && idx.row() <
_accounts.count())
145 QList<AccountId> list;
163 if (acc.
uuid().isNull())
164 acc.
setUuid(QUuid::createUuid());
170 for (
int i = 1;; i++) {
184 emit dataChanged(index(idx, 0), index(idx, 0));
202 qWarning() <<
"Trying to insert a second internal account in CoreAccountModel, ignoring";
213 beginInsertRows(QModelIndex(), idx, idx);
225 beginRemoveRows(QModelIndex(), idx, idx);
245 for (
int i = 0; i <
_accounts.count(); i++) {
246 if (
_accounts.at(i).accountId() == accId)
249 return QModelIndex();
256 return idx.isValid() ? idx.row() : -1;