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

Method addNewLabel

YACReaderLibrary/db/reading_list_model.cpp:386–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386void 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
402void ReadingListModel::addReadingList(const QString &name)
403{

Callers 1

showAddNewLabelDialogMethod · 0.80

Calls 1

QModelIndexClass · 0.50

Tested by

no test coverage detected