Automatic Spoiler Season (#2991)

* oracle now can be run in spoiler or normal mode

* tests for travis

* only run on relaunch

* spoilers in client (not oracle now) and tray icon shows when done

* spoiler status will be checked before downloading spoiler file

* only download if they care about spoilers

* reload db on spoiler download

* manual update button, code cleanup, and fix enabling sets when new

* cleanup, nullchecks, and fixes to spoiler

* reload DB even if not in spoiler season; necessary as we have a check elsewhere to prevent the reload if spoiler check happens

* Implement changes from 2991#issuecomment-356169374

* Change implicit nullptrs, alert on file deletion, minor changes

* make reload thread safe and minor changes from 2991#issuecomment-356450302

* Fix locking

* Disable update now button while process running
This commit is contained in:
Zach H 2018-01-10 13:27:43 -05:00 committed by GitHub
parent 51ec593759
commit d19744236e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 2106 additions and 913 deletions

View file

@ -1,43 +1,58 @@
#include "settingsmanager.h"
SettingsManager::SettingsManager(QString settingPath, QObject *parent)
: QObject(parent),
settings(settingPath, QSettings::IniFormat)
SettingsManager::SettingsManager(QString settingPath, QObject *parent) : QObject(parent), settings(settingPath, QSettings::IniFormat)
{
}
void SettingsManager::setValue(QVariant value, QString name, QString group, QString subGroup)
{
if(!group.isEmpty())
if (!group.isEmpty())
{
settings.beginGroup(group);
}
if(!subGroup.isEmpty())
if (!subGroup.isEmpty())
{
settings.beginGroup(subGroup);
}
settings.setValue(name, value);
if(!subGroup.isEmpty())
if (!subGroup.isEmpty())
{
settings.endGroup();
}
if(!group.isEmpty())
if (!group.isEmpty())
{
settings.endGroup();
}
}
QVariant SettingsManager::getValue(QString name, QString group, QString subGroup)
{
if(!group.isEmpty())
if (!group.isEmpty())
{
settings.beginGroup(group);
}
if(!subGroup.isEmpty())
if (!subGroup.isEmpty())
{
settings.beginGroup(subGroup);
}
QVariant value = settings.value(name);
if(!subGroup.isEmpty())
if (!subGroup.isEmpty())
{
settings.endGroup();
}
if(!group.isEmpty())
if (!group.isEmpty())
{
settings.endGroup();
}
return value;
}