GH-907 improve Java testing and PermGen deprecation handling

This commit is contained in:
Petr Mrázek
2015-05-04 01:20:48 +02:00
parent 8e9d5f56b5
commit 1b884d0a9d
24 changed files with 515 additions and 231 deletions

View File

@ -16,6 +16,7 @@
#include "settings/SettingsObject.h"
#include "settings/Setting.h"
#include "settings/OverrideSetting.h"
#include "PassthroughSetting.h"
#include <QDebug>
#include <QVariant>
@ -44,6 +45,22 @@ std::shared_ptr<Setting> SettingsObject::registerOverride(std::shared_ptr<Settin
return override;
}
std::shared_ptr<Setting> SettingsObject::registerPassthrough(std::shared_ptr<Setting> original,
std::shared_ptr<Setting> gate)
{
if (contains(original->id()))
{
qCritical() << QString("Failed to register setting %1. ID already exists.")
.arg(original->id());
return nullptr; // Fail
}
auto passthrough = std::make_shared<PassthroughSetting>(original, gate);
passthrough->m_storage = this;
connectSignals(*passthrough);
m_settings.insert(passthrough->id(), passthrough);
return passthrough;
}
std::shared_ptr<Setting> SettingsObject::registerSetting(QStringList synonyms, QVariant defVal)
{
if (synonyms.empty())