forked from qt-creator/qt-creator
RemoteLinux: Simplify AbstractPackaging and derived step
Change-Id: I1a9fc0947fcca358ce3e8ca24c6430bc973f131f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -42,7 +42,6 @@ namespace Internal {
|
||||
class AbstractPackagingStepPrivate
|
||||
{
|
||||
public:
|
||||
BuildConfiguration *currentBuildConfiguration = nullptr;
|
||||
QString cachedPackageFilePath;
|
||||
QString cachedPackageDirectory;
|
||||
bool deploymentDataModified = false;
|
||||
@@ -54,9 +53,6 @@ AbstractPackagingStep::AbstractPackagingStep(BuildStepList *bsl, Core::Id id)
|
||||
: BuildStep(bsl, id)
|
||||
{
|
||||
d = new Internal::AbstractPackagingStepPrivate;
|
||||
connect(target(), &Target::activeBuildConfigurationChanged,
|
||||
this, &AbstractPackagingStep::handleBuildConfigurationChanged);
|
||||
handleBuildConfigurationChanged();
|
||||
|
||||
connect(target(), &Target::deploymentDataChanged,
|
||||
this, &AbstractPackagingStep::setDeploymentDataModified);
|
||||
@@ -71,18 +67,6 @@ AbstractPackagingStep::~AbstractPackagingStep()
|
||||
delete d;
|
||||
}
|
||||
|
||||
void AbstractPackagingStep::handleBuildConfigurationChanged()
|
||||
{
|
||||
if (d->currentBuildConfiguration)
|
||||
disconnect(d->currentBuildConfiguration, nullptr, this, nullptr);
|
||||
d->currentBuildConfiguration = buildConfiguration();
|
||||
if (d->currentBuildConfiguration) {
|
||||
connect(d->currentBuildConfiguration, &BuildConfiguration::buildDirectoryChanged,
|
||||
this, &AbstractPackagingStep::packageFilePathChanged);
|
||||
}
|
||||
emit packageFilePathChanged();
|
||||
}
|
||||
|
||||
QString AbstractPackagingStep::cachedPackageFilePath() const
|
||||
{
|
||||
return d->cachedPackageFilePath;
|
||||
@@ -102,8 +86,7 @@ QString AbstractPackagingStep::cachedPackageDirectory() const
|
||||
|
||||
QString AbstractPackagingStep::packageDirectory() const
|
||||
{
|
||||
return d->currentBuildConfiguration
|
||||
? d->currentBuildConfiguration->buildDirectory().toString() : QString();
|
||||
return buildConfiguration()->buildDirectory().toString();
|
||||
}
|
||||
|
||||
bool AbstractPackagingStep::isPackagingNeeded() const
|
||||
|
||||
@@ -46,7 +46,6 @@ public:
|
||||
bool init() override;
|
||||
|
||||
signals:
|
||||
void packageFilePathChanged();
|
||||
void unmodifyDeploymentData();
|
||||
|
||||
protected:
|
||||
@@ -61,7 +60,6 @@ protected:
|
||||
virtual bool isPackagingNeeded() const;
|
||||
|
||||
private:
|
||||
void handleBuildConfigurationChanged();
|
||||
void setDeploymentDataUnmodified();
|
||||
void setDeploymentDataModified();
|
||||
|
||||
|
||||
@@ -82,6 +82,14 @@ TarPackageCreationStep::TarPackageCreationStep(BuildStepList *bsl)
|
||||
m_incrementalDeploymentAspect = addAspect<BaseBoolAspect>();
|
||||
m_incrementalDeploymentAspect->setLabel(tr("Package modified files only"));
|
||||
m_incrementalDeploymentAspect->setSettingsKey(IncrementalDeploymentKey);
|
||||
|
||||
setSummaryUpdater([this] {
|
||||
QString path = packageFilePath();
|
||||
if (path.isEmpty())
|
||||
return QString("<font color=\"red\">" + tr("Tarball creation not possible.")
|
||||
+ "</font>");
|
||||
return QString("<b>" + tr("Create tarball:") + "</b> " + path);
|
||||
});
|
||||
}
|
||||
|
||||
bool TarPackageCreationStep::init()
|
||||
@@ -344,29 +352,6 @@ bool TarPackageCreationStep::runImpl()
|
||||
return success;
|
||||
}
|
||||
|
||||
BuildStepConfigWidget *TarPackageCreationStep::createConfigWidget()
|
||||
{
|
||||
auto widget = BuildStep::createConfigWidget();
|
||||
|
||||
auto updateSummary = [this, widget] {
|
||||
QString path = packageFilePath();
|
||||
if (path.isEmpty()) {
|
||||
widget->setSummaryText("<font color=\"red\">"
|
||||
+ tr("Tarball creation not possible.")
|
||||
+ "</font>");
|
||||
} else {
|
||||
widget->setSummaryText("<b>" + tr("Create tarball:") + "</b> " + path);
|
||||
}
|
||||
};
|
||||
|
||||
connect(this, &AbstractPackagingStep::packageFilePathChanged,
|
||||
this, updateSummary);
|
||||
|
||||
updateSummary();
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
bool TarPackageCreationStep::fromMap(const QVariantMap &map)
|
||||
{
|
||||
if (!AbstractPackagingStep::fromMap(map))
|
||||
|
||||
@@ -63,7 +63,6 @@ private:
|
||||
void addNeededDeploymentFiles(const ProjectExplorer::DeployableFile &deployable,
|
||||
const ProjectExplorer::Kit *kit);
|
||||
|
||||
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
|
||||
bool fromMap(const QVariantMap &map) override;
|
||||
QVariantMap toMap() const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user