Commit 675e9d9d authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Remove workaround

parent 2359fe4a
......@@ -6,6 +6,7 @@ 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.reset(new QCollatorSortKey(QCollator().sortKey(name())));
m_collatorKey = 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,6 +102,8 @@ 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;
......@@ -206,8 +208,7 @@ class DISCOVERCOMMON_EXPORT AbstractResource : public QObject
private:
void reportNewState();
// TODO: make it std::optional or make QCollatorSortKey()
QScopedPointer<QCollatorSortKey> m_collatorKey;
std::optional<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