mirror of
https://github.com/YACReader/yacreader
synced 2025-07-26 00:44:59 -04:00
Corregido picture flow, ahora centerIndexChanged funciona igual que en la versi?n OpenGL.
Implementada la versi?n RC del borrado de c?mics.
This commit is contained in:
@ -435,6 +435,33 @@ QModelIndex TableModel::getIndexFromId(quint64 id)
|
||||
return index(i,0);
|
||||
}
|
||||
|
||||
void TableModel::startTransaction(int first, int last)
|
||||
{
|
||||
beginRemoveRows(QModelIndex(),first,last);
|
||||
dbTransaction = DataBaseManagement::loadDatabase(_databasePath);
|
||||
dbTransaction.transaction();
|
||||
}
|
||||
|
||||
void TableModel::finishTransaction()
|
||||
{
|
||||
dbTransaction.commit();
|
||||
dbTransaction.close();
|
||||
QSqlDatabase::removeDatabase(_databasePath);
|
||||
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
void TableModel::removeInTransaction(int row)
|
||||
{
|
||||
ComicDB c = DBHelper::loadComic(_data.at(row)->data(ID).toULongLong(),dbTransaction);
|
||||
|
||||
DBHelper::removeFromDB(&c,dbTransaction);
|
||||
|
||||
removeRow(row);
|
||||
delete _data.at(row);
|
||||
_data.removeAt(row);
|
||||
}
|
||||
|
||||
void TableModel::remove(ComicDB * comic, int row)
|
||||
{
|
||||
beginRemoveRows(QModelIndex(),row,row);
|
||||
@ -449,4 +476,14 @@ void TableModel::remove(ComicDB * comic, int row)
|
||||
db.close();
|
||||
QSqlDatabase::removeDatabase(_databasePath);
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
ComicDB TableModel::getComic(int row)
|
||||
{
|
||||
return getComic(index(row,0));
|
||||
}
|
||||
|
||||
void TableModel::remove(int row)
|
||||
{
|
||||
removeInTransaction(row);
|
||||
}
|
Reference in New Issue
Block a user