]> git.tdb.fi Git - builder.git/commitdiff
Add a signal to propagate rebuild state after preparation
authorMikko Rasa <tdb@tdb.fi>
Sat, 23 Jun 2012 17:50:09 +0000 (20:50 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 8 Jul 2012 21:08:53 +0000 (00:08 +0300)
source/filetarget.cpp
source/target.cpp
source/target.h

index 62265b0d9c956bbdaf644192f0a5f428ecb483ee..74f7833187cce39e275956c1c6edb8e0b3b4a14a 100644 (file)
@@ -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()
index 297ae3f4211b9a4b3be3b2f68e1fd2ab43dc2ec5..88d8b70e2c1cce48cb545c6c8e1a52708700c10c 100644 (file)
@@ -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*/)
index 03b87557873e111a2b0eb986b90fb97b1cbe959a..c1f932791b32f9288daf2731c4ca3b1ee35a9d2f 100644 (file)
@@ -5,6 +5,7 @@
 #include <map>
 #include <set>
 #include <string>
+#include <sigc++/signal.h>
 #include <msp/time/timestamp.h>
 
 class Builder;
@@ -34,6 +35,10 @@ protected:
                UPTODATE
        };
 
+public:
+       sigc::signal<void> signal_bubble_rebuild;
+
+protected:
        Builder &builder;
        const Package *package;
        const Component *component;