kf6-solid: guard optical-disc shared cache (Redox has no QSystemSemaphore)
udisksopticaldisc.cpp SharedContentTypesCache uses QSystemSemaphore +
QSharedMemory locking for a cross-process content-type cache; Redox Qt is built
without systemsemaphore-backed shared memory (same limitation the qtwayland
recipe notes), so it failed to compile ("m_semaphore not declared",
"QSharedMemory has no member named lock"). Guard the cache on
QT_CONFIG(sharedmemory) && QT_CONFIG(systemsemaphore); on Redox provide a
no-cache stub that detects directly (the cached path already fell back to
advancedDiscDetect()). Durable patch.
This commit is contained in:
@@ -6,6 +6,12 @@ version = "6.28"
|
||||
[source]
|
||||
tar = "https://download.kde.org/stable/frameworks/6.28/solid-6.28.0.tar.xz"
|
||||
blake3 = "fc1c0f092ff6786a2284e57b57500e11ac47dcd5471e842e0898ce76c96ab8cb"
|
||||
patches = [
|
||||
# Redox Qt lacks QSystemSemaphore + QSharedMemory locking, so the optical
|
||||
# disc content-type shared cache (udisksopticaldisc.cpp) fails to compile.
|
||||
# Guard it and fall back to direct detection.
|
||||
"redox-no-systemsemaphore-optical-cache.patch",
|
||||
]
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
--- a/src/solid/devices/backends/udisks2/udisksopticaldisc.cpp
|
||||
+++ b/src/solid/devices/backends/udisks2/udisksopticaldisc.cpp
|
||||
@@ -186,6 +186,7 @@
|
||||
QPair<OpticalDisc::Identity, Solid::OpticalDisc::ContentTypes> m_info[100];
|
||||
};
|
||||
|
||||
+#if QT_CONFIG(sharedmemory) && QT_CONFIG(systemsemaphore)
|
||||
class SharedContentTypesCache
|
||||
{
|
||||
private:
|
||||
@@ -295,6 +296,18 @@
|
||||
m_shmem.detach();
|
||||
}
|
||||
};
|
||||
+#else
|
||||
+// Redox and other platforms without QSystemSemaphore + QSharedMemory locking:
|
||||
+// there is no cross-process content-type cache; detect directly each call.
|
||||
+class SharedContentTypesCache
|
||||
+{
|
||||
+public:
|
||||
+ Solid::OpticalDisc::ContentTypes getContent(const OpticalDisc::Identity &, const QByteArray &file)
|
||||
+ {
|
||||
+ return advancedDiscDetect(file);
|
||||
+ }
|
||||
+};
|
||||
+#endif // QT_CONFIG(sharedmemory) && QT_CONFIG(systemsemaphore)
|
||||
|
||||
Q_GLOBAL_STATIC(QThreadStorage<SharedContentTypesCache>, sharedContentTypesCache)
|
||||
|
||||
Reference in New Issue
Block a user