1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-15 06:52:34 +02: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: ""
Component.onCompleted: {
workshopListModel.clear()
steamWorkshop.searchWorkshop()
}
GridView {
@ -112,6 +114,7 @@ CustomPage {
Item {
id: searchBar
height: 100
visible: false
anchors {
top: banner.bottom
right: parent.right

View File

@ -81,6 +81,14 @@ unsigned int SteamWorkshopListModel::getBannerID()
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)
{
if (data(index, role) != value) {

View File

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