create plugin cache per application to prevent clashes on stratup

This commit is contained in:
Patrick von Reth 2014-01-23 18:52:34 +01:00
parent 991b6641e3
commit e4e1ab0cbf
2 changed files with 3 additions and 2 deletions

View File

@ -28,7 +28,6 @@
#include <QDir>
#include <QDebug>
#include <QMetaEnum>
#include <QApplication>
using namespace Snore;
@ -145,6 +144,7 @@ void PluginContainer::updatePluginCache()
cache().setValue("version",Version::revision());
cache().setValue("buildtime",Version::buildTime());
cache().setValue("pluginPath",pluginDir().absolutePath());
cache().setValue("application", qApp->applicationFilePath());
QList<PluginContainer*> plugins = pluginCache(SnorePlugin::ALL).values();
cache().beginWriteArray("plugins");
for(int i=0;i< plugins.size();++i)

View File

@ -26,6 +26,7 @@
#include <QSettings>
#include <QFlag>
#include <QPluginLoader>
#include <QApplication>
@ -72,7 +73,7 @@ private:
if(_cache == NULL)
{
_cache = new QSettings("SnoreNotify","libsnore");
_cache->beginGroup( SnoreCorePrivate::computeHash(pluginDir().absolutePath().toLatin1()));
_cache->beginGroup( SnoreCorePrivate::computeHash(pluginDir().absolutePath().append(qApp->applicationFilePath()).toLatin1()));
}
return *_cache;
}