forked from teamnwah/openmw-tes3coop
Revert user preference setting checks until a thread safe method is worked out. The OSX namespace issue is retained.
parent
01eba7b721
commit
c4aa3d3ee3
@ -1,41 +0,0 @@
|
||||
#include "signalhandler.hpp"
|
||||
|
||||
#include <QMetaObject>
|
||||
#include <QThread>
|
||||
|
||||
#include "../settings/usersettings.hpp"
|
||||
|
||||
CSMTools::SignalHandler::SignalHandler(bool extraCheck)
|
||||
: mExtraCheck(extraCheck)
|
||||
{
|
||||
connect (&CSMSettings::UserSettings::instance(),
|
||||
SIGNAL (userSettingUpdated(const QString &, const QStringList &)),
|
||||
this,
|
||||
SLOT (updateUserSetting (const QString &, const QStringList &)));
|
||||
}
|
||||
|
||||
// called from the main thread
|
||||
void CSMTools::SignalHandler::updateUserSetting (const QString &name, const QStringList &list)
|
||||
{
|
||||
if (name=="verifier/pathgrid-extra-check" && !list.empty())
|
||||
QMetaObject::invokeMethod(this, "updateExtraCheck", Qt::AutoConnection, Q_ARG(bool, list.at(0) == "true"));
|
||||
}
|
||||
|
||||
// should be in the operations thread via an event message queue
|
||||
void CSMTools::SignalHandler::updateExtraCheck (bool extraCheck)
|
||||
{
|
||||
if (thread()!=QThread::currentThread())
|
||||
{
|
||||
QMetaObject::invokeMethod(this,"updateExtraCheck", Qt::QueuedConnection, Q_ARG(bool, extraCheck));
|
||||
return;
|
||||
}
|
||||
|
||||
// extra safety
|
||||
mExtraCheck = extraCheck;
|
||||
}
|
||||
|
||||
// called from the operations thread
|
||||
bool CSMTools::SignalHandler::extraCheck ()
|
||||
{
|
||||
return mExtraCheck;
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
#ifndef CSM_TOOLS_SIGNALHANDLER_H
|
||||
#define CSM_TOOLS_SIGNALHANDLER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace CSMTools
|
||||
{
|
||||
class SignalHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
bool mExtraCheck;
|
||||
|
||||
public:
|
||||
|
||||
SignalHandler (bool extraCheck);
|
||||
|
||||
bool extraCheck ();
|
||||
|
||||
public slots:
|
||||
|
||||
void updateUserSetting (const QString &name, const QStringList &list);
|
||||
|
||||
private slots:
|
||||
|
||||
void updateExtraCheck (bool extraCheck);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue