OSDN Git Service

RemoteLinux: Don't force generic run configurations on all targets.
authorChristian Kandeler <christian.kandeler@nokia.com>
Fri, 21 Oct 2011 09:21:19 +0000 (11:21 +0200)
committerChristian Kandeler <christian.kandeler@nokia.com>
Fri, 21 Oct 2011 09:27:54 +0000 (11:27 +0200)
Instead, as a heuristic, check whether a RemoteLinuxDeployConfiguration
(not a derived one!) exists.

Change-Id: I06561e37ef8d0ddc6eddcf7ed211be779b21ab4d
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
src/plugins/remotelinux/remotelinuxrunconfigurationfactory.cpp

index f2d66b0..6aa3c6e 100644 (file)
@@ -31,6 +31,7 @@
 **************************************************************************/
 #include "remotelinuxrunconfigurationfactory.h"
 
+#include "remotelinuxdeployconfigurationfactory.h"
 #include "remotelinuxrunconfiguration.h"
 #include "remotelinuxutils.h"
 
@@ -91,10 +92,12 @@ bool RemoteLinuxRunConfigurationFactory::canClone(Target *parent, RunConfigurati
 
 QStringList RemoteLinuxRunConfigurationFactory::availableCreationIds(Target *parent) const
 {
-    if (Qt4BaseTarget *t = qobject_cast<Qt4BaseTarget *>(parent)) {
-        if (t && RemoteLinuxUtils::hasUnixQt(t)) {
-            return t->qt4Project()->applicationProFilePathes(RemoteLinuxRunConfiguration::Id);
-        }
+    const QList<DeployConfiguration *> &depConfs = parent->deployConfigurations();
+    foreach (const DeployConfiguration * const dc, depConfs) {
+        if (dc->id() == RemoteLinuxDeployConfigurationFactory::genericDeployConfigurationId()) {
+            return qobject_cast<Qt4BaseTarget *>(parent)->qt4Project()
+                ->applicationProFilePathes(RemoteLinuxRunConfiguration::Id);
+    }
     }
     return QStringList();
 }