mirror of
https://github.com/YACReader/yacreader
synced 2025-07-19 13:34:44 -04:00
fixed reading lists loading/setup
This commit is contained in:
@ -393,7 +393,7 @@ void ReadingListModel::setupReadingListsData(QSqlQuery &sqlquery, ReadingListIte
|
|||||||
else
|
else
|
||||||
currentParent = items.value(record.value("parentId").toULongLong());
|
currentParent = items.value(record.value("parentId").toULongLong());
|
||||||
|
|
||||||
parent->appendChild(rli);
|
currentParent->appendChild(rli);
|
||||||
|
|
||||||
items.insert(rli->getId(),rli);
|
items.insert(rli->getId(),rli);
|
||||||
}
|
}
|
||||||
@ -447,7 +447,7 @@ void ReadingListModel::setupReadingLists(QSqlDatabase & db)
|
|||||||
//setup root item
|
//setup root item
|
||||||
rootItem = new ReadingListItem(QList<QVariant>() << "ROOT" << 0 << true << false);
|
rootItem = new ReadingListItem(QList<QVariant>() << "ROOT" << 0 << true << false);
|
||||||
|
|
||||||
QSqlQuery selectQuery("select * from reading_list order by parentId,name",db);
|
QSqlQuery selectQuery("select * from reading_list order by parentId IS NULL DESC",db);
|
||||||
|
|
||||||
//setup reading lists
|
//setup reading lists
|
||||||
setupReadingListsData(selectQuery,rootItem);
|
setupReadingListsData(selectQuery,rootItem);
|
||||||
|
Reference in New Issue
Block a user