From: Mikko Rasa Date: Sat, 23 Jun 2012 17:50:09 +0000 (+0300) Subject: Add a signal to propagate rebuild state after preparation X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=525c055f83e9fd748ff878462ed84b0897b46e75;p=builder.git Add a signal to propagate rebuild state after preparation --- diff --git a/source/filetarget.cpp b/source/filetarget.cpp index 62265b0..74f7833 100644 --- a/source/filetarget.cpp +++ b/source/filetarget.cpp @@ -28,6 +28,7 @@ FileTarget::FileTarget(Builder &b, const Package *p, const FS::Path &a): void FileTarget::touch() { mtime = Time::now(); + signal_bubble_rebuild.emit(); } void FileTarget::check_rebuild() diff --git a/source/target.cpp b/source/target.cpp index 297ae3f..88d8b70 100644 --- a/source/target.cpp +++ b/source/target.cpp @@ -52,6 +52,7 @@ void Target::add_depend(Target *dep) if(dep==this) throw invalid_argument("Target::add_depend"); depends.push_back(dep); + dep->signal_bubble_rebuild.connect(sigc::mem_fun(this, &Target::check_rebuild)); } void Target::prepare() @@ -102,6 +103,7 @@ void Target::mark_rebuild(const std::string &reason) state = REBUILD; rebuild_reason = reason; + signal_bubble_rebuild.emit(); } void Target::build_finished(bool /*success*/) diff --git a/source/target.h b/source/target.h index 03b8755..c1f9327 100644 --- a/source/target.h +++ b/source/target.h @@ -5,6 +5,7 @@ #include #include #include +#include #include class Builder; @@ -34,6 +35,10 @@ protected: UPTODATE }; +public: + sigc::signal signal_bubble_rebuild; + +protected: Builder &builder; const Package *package; const Component *component;