Commit 4e6ca93e authored by Laurent Montel's avatar Laurent Montel
Browse files

Allow to build against qt6

parent 967f6b99
Pipeline #129860 passed with stage
in 2 minutes and 33 seconds
......@@ -5,7 +5,7 @@ set(PROJECT_VERSION "5.24.80")
set(PROJECT_VERSION_MAJOR 5)
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.86")
set(KF5_MIN_VERSION "5.90")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
......@@ -27,7 +27,7 @@ include(KDEGitCommitHooks)
kde_enable_exceptions()
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Widgets Test DBus Concurrent)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Widgets Test DBus Concurrent)
find_package(
KF5
......
......@@ -111,8 +111,8 @@ target_link_libraries(
KF5::Crash
KF5::Completion
KF5::WindowSystem
Qt::DBus
Qt::Concurrent
Qt${QT_MAJOR_VERSION}::DBus
Qt${QT_MAJOR_VERSION}::Concurrent
KF5::WidgetsAddons
KF5::Wallet
KF5::Notifications # for status notifier
......
......@@ -34,4 +34,4 @@ ecm_qt_declare_logging_category(
)
add_library(qbugzilla STATIC ${lib_SRCS})
target_link_libraries(qbugzilla PUBLIC Qt::Core Qt::Network KF5::CoreAddons KF5::KIOCore)
target_link_libraries(qbugzilla PUBLIC Qt${QT_MAJOR_VERSION}::Core Qt${QT_MAJOR_VERSION}::Network KF5::CoreAddons KF5::KIOCore)
......@@ -9,7 +9,7 @@
#include <QMetaMethod>
#include <QTimer>
#include <KIOCore/KIO/TransferJob>
#include <KIO/TransferJob>
#include "bugzilla_debug.h"
#include "exceptions.h"
......
......@@ -17,7 +17,7 @@ ecm_add_tests(
commenttest.cpp
connectiontest.cpp
producttest.cpp
LINK_LIBRARIES Qt::Core Qt::Test Qt::Network qbugzilla
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Core Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Network qbugzilla
)
ecm_mark_nongui_executable(bugzillatest)
......@@ -6,7 +6,7 @@
#include "connection.h"
#include <KIOCore/KIO/TransferJob>
#include <KIO/TransferJob>
#include <QUrlQuery>
#include "bugzilla_debug.h"
......
......@@ -7,5 +7,5 @@ endif()
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
ecm_add_tests(cleanuptest.cpp LINK_LIBRARIES Qt::Core Qt::Test TARGET_NAMES_VAR cleanuptest_TARGET)
ecm_add_tests(cleanuptest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Core Qt${QT_MAJOR_VERSION}::Test TARGET_NAMES_VAR cleanuptest_TARGET)
add_dependencies(${cleanuptest_TARGET} drkonqi-coredump-cleanup)
......@@ -2,12 +2,12 @@
# SPDX-FileCopyrightText: 2019-2021 Harald Sitter <sitter@kde.org>
add_executable(drkonqi-coredump-launcher main.cpp)
target_link_libraries(drkonqi-coredump-launcher Qt::Core Qt::Network Systemd::systemd)
target_link_libraries(drkonqi-coredump-launcher Qt${QT_MAJOR_VERSION}::Core Qt${QT_MAJOR_VERSION}::Network Systemd::systemd)
target_compile_options(
drkonqi-coredump-launcher
PRIVATE
-DKDE_INSTALL_FULL_LIBEXECDIR=\"${KDE_INSTALL_FULL_LIBEXECDIR}\"
-DKDE_PLUGIN_INSTALL_DIR=\"${PLUGIN_INSTALL_DIR}\"
-DKDE_PLUGIN_INSTALL_DIR=\"${KDE_INSTALL_PLUGINDIR}\"
)
install(TARGETS drkonqi-coredump-launcher DESTINATION ${KDE_INSTALL_LIBEXECDIR})
......@@ -18,5 +18,5 @@ install(
)
add_library(KDECoredumpNotifierTruck MODULE NotifierTruck.cpp)
target_link_libraries(KDECoredumpNotifierTruck Qt5::Core KF5::Notifications KF5::KIOGui)
install(TARGETS KDECoredumpNotifierTruck DESTINATION ${PLUGIN_INSTALL_DIR}/drkonqi/)
target_link_libraries(KDECoredumpNotifierTruck Qt${QT_MAJOR_VERSION}::Core KF5::Notifications KF5::KIOGui)
install(TARGETS KDECoredumpNotifierTruck DESTINATION ${KDE_INSTALL_PLUGINDIR}/drkonqi/)
......@@ -2,7 +2,7 @@
# SPDX-FileCopyrightText: 2019-2021 Harald Sitter <sitter@kde.org>
add_executable(drkonqi-coredump-processor main.cpp)
target_link_libraries(drkonqi-coredump-processor Qt::Core Qt::Network Systemd::systemd)
target_link_libraries(drkonqi-coredump-processor Qt${QT_MAJOR_VERSION}::Core Qt${QT_MAJOR_VERSION}::Network Systemd::systemd)
install(TARGETS drkonqi-coredump-processor DESTINATION ${KDE_INSTALL_LIBEXECDIR})
configure_file(
......
......@@ -265,7 +265,7 @@ void CoredumpWatcher::processLog()
QByteArray data = QJsonDocument::fromVariant(variantMap).toJson();
while (!data.isEmpty()) {
// NB: we need to constrain the segment size to not run into QLocalSocket::DatagramTooLargeError
const qint64 written = s.write(data.constData(), std::min(data.size(), Socket::DatagramSize));
const qint64 written = s.write(data.constData(), std::min<int>(data.size(), Socket::DatagramSize));
if (written > 0) {
data = data.mid(written);
s.waitForBytesWritten();
......
......@@ -172,7 +172,7 @@ CrashedApplication *KCrashBackend::constructCrashedApplication()
executable = execPath;
} else if (!DrKonqi::appPath().isEmpty()) {
QDir execDir(DrKonqi::appPath());
executable = execDir.absoluteFilePath(execPath.fileName());
executable = QFileInfo(execDir.absoluteFilePath(execPath.fileName()));
} else {
executable = QFileInfo(QStandardPaths::findExecutable(execPath.fileName()));
}
......
......@@ -14,7 +14,7 @@ set(kdbgwin_SRCS
${CMAKE_CURRENT_BINARY_DIR}/../drkonqi_debug.cpp
)
set(COMMON_LIBS dbghelp psapi shlwapi Qt::Core)
set(COMMON_LIBS dbghelp psapi shlwapi Qt${QT_MAJOR_VERSION}::Core)
if(MINGW)
add_executable(kdbgwin ${kdbgwin_SRCS} mingw_generator.h mingw_generator.cpp)
......
......@@ -98,7 +98,9 @@ int main(int argc, char *argv[])
#endif
QApplication app(argc, argv);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
#endif
KLocalizedString::setApplicationDomain("drkonqi5");
// Prevent KApplication from setting the crash handler. We will set it later...
......
......@@ -17,4 +17,4 @@ ecm_qt_declare_logging_category(
)
add_library(drkonqi_backtrace_parser STATIC ${BACKTRACEPARSER_SRCS})
target_link_libraries(drkonqi_backtrace_parser PUBLIC Qt::Core)
target_link_libraries(drkonqi_backtrace_parser PUBLIC Qt${QT_MAJOR_VERSION}::Core)
......@@ -5,24 +5,24 @@ endif()
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
find_package(Qt5Test ${REQUIRED_QT_VERSION} CONFIG REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test ${REQUIRED_QT_VERSION} CONFIG REQUIRED)
# Test helper for systeminformationtest
if(HAVE_UNAME)
add_executable(lsb_release lsb_release_double.c)
ecm_add_tests(systeminformationtest.cpp LINK_LIBRARIES Qt::Core Qt::Test DrKonqiInternal)
ecm_add_tests(systeminformationtest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Core Qt${QT_MAJOR_VERSION}::Test DrKonqiInternal)
endif()
add_subdirectory(crashtest)
add_subdirectory(backtraceparsertest)
add_subdirectory(bugzillalibtest)
ecm_add_tests(gdbbacktracelinetest.cpp LINK_LIBRARIES Qt::Core Qt::Test drkonqi_backtrace_parser)
ecm_add_tests(gdbbacktracelinetest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Core Qt${QT_MAJOR_VERSION}::Test drkonqi_backtrace_parser)
ecm_add_tests(
linuxprocmapsparsertest.cpp
statusnotifier_activationclosetimertest.cpp
LINK_LIBRARIES Qt::Core Qt::Test DrKonqiInternal)
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Core Qt${QT_MAJOR_VERSION}::Test DrKonqiInternal)
if(NOT APPLE)
if(NOT RUBY_EXECTUABLE)
......
......@@ -2,9 +2,9 @@ ecm_add_test(
fakebacktracegenerator.cpp
backtraceparsertest.cpp
TEST_NAME backtraceparsertest
LINK_LIBRARIES Qt::Test Qt::Core KF5::KIOWidgets drkonqi_backtrace_parser
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Core KF5::KIOWidgets drkonqi_backtrace_parser
)
add_executable(backtraceparsertest_manual fakebacktracegenerator.cpp backtraceparsertest_manual.cpp)
target_link_libraries(backtraceparsertest_manual Qt::Core KF5::I18n KF5::KIOWidgets drkonqi_backtrace_parser)
target_link_libraries(backtraceparsertest_manual Qt${QT_MAJOR_VERSION}::Core KF5::I18n KF5::KIOWidgets drkonqi_backtrace_parser)
ecm_mark_as_test(backtraceparsertest_manual)
ecm_mark_nongui_executable(backtraceparsertest_manual)
add_executable(crashtest crashtest.cpp)
ecm_mark_as_test(crashtest)
ecm_mark_nongui_executable(crashtest)
target_link_libraries(crashtest KF5::Crash KF5::CoreAddons Qt::Gui Qt::Concurrent)
target_link_libraries(crashtest KF5::Crash KF5::CoreAddons Qt${QT_MAJOR_VERSION}::Gui Qt${QT_MAJOR_VERSION}::Concurrent)
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