Commit 0e5dae10 authored by Volker Krause's avatar Volker Krause Committed by David Edmundson
Browse files

Fix Qt6 build regressions

parent e757276f
Pipeline #201425 passed with stage
in 6 minutes and 30 seconds
......@@ -235,8 +235,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
################## Find libraries ###################
if(REGION_LANG_GENERATE_LOCALE)
find_package(PolkitQt5-1)
set_package_properties(PolkitQt5-1
find_package(PolkitQt${QT_MAJOR_VERSION}-1)
set_package_properties(PolkitQt${QT_MAJOR_VERSION}-1
PROPERTIES DESCRIPTION "DBus interface wrapper for Polkit"
PURPOSE "Communicate with localegen helper in region & lang kcm"
TYPE REQUIRED
......
......@@ -41,12 +41,12 @@ ecm_qt_declare_logging_category(
################ Build helper and add additional source files #############
if(REGION_LANG_GENERATE_LOCALE)
add_subdirectory("localegenhelper")
qt5_generate_dbus_interface(
qt_generate_dbus_interface(
${CMAKE_CURRENT_SOURCE_DIR}/localegenhelper/localegenhelper.h
org.kde.localegenhelper.xml
OPTIONS -s -m
)
qt5_add_dbus_interface(kcm_regionandlang_PART_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.localegenhelper.xml localegenhelperinterface)
qt_add_dbus_interface(kcm_regionandlang_PART_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.localegenhelper.xml localegenhelperinterface)
endif()
#################### Declare target #######################
......@@ -66,7 +66,7 @@ target_link_libraries(kcm_regionandlang
KF5::QuickAddons
KF5::ItemModels)
if (QT_MAJOR_VERSION EQUAL "6")
target_link_libraries(kcm_formats Qt::Core5Compat) # for QTextCodec
target_link_libraries(kcm_regionandlang Qt::Core5Compat) # for QTextCodec
endif()
if(UBUNTU_PACKAGEKIT)
target_link_libraries(kcm_regionandlang PK::packagekitqt${QT_MAJOR_VERSION})
......
......@@ -7,21 +7,21 @@
set(localegen_Helper_SRCS
localegenhelper.cpp
)
qt5_generate_dbus_interface(
qt_generate_dbus_interface(
${CMAKE_CURRENT_SOURCE_DIR}/localegenhelper.h
org.kde.localegenhelper.xml
OPTIONS -s -m
)
qt5_add_dbus_adaptor(localegen_Helper_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.localegenhelper.xml
qt_add_dbus_adaptor(localegen_Helper_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.localegenhelper.xml
${CMAKE_CURRENT_SOURCE_DIR}/localegenhelper.h LocaleGenHelper)
add_executable(plasma-localegen-helper ${localegen_Helper_SRCS})
target_link_libraries(plasma-localegen-helper
Qt::DBus
PolkitQt5-1::Core
PolkitQt${QT_MAJOR_VERSION}-1::Core
KF5::I18n
)
ecm_install_configured_files(INPUT org.kde.localegenhelper.service.in DESTINATION ${DBUS_SYSTEM_SERVICES_INSTALL_DIR} @ONLY)
install(TARGETS plasma-localegen-helper ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
ecm_install_configured_files(INPUT org.kde.localegenhelper.service.in DESTINATION ${KDE_INSTALL_DBUSSYSTEMSERVICEDIR} @ONLY)
install(TARGETS plasma-localegen-helper ${KF_INSTALL_TARGETS_DEFAULT_ARGS})
option(USE_CMAKE_PREFIX "Use CMAKE_INSTALL_PREFIX instead of `/usr` for DBus and PolicyKit config files" ON)
set(POLICY_FILES_INSTALL_DIR "/usr")
......
......@@ -21,6 +21,8 @@
#include "exampleutility.h"
#include "kcmregionandlang.h"
#include <QTextCodec>
using namespace KCM_RegionAndLang;
LocaleListModel::LocaleListModel(QObject *parent)
......
......@@ -27,28 +27,28 @@ OptionsModel::OptionsModel(KCMRegionAndLang *parent)
{i18nc("@info:title", "Measurements"), SettingType::Measurement}}};
connect(m_settings, &RegionAndLangSettings::langChanged, this, &OptionsModel::handleLangChange);
connect(m_settings, &RegionAndLangSettings::numericChanged, this, [this] {
QLocale locale = m_settings->LC_LocaleWithLang(SettingType::Numeric);
QLocale locale(m_settings->LC_LocaleWithLang(SettingType::Numeric));
m_numberExample = Utility::numericExample(locale);
Q_EMIT dataChanged(createIndex(1, 0), createIndex(1, 0), {Subtitle, Example});
});
connect(m_settings, &RegionAndLangSettings::timeChanged, this, [this] {
QLocale locale = m_settings->LC_LocaleWithLang(SettingType::Time);
QLocale locale(m_settings->LC_LocaleWithLang(SettingType::Time));
m_timeExample = Utility::timeExample(locale);
Q_EMIT dataChanged(createIndex(2, 0), createIndex(2, 0), {Subtitle, Example});
});
connect(m_settings, &RegionAndLangSettings::monetaryChanged, this, [this] {
QLocale locale = m_settings->LC_LocaleWithLang(SettingType::Currency);
QLocale locale(m_settings->LC_LocaleWithLang(SettingType::Currency));
m_currencyExample = Utility::monetaryExample(locale);
Q_EMIT dataChanged(createIndex(3, 0), createIndex(3, 0), {Subtitle, Example});
});
connect(m_settings, &RegionAndLangSettings::measurementChanged, this, [this] {
QLocale locale = m_settings->LC_LocaleWithLang(SettingType::Measurement);
QLocale locale(m_settings->LC_LocaleWithLang(SettingType::Measurement));
m_measurementExample = Utility::measurementExample(locale);
Q_EMIT dataChanged(createIndex(4, 0), createIndex(4, 0), {Subtitle, Example});
});
// initialize examples
m_numberExample = Utility::numericExample(m_settings->LC_LocaleWithLang(SettingType::Numeric));
m_numberExample = Utility::numericExample(QLocale(m_settings->LC_LocaleWithLang(SettingType::Numeric)));
m_timeExample = Utility::timeExample(QLocale(m_settings->LC_LocaleWithLang(SettingType::Time)));
m_measurementExample = Utility::measurementExample(QLocale(m_settings->LC_LocaleWithLang(SettingType::Measurement)));
m_currencyExample = Utility::monetaryExample(QLocale(m_settings->LC_LocaleWithLang(SettingType::Currency)));
......
......@@ -16,5 +16,5 @@ public:
Image,
Package,
};
Q_ENUM(Provider)
Q_ENUM(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