let Functions::Add() returns info whether the functions/controller has been added
This commit is contained in:
parent
43ebbdaa33
commit
aad5db9a6a
|
@ -197,28 +197,30 @@ void Functions::SetObjects(FunctionBase * fun)
|
|||
}
|
||||
|
||||
|
||||
void Functions::Add(FunctionBase * fun)
|
||||
bool Functions::Add(FunctionBase * fun)
|
||||
{
|
||||
if( fun->fun.url.empty() )
|
||||
{
|
||||
log << log1 << "Functions: skipping a function with an empty url" << logend;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( Find(fun->fun.url) )
|
||||
{
|
||||
log << log1 << "Functions: function " << fun->fun.url << " already exists (skipped)" << logend;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
SetObjects(fun);
|
||||
table[fun->fun.url] = fun;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Functions::Add(FunctionBase & fun)
|
||||
bool Functions::Add(FunctionBase & fun)
|
||||
{
|
||||
Add(&fun);
|
||||
return Add(&fun);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -191,8 +191,8 @@ public:
|
|||
|
||||
void SetUser(Item & item);
|
||||
|
||||
void Add(FunctionBase * fun);
|
||||
void Add(FunctionBase & fun);
|
||||
bool Add(FunctionBase * fun);
|
||||
bool Add(FunctionBase & fun);
|
||||
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue