| 384 | } |
| 385 | |
| 386 | void ReadingListModel::addNewLabel(const QString &name, YACReader::LabelColors color) |
| 387 | { |
| 388 | QString connectionName = ""; |
| 389 | { |
| 390 | QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath); |
| 391 | qulonglong id = DBHelper::insertLabel(name, color, db); |
| 392 | |
| 393 | int newPos = addLabelIntoList(new LabelItem(QList<QVariant>() << name << YACReader::colorToName(color) << id << color)); |
| 394 | beginInsertRows(QModelIndex(), specialLists.count() + 1 + newPos + 1, specialLists.count() + 1 + newPos + 1); |
| 395 | |
| 396 | endInsertRows(); |
| 397 | connectionName = db.connectionName(); |
| 398 | } |
| 399 | QSqlDatabase::removeDatabase(connectionName); |
| 400 | } |
| 401 | |
| 402 | void ReadingListModel::addReadingList(const QString &name) |
| 403 | { |
no test coverage detected