Update the current comic model when the server gets a syn request

Sadly the grid view resets its scroll to origin. Not sure if it is going to bother anyone, we'll see.
This commit is contained in:
Luis Ángel San Martín 2022-10-15 12:53:02 +02:00
parent 928afa4675
commit e8f31b39ee
3 changed files with 23 additions and 0 deletions

View File

@ -896,6 +896,27 @@ void ComicModel::reloadContinueReading()
setupReadingModelData(_databasePath);
}
void ComicModel::reload()
{
switch (mode) {
case Folder:
setupFolderModelData(sourceId, _databasePath);
break;
case Favorites:
setupFavoritesModelData(_databasePath);
break;
case Reading:
setupReadingModelData(_databasePath);
break;
case Label:
setupLabelModelData(sourceId, _databasePath);
break;
case ReadingList:
setupReadingListModelData(sourceId, _databasePath);
break;
}
}
void ComicModel::remove(int row)
{
removeInTransaction(row);

View File

@ -112,6 +112,7 @@ public:
// void remove(ComicDB * comic, int row);
void removeInTransaction(int row);
void reloadContinueReading();
void reload();
void reload(const ComicDB &comic);
void resetComicRating(const QModelIndex &mi);

View File

@ -2812,6 +2812,7 @@ void LibraryWindow::importLibraryPackage()
void LibraryWindow::updateViewsOnClientSync()
{
comicsModel->reload();
contentViewsManager->updateCurrentComicView();
contentViewsManager->updateContinueReadingView();
}