X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fsourcepackage.cpp;h=74c38864bce10cb4f63bdd5888604b0f69841365;hb=8f99b70eb78bdb5537afc77aa283961a2e825506;hp=a89feb245c7c13ad50f4ad72920202ba328caed2;hpb=7c2db9e2b91da953701be233336c5bfa1f3c4af0;p=builder.git diff --git a/source/sourcepackage.cpp b/source/sourcepackage.cpp index a89feb2..74c3886 100644 --- a/source/sourcepackage.cpp +++ b/source/sourcepackage.cpp @@ -167,23 +167,11 @@ void SourcePackage::save_caches() } -SourcePackage::Loader::Loader(SourcePackage &p): +SourcePackage::Loader::Loader(SourcePackage &p, const Config::InputOptions *o): DataFile::DerivedObjectLoader(p), - FeatureConditional(p, p.name) + FeatureConditional(p, p.name), + options(o) { - init(0); -} - -SourcePackage::Loader::Loader(SourcePackage &p, const Config::InputOptions &o): - DataFile::DerivedObjectLoader(p), - FeatureConditional(p, p.name) -{ - init(&o); -} - -void SourcePackage::Loader::init(const Config::InputOptions *o) -{ - options = o; add("android_application", &Loader::component); add("build_info", &Loader::build_info); add("datapack", &Loader::component); @@ -205,7 +193,7 @@ void SourcePackage::Loader::finish() { /* Make sure the source tarball is last in the list so targets from all other components wil be created first */ - ComponentList::iterator i = find(obj.components.begin(), obj.components.end(), obj.source_archive); + auto i = find(obj.components, obj.source_archive); if(i!=obj.components.end()) obj.components.splice(obj.components.end(), obj.components, i); } @@ -220,7 +208,7 @@ void SourcePackage::Loader::feature(const string &n, const string &d) const Config::Option &opt = obj.config.add_option(feat); if(options) { - Config::InputOptions::const_iterator i = options->find(opt.name); + auto i = options->find(opt.name); if(i!=options->end()) obj.config.set_option(opt.name, i->second); }