Changeset View
Changeset View
Standalone View
Standalone View
src/models/alltracksproxymodel.cpp
Show All 31 Lines | |||||
32 | bool AllTracksProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const | 32 | bool AllTracksProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const | ||
33 | { | 33 | { | ||
34 | bool result = false; | 34 | bool result = false; | ||
35 | 35 | | |||
36 | auto currentIndex = sourceModel()->index(source_row, 0, source_parent); | 36 | auto currentIndex = sourceModel()->index(source_row, 0, source_parent); | ||
37 | 37 | | |||
38 | const auto &titleValue = sourceModel()->data(currentIndex, Qt::DisplayRole).toString(); | 38 | const auto &titleValue = sourceModel()->data(currentIndex, Qt::DisplayRole).toString(); | ||
39 | const auto &artistValue = sourceModel()->data(currentIndex, DatabaseInterface::ColumnsRoles::ArtistRole).toString(); | 39 | const auto &artistValue = sourceModel()->data(currentIndex, DatabaseInterface::ColumnsRoles::ArtistRole).toString(); | ||
40 | const auto &fileNameValue = sourceModel()->data(currentIndex, DatabaseInterface::ColumnsRoles::FileNameRole).toString(); | ||||
40 | const auto maximumRatingValue = sourceModel()->data(currentIndex, DatabaseInterface::ColumnsRoles::RatingRole).toInt(); | 41 | const auto maximumRatingValue = sourceModel()->data(currentIndex, DatabaseInterface::ColumnsRoles::RatingRole).toInt(); | ||
41 | 42 | | |||
42 | if (maximumRatingValue < mFilterRating) { | 43 | if (maximumRatingValue < mFilterRating) { | ||
43 | return result; | 44 | return result; | ||
44 | } | 45 | } | ||
45 | 46 | | |||
46 | if (mFilterExpression.match(titleValue).hasMatch()) { | 47 | if (mFilterExpression.match(titleValue).hasMatch()) { | ||
47 | result = true; | 48 | result = true; | ||
48 | } | 49 | } | ||
49 | 50 | | |||
50 | if (mFilterExpression.match(artistValue).hasMatch()) { | 51 | if (mFilterExpression.match(artistValue).hasMatch()) { | ||
51 | result = true; | 52 | result = true; | ||
52 | } | 53 | } | ||
53 | 54 | | |||
55 | if (mFilterExpression.match(fileNameValue).hasMatch()) { | ||||
56 | result = true; | ||||
57 | } | ||||
58 | | ||||
54 | return result; | 59 | return result; | ||
55 | } | 60 | } | ||
56 | 61 | | |||
57 | void AllTracksProxyModel::genericEnqueueToPlayList(ElisaUtils::PlayListEnqueueMode enqueueMode, | 62 | void AllTracksProxyModel::genericEnqueueToPlayList(ElisaUtils::PlayListEnqueueMode enqueueMode, | ||
58 | ElisaUtils::PlayListEnqueueTriggerPlay triggerPlay) | 63 | ElisaUtils::PlayListEnqueueTriggerPlay triggerPlay) | ||
59 | { | 64 | { | ||
60 | QtConcurrent::run(&mThreadPool, [=] () { | 65 | QtConcurrent::run(&mThreadPool, [=] () { | ||
61 | QReadLocker locker(&mDataLock); | 66 | QReadLocker locker(&mDataLock); | ||
Show All 23 Lines |