CVS commit by rodda: Remember when the last command failed, so that isDirty() continues to return true. Fixes a bug where executing twice in a row after a build failure doesn't re-trigger the build. I don't know why m_executeAfterBuild was being checked... possibly to fix the same bug. Anyway, it wasn't working, so it's resigned to only being used to execute a command after a successful build. M +16 -4 autoprojectpart.cpp 1.94 M +4 -2 autoprojectpart.h 1.32 --- kdevelop/parts/autoproject/autoprojectpart.cpp #1.93:1.94 @@ -53,4 +53,5 @@ K_EXPORT_COMPONENT_FACTORY( libkdevautop AutoProjectPart::AutoProjectPart(QObject *parent, const char *name, const QStringList &args) : KDevProject("AutoProject", "autoproject", parent, name ? name : "AutoProjectPart") + , m_lastCompilationFailed(false) { setInstance(AutoProjectFactory::instance()); @@ -151,4 +152,6 @@ AutoProjectPart::AutoProjectPart(QObject connect( makeFrontend(), SIGNAL(commandFinished(const QString&)), this, SLOT(slotCommandFinished(const QString&)) ); + connect( makeFrontend(), SIGNAL(commandFailed(const QString&)), + this, SLOT(slotCommandFailed(const QString&)) ); setWantautotools(); @@ -529,4 +532,6 @@ void AutoProjectPart::queueInternalLibDe void AutoProjectPart::slotBuild() { + m_lastCompilationFailed = false; + if( m_needMakefileCvs ){ slotMakefilecvs(); @@ -750,5 +755,5 @@ void AutoProjectPart::slotExecute() partController()->saveAllFiles(); - if( !m_executeAfterBuild && DomUtil::readBoolEntry(*projectDom(), "/kdevautoproject/run/autocompile", true) && isDirty() ){ + if( DomUtil::readBoolEntry(*projectDom(), "/kdevautoproject/run/autocompile", true) && isDirty() ){ m_executeAfterBuild = true; slotBuild(); @@ -842,7 +847,5 @@ void AutoProjectPart::savePartialProject void AutoProjectPart::slotCommandFinished( const QString& command ) { - kdDebug(9020) << "AutoProjectPart::slotProcessFinished()" << endl; - - Q_UNUSED( command ); + kdDebug(9020) << k_funcinfo << endl; if( m_buildCommand != command ) @@ -869,6 +872,15 @@ void AutoProjectPart::slotCommandFinishe } +void AutoProjectPart::slotCommandFailed( const QString& /*command*/ ) +{ + kdDebug(9020) << k_funcinfo << endl; + + m_lastCompilationFailed = true; +} + bool AutoProjectPart::isDirty() { + if (m_lastCompilationFailed) return true; + QStringList fileList = allFiles(); QStringList::Iterator it = fileList.begin(); --- kdevelop/parts/autoproject/autoprojectpart.h #1.31:1.32 @@ -97,4 +97,5 @@ private slots: void slotBuildConfigAboutToShow(); void slotCommandFinished( const QString& command ); + void slotCommandFailed( const QString& command ); //void slotImportExisting(); @@ -112,4 +113,5 @@ private: QString m_buildCommand; bool m_needMakefileCvs; + bool m_lastCompilationFailed; // Enble AutoProjectWidget to emit our signals