Bug 76037 - qmake project: binary not rebuild before execution (after changes in files)
Summary: qmake project: binary not rebuild before execution (after changes in files)
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: QMake (show other bugs)
Version: 3.0.1
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-24 17:26 UTC by Daniel Franke
Modified: 2004-12-11 01:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch against CVS HEAD (2004/04/23) (2.36 KB, patch)
2004-04-24 10:30 UTC, Daniel Franke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Franke 2004-02-24 17:26:34 UTC
Version:           3.0.1 (using KDE 3.1.4)
Installed from:    compiled sources
Compiler:          gcc version 3.2.2
OS:          SunOS (sun4u) release 5.8

In automake based projects, the executable is rebuild before execution [SHIFT+F9] (if necessary, e.g. if files have changed). 
One would expect this would be true for qmake projects also - but it isn't. The binary has to be rebuild explicitly [F8] before execution [SHIFT+F9].

version: kdevelop-3.0.1 (CVS 040219)
Comment 1 Daniel Franke 2004-04-24 10:30:13 UTC
Created attachment 5758 [details]
patch against CVS HEAD (2004/04/23)

Could somebody have a look at this patch? Works fine so far, but it might not
be the best solution since I'm not involved in history of trollproject.
Comment 2 Alexander Dymo 2004-12-11 01:19:38 UTC
CVS commit by dymo: 

Build the project (or subproject) before execution if source files were changed.
BUG: 76037
Thanks to Daniel Franke for the patch.


  M +26 -6     trollprojectpart.cpp   1.81
  M +2 -0      trollprojectpart.h   1.29


--- kdevelop/buildtools/qmake/trollprojectpart.cpp  #1.80:1.81
@@ -112,5 +112,5 @@ TrollProjectPart::TrollProjectPart(QObje
 
     action = new KAction( i18n("Execute Main Program"), "exec", SHIFT+Key_F9,
-                          m_widget, SLOT(slotExecuteProject()),
+                          this, SLOT(slotBuildAndExecuteProject()),
                           actionCollection(), "build_execute_project" );
     action->setToolTip(i18n("Execute main program"));
@@ -149,5 +149,5 @@ TrollProjectPart::TrollProjectPart(QObje
 
     action = new KAction( i18n("Execute Subproject"), "exec", 0,
-                          m_widget, SLOT(slotExecuteTarget()),
+                          this, SLOT(slotBuildAndExecuteTarget()),
                           actionCollection(), "build_execute_target" );
     action->setToolTip(i18n("Execute subproject"));
@@ -276,4 +276,24 @@ DomUtil::PairList TrollProjectPart::runE
 }
 
+void TrollProjectPart::slotBuildAndExecuteProject()
+{
+    partController()->saveAllFiles();
+    if (isDirty()) {
+        m_executeAfterBuild = true;
+        m_widget->slotBuildProject();
+    } else
+        m_widget->slotExecuteProject();
+}
+
+void TrollProjectPart::slotBuildAndExecuteTarget()
+{
+    partController()->saveAllFiles();
+    if (isDirty()) {
+        m_executeAfterBuild = true;
+        m_widget->slotBuildTarget();
+    } else
+        m_widget->slotExecuteTarget();
+}
+
 
 /** Retuns the currently selected run directory
@@ -497,8 +517,8 @@ void TrollProjectPart::slotCommandFinish
     Q_UNUSED( command );
 
-    if( m_buildCommand != command )
-        return;
-
-    m_buildCommand = QString::null;
+//     if( m_buildCommand != command )
+//         return;
+// 
+//     m_buildCommand = QString::null;
 
     m_timestamp.clear();

--- kdevelop/buildtools/qmake/trollprojectpart.h  #1.28:1.29
@@ -66,4 +66,6 @@ private slots:
 //    void slotExecute();
     void slotCommandFinished( const QString& command );
+    void slotBuildAndExecuteProject();
+    void slotBuildAndExecuteTarget();
 
 private: