KDE/kdevelop/buildtools/builders/qmakebuilder

Andreas Pakulat apaku at gmx.de
Mon Jul 23 23:51:16 UTC 2007


SVN commit 691596 by apaku:

Allow to easily retrieve the exact binary used in a project. This will be used by the QMake Manager.

CC'ing kdevelop-devel to get some input on a question wrt. to this change:
Would it be better to offer something like
QString queryQMake(const QString& var, KDevelop::IProject*)
which would basically run qmake -query var and return the result?

I need a way in the qmake manager to run qmake -query var but am not 100%
sure which of the two API's is "better" and I'd like to not hardcode the qmake group
config-key in two places..

CCMAIL:kdevelop-devel at kdevelop.org

 M  +1 -1      iqmakebuilder.h  
 M  +8 -0      qmakebuilder.cpp  
 M  +2 -0      qmakebuilder.h  


--- trunk/KDE/kdevelop/buildtools/builders/qmakebuilder/iqmakebuilder.h #691595:691596
@@ -32,7 +32,7 @@
 class IQMakeBuilder : public KDevelop::IProjectBuilder
 {
 public:
-
+    virtual QString qmakeBinary(  KDevelop::IProject* project  ) = 0;
     virtual ~IQMakeBuilder() {}
 
 };
--- trunk/KDE/kdevelop/buildtools/builders/qmakebuilder/qmakebuilder.cpp #691595:691596
@@ -195,6 +195,14 @@
         emit failed(m_items[id]);
 }
 
+QString QMakeBuilder::qmakeBinary( KDevelop::IProject* project )
+{
+    KSharedConfig::Ptr cfg = project->projectConfiguration();
+    KConfigGroup group(cfg.data(), "QMake Builder");
+    KUrl v = group.readEntry("QMake Binary", KUrl( "file:///usr/bin/qmake" ) );
+    return v.toLocalFile();
+}
+
 #include "qmakebuilder.moc"
 
 //kate: space-indent on; indent-width 4; replace-tabs on; auto-insert-doxygen on; indent-mode cstyle;
--- trunk/KDE/kdevelop/buildtools/builders/qmakebuilder/qmakebuilder.h #691595:691596
@@ -51,6 +51,8 @@
     virtual bool build(KDevelop::ProjectBaseItem *dom);
     virtual bool clean(KDevelop::ProjectBaseItem *dom);
 
+    QString qmakeBinary( KDevelop::IProject* project );
+
 Q_SIGNALS:
     void built(KDevelop::ProjectBaseItem*);
     void failed(KDevelop::ProjectBaseItem*);




More information about the KDevelop-devel mailing list