X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftask.cpp;h=e72a7415de285767ee93369051fb384113b8d2a1;hb=1ed833343bc83b83c5f61cbfd74423bbba677a04;hp=75b725ede8657cc760efaa07d0bb92456b51975e;hpb=24981eb7ef702aa97b2ab90399ccd3fc23ce9ccf;p=builder.git diff --git a/source/task.cpp b/source/task.cpp index 75b725e..e72a741 100644 --- a/source/task.cpp +++ b/source/task.cpp @@ -6,10 +6,6 @@ using namespace std; using namespace Msp; -Task::Task(): - unlink(false) -{ } - void Task::add_file(const FS::Path &f) { files.push_back(f); @@ -22,16 +18,16 @@ void Task::set_unlink(bool u) void Task::prepare() { - for(list::const_iterator i=files.begin(); i!=files.end(); ++i) + for(const FS::Path &f: files) { - if(FS::exists(*i)) + if(FS::exists(f)) { // If the file exists, the directory it's in must exist too - FS::unlink(*i); + FS::unlink(f); } else { - FS::Path dir = FS::dirname(*i); + FS::Path dir = FS::dirname(f); if(!FS::exists(dir)) FS::mkpath(dir, 0755); }