mirror of
https://github.com/YACReader/yacreader
synced 2025-07-21 06:24:39 -04:00
actualizada la informaci?n de p?gina actual en la biblioteca tras cerrar el visor
This commit is contained in:
@ -15,7 +15,7 @@ public:
|
||||
QVariant data(int column) const;
|
||||
void setData(int column,const QVariant & value);
|
||||
int row() const;
|
||||
unsigned long long int id; //TODO sustituir por una clase adecuada
|
||||
//unsigned long long int id; //TODO sustituir por una clase adecuada
|
||||
//Comic comic;
|
||||
private:
|
||||
QList<QVariant> itemData;
|
||||
|
@ -563,3 +563,23 @@ void TableModel::remove(int row)
|
||||
{
|
||||
removeInTransaction(row);
|
||||
}
|
||||
|
||||
void TableModel::reload(const ComicDB & comic)
|
||||
{
|
||||
int row = 0;
|
||||
bool found = false;
|
||||
foreach(TableItem * item,_data)
|
||||
{
|
||||
if(item->data(ID).toULongLong() == comic.id)
|
||||
{
|
||||
found = true;
|
||||
item->setData(CURRENT_PAGE,comic.info.currentPage);
|
||||
item->setData(HAS_BEEN_OPENED,true);
|
||||
break;
|
||||
|
||||
}
|
||||
row++;
|
||||
}
|
||||
if(found)
|
||||
emit dataChanged(index(row,CURRENT_PAGE),index(row,CURRENT_PAGE));
|
||||
}
|
@ -50,6 +50,7 @@ public:
|
||||
qint64 asignNumbers(QList<QModelIndex> list,int startingNumber);
|
||||
void remove(ComicDB * comic, int row);
|
||||
void removeInTransaction(int row);
|
||||
void reload(const ComicDB & comic);
|
||||
|
||||
public slots:
|
||||
void remove(int row);
|
||||
|
Reference in New Issue
Block a user