[dss-commits] r8838 - dss/trunk/core
dss-commits at forum.digitalstrom.org
dss-commits at forum.digitalstrom.org
Fri Oct 9 14:01:28 CEST 2009
Author: pstaehlin
Date: 2009-10-09 14:01:28 +0200 (Fri, 09 Oct 2009)
New Revision: 8838
Modified:
dss/trunk/core/setbuilder.cpp
Log:
SetBuilder: Check for global group names too.
Fixes #41
Modified: dss/trunk/core/setbuilder.cpp
===================================================================
--- dss/trunk/core/setbuilder.cpp 2009-10-07 12:51:41 UTC (rev 8837)
+++ dss/trunk/core/setbuilder.cpp 2009-10-09 12:01:28 UTC (rev 8838)
@@ -139,17 +139,29 @@
Set result;
result.addDevice(ref);
return result;
- } catch(std::exception&) {
+ } catch(ItemNotFoundException&) {
}
- // TODO: we might need to query zone 0 for the identifier too
+ // check for a local group
Group* grp = _zone.getGroup(_identifier);
if(grp != NULL) {
Set result = _set.getByGroup(*grp);
return result;
}
+
+ // check for a global group
+ try {
+ return _set.getByGroup(_identifier);
+ } catch(ItemNotFoundException&) {
+ }
+
+ // check for a zone name
+ try {
+ return _set.getByZone(_identifier);
+ } catch(ItemNotFoundException&) {
+ }
+
// return empty set
- // TODO: throw exception?
Set result;
return result;
} // restrictBy
More information about the dss-commits
mailing list