Commit 707ab256 authored by Matthieu Gallien's avatar Matthieu Gallien 🎵
Browse files

implement more stuff in FileBrowserProxyModel

parent 627e41be
......@@ -220,6 +220,11 @@ MediaPlayListProxyModel *FileBrowserProxyModel::playList() const
return mPlayList;
}
int FileBrowserProxyModel::filterRating() const
{
return mFilterRating;
}
void FileBrowserProxyModel::sortModel(Qt::SortOrder order)
{
this->sort(0,order);
......@@ -240,4 +245,14 @@ void FileBrowserProxyModel::setPlayList(MediaPlayListProxyModel *playList)
connectPlayList();
}
void FileBrowserProxyModel::setFilterRating(int filterRating)
{
if (mFilterRating == filterRating) {
return;
}
mFilterRating = filterRating;
Q_EMIT filterRatingChanged();
}
#include "moc_filebrowserproxymodel.cpp"
......@@ -44,6 +44,11 @@ class ELISALIB_EXPORT FileBrowserProxyModel : public KDirSortFilterProxyModel
READ sortedAscending
NOTIFY sortedAscendingChanged)
Q_PROPERTY(int filterRating
READ filterRating
WRITE setFilterRating
NOTIFY filterRatingChanged)
Q_PROPERTY(MediaPlayListProxyModel* playList READ playList WRITE setPlayList NOTIFY playListChanged)
public:
......@@ -64,6 +69,8 @@ public:
MediaPlayListProxyModel* playList() const;
int filterRating() const;
public Q_SLOTS:
void enqueueToPlayList();
......@@ -80,6 +87,8 @@ public Q_SLOTS:
void setPlayList(MediaPlayListProxyModel* playList);
void setFilterRating(int filterRating);
Q_SIGNALS:
void entriesToEnqueue(const DataTypes::EntryDataList &newEntries,
......@@ -96,6 +105,8 @@ Q_SIGNALS:
void playListChanged();
void filterRatingChanged();
protected:
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
......@@ -125,6 +136,8 @@ private:
MediaPlayListProxyModel* mPlayList = nullptr;
bool mFilterRating = false;
};
#endif // FILEBROWSERPROXYMODEL_H
......@@ -80,6 +80,11 @@ public:
QUrl{QStringLiteral("image://icon/document-open-folder")},
ViewManager::GridView,
ViewManager::FileBrowserModel,
ElisaUtils::NoFilter,
ElisaUtils::FileName,
QUrl{QStringLiteral("image://icon/view-media-genre")},
ViewManager::DelegateWithoutSecondaryText,
ViewManager::ViewHideRating
},
{{i18nc("Title of the file radios browser view", "Radios")},
QUrl{QStringLiteral("image://icon/radio")},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment