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

Method setCustomFolderCover

YACReaderLibrary/db/folder_model.cpp:711–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709}
710
711void FolderModel::setCustomFolderCover(const QModelIndex &index, const QString &path)
712{
713 QString connectionName = "";
714 {
715 QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath);
716 db.transaction();
717
718 auto item = static_cast<FolderItem *>(index.internalPointer());
719 item->setData(FolderModel::CustomImage, path);
720
721 Folder f = DBHelper::loadFolder(item->id, db);
722 f.customImage = path;
723 DBHelper::update(f, db);
724
725 db.commit();
726 connectionName = db.connectionName();
727 }
728 QSqlDatabase::removeDatabase(connectionName);
729
730 emit dataChanged(index, index);
731}
732
733void FolderModel::resetFolderCover(const QModelIndex &index)
734{

Callers

nothing calls this directly

Calls 1

setDataMethod · 0.45

Tested by

no test coverage detected