possible workaround for a timer initialized in the wrong thread
This commit is contained in:
parent
e70a6c8fa8
commit
9fcc70a98b
|
@ -131,7 +131,7 @@ void PluginContainer::updatePluginCache()
|
|||
snoreDebug( SNORE_DEBUG ) << "adding" << file.absoluteFilePath();
|
||||
QPluginLoader loader(file.absoluteFilePath());
|
||||
QObject *plugin = loader.instance();
|
||||
if (plugin == NULL)
|
||||
if (plugin == NULL)//TODO: Qt5 json stuff
|
||||
{
|
||||
snoreDebug( SNORE_WARNING ) << "Failed loading plugin: " << file.absoluteFilePath() << loader.errorString();
|
||||
continue;
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include <QTimer>
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
#include <QThread>
|
||||
#include <QMetaMethod>
|
||||
|
||||
|
||||
using namespace Snore;
|
||||
|
@ -120,12 +122,12 @@ SnoreSecondaryBackend::~SnoreSecondaryBackend()
|
|||
|
||||
bool SnoreSecondaryBackend::initialize(SnoreCore *snore)
|
||||
{
|
||||
if(!SnorePlugin::initialize(snore))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
connect( snore->d(), SIGNAL(notify(Snore::Notification)), this, SLOT(slotNotify(Snore::Notification)), Qt::QueuedConnection);
|
||||
return true;
|
||||
if(!SnorePlugin::initialize(snore))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
connect( snore->d(), SIGNAL(notify(Snore::Notification)), this, SLOT(slotNotify(Snore::Notification)), Qt::QueuedConnection);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SnoreSecondaryBackend::deinitialize()
|
||||
|
@ -206,6 +208,11 @@ bool SnoreBackend::deinitialize()
|
|||
|
||||
void SnoreBackend::startTimeout(Notification ¬ification)
|
||||
{
|
||||
if(thread() != QThread::currentThread())
|
||||
{
|
||||
metaObject()->invokeMethod(this, "startTimeout", Qt::QueuedConnection, Q_ARG(Notification,notification));
|
||||
return;
|
||||
}
|
||||
if(notification.isSticky())
|
||||
{
|
||||
return;
|
||||
|
|
|
@ -60,8 +60,10 @@ public slots:
|
|||
private slots:
|
||||
void notificationTimedOut();
|
||||
|
||||
protected:
|
||||
protected slots:
|
||||
void startTimeout(Notification ¬ification);
|
||||
|
||||
protected:
|
||||
void closeNotification(Snore::Notification,Snore::Notification::CloseReasons);
|
||||
void setSupportsRichtext(bool b);
|
||||
|
||||
|
|
Loading…
Reference in New Issue