mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Removed usage of QSqlRecoerd unless is totally necessary.
This commit is contained in:
parent
9ed1f0f306
commit
4d4556f7e2
@ -287,11 +287,15 @@ QList<ReadingList> DBHelper::getReadingLists(qulonglong libraryId)
|
|||||||
|
|
||||||
selectQuery.exec();
|
selectQuery.exec();
|
||||||
|
|
||||||
|
QSqlRecord record = selectQuery.record();
|
||||||
|
|
||||||
|
int name = record.indexOf("name");
|
||||||
|
int id = record.indexOf("id");
|
||||||
|
int ordering = record.indexOf("ordering");
|
||||||
|
|
||||||
while (selectQuery.next())
|
while (selectQuery.next())
|
||||||
{
|
{
|
||||||
QSqlRecord record = selectQuery.record();
|
ReadingList item(selectQuery.value(name).toString(), selectQuery.value(id).toLongLong(),selectQuery.value(ordering).toInt());
|
||||||
|
|
||||||
ReadingList item(record.value("name").toString(), record.value("id").toLongLong(),record.value("ordering").toInt());
|
|
||||||
|
|
||||||
if(list.isEmpty())
|
if(list.isEmpty())
|
||||||
{
|
{
|
||||||
@ -328,7 +332,7 @@ QList<ComicDB> DBHelper::getReadingListFullContent(qulonglong libraryId, qulongl
|
|||||||
subfolders.bindValue(":parentId", readingListId);
|
subfolders.bindValue(":parentId", readingListId);
|
||||||
subfolders.exec();
|
subfolders.exec();
|
||||||
while(subfolders.next())
|
while(subfolders.next())
|
||||||
ids << subfolders.record().value(0).toULongLong();
|
ids << subfolders.value(0).toULongLong();
|
||||||
|
|
||||||
foreach(qulonglong id, ids)
|
foreach(qulonglong id, ids)
|
||||||
{
|
{
|
||||||
@ -345,16 +349,14 @@ QList<ComicDB> DBHelper::getReadingListFullContent(qulonglong libraryId, qulongl
|
|||||||
{
|
{
|
||||||
ComicDB comic;
|
ComicDB comic;
|
||||||
|
|
||||||
QSqlRecord record = selectQuery.record();
|
comic.id = selectQuery.value(0).toULongLong();
|
||||||
|
comic.parentId = selectQuery.value(1).toULongLong();
|
||||||
comic.id = record.value(0).toULongLong();
|
comic.name = selectQuery.value(2).toString();
|
||||||
comic.parentId = record.value(1).toULongLong();
|
comic.info.title = selectQuery.value(3).toString();
|
||||||
comic.name = record.value(2).toString();
|
comic.info.currentPage = selectQuery.value(4).toInt();
|
||||||
comic.info.title = record.value(3).toString();
|
comic.info.numPages = selectQuery.value(5).toInt();
|
||||||
comic.info.currentPage = record.value(4).toInt();
|
comic.info.hash = selectQuery.value(6).toString();
|
||||||
comic.info.numPages = record.value(5).toInt();
|
comic.info.read = selectQuery.value(7).toBool();
|
||||||
comic.info.hash = record.value(6).toString();
|
|
||||||
comic.info.read = record.value(7).toBool();
|
|
||||||
|
|
||||||
list.append(comic);
|
list.append(comic);
|
||||||
}
|
}
|
||||||
@ -660,7 +662,7 @@ void DBHelper::updateChildrenInfo(QSqlDatabase & db)
|
|||||||
|
|
||||||
while (selectQuery.next())
|
while (selectQuery.next())
|
||||||
{
|
{
|
||||||
DBHelper::updateChildrenInfo(selectQuery.record().value(0).toULongLong(), db);
|
DBHelper::updateChildrenInfo(selectQuery.value(0).toULongLong(), db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user