Show the current type as checked in the context menu

This commit is contained in:
Luis Ángel San Martín
2024-01-19 16:43:37 +01:00
parent 9ae4911b78
commit abdf5bda4f
3 changed files with 133 additions and 42 deletions

View File

@ -1030,6 +1030,12 @@ void ComicModel::setComicsType(QList<QModelIndex> list, FileType type)
connectionName = db.connectionName();
}
QSqlDatabase::removeDatabase(connectionName);
foreach (QModelIndex mi, list) {
_data.value(mi.row())->setData(ComicModel::Type, QVariant::fromValue(type));
}
emit dataChanged(index(list.first().row(), ComicModel::Type), index(list.last().row(), ComicModel::Type), QVector<int>() << TypeRole);
}
qint64 ComicModel::asignNumbers(QList<QModelIndex> list, int startingNumber)