forked from teamnwah/openmw-tes3coop
Use signals for user preference setting updates.
parent
734e52d1c8
commit
393cee406f
@ -0,0 +1,23 @@
|
||||
#include "signalhandler.hpp"
|
||||
|
||||
#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 &)));
|
||||
}
|
||||
|
||||
void CSMTools::SignalHandler::updateUserSetting (const QString &name, const QStringList &list)
|
||||
{
|
||||
if (name=="verifier/pathgrid-extra-check")
|
||||
mExtraCheck = list.at(0) == "true";
|
||||
}
|
||||
|
||||
bool CSMTools::SignalHandler::extraCheck ()
|
||||
{
|
||||
return mExtraCheck;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
#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);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue