mirror of
https://github.com/YACReader/yacreader
synced 2025-09-20 12:14:37 -04:00
fixed adding the first label
This commit is contained in:
@ -216,9 +216,11 @@ 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);
|
||||||
|
|
||||||
|
beginInsertRows(QModelIndex(),0, 0);
|
||||||
|
|
||||||
int newPos = addLabelIntoList(new LabelItem(QList<QVariant>() << name << YACReader::colorToName(color) << id << color));
|
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(),specialLists.count()+1+newPos+1, specialLists.count()+1+newPos+1);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
|
|
||||||
QSqlDatabase::removeDatabase(_databasePath);
|
QSqlDatabase::removeDatabase(_databasePath);
|
||||||
|
Reference in New Issue
Block a user