Commit d1881419 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Revert "Remove workaround"

Some distros live in the past

This reverts commit 675e9d9d.
parent 675e9d9d
......@@ -6,7 +6,6 @@ cmake_minimum_required(VERSION 2.8.12)
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} "${CMAKE_SOURCE_DIR}/cmake")
find_package(Qt5 5.7.0 REQUIRED CONFIG COMPONENTS Widgets Test Network Xml Concurrent DBus Quick)
......
......@@ -95,7 +95,7 @@ QString AbstractResource::sizeDescription()
QCollatorSortKey AbstractResource::nameSortKey()
{
if (!m_collatorKey) {
m_collatorKey = QCollator().sortKey(name());
m_collatorKey.reset(new QCollatorSortKey(QCollator().sortKey(name())));
}
return *m_collatorKey;
}
......
......@@ -24,10 +24,10 @@
#include <QtCore/QObject>
#include <QUrl>
#include <QStringList>
#include <QScopedPointer>
#include <QVector>
#include <QCollatorSortKey>
#include <QJsonObject>
#include <optional>
#include "discovercommon_export.h"
#include "PackageState.h"
......@@ -102,8 +102,6 @@ class DISCOVERCOMMON_EXPORT AbstractResource : public QObject
*/
explicit AbstractResource(AbstractResourcesBackend* parent);
virtual ~AbstractResource() = default;
///used as internal identification of a resource
virtual QString packageName() const = 0;
......@@ -208,7 +206,8 @@ class DISCOVERCOMMON_EXPORT AbstractResource : public QObject
private:
void reportNewState();
std::optional<QCollatorSortKey> m_collatorKey;
// TODO: make it std::optional or make QCollatorSortKey()
QScopedPointer<QCollatorSortKey> m_collatorKey;
QJsonObject m_metadata;
};
......
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