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
Libraries
Baloo Widgets
Commits
8bfe7af2
Commit
8bfe7af2
authored
Feb 02, 2022
by
Laurent Montel
😁
Browse files
Prepare to port to qt6
parent
9c35b9ed
Changes
5
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
8bfe7af2
...
...
@@ -8,7 +8,7 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
project
(
baloo-widgets VERSION
${
RELEASE_SERVICE_VERSION
}
)
set
(
QT_MIN_VERSION
"5.15.0"
)
set
(
KF5_MIN_VERSION
"5.
87
.0"
)
set
(
KF5_MIN_VERSION
"5.
90
.0"
)
find_package
(
ECM
${
KF5_MIN_VERSION
}
REQUIRED NO_MODULE
)
set
(
CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/modules"
${
ECM_MODULE_PATH
}
)
...
...
@@ -30,7 +30,7 @@ include(ECMAddTests)
include
(
ECMQtDeclareLoggingCategory
)
include
(
CMakePackageConfigHelpers
)
find_package
(
Qt
5
${
QT_MIN_VERSION
}
REQUIRED NO_MODULE COMPONENTS Core Widgets Test
)
find_package
(
Qt
${
QT_MAJOR_VERSION
}
${
QT_MIN_VERSION
}
REQUIRED NO_MODULE COMPONENTS Core Widgets Test
)
find_package
(
KF5
${
KF5_MIN_VERSION
}
REQUIRED COMPONENTS Config KIO I18n FileMetaData Baloo
)
ecm_setup_version
(
PROJECT
...
...
autotests/CMakeLists.txt
View file @
8bfe7af2
...
...
@@ -2,7 +2,7 @@ include(ECMMarkAsTest)
ecm_add_test
(
extractortest.cpp
TEST_NAME
"extractortest"
LINK_LIBRARIES Qt
5
::Test
LINK_LIBRARIES Qt
${
QT_MAJOR_VERSION
}
::Test
KF5::FileMetaData
)
ecm_add_tests
(
...
...
@@ -15,8 +15,8 @@ ecm_add_tests(
KF5::ConfigCore
KF5::BalooWidgets
KF5::FileMetaData
Qt
5
::Test
Qt
5
::Widgets
Qt
${
QT_MAJOR_VERSION
}
::Test
Qt
${
QT_MAJOR_VERSION
}
::Widgets
)
target_include_directories
(
extractortest
...
...
src/CMakeLists.txt
View file @
8bfe7af2
...
...
@@ -39,8 +39,8 @@ ecm_qt_declare_logging_category(KF5BalooWidgets
target_link_libraries
(
KF5BalooWidgets
PUBLIC
Qt
5
::Widgets
Qt
5
::Core
Qt
${
QT_MAJOR_VERSION
}
::Widgets
Qt
${
QT_MAJOR_VERSION
}
::Core
KF5::KIOCore
# KFileItem
KF5::CoreAddons
# KProcess, KJob
...
...
@@ -53,7 +53,7 @@ target_link_libraries(KF5BalooWidgets
KF5::ConfigGui
)
target_include_directories
(
KF5BalooWidgets INTERFACE
"$<INSTALL_INTERFACE:
${
KDE_INSTALL_INCLUDEDIR_KF
5
}
/BalooWidgets>"
)
target_include_directories
(
KF5BalooWidgets INTERFACE
"$<INSTALL_INTERFACE:
${
KDE_INSTALL_INCLUDEDIR_KF
}
/BalooWidgets>"
)
generate_export_header
(
KF5BalooWidgets BASE_NAME BALOO_WIDGETS EXPORT_FILE_NAME widgets_export.h
)
...
...
@@ -71,14 +71,14 @@ ecm_generate_headers(KF5BalooWidgets_CamelCase_HEADERS
install
(
FILES
${
KF5BalooWidgets_CamelCase_HEADERS
}
DESTINATION
${
KDE_INSTALL_INCLUDEDIR_KF
5
}
/BalooWidgets/Baloo
DESTINATION
${
KDE_INSTALL_INCLUDEDIR_KF
}
/BalooWidgets/Baloo
COMPONENT Devel
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/widgets_export.h
${
KF5BalooWidgets_HEADERS
}
DESTINATION
${
KDE_INSTALL_INCLUDEDIR_KF
5
}
/BalooWidgets/baloo
DESTINATION
${
KDE_INSTALL_INCLUDEDIR_KF
}
/BalooWidgets/baloo
COMPONENT Devel
)
...
...
@@ -87,7 +87,7 @@ install(FILES
#
add_executable
(
baloo_filemetadata_temp_extractor extractor.cpp filemetadatautil.cpp
)
target_link_libraries
(
baloo_filemetadata_temp_extractor
Qt
5
::Core
Qt
${
QT_MAJOR_VERSION
}
::Core
KF5::I18n
KF5::FileMetaData
)
...
...
src/filemetadataprovider.cpp
View file @
8bfe7af2
...
...
@@ -61,8 +61,8 @@ QVariant intersect(const QVariant &v1, const QVariant &v2)
// List and List
if
(
v1
.
type
()
==
QVariant
::
StringList
&&
v2
.
type
()
==
QVariant
::
StringList
)
{
QSet
<
QString
>
s1
=
v1
.
toStringList
().
toSet
(
);
QSet
<
QString
>
s2
=
v2
.
toStringList
().
toSet
(
);
QSet
<
QString
>
s1
(
v1
.
toStringList
().
cbegin
(),
v1
.
toStringList
().
cend
()
);
QSet
<
QString
>
s2
(
v2
.
toStringList
().
cbegin
(),
v2
.
toStringList
().
cend
()
);
return
QVariant
(
s1
.
intersect
(
s2
).
values
());
}
...
...
@@ -448,7 +448,11 @@ QString FileMetaDataProvider::label(const QString &metaDataLabel) const
if
(
value
.
isEmpty
())
{
static
const
auto
extraPrefix
=
QStringLiteral
(
"kfileitem#extra_"
);
if
(
metaDataLabel
.
startsWith
(
extraPrefix
))
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const
auto
parts
=
metaDataLabel
.
splitRef
(
QLatin1Char
(
'_'
));
#else
const
auto
parts
=
metaDataLabel
.
split
(
QLatin1Char
(
'_'
));
#endif
Q_ASSERT
(
parts
.
count
()
==
3
);
const
auto
protocol
=
parts
.
at
(
1
);
const
int
extraNumber
=
parts
.
at
(
2
).
toInt
()
-
1
;
...
...
test/CMakeLists.txt
View file @
8bfe7af2
...
...
@@ -2,22 +2,22 @@ add_executable(tagwidgetapp tagwidgetapp.cpp tagwidgettest.cpp)
target_link_libraries
(
tagwidgetapp
KF5::Baloo
KF5::BalooWidgets
Qt
5
::Widgets
Qt
5
::Core
Qt
${
QT_MAJOR_VERSION
}
::Widgets
Qt
${
QT_MAJOR_VERSION
}
::Core
)
add_executable
(
metadatawidgetapp metadatawidgetapp.cpp
)
target_link_libraries
(
metadatawidgetapp
KF5::Baloo
KF5::BalooWidgets
Qt
5
::Widgets
Qt
5
::Core
Qt
${
QT_MAJOR_VERSION
}
::Widgets
Qt
${
QT_MAJOR_VERSION
}
::Core
)
add_executable
(
metadataconfigwidgetapp metadataconfigwidgetapp.cpp
)
target_link_libraries
(
metadataconfigwidgetapp
KF5::Baloo
KF5::BalooWidgets
Qt
5
::Widgets
Qt
5
::Core
Qt
${
QT_MAJOR_VERSION
}
::Widgets
Qt
${
QT_MAJOR_VERSION
}
::Core
)
Write
Preview
Supports
Markdown
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