forked from qt-creator/qt-creator
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:
@@ -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
|
||||||
|
@@ -368,7 +368,10 @@ void Target::setActiveDeployConfiguration(DeployConfiguration *dc)
|
|||||||
|
|
||||||
void Target::setDeploymentData(const DeploymentData &deploymentData)
|
void Target::setDeploymentData(const DeploymentData &deploymentData)
|
||||||
{
|
{
|
||||||
d->m_deploymentData = deploymentData;
|
if (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)
|
||||||
{
|
{
|
||||||
d->m_appTargets = appTargets;
|
if (d->m_appTargets != appTargets) {
|
||||||
|
d->m_appTargets = appTargets;
|
||||||
|
emit applicationTargetsChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildTargetInfoList Target::applicationTargets() const
|
BuildTargetInfoList Target::applicationTargets() const
|
||||||
|
@@ -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.
|
||||||
|
@@ -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()));
|
||||||
|
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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.
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user