ProjectExplorer: Add signal to inform about deployment data changes.

Also one for changes to the application target list.
This re-enables the RemoteLinux plugin's ability to react to changes in
project files, which has been broken by the removal of the
buildSystemEvaluated() signal from the Project class in
I50249b186917cd3a4f399f187f09ac8428ab6f9e.

Change-Id: I380db69c9396b99423ff305096d4b9f4f17d3075
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Christian Kandeler
2012-08-29 15:52:47 +02:00
parent a92694596e
commit 42c965d17d
6 changed files with 42 additions and 7 deletions

View File

@@ -35,6 +35,7 @@
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <QList> #include <QList>
#include <QSet>
namespace ProjectExplorer { namespace ProjectExplorer {
@@ -59,6 +60,22 @@ public:
bool isValid() const { return !targetFilePath.isEmpty(); } bool isValid() const { return !targetFilePath.isEmpty(); }
}; };
inline bool operator==(const BuildTargetInfo &ti1, const BuildTargetInfo &ti2)
{
return ti1.targetFilePath == ti2.targetFilePath;
}
inline bool operator!=(const BuildTargetInfo &ti1, const BuildTargetInfo &ti2)
{
return !(ti1 == ti2);
}
inline uint qHash(const BuildTargetInfo &ti)
{
return qHash(ti.targetFilePath);
}
class PROJECTEXPLORER_EXPORT BuildTargetInfoList class PROJECTEXPLORER_EXPORT BuildTargetInfoList
{ {
public: public:
@@ -79,6 +96,16 @@ public:
QList<BuildTargetInfo> list; QList<BuildTargetInfo> list;
}; };
inline bool operator==(const BuildTargetInfoList &til1, const BuildTargetInfoList &til2)
{
return til1.list.toSet() == til2.list.toSet();
}
inline bool operator!=(const BuildTargetInfoList &til1, const BuildTargetInfoList &til2)
{
return !(til1 == til2);
}
} // namespace ProjectExplorer } // namespace ProjectExplorer
#endif // BUILDTARGETINFO_H #endif // BUILDTARGETINFO_H

View File

@@ -368,7 +368,10 @@ void Target::setActiveDeployConfiguration(DeployConfiguration *dc)
void Target::setDeploymentData(const DeploymentData &deploymentData) void Target::setDeploymentData(const DeploymentData &deploymentData)
{ {
if (d->m_deploymentData != deploymentData) {
d->m_deploymentData = deploymentData; d->m_deploymentData = deploymentData;
emit deploymentDataChanged();
}
} }
DeploymentData Target::deploymentData() const DeploymentData Target::deploymentData() const
@@ -378,7 +381,10 @@ DeploymentData Target::deploymentData() const
void Target::setApplicationTargets(const BuildTargetInfoList &appTargets) void Target::setApplicationTargets(const BuildTargetInfoList &appTargets)
{ {
if (d->m_appTargets != appTargets) {
d->m_appTargets = appTargets; d->m_appTargets = appTargets;
emit applicationTargetsChanged();
}
} }
BuildTargetInfoList Target::applicationTargets() const BuildTargetInfoList Target::applicationTargets() const

View File

@@ -150,6 +150,9 @@ signals:
void deployConfigurationEnabledChanged(); void deployConfigurationEnabledChanged();
void runConfigurationEnabledChanged(); void runConfigurationEnabledChanged();
void deploymentDataChanged();
void applicationTargetsChanged();
// Remove all the signals below, they are stupid // Remove all the signals below, they are stupid
/// Emitted whenever the current build configuartion changed or the build directory of the current /// Emitted whenever the current build configuartion changed or the build directory of the current
/// build configuration was changed. /// build configuration was changed.

View File

@@ -78,7 +78,7 @@ void AbstractPackagingStep::ctor()
SLOT(handleBuildConfigurationChanged())); SLOT(handleBuildConfigurationChanged()));
handleBuildConfigurationChanged(); handleBuildConfigurationChanged();
connect(project(), SIGNAL(buildSystemEvaluated()), SLOT(setDeploymentDataModified())); connect(target(), SIGNAL(deploymentDataChanged()), SLOT(setDeploymentDataModified()));
setDeploymentDataModified(); setDeploymentDataModified();
connect(this, SIGNAL(unmodifyDeploymentData()), this, SLOT(setDeploymentDataUnmodified())); connect(this, SIGNAL(unmodifyDeploymentData()), this, SLOT(setDeploymentDataUnmodified()));

View File

@@ -73,8 +73,7 @@ void RemoteLinuxDeployConfigurationWidget::init(DeployConfiguration *dc)
d->deployConfiguration = qobject_cast<RemoteLinuxDeployConfiguration *>(dc); d->deployConfiguration = qobject_cast<RemoteLinuxDeployConfiguration *>(dc);
QTC_ASSERT(d->deployConfiguration, return); QTC_ASSERT(d->deployConfiguration, return);
connect(dc->target()->project(), SIGNAL(buildSystemEvaluated()), connect(dc->target(), SIGNAL(deploymentDataChanged()), SLOT(updateDeploymentDataModel()));
SLOT(updateDeploymentDataModel()));
updateDeploymentDataModel(); updateDeploymentDataModel();
} }

View File

@@ -126,8 +126,8 @@ void RemoteLinuxRunConfiguration::init()
setDefaultDisplayName(defaultDisplayName()); setDefaultDisplayName(defaultDisplayName());
debuggerAspect()->suppressQmlDebuggingSpinbox(); debuggerAspect()->suppressQmlDebuggingSpinbox();
Project *pro = target()->project(); connect(target(), SIGNAL(deploymentDataChanged()), SLOT(handleBuildSystemDataUpdated()));
connect(pro, SIGNAL(buildSystemEvaluated()), SLOT(handleBuildSystemDataUpdated())); connect(target(), SIGNAL(applicationTargetsChanged()), SLOT(handleBuildSystemDataUpdated()));
connect(target(), SIGNAL(profileChanged()), connect(target(), SIGNAL(profileChanged()),
this, SLOT(handleBuildSystemDataUpdated())); // Handles device changes, etc. this, SLOT(handleBuildSystemDataUpdated())); // Handles device changes, etc.
} }