Commit 0d584326 authored by Laurent Montel's avatar Laurent Montel
Browse files

Make it compiles against qt6

parent 416f5d7d
Pipeline #129797 passed with stage
in 48 seconds
......@@ -30,11 +30,11 @@ kde_enable_exceptions()
#################################################
# Dependencies
find_package(Qt5Core ${QT_VERSION} REQUIRED)
find_package(Qt5Quick ${QT_VERSION} REQUIRED)
find_package(Qt5DBus ${QT_VERSION} REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Core ${QT_VERSION} REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Quick ${QT_VERSION} REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}DBus ${QT_VERSION} REQUIRED)
if (BUILD_TESTING)
find_package(Qt5Test ${QT_VERSION} REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_VERSION} REQUIRED)
endif()
find_package(KF5CoreAddons ${KF5_VERSION} REQUIRED)
......
......@@ -27,5 +27,5 @@ target_link_libraries(kded_bolt
kbolt
)
install(TARGETS kded_bolt DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kded)
install(FILES kded_bolt.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
install(TARGETS kded_bolt DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${QT_MAJOR_VERSION}/kded)
install(FILES kded_bolt.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
......@@ -25,8 +25,8 @@ add_library(kbolt SHARED ${LIBKBOLT_SRCS})
set_target_properties(kbolt PROPERTIES CXX_STANDARD 14)
generate_export_header(kbolt)
target_link_libraries(kbolt
Qt::Core
Qt::DBus
Qt${QT_MAJOR_VERSION}::Core
Qt${QT_MAJOR_VERSION}::DBus
KF5::I18n
)
......
......@@ -6,7 +6,6 @@
#include "devicemodel.h"
#include "device.h"
#include "manager.h"
using namespace Bolt;
......
......@@ -10,10 +10,9 @@
#include <QAbstractListModel>
#include "kbolt_export.h"
#include "manager.h"
namespace Bolt
{
class Manager;
class Device;
class KBOLT_EXPORT DeviceModel : public QAbstractListModel
{
......
......@@ -8,7 +8,11 @@
#include "libkbolt_debug.h"
#include <QStringList>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QStringRef>
#else
#include <QStringView>
#endif
#include <QVector>
Bolt::Status Bolt::statusFromString(const QString &str)
......@@ -58,7 +62,11 @@ QString Bolt::statusToString(Bolt::Status status)
Bolt::AuthFlags Bolt::authFlagsFromString(const QString &str)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const auto splitRef = str.splitRef(QStringLiteral("|"));
#else
const auto splitRef = str.split(QStringLiteral("|"));
#endif
Bolt::AuthFlags outFlags = Bolt::Auth::None;
for (const auto &flag : splitRef) {
const auto f = flag.trimmed();
......
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