1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Add workaround for Workshop duplicate entries

This commit is contained in:
kelteseth 2017-10-30 23:18:25 +01:00
parent 2519f6a355
commit 8c0cc1664c
3 changed files with 12 additions and 0 deletions

View File

@ -6,7 +6,9 @@ CustomPage {
pageName: "" pageName: ""
Component.onCompleted: { Component.onCompleted: {
workshopListModel.clear()
steamWorkshop.searchWorkshop() steamWorkshop.searchWorkshop()
} }
GridView { GridView {
@ -112,6 +114,7 @@ CustomPage {
Item { Item {
id: searchBar id: searchBar
height: 100 height: 100
visible: false
anchors { anchors {
top: banner.bottom top: banner.bottom
right: parent.right right: parent.right

View File

@ -81,6 +81,14 @@ unsigned int SteamWorkshopListModel::getBannerID()
return m_workshopItemList.at(0)->m_id; return m_workshopItemList.at(0)->m_id;
} }
void SteamWorkshopListModel::clear()
{
beginResetModel();
m_workshopItemList.clear();
m_workshopItemList.squeeze();
endResetModel();
}
bool SteamWorkshopListModel::setData(const QModelIndex& index, const QVariant& value, int role) bool SteamWorkshopListModel::setData(const QModelIndex& index, const QVariant& value, int role)
{ {
if (data(index, role) != value) { if (data(index, role) != value) {

View File

@ -34,6 +34,7 @@ public:
Q_INVOKABLE QUrl getBannerUrl(); Q_INVOKABLE QUrl getBannerUrl();
Q_INVOKABLE QString getBannerText(); Q_INVOKABLE QString getBannerText();
Q_INVOKABLE unsigned int getBannerID(); Q_INVOKABLE unsigned int getBannerID();
Q_INVOKABLE void clear();
// Editable: // Editable:
bool setData(const QModelIndex& index, const QVariant& value, bool setData(const QModelIndex& index, const QVariant& value,