Commit 20d651f6 authored by Laurent Montel's avatar Laurent Montel
Browse files

Make it compile against qt6

parent bf39d6a6
Pipeline #224160 passed with stage
in 3 minutes and 4 seconds
......@@ -39,7 +39,11 @@ bool Core::initialize()
}
qRegisterMetaType<Minuet::ISoundController::State>("State");
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
qmlRegisterInterface<Minuet::ISoundController>("ISoundController");
#else
qRegisterMetaType<Minuet::ISoundController>();
#endif
qmlRegisterUncreatableType<Minuet::ISoundController>(
"org.kde.minuet.isoundcontroller", 1, 0, "ISoundController",
QStringLiteral("ISoundController cannot be instantiated"));
......
......@@ -39,7 +39,9 @@
int main(int argc, char *argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QGuiApplication application(argc, argv);
#if !defined(Q_OS_ANDROID)
......
......@@ -23,16 +23,17 @@
#ifndef MINUET_ICORE_H
#define MINUET_ICORE_H
#include "iexercisecontroller.h"
#include "iplugincontroller.h"
#include "isoundcontroller.h"
#include "iuicontroller.h"
#include <interfaces/minuetinterfacesexport.h>
#include <QObject>
namespace Minuet
{
class IPluginController;
class ISoundController;
class IExerciseController;
class IUiController;
class MINUETINTERFACES_EXPORT ICore : public QObject
{
......
......@@ -28,7 +28,11 @@ namespace Minuet
{
IExerciseController::IExerciseController(QObject *parent) : QObject(parent)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
qmlRegisterInterface<IExerciseController>("IExerciseController");
#else
qRegisterMetaType<IExerciseController>();
#endif
}
void IExerciseController::setCurrentExercise(QVariantMap currentExercise)
......
......@@ -13,13 +13,13 @@ QStringList Utils::getXdgDataDirs()
}
QStringList results;
const auto paths = xdgDataDirsEnv.splitRef(QLatin1Char(':'), Qt::SkipEmptyParts);
const auto paths = xdgDataDirsEnv.split(QLatin1Char(':'), Qt::SkipEmptyParts);
// Normalize paths, skip relative paths
for (const auto &path : paths) {
if (!QDir::isAbsolutePath(path.toString()) || !QDir(path.toString()).exists()) {
if (!QDir::isAbsolutePath(path) || !QDir(path).exists()) {
continue;
}
results.append(path.toString());
results.append(path);
}
return results;
......
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