forked from mirror/openmw-tes3mp
Update user preference setting value via an event message queue.
This commit is contained in:
parent
393cee406f
commit
76196d815d
2 changed files with 16 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
||||||
#include "signalhandler.hpp"
|
#include "signalhandler.hpp"
|
||||||
|
|
||||||
|
#include <QMetaObject>
|
||||||
|
|
||||||
#include "../settings/usersettings.hpp"
|
#include "../settings/usersettings.hpp"
|
||||||
|
|
||||||
CSMTools::SignalHandler::SignalHandler(bool extraCheck)
|
CSMTools::SignalHandler::SignalHandler(bool extraCheck)
|
||||||
|
@ -11,12 +13,20 @@ CSMTools::SignalHandler::SignalHandler(bool extraCheck)
|
||||||
SLOT (updateUserSetting (const QString &, const QStringList &)));
|
SLOT (updateUserSetting (const QString &, const QStringList &)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// called from the main thread
|
||||||
void CSMTools::SignalHandler::updateUserSetting (const QString &name, const QStringList &list)
|
void CSMTools::SignalHandler::updateUserSetting (const QString &name, const QStringList &list)
|
||||||
{
|
{
|
||||||
if (name=="verifier/pathgrid-extra-check")
|
if (name=="verifier/pathgrid-extra-check" && !list.empty())
|
||||||
mExtraCheck = list.at(0) == "true";
|
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)
|
||||||
|
{
|
||||||
|
mExtraCheck = extraCheck;
|
||||||
|
}
|
||||||
|
|
||||||
|
// called from the operations thread
|
||||||
bool CSMTools::SignalHandler::extraCheck ()
|
bool CSMTools::SignalHandler::extraCheck ()
|
||||||
{
|
{
|
||||||
return mExtraCheck;
|
return mExtraCheck;
|
||||||
|
|
|
@ -20,6 +20,10 @@ namespace CSMTools
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void updateUserSetting (const QString &name, const QStringList &list);
|
void updateUserSetting (const QString &name, const QStringList &list);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
void updateExtraCheck (bool extraCheck);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue