From 56b1a0a3aef5075502a2d651ad9049bc7d2e3303 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Wed, 19 Feb 2014 11:17:57 +0100 Subject: [PATCH] remove crazy locking until I have a better idea --- src/core/plugins/plugincontainer.cpp | 20 ++------------------ src/core/plugins/plugincontainer.h | 2 +- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/core/plugins/plugincontainer.cpp b/src/core/plugins/plugincontainer.cpp index 21f4953..af60640 100644 --- a/src/core/plugins/plugincontainer.cpp +++ b/src/core/plugins/plugincontainer.cpp @@ -104,23 +104,8 @@ const QList &PluginContainer::types() return t; } -void PluginContainer::updatePluginCache(bool force) +void PluginContainer::updatePluginCache() { - QSystemSemaphore sema("cache_update", 1, QSystemSemaphore::Open); - if(sema.acquire()) - { - cache().sync(); - if(!force && cache().value("version").toString() == Version::revision()) - { - sema.release(); - return; - } - } - else - { - qFatal("Failed to lock cache"); - } - snoreDebug( SNORE_DEBUG ) << "Updating plugin cache"; foreach(PluginContaienrHash list, s_pluginCache) { @@ -174,7 +159,6 @@ void PluginContainer::updatePluginCache(bool force) } cache().endArray(); cache().sync(); - sema.release(); } void PluginContainer::loadPluginCache() @@ -194,7 +178,7 @@ void PluginContainer::loadPluginCache() { snoreDebug( SNORE_WARNING ) << "Cache Corrupted" << fileName << cache().value("name").toString() << type; cache().endArray(); - updatePluginCache(true); + updatePluginCache(); return; } } diff --git a/src/core/plugins/plugincontainer.h b/src/core/plugins/plugincontainer.h index a462349..a804d91 100644 --- a/src/core/plugins/plugincontainer.h +++ b/src/core/plugins/plugincontainer.h @@ -56,7 +56,7 @@ public: private: static QHash s_pluginCache; - void static updatePluginCache(bool force = false); + void static updatePluginCache(); void static loadPluginCache(); static const QDir &pluginDir(); static inline const QString pluginExtention()