Overwrite custom created effect config when effect name is exist (#335)

* Overwrite exist Effects

* move find_schema and find_effect struct to include file
This commit is contained in:
Paulchen Panther
2016-12-16 19:48:15 +01:00
committed by redPanther
parent a724fd1535
commit b227f5a71c
2 changed files with 36 additions and 23 deletions

View File

@@ -72,7 +72,25 @@ namespace OPCODE {
}
}
struct find_schema: std::unary_function<EffectSchema, bool>
{
QString pyFile;
find_schema(QString pyFile):pyFile(pyFile) { }
bool operator()(EffectSchema const& schema) const
{
return schema.pyFile == pyFile;
}
};
struct find_effect: std::unary_function<EffectDefinition, bool>
{
QString effectName;
find_effect(QString effectName) :effectName(effectName) { }
bool operator()(EffectDefinition const& effectDefinition) const
{
return effectDefinition.name == effectName;
}
};
///
/// The Connection object created by \a JsonServer when a new connection is establshed