X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fconfig.cpp;h=2e3741e2a2a5120ab1d8e3bddfe573e2fc3ce21a;hb=69ad3610053e140cb5108f53e4c46a0583e33559;hp=e7207ce8a249151a112afe6b6a4f393a7de82b9b;hpb=445edbc3c42bbd7880cc414cf153ddfd196bfc1c;p=builder.git diff --git a/source/config.cpp b/source/config.cpp index e7207ce..2e3741e 100644 --- a/source/config.cpp +++ b/source/config.cpp @@ -1,15 +1,22 @@ +/* $Id$ + +This file is part of builder +Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ + #include -#include +#include #include #include #include "builder.h" #include "config.h" -#include "package.h" +#include "sourcepackage.h" using namespace std; using namespace Msp; -Config::Config(Package &p): +Config::Config(SourcePackage &p): package(p), freeze_mtime(false) { } @@ -164,7 +171,7 @@ void Config::finish() void Config::save() const { - Path::Path fn=package.get_source()/".options.cache"; + Path fn=package.get_source()/".options.cache"; OptionMap::const_iterator i=options.find("profile"); if(i!=options.end()) @@ -194,7 +201,7 @@ bool Config::set_option(const string &opt, const string &val) void Config::load() { - Path::Path fn=package.get_source()/".options.cache"; + Path fn=package.get_source()/".options.cache"; OptionMap::iterator i=options.find("profile"); if(i!=options.end()) @@ -203,11 +210,9 @@ void Config::load() ifstream in(fn.str().c_str()); if(!in) return; - struct stat st; - Path::stat(fn, st); - mtime=Time::TimeStamp::from_unixtime(st.st_mtime); + mtime=Time::TimeStamp::from_unixtime(stat(fn).st_mtime); - Parser::Parser parser(in, fn.str()); + DataFile::Parser parser(in, fn.str()); Loader loader(*this); loader.load(parser); }