Commit 516d2b97 authored by Volker Krause's avatar Volker Krause
Browse files

Change wallpaper enums to be in namespaces rather than in gadgets

Qt 6 no longer allows exporting gadgets with an uppercase name. Namespaces
work just as well here, but we unfortunately have this problem also in
other places where the solution is less straightforward.
parent 170564cd
Pipeline #226296 passed with stage
in 6 minutes and 15 seconds
......@@ -24,7 +24,7 @@ class ImageProxyModel;
class SlideModel;
class SlideFilterModel;
class ImageBackend : public QObject, public QQmlParserStatus, public SortingMode
class ImageBackend : public QObject, public QQmlParserStatus
{
Q_OBJECT
Q_INTERFACES(QQmlParserStatus)
......
......@@ -39,6 +39,6 @@ void ImagePlugin::registerTypes(const char *uri)
qmlRegisterAnonymousType<QAbstractItemModel>("QAbstractItemModel", 1);
qmlRegisterUncreatableType<BackgroundType>(uri, 2, 0, "BackgroundType", QStringLiteral("error: only enums"));
qmlRegisterUncreatableType<SortingMode>(uri, 2, 0, "SortingMode", QStringLiteral("error: only enums"));
qmlRegisterUncreatableMetaObject(BackgroundType::staticMetaObject, uri, 2, 0, "BackgroundType", QStringLiteral("error: only enums"));
qmlRegisterUncreatableMetaObject(SortingMode::staticMetaObject, uri, 2, 0, "SortingMode", QStringLiteral("error: only enums"));
}
......@@ -7,19 +7,18 @@
#ifndef SORTINGMODE_H
#define SORTINGMODE_H
class SortingMode
namespace SortingMode
{
Q_GADGET
Q_NAMESPACE
public:
enum Mode {
Random,
Alphabetical,
AlphabeticalReversed,
Modified,
ModifiedReversed,
};
Q_ENUM(Mode)
enum Mode {
Random,
Alphabetical,
AlphabeticalReversed,
Modified,
ModifiedReversed,
};
Q_ENUM_NS(Mode)
}
#endif
......@@ -6,15 +6,14 @@
#pragma once
class BackgroundType
namespace BackgroundType
{
Q_GADGET
Q_NAMESPACE
public:
enum class Type {
Unknown,
Image,
AnimatedImage, /**< AnimatedImage doesn't support \QQuickImageProvider , @see https://bugreports.qt.io/browse/QTBUG-30524 */
};
Q_ENUM(Type)
enum class Type {
Unknown,
Image,
AnimatedImage, /**< AnimatedImage doesn't support \QQuickImageProvider , @see https://bugreports.qt.io/browse/QTBUG-30524 */
};
Q_ENUM_NS(Type)
}
Supports Markdown
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