Commit 2580b297 authored by Laurent Montel's avatar Laurent Montel
Browse files

Make it compile against qt6

parent e534a2d7
Pipeline #135711 passed with stage
in 52 seconds
......@@ -13,8 +13,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(KDEInstallDirs)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Core
Widgets
Qml
......@@ -40,7 +41,6 @@ set_package_properties(KF5Kirigami2 PROPERTIES
TYPE RUNTIME
)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMOptionalAddSubdirectory)
......
......@@ -7,7 +7,7 @@ add_subdirectory(wizard)
add_subdirectory(applet)
add_subdirectory(kcm)
install(FILES bluedevil.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR})
install(FILES bluedevil.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
install(FILES bluedevil-mime.xml DESTINATION ${KDE_INSTALL_MIMEDIR})
update_xdg_mimetypes(${KDE_INSTALL_MIMEDIR})
......@@ -36,8 +36,9 @@ int main(int argc, char *argv[])
i18n("Previous Maintainer"),
QStringLiteral("afiestas@kde.org"),
QStringLiteral("http://www.afiestas.org/"));
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")));
app.setQuitOnLastWindowClosed(false);
......
......@@ -93,7 +93,11 @@ QString WizardAgent::getPin(BluezQt::DevicePtr device)
m_fromDatabase = true;
if (m_pin.startsWith(QLatin1String("max:"))) {
m_fromDatabase = false;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
int num = m_pin.rightRef(m_pin.length() - 4).toInt();
#else
int num = QStringView(m_pin).right(m_pin.length() - 4).toInt();
#endif
m_pin = QString::number(QRandomGenerator::global()->bounded(RAND_MAX)).left(num);
}
......
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