mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Fixed add label, begin/end insert rows used to fail in this case, probably it was a qt bug, not it works as intended.
This commit is contained in:
parent
5bf5297229
commit
980b92a27f
@ -390,15 +390,9 @@ void ReadingListModel::addNewLabel(const QString &name, YACReader::LabelColors c
|
|||||||
QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath);
|
QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath);
|
||||||
qulonglong id = DBHelper::insertLabel(name, color, db);
|
qulonglong id = DBHelper::insertLabel(name, color, db);
|
||||||
|
|
||||||
Q_UNUSED(id);
|
int newPos = addLabelIntoList(new LabelItem(QList<QVariant>() << name << YACReader::colorToName(color) << id << color));
|
||||||
|
beginInsertRows(QModelIndex(),specialLists.count()+1+newPos+1, specialLists.count()+1+newPos+1);
|
||||||
|
|
||||||
beginInsertRows(QModelIndex(),0, 0);
|
|
||||||
|
|
||||||
// using the specfic row pos for inserting doesnt work
|
|
||||||
// int newPos = addLabelIntoList(new LabelItem(QList<QVariant>() << name << YACReader::colorToName(color) << id << color));
|
|
||||||
// beginInsertRows(QModelIndex(),specialLists.count()+1+newPos+1, specialLists.count()+1+newPos+1);
|
|
||||||
|
|
||||||
// endInsertRows();
|
|
||||||
|
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user