mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2024-12-22 22:15:17 +00:00
Fix models acting weird when changing sort
Apparently the Jellyfin server may include different fields in the resposne depending on which SortOrder you use. This causes the model to generate new roleNames when changing its sortOrder, but the QML part does not know of this happening and there's no way of notifying the QML part as far as I'm aware of (if so, let me know). So whenever new generateFields() is called, it shouldn't reset its roleNames map and recreate it anew, rather, just append the new roleNames to the current map. If a model in QML wants to use information used in fields which are added by changing SortOrder, please add those fields explicitly in Fields.
This commit is contained in:
parent
5d395ad7b6
commit
9e9d075cd4
|
@ -121,7 +121,6 @@ void ApiModel::load(LoadType type) {
|
|||
void ApiModel::generateFields() {
|
||||
if (m_array.size() == 0) return;
|
||||
this->beginResetModel();
|
||||
m_roles.clear();
|
||||
int i = Qt::UserRole + 1;
|
||||
if (!m_array[0].isObject()) {
|
||||
qWarning() << "Iterator is not an object?";
|
||||
|
|
Loading…
Reference in a new issue