Commit 5b445bef authored by Matthieu Gallien's avatar Matthieu Gallien 🎵

remove AllTracksProxyModel as it is no longer needed

parent 46016012
......@@ -141,20 +141,6 @@ ecm_add_test(${trackmetadatamodeltest_SOURCES}
target_include_directories(trackmetadatamodeltest PRIVATE ${CMAKE_SOURCE_DIR}/src)
set(alltracksproxymodeltest_SOURCES
alltracksproxymodeltest.cpp
)
ecm_qt_declare_logging_category(alltracksproxymodeltest_SOURCES HEADER elisa_debug.h IDENTIFIER lcModelTest CATEGORY_NAME qt.modeltest)
ecm_add_test(${alltracksproxymodeltest_SOURCES}
TEST_NAME "alltracksproxymodeltest"
LINK_LIBRARIES
Qt5::Test elisaLib Qt5::CorePrivate
)
target_include_directories(alltracksproxymodeltest PRIVATE ${CMAKE_SOURCE_DIR}/src)
if (KF5FileMetaData_FOUND)
set(localfilelistingtest_SOURCES
localfilelistingtest.cpp
......
This diff is collapsed.
......@@ -29,7 +29,6 @@ set(elisaLib_SOURCES
models/datamodel.cpp
models/abstractmediaproxymodel.cpp
models/gridviewproxymodel.cpp
models/alltracksproxymodel.cpp
models/trackmetadatamodel.cpp
models/editabletrackmetadatamodel.cpp
models/trackcontextmetadatamodel.cpp
......
......@@ -42,7 +42,6 @@
#include "models/editabletrackmetadatamodel.h"
#include "models/viewsmodel.h"
#include "models/gridviewproxymodel.h"
#include "models/alltracksproxymodel.h"
#include "localFileConfiguration/elisaconfigurationdialog.h"
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
......@@ -122,7 +121,6 @@ void ElisaQmlTestPlugin::registerTypes(const char *uri)
qmlRegisterType<EditableTrackMetadataModel>(uri, 1, 0, "EditableTrackMetadataModel");
qmlRegisterType<ViewsModel>(uri, 1, 0, "ViewsModel");
qmlRegisterType<GridViewProxyModel>(uri, 1, 0, "GridViewProxyModel");
qmlRegisterType<AllTracksProxyModel>(uri, 1, 0, "AllTracksProxyModel");
#if defined KF5KIO_FOUND && KF5KIO_FOUND
qmlRegisterType<FileBrowserModel>(uri, 1, 0, "FileBrowserModel");
......
/*
SPDX-FileCopyrightText: 2017 (c) Alexander Stippich <a.stippich@gmx.net>
SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include "alltracksproxymodel.h"
#include "datatypes.h"
AllTracksProxyModel::AllTracksProxyModel(QObject *parent) : AbstractMediaProxyModel(parent)
{
setSortCaseSensitivity(Qt::CaseInsensitive);
}
AllTracksProxyModel::~AllTracksProxyModel() = default;
bool AllTracksProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
{
bool result = false;
auto currentIndex = sourceModel()->index(source_row, 0, source_parent);
const auto &titleValue = sourceModel()->data(currentIndex, Qt::DisplayRole).toString();
const auto &artistValue = sourceModel()->data(currentIndex, DataTypes::ColumnsRoles::ArtistRole).toString();
const auto maximumRatingValue = sourceModel()->data(currentIndex, DataTypes::ColumnsRoles::RatingRole).toInt();
if (maximumRatingValue < mFilterRating) {
return result;
}
if (mFilterExpression.match(titleValue).hasMatch()) {
result = true;
}
if (mFilterExpression.match(artistValue).hasMatch()) {
result = true;
}
return result;
}
#include "moc_alltracksproxymodel.cpp"
/*
SPDX-FileCopyrightText: 2017 (c) Alexander Stippich <a.stippich@gmx.net>
SPDX-FileCopyrightText: 2018 (c) Matthieu Gallien <matthieu_gallien@yahoo.fr>
SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef ALLTRACKSPROXYMODEL_H
#define ALLTRACKSPROXYMODEL_H
#include "elisaLib_export.h"
#include "abstractmediaproxymodel.h"
#include "elisautils.h"
class ELISALIB_EXPORT AllTracksProxyModel : public AbstractMediaProxyModel
{
Q_OBJECT
public:
explicit AllTracksProxyModel(QObject *parent = nullptr);
~AllTracksProxyModel() override;
Q_SIGNALS:
public Q_SLOTS:
protected:
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
private:
};
#endif // ALLTRACKSPROXYMODEL_H
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