From 6b12e7ecbf29f08095a99811990f642c18a5f748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Thu, 27 Nov 2014 12:56:14 +0100 Subject: [PATCH] fixed adding the first label --- YACReaderLibrary/db/reading_list_model.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/YACReaderLibrary/db/reading_list_model.cpp b/YACReaderLibrary/db/reading_list_model.cpp index 2674556a..ec7235a4 100644 --- a/YACReaderLibrary/db/reading_list_model.cpp +++ b/YACReaderLibrary/db/reading_list_model.cpp @@ -216,9 +216,11 @@ void ReadingListModel::addNewLabel(const QString &name, YACReader::LabelColors c QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath); qulonglong id = DBHelper::insertLabel(name, color, db); + beginInsertRows(QModelIndex(),0, 0); + int newPos = addLabelIntoList(new LabelItem(QList() << 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(); QSqlDatabase::removeDatabase(_databasePath);