Skip to content

Commit

Permalink
Merge pull request #387 from YACReader/develop
Browse files Browse the repository at this point in the history
9.13.1
  • Loading branch information
luisangelsm authored Jul 16, 2023
2 parents b609ff9 + 02342ab commit 214ae69
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Version counting is based on semantic versioning (Major.Feature.Patch)

## 9.13.1

### YACReaderLibrary
* Fix crash when dropping comics in sublists

## 9.13

### YACReaderLibrary
Expand Down
5 changes: 5 additions & 0 deletions YACReaderLibrary/db/reading_list_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,13 @@ bool ReadingListModel::canDropMimeData(const QMimeData *data, Qt::DropAction act
QByteArray rawData = data->data(YACReader::YACReaderLibrarSubReadingListMimeDataFormat);
QDataStream in(&rawData, QIODevice::ReadOnly);
in >> sublistsRows; // deserialize the list of indentifiers

if (sublistsRows.isEmpty())
return false;

if (parent.row() != sublistsRows.at(0).second)
return false;

return data->formats().contains(YACReader::YACReaderLibrarSubReadingListMimeDataFormat);
}
}
Expand Down
12 changes: 6 additions & 6 deletions YACReaderLibrary/db_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1363,10 +1363,10 @@ void DBHelper::insertComicsInFavorites(const QList<ComicDB> &comicsList, QSqlDat

void DBHelper::insertComicsInLabel(const QList<ComicDB> &comicsList, qulonglong labelId, QSqlDatabase &db)
{
QSqlQuery getNumComicsInFavoritesQuery(QString("SELECT count(*) FROM comic_label WHERE label_id = %1;").arg(labelId), db);
getNumComicsInFavoritesQuery.next();
QSqlQuery getNumComics(QString("SELECT count(*) FROM comic_label WHERE label_id = %1;").arg(labelId), db);
getNumComics.next();

int numComics = getNumComicsInFavoritesQuery.value(0).toInt();
int numComics = getNumComics.value(0).toInt();

db.transaction();

Expand All @@ -1388,10 +1388,10 @@ void DBHelper::insertComicsInLabel(const QList<ComicDB> &comicsList, qulonglong

void DBHelper::insertComicsInReadingList(const QList<ComicDB> &comicsList, qulonglong readingListId, QSqlDatabase &db)
{
QSqlQuery getNumComicsInFavoritesQuery("SELECT count(*) FROM comic_reading_list;", db);
getNumComicsInFavoritesQuery.next();
QSqlQuery getNumComics("SELECT count(*) FROM comic_reading_list;", db);
getNumComics.next();

int numComics = getNumComicsInFavoritesQuery.value(0).toInt();
int numComics = getNumComics.value(0).toInt();

db.transaction();

Expand Down

0 comments on commit 214ae69

Please sign in to comment.