From d418d68a290e9a71ad1a792131ea8faf51ded0e1 Mon Sep 17 00:00:00 2001 From: Aaron Rainbolt Date: Tue, 13 Aug 2024 19:05:01 -0500 Subject: [PATCH] Port to Qt6. --- CMakeLists.txt | 11 +++++------ debian/changelog | 6 ++++++ debian/control | 4 ++-- src/aptmanager.cpp | 16 ++++++++-------- src/mainwindow.ui | 5 ++++- 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9721029..52fc5ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,7 @@ set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets DBus LinguistTools) -find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets DBus LinguistTools) +find_package(Qt6 REQUIRED COMPONENTS Widgets DBus LinguistTools) set(TS_FILES src/translations/lubuntu-update_en_US.ts @@ -50,8 +49,8 @@ set(PROJECT_SOURCES set(TRANSLATION_RESOURCES "src/translations.qrc") configure_file(${TRANSLATION_RESOURCES} translations.qrc COPYONLY) -qt5_add_translation(QM_FILES ${TS_FILES}) -qt5_add_resources(QM_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc) +qt6_add_translation(QM_FILES ${TS_FILES}) +qt6_add_resources(QM_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc) add_custom_target(translations ALL DEPENDS ${QM_FILES}) @@ -64,8 +63,8 @@ add_executable(lubuntu-update add_dependencies(lubuntu-update translations) target_link_libraries(lubuntu-update PRIVATE - Qt${QT_VERSION_MAJOR}::Widgets - Qt${QT_VERSION_MAJOR}::DBus) + Qt6::Widgets + Qt6::DBus) install(TARGETS lubuntu-update BUNDLE DESTINATION . diff --git a/debian/changelog b/debian/changelog index 59001b5..d09521f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +lubuntu-update-notifier (1.1.0~ppa1) oracular; urgency=medium + + * Port to Qt6. + + -- Aaron Rainbolt Tue, 13 Aug 2024 19:02:31 -0500 + lubuntu-update-notifier (1.0.0) noble; urgency=medium * Change from beta to final release. diff --git a/debian/control b/debian/control index 3a585de..1136146 100644 --- a/debian/control +++ b/debian/control @@ -5,8 +5,8 @@ Maintainer: Lubuntu Developers Build-Depends: cmake, debhelper-compat (= 13), lxqt-sudo (>= 1.4.0-0ubuntu2), - qtbase5-dev, - qttools5-dev + qt6-base-dev, + qt6-tools-dev Standards-Version: 4.6.2 Rules-Requires-Root: no diff --git a/src/aptmanager.cpp b/src/aptmanager.cpp index bf773c5..a1967ab 100644 --- a/src/aptmanager.cpp +++ b/src/aptmanager.cpp @@ -88,10 +88,10 @@ void AptManager::handleUpdateProcessBuffer() // yes, this gave me a headache also if (dlLineMatch.hasMatch()) { // Increments the progress counter for each package downloaded internalUpdateProgress++; - } else if (line.count() >= 25 && line.left(24) == "Preparing to unpack .../" && numPackagesToPrep != 0) { + } else if (line.length() >= 25 && line.left(24) == "Preparing to unpack .../" && numPackagesToPrep != 0) { internalUpdateProgress++; // Increments the progress counter for each package that is "prepared to unpack" numPackagesToPrep--; - } else if (line.count() >= 10 && line.left(9) == "Unpacking") { + } else if (line.length() >= 10 && line.left(9) == "Unpacking") { /* * Increments the progress counter for each package that is unpacked * The package name may be suffixed with ":amd64" or some other @@ -109,7 +109,7 @@ void AptManager::handleUpdateProcessBuffer() internalUpdateProgress++; } } - } else if (line.count() >= 11 && line.left(10) == "Setting up") { + } else if (line.length() >= 11 && line.left(10) == "Setting up") { QStringList parts = line.split(' '); QString packageName; if (parts.count() >= 3) { @@ -118,7 +118,7 @@ void AptManager::handleUpdateProcessBuffer() internalUpdateProgress++; } } - } else if (line.count() >= 9 && line.left(8) == "Removing") { + } else if (line.length() >= 9 && line.left(8) == "Removing") { QStringList parts = line.split(' '); QString packageName; if (parts.count() >= 2) { @@ -136,7 +136,7 @@ void AptManager::handleUpdateProcessBuffer() } aptProcess->readLine(lineBuf, 2048); QString confLine = QString(lineBuf); - confLine = confLine.left(confLine.count() - 2); + confLine = confLine.left(confLine.length() - 2); if (confLine == "Lubuntu Update !!! CONFIGURATION FILE LIST END") { emit conffileListReady(conffileList); // this triggers the main window to show the conffile handler window break; @@ -151,7 +151,7 @@ void AptManager::handleUpdateProcessBuffer() } aptProcess->readLine(lineBuf, 2048); QString releaseCode = QString(lineBuf); - releaseCode = releaseCode.left(releaseCode.count() - 2); + releaseCode = releaseCode.left(releaseCode.length() - 2); emit newRelease(releaseCode); } @@ -246,7 +246,7 @@ QList AptManager::getUpdateInfo() * spaces, we know we're no longer reading a package list. */ - if (stdoutLine.count() < 3 || stdoutLine.left(2) != " ") { + if (stdoutLine.length() < 3 || stdoutLine.left(2) != " ") { gettingInstallPackages = false; gettingUpgradePackages = false; gettingUninstallPackages = false; @@ -317,7 +317,7 @@ QStringList AptManager::getSecurityUpdateList() QString distroLine; while (distroFinder.readLineInto(&distroLine)) { // The line has to be at least 18 characters long - 16 for the string "DISTRIB_CODENAME", one for the = sign, and one for a codename with a length of at least one. - if (distroLine.count() >= 18 && distroLine.left(16) == "DISTRIB_CODENAME") { + if (distroLine.length() >= 18 && distroLine.left(16) == "DISTRIB_CODENAME") { QStringList distroParts = distroLine.split('='); if (distroParts.count() >= 2) { distroName = distroParts[1]; diff --git a/src/mainwindow.ui b/src/mainwindow.ui index c80921f..9a0045f 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -6,7 +6,7 @@ 0 0 - 462 + 473 600 @@ -37,6 +37,9 @@ + + 100 + 0