3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/kde-frameworks/kpackage/0002-QDirIterator-follow-symlinks.patch

40 lines
1.8 KiB
Diff
Raw Normal View History

2021-03-28 16:28:03 +01:00
From b1c0d2542234247a5051df015d70347597dfe8d8 Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@mailbox.org>
Date: Sun, 28 Mar 2021 10:26:40 -0500
Subject: [PATCH 2/2] QDirIterator follow symlinks
---
src/kpackage/packageloader.cpp | 2 +-
src/kpackage/private/packagejobthread.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/kpackage/packageloader.cpp b/src/kpackage/packageloader.cpp
index f03d882..d5aee56 100644
--- a/src/kpackage/packageloader.cpp
+++ b/src/kpackage/packageloader.cpp
@@ -234,7 +234,7 @@ QList<KPluginMetaData> PackageLoader::listPackages(const QString &packageFormat,
} else {
qCDebug(KPACKAGE_LOG) << "kpluginindex: Not cached" << plugindir;
// If there's no cache file, fall back to listing the directory
- const QDirIterator::IteratorFlags flags = QDirIterator::Subdirectories;
+ const QDirIterator::IteratorFlags flags = QDirIterator::Subdirectories | QDirIterator::FollowSymlinks;
const QStringList nameFilters = {QStringLiteral("metadata.json"), QStringLiteral("metadata.desktop")};
QDirIterator it(plugindir, nameFilters, QDir::Files, flags);
diff --git a/src/kpackage/private/packagejobthread.cpp b/src/kpackage/private/packagejobthread.cpp
index 3eed307..dd6ca6e 100644
--- a/src/kpackage/private/packagejobthread.cpp
+++ b/src/kpackage/private/packagejobthread.cpp
@@ -108,7 +108,7 @@ bool indexDirectory(const QString &dir, const QString &dest)
QJsonArray plugins;
- QDirIterator it(dir, *metaDataFiles, QDir::Files, QDirIterator::Subdirectories);
+ QDirIterator it(dir, *metaDataFiles, QDir::Files, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks);
while (it.hasNext()) {
it.next();
const QString path = it.fileInfo().absoluteFilePath();
--
2.30.1