Detecting binary out-of-dateness

Matt Rogers mattr at
Fri Aug 19 14:41:59 UTC 2005

On Friday 19 August 2005 03:23, Vladimir Prus wrote:
> Hi,
> is there any reliable method of detecting when the project is rebuild? I
> can see of two approaches -- connecting to the
> actionCollection()->action("build_build") and connecting to commandFinished
> and commandFailed signals of make frontend. However, since plugin load
> order is not defined, both methods can fail inside constructor of
> DebuggerPart.
> Actually, I'm looking at
> (should warn about unsaved documents or out of date binaries before
> starting debugging) and have some questions about KDevelop core.
> The bug says that the "run debugger" command should rebuild the project
> when the binary is out of date. However, it's not obvious how to detect
> this.

this is handled by the build system in general.

> 1. Always running build can be slow. ("make install" in
> languages/cpp/debugger
> 2. Always asking a user is terrible idea.
> 3. To detect if application is possible out of date, I need to compare the
> time when "build" command was last run with the last time a file was saved.
> I can detect file saves with KDevPartController's signals savedFile and
> fileDirty, but I also need to detect the last time when the project was
> build, so that's the reason for my question.

if there was a file saved, then you should just rebuild. that's basically what 
make does anyways (notice that you can do "touch <file>" where <file> is a 
source code file and make will happily rebuild things. It may be a bit 
different with other build systems, but this simple hack should take care of 

> Thanks in advance,
> Volodya


More information about the KDevelop-devel mailing list