Skip to content

Commit dbbc0d6

Browse files
authored
Switch from Qt5 to Qt6 (#13)
* Switch from Qt5 to Qt6 by default - Fix compile with Qt6 * Use QT_MAJOR_VERSION and set to 6 as default
1 parent eb9a706 commit dbbc0d6

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16.0)
22

33
# Version setup
44
set(OPENBSDISKS_VERSION_MAJOR "0")
5-
set(OPENBSDISKS_VERSION_MINOR "4")
5+
set(OPENBSDISKS_VERSION_MINOR "5")
66
set(OPENBSDISKS_VERSION_PATCH "0")
77
set(OPENBSDISKS_VERSION "${OPENBSDISKS_VERSION_MAJOR}.${OPENBSDISKS_VERSION_MINOR}.${OPENBSDISKS_VERSION_PATCH}")
88

@@ -17,6 +17,8 @@ if(NOT CMAKE_BUILD_TYPE)
1717
FORCE)
1818
endif()
1919

20+
set(QT_MAJOR_VERSION 6 CACHE STRING "Qt version to use (5 or 6), defaults to 6")
21+
2022
include(GNUInstallDirs)
2123

2224
option(INSTALL_POLKIT_RULES "Install polkit rules" OFF)
@@ -25,8 +27,7 @@ option(INSTALL_MAN_PAGES "Install man pages" ON)
2527
set(CMAKE_INCLUDE_CURRENT_DIR ON)
2628
set(CMAKE_AUTOMOC ON)
2729

28-
set(QT5COMPONENTS Core DBus)
29-
find_package(Qt5 COMPONENTS ${QT5COMPONENTS} REQUIRED)
30+
find_package(Qt${QT_MAJOR_VERSION} COMPONENTS Core DBus REQUIRED)
3031
find_package(Threads REQUIRED)
3132

3233
set(SOURCE
@@ -46,7 +47,7 @@ set(SOURCE
4647
)
4748
add_executable(openbsdisks2 ${SOURCE})
4849

49-
target_link_libraries(openbsdisks2 Qt5::DBus Qt5::Core util)
50+
target_link_libraries(openbsdisks2 Qt${QT_MAJOR_VERSION}::DBus Qt${QT_MAJOR_VERSION}::Core util)
5051

5152
target_compile_features(openbsdisks2 PRIVATE cxx_std_17)
5253
target_compile_options(openbsdisks2 PRIVATE "-Wall")

src/adaptors.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class QByteArray;
1818
template<class T> class QList;
1919
template<class Key, class Value> class QMap;
2020
class QString;
21-
class QStringList;
2221
class QVariant;
2322

2423
#include <QVariantMap>

src/disk_label.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void DiskLabel::analyseDev(const QString& dev)
8484
for (int i = 0; i < lab.d_npartitions; i++) {
8585
pp = &lab.d_partitions[i];
8686
if (DL_GETPSIZE(pp) > 0) {
87-
QString p('a' + i);
87+
const QString p = QChar('a' + i);
8888
if (p != QStringLiteral("c")) {
8989
if (isValidFileSysetem(pp->p_fstype)) {
9090
auto block = createBlock(

src/manageradaptor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
class QByteArray;
1818
template<class T> class QList;
1919
template<class Key, class Value> class QMap;
20+
2021
class QString;
21-
class QStringList;
2222
class QVariant;
2323

2424
typedef QMap<QString, QVariantMap> QVariantMapMap;

0 commit comments

Comments
 (0)