Commit 0c4c4de6 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Can't completely remove the QSortFilterProxyModel

It's still used in the updater
parent 9e082f00
......@@ -36,6 +36,7 @@
#include <qqml.h>
#include <QPointer>
#include <QGuiApplication>
#include <QSortFilterProxyModel>
#include <QTimer>
#include <QSessionManager>
#include <QClipboard>
......@@ -83,6 +84,18 @@ class CachedNetworkAccessManagerFactory : public QQmlNetworkAccessManagerFactory
}
};
class OurSortFilterProxyModel : public QSortFilterProxyModel, public QQmlParserStatus
{
Q_OBJECT
Q_INTERFACES(QQmlParserStatus)
public:
void classBegin() override {}
void componentComplete() override {
if (dynamicSortFilter())
sort(0);
}
};
DiscoverObject::DiscoverObject(CompactMode mode, const QVariantMap &initialProperties)
: QObject()
, m_engine(new QQmlApplicationEngine)
......@@ -100,6 +113,7 @@ DiscoverObject::DiscoverObject(CompactMode mode, const QVariantMap &initialPrope
qmlRegisterType<PaginateModel>("org.kde.discover.app", 1, 0, "PaginateModel");
qmlRegisterType<KConcatenateRowsProxyModel>("org.kde.discover.app", 1, 0, "KConcatenateRowsProxyModel");
qmlRegisterType<FeaturedModel>("org.kde.discover.app", 1, 0, "FeaturedModel");
qmlRegisterType<OurSortFilterProxyModel>("org.kde.discover.app", 1, 0, "QSortFilterProxyModel");
#ifdef WITH_FEEDBACK
qmlRegisterSingletonType<PlasmaUserFeedback>("org.kde.discover.app", 1, 0, "UserFeedbackSettings", [](QQmlEngine*, QJSEngine*) -> QObject* { return new PlasmaUserFeedback(KSharedConfig::openConfig(QStringLiteral("PlasmaUserFeedback"), KConfig::NoGlobals)); });
#endif
......
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