MCPcopy Create free account
hub / github.com/YACReader/yacreader / addReadingList

Method addReadingList

YACReaderLibrary/db/reading_list_model.cpp:402–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402void ReadingListModel::addReadingList(const QString &name)
403{
404 QString connectionName = "";
405 {
406 QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath);
407 beginInsertRows(QModelIndex(), 0, 0); // TODO calculate the right coordinates before inserting
408
409 qulonglong id = DBHelper::insertReadingList(name, db);
410 ReadingListItem *newItem;
411 rootItem->appendChild(newItem = new ReadingListItem(QList<QVariant>()
412 << name
413 << id
414 << false
415 << true
416 << 0));
417
418 items.insert(id, newItem);
419
420 endInsertRows();
421 connectionName = db.connectionName();
422 }
423 QSqlDatabase::removeDatabase(connectionName);
424}
425
426void ReadingListModel::addReadingListAt(const QString &name, const QModelIndex &mi)
427{

Callers 1

addNewReadingListMethod · 0.80

Calls 3

QModelIndexClass · 0.50
appendChildMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected