Commit 8f29131b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile against qt6

parent fc7ecf0f
Pipeline #113788 failed with stage
in 31 seconds
......@@ -30,8 +30,16 @@ file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h *.c)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core DBus Widgets)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n CoreAddons Completion DocTools XmlGui)
find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core DBus Widgets)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6Core5Compat)
endif()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n CoreAddons Completion XmlGui)
find_package(KF5DocTools ${KF5_MIN_VERSION})
set_package_properties(KF5DocTools PROPERTIES DESCRIPTION
"Tools to generate documentation"
TYPE OPTIONAL
)
find_package(KF5Crash ${KF5_MIN_VERSION} CONFIG REQUIRED)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
......@@ -45,7 +53,10 @@ set_property(SOURCE main.cpp APPEND PROPERTY COMPILE_DEFINITIONS "KFLOPPY_VERSIO
ecm_qt_declare_logging_category(kfloppy HEADER kfloppy_debug.h IDENTIFIER KFLOPPY_LOG CATEGORY_NAME org.kde.kfloppy DESCRIPTION "KFloppy" EXPORT KFLOPPY)
target_link_libraries(kfloppy KF5::CoreAddons KF5::I18n KF5::Completion KF5::XmlGui Qt::DBus KF5::Crash)
target_link_libraries(kfloppy KF5::CoreAddons KF5::I18n KF5::Completion KF5::XmlGui Qt${QT_MAJOR_VERSION}::DBus KF5::Crash)
if (TARGET Qt6::Core5Compat)
target_link_libraries(kfloppy Qt6::Core5Compat) # QRegExp
endif()
install(TARGETS kfloppy ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
......@@ -70,15 +81,17 @@ ecm_install_icons(ICONS
THEME hicolor
)
add_subdirectory(doc)
ecm_qt_install_logging_categories(
EXPORT KFLOPPY
FILE kfloppy.categories
DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
ki18n_install(po)
kdoctools_install(po)
if (KF5DocTools_FOUND)
kdoctools_install(po)
add_subdirectory(doc)
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
......@@ -36,7 +36,10 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
// Not needed in Qt6 (and doesn't exist at all)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QGuiApplication::setFallbackSessionManagementEnabled(false);
#endif
Kdelibs4ConfigMigrator migrator(QStringLiteral("kfloppy"));
migrator.setConfigFiles(QStringList() << QStringLiteral("kfloppyrc"));
......
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