Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
KDebugSettings
Commits
678bdac0
Commit
678bdac0
authored
Dec 22, 2021
by
Laurent Montel
😁
Browse files
Allow to compile against qt6
parent
4051454d
Pipeline
#113074
passed with stage
in 1 minute and 5 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
678bdac0
...
...
@@ -29,7 +29,7 @@ include(ECMQtDeclareLoggingCategory)
include
(
GenerateExportHeader
)
find_package
(
Qt
5
${
QT_MIN_VERSION
}
REQUIRED NO_MODULE COMPONENTS Widgets
)
find_package
(
Qt
${
QT_MAJOR_VERSION
}
${
QT_MIN_VERSION
}
REQUIRED NO_MODULE COMPONENTS Widgets
)
find_package
(
KF5
${
KF5_MIN_VERSION
}
REQUIRED COMPONENTS
CoreAddons
Config
...
...
@@ -61,7 +61,7 @@ endif()
add_subdirectory
(
src
)
if
(
BUILD_TESTING
)
find_package
(
Qt
5
${
QT_MIN_VERSION
}
REQUIRED NO_MODULE COMPONENTS Test
)
find_package
(
Qt
${
QT_MAJOR_VERSION
}
${
QT_MIN_VERSION
}
REQUIRED NO_MODULE COMPONENTS Test
)
add_subdirectory
(
autotests
)
endif
()
ecm_qt_install_logging_categories
(
EXPORT KDEBUGSETTINGS FILE kdebugsettings.categories DESTINATION
${
KDE_INSTALL_LOGGINGCATEGORIESDIR
}
)
...
...
autotests/CMakeLists.txt
View file @
678bdac0
...
...
@@ -12,9 +12,9 @@ macro(add_unittest _source)
add_test
(
NAME
${
_name
}
COMMAND
${
_name
}
)
ecm_mark_as_test
(
kdebugsettings-
${
_name
}
)
target_link_libraries
(
${
_name
}
Qt::Test
Qt
${
QT_MAJOR_VERSION
}
::Test
KF5::I18n
Qt::Widgets
Qt
${
QT_MAJOR_VERSION
}
::Widgets
KF5::ConfigCore
KF5::WidgetsAddons
KF5::ItemViews
...
...
autotests/groupmanagementwidgettest.cpp
View file @
678bdac0
...
...
@@ -22,7 +22,7 @@ void GroupManagementWidgetTest::shouldHaveDefaultValues()
GroupManagementWidget
w
;
auto
mainLayout
=
w
.
findChild
<
QVBoxLayout
*>
(
QStringLiteral
(
"mainLayout"
));
QVERIFY
(
mainLayout
);
QCOMPARE
(
mainLayout
->
contentsMargins
(),
{});
QCOMPARE
(
mainLayout
->
contentsMargins
(),
QMargins
{});
auto
mListWidget
=
w
.
findChild
<
QListWidget
*>
(
QStringLiteral
(
"mListWidget"
));
QVERIFY
(
mListWidget
);
...
...
src/CMakeLists.txt
View file @
678bdac0
...
...
@@ -62,9 +62,9 @@ if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
endif
()
generate_export_header
(
libkdebugsettings BASE_NAME libkdebugsettings
)
target_link_libraries
(
libkdebugsettings
Qt::Core
Qt
${
QT_MAJOR_VERSION
}
::Core
KF5::I18n
Qt::Widgets
Qt
${
QT_MAJOR_VERSION
}
::Widgets
KF5::WidgetsAddons
KF5::ItemViews
KF5::ConfigCore
...
...
@@ -83,7 +83,7 @@ if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties
(
kdebugsettings PROPERTIES UNITY_BUILD ON
)
endif
()
target_link_libraries
(
kdebugsettings Qt::Widgets KF5::I18n KF5::DBusAddons KF5::CoreAddons libkdebugsettings
)
target_link_libraries
(
kdebugsettings Qt
${
QT_MAJOR_VERSION
}
::Widgets KF5::I18n KF5::DBusAddons KF5::CoreAddons libkdebugsettings
)
install
(
TARGETS kdebugsettings
${
KDE_INSTALL_TARGETS_DEFAULT_ARGS
}
)
...
...
src/kdebugsettingsloadingcategories.cpp
View file @
678bdac0
...
...
@@ -24,7 +24,11 @@ void KDebugSettingsLoadingCategories::readQtLoggingFile()
if
(
!
envPath
.
isEmpty
())
{
readCategoriesFiles
(
envPath
);
}
else
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
const
QString
dataPath
=
QDir
(
QLibraryInfo
::
path
(
QLibraryInfo
::
DataPath
)).
absoluteFilePath
(
QStringLiteral
(
"qtlogging.ini"
));
#else
const
QString
dataPath
=
QDir
(
QLibraryInfo
::
location
(
QLibraryInfo
::
DataPath
)).
absoluteFilePath
(
QStringLiteral
(
"qtlogging.ini"
));
#endif
readCategoriesFiles
(
dataPath
);
}
}
...
...
src/main.cpp
View file @
678bdac0
...
...
@@ -23,8 +23,8 @@ int main(int argc, char **argv)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication
::
setAttribute
(
Qt
::
AA_EnableHighDpiScaling
,
true
);
#endif
QCoreApplication
::
setAttribute
(
Qt
::
AA_UseHighDpiPixmaps
,
true
);
#endif
QApplication
app
(
argc
,
argv
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment