+ if(!loaded && fallback)
+ if(CollectionItemTypeBase *fb_type = fallback->get_type(*type))
+ if(fallback->get_status(name, *fb_type))
+ return fallback->find_var(name, fb_type);
+ }
+
+ i = items.find(name);
+ return (i!=items.end() ? &i->second : 0);
+}
+
+void Collection::gather_items(vector<const Variant *> *vars, list<string> *names, const CollectionItemTypeBase &type, bool include_sources) const
+{
+ for(ItemMap::const_iterator i=items.begin(); i!=items.end(); ++i)
+ if(type.check_item_type(i->second))
+ {
+ if(vars)
+ vars->push_back(&i->second);
+ if(names)
+ names->push_back(i->first);
+ }
+
+ if(include_sources && names)
+ gather_names_from_sources(*names, type);
+}
+
+unsigned Collection::get_status(const string &name, const CollectionItemTypeBase &type) const
+{
+ ItemMap::const_iterator i = items.find(name);
+ if(i==items.end())
+ {
+ for(SourceList::const_iterator j=sources.begin(); j!=sources.end(); ++j)
+ if((*j)->is_loadable(type, name))
+ return 2;
+ if(fallback)
+ if(CollectionItemTypeBase *fb_type = fallback->get_type(type))
+ return fallback->get_status(name, *fb_type);
+ return 0;