Commit 5f7eed7c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port deprecated methods

parent f1df97df
Pipeline #184015 passed with stage
in 53 seconds
......@@ -39,6 +39,9 @@ ecm_setup_version(PROJECT
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/baloowidgets_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5BalooWidgetsConfigVersion.cmake")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050F00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
  • @mlaurent Hi. This should not have made into the repo, breaks the build with any newer deprecations (like just happened with KIO stuff). Please also fix for the release/22.08 branch and inform packages, ideally before KF 5.98 is released.

  • Should be fixed in master and 22.08 (email sent to distributions ML).

Please register or sign in to reply
add_subdirectory(src)
if (BUILD_TESTING)
add_subdirectory(test)
......
......@@ -33,7 +33,7 @@ void FileFetchJob::doStart()
{
for (const QString &filePath : std::as_const(m_urls)) {
bool extractorRunning = false;
KFileMetaData::PropertyMap fileProperties;
KFileMetaData::PropertyMultiMap fileProperties;
// UseRealtimeIndexing::Fallback: try DB first, then filesystem
// UseRealtimeIndexing::Disabled: DB contents only
......@@ -66,7 +66,7 @@ void FileFetchJob::doStart()
fileProperties = m_extractor.properties();
qCDebug(WIDGETS) << filePath << " properties:" << fileProperties;
}
prop.unite(Baloo::Private::toNamedVariantMap(fileProperties));
prop.insert(Baloo::Private::toNamedVariantMap(fileProperties));
m_data << prop;
}
......
......@@ -305,7 +305,9 @@ void FileMetaDataProvider::insertCommonData(const QList<QVariantMap> &files)
QList<QVariantMap> propertyList;
for (const QVariantMap &fileData : files) {
propertyList << fileData;
allProperties.unite(fileData.uniqueKeys().toSet());
auto uniqueValues = fileData.keys();
uniqueValues.erase(std::unique(uniqueValues.begin(), uniqueValues.end()), uniqueValues.end());
allProperties += QSet<QString>(uniqueValues.begin(), uniqueValues.end());
}
// Special handling for certain properties
......
......@@ -52,7 +52,7 @@ QVariantMap convertUserMetaData(const KFileMetaData::UserMetaData &metaData)
return properties;
}
QVariantMap toNamedVariantMap(const KFileMetaData::PropertyMap &propMap)
QVariantMap toNamedVariantMap(const KFileMetaData::PropertyMultiMap &propMap)
{
QVariantMap map;
if (propMap.isEmpty()) {
......
......@@ -25,7 +25,7 @@ QVariantMap convertUserMetaData(const KFileMetaData::UserMetaData &metaData);
* all its values are collected in a QVariantList that is
* stored as a single entry.
*/
QVariantMap toNamedVariantMap(const KFileMetaData::PropertyMap &propMap);
QVariantMap toNamedVariantMap(const KFileMetaData::PropertyMultiMap &propMap);
} // namespace Private
} // namespace Baloo
......@@ -231,7 +231,7 @@ QStringList FileMetaDataWidgetPrivate::sortedKeys(const QVariantMap &data) const
QString key = m_provider->group(propName);
key += m_provider->label(propName);
map.insertMulti(key, propName);
map.insert(key, propName);
++hashIt;
}
......
......@@ -52,7 +52,7 @@ bool OnDemandExtractor::waitFinished()
return m_process.waitForFinished();
}
KFileMetaData::PropertyMap OnDemandExtractor::properties() const
KFileMetaData::PropertyMultiMap OnDemandExtractor::properties() const
{
return m_properties;
}
......
......@@ -25,7 +25,7 @@ public:
void process(const QString &filePath);
bool waitFinished();
KFileMetaData::PropertyMap properties() const;
KFileMetaData::PropertyMultiMap properties() const;
Q_SIGNALS:
void fileFinished(QProcess::ExitStatus exitStatus);
......@@ -35,7 +35,7 @@ private Q_SLOTS:
private:
QProcess m_process;
KFileMetaData::PropertyMap m_properties;
KFileMetaData::PropertyMultiMap m_properties;
};
} // namespace Private
......
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