Merge remote-tracking branch 'origin/4.5'

Change-Id: I60fca091b2eac67259580acba5ae934c16d74a83
This commit is contained in:
Orgad Shaneh
2017-11-11 19:54:32 +02:00
51 changed files with 1930 additions and 1642 deletions

View File

@@ -199,6 +199,7 @@ PaletteButton=shadowBackground
PaletteBrightText=ffff0000
PaletteText=text
PaletteButtonText=text
PaletteButtonTextDisabled=textDisabled
PaletteToolTipBase=selectedBackground
PaletteHighlight=selectedBackground
PaletteDark=shadowBackground

File diff suppressed because it is too large Load Diff

View File

@@ -122,12 +122,6 @@ void BareMetalCustomRunConfiguration::initialize()
BareMetalRunConfiguration::initialize(runConfigId(), QString());
}
void BareMetalCustomRunConfiguration::copyFrom(const BareMetalCustomRunConfiguration *source)
{
BareMetalRunConfiguration::copyFrom(source);
m_localExecutable = source->m_localExecutable;
}
bool BareMetalCustomRunConfiguration::isConfigured() const
{
return !m_localExecutable.isEmpty();

View File

@@ -39,7 +39,6 @@ public:
explicit BareMetalCustomRunConfiguration(ProjectExplorer::Target *parent);
void initialize();
void copyFrom(const BareMetalCustomRunConfiguration *source);
bool isConfigured() const override;
ConfigurationState ensureConfigured(QString *errorMessage) override;

View File

@@ -57,15 +57,6 @@ BareMetalRunConfiguration::BareMetalRunConfiguration(Target *target)
this, &BareMetalRunConfiguration::handleBuildSystemDataUpdated); // Handles device changes, etc.
}
void BareMetalRunConfiguration::copyFrom(const BareMetalRunConfiguration *other)
{
RunConfiguration::copyFrom(other);
m_projectFilePath = other->m_projectFilePath;
m_workingDirectory = other->m_workingDirectory;
setDefaultDisplayName(defaultDisplayName());
}
void BareMetalRunConfiguration::initialize(const Core::Id id, const QString &projectFilePath)
{
RunConfiguration::initialize(id);

View File

@@ -67,7 +67,6 @@ protected:
bool fromMap(const QVariantMap &map) override;
QString defaultDisplayName();
void initialize(Core::Id id, const QString &projectFilePath);
void copyFrom(const BareMetalRunConfiguration *source);
private:
void handleBuildSystemDataUpdated();

View File

@@ -83,17 +83,6 @@ void CMakeRunConfiguration::initialize(Core::Id id, const QString &target,
setDefaultDisplayName(defaultDisplayName());
}
void CMakeRunConfiguration::copyFrom(const CMakeRunConfiguration *source)
{
RunConfiguration::copyFrom(source);
m_buildSystemTarget = source->m_buildSystemTarget;
m_executable = source->m_executable;
m_title = source->m_title;
setDefaultDisplayName(defaultDisplayName());
}
Runnable CMakeRunConfiguration::runnable() const
{
StandardRunnable r;

View File

@@ -59,7 +59,6 @@ public:
private:
void initialize(Core::Id id, const QString &target,
const Utils::FileName &workingDirectory, const QString &title);
void copyFrom(const CMakeRunConfiguration *source);
bool fromMap(const QVariantMap &map) override;
QString defaultDisplayName() const;

View File

@@ -330,10 +330,4 @@ void DebuggerRunConfigurationAspect::fromMap(const QVariantMap &map)
d.useMultiProcess = map.value(QLatin1String(USE_MULTIPROCESS_KEY), false).toBool();
}
DebuggerRunConfigurationAspect *DebuggerRunConfigurationAspect::create
(RunConfiguration *runConfiguration) const
{
return new DebuggerRunConfigurationAspect(runConfiguration);
}
} // namespace Debugger

View File

@@ -56,10 +56,9 @@ class DEBUGGER_EXPORT DebuggerRunConfigurationAspect
public:
DebuggerRunConfigurationAspect(ProjectExplorer::RunConfiguration *runConfiguration);
DebuggerRunConfigurationAspect *create(ProjectExplorer::RunConfiguration *runConfiguration) const;
void fromMap(const QVariantMap &map);
void toMap(QVariantMap &map) const;
void fromMap(const QVariantMap &map) override;
void toMap(QVariantMap &map) const override;
bool useCppDebugger() const;
void setUseCppDebugger(bool value);

View File

@@ -105,7 +105,6 @@ IosRunConfiguration::IosRunConfiguration(Target *target)
this, &IosRunConfiguration::deviceChanges);
}
void IosRunConfiguration::initialize(Core::Id id, const FileName &path)
{
RunConfiguration::initialize(id);
@@ -114,14 +113,6 @@ void IosRunConfiguration::initialize(Core::Id id, const FileName &path)
updateDisplayNames();
}
void IosRunConfiguration::copyFrom(const IosRunConfiguration *source)
{
RunConfiguration::copyFrom(source);
m_profilePath = source->m_profilePath;
updateDisplayNames();
}
void IosRunConfiguration::deviceChanges() {
updateDisplayNames();
updateEnabledState();

View File

@@ -72,7 +72,6 @@ signals:
private:
friend class ProjectExplorer::IRunConfigurationFactory;
void initialize(Core::Id id, const Utils::FileName &path);
void copyFrom(const IosRunConfiguration *source);
void deviceChanges();
friend class IosRunConfigurationWidget;

View File

@@ -63,7 +63,8 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
if (mode == InstantApply) {
argumentsAspect->addToMainConfigurationWidget(this, layout);
} else {
m_temporaryArgumentsAspect = argumentsAspect->clone(rc);
m_temporaryArgumentsAspect = new ArgumentsAspect(rc, QString());
m_temporaryArgumentsAspect->copyFrom(argumentsAspect);
m_temporaryArgumentsAspect->addToMainConfigurationWidget(this, layout);
connect(m_temporaryArgumentsAspect, &ArgumentsAspect::argumentsChanged,
this, &CustomExecutableConfigurationWidget::validChanged);
@@ -80,7 +81,8 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
if (mode == InstantApply) {
terminalAspect->addToMainConfigurationWidget(this, layout);
} else {
m_temporaryTerminalAspect = terminalAspect->clone(rc);
m_temporaryTerminalAspect = new TerminalAspect(rc, QString());
m_temporaryTerminalAspect->copyFrom(terminalAspect);
m_temporaryTerminalAspect->addToMainConfigurationWidget(this, layout);
connect(m_temporaryTerminalAspect, &TerminalAspect::useTerminalChanged,
this, &CustomExecutableConfigurationWidget::validChanged);

View File

@@ -101,15 +101,6 @@ void CustomExecutableRunConfiguration::initialize()
setDefaultDisplayName(defaultDisplayName());
}
void CustomExecutableRunConfiguration::copyFrom(const CustomExecutableRunConfiguration *source)
{
RunConfiguration::copyFrom(source);
m_executable = source->m_executable;
m_workingDirectory = source->m_workingDirectory;
setDefaultDisplayName(defaultDisplayName());
}
// Note: Qt4Project deletes all empty customexecrunconfigs for which isConfigured() == false.
CustomExecutableRunConfiguration::~CustomExecutableRunConfiguration()
{

View File

@@ -67,8 +67,7 @@ signals:
protected:
void initialize();
void copyFrom(const CustomExecutableRunConfiguration *source);
virtual bool fromMap(const QVariantMap &map) override;
bool fromMap(const QVariantMap &map) override;
QString defaultDisplayName() const;
private:

View File

@@ -115,6 +115,8 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent
m_toggleSync(new QToolButton(this)),
m_rootSelector(new QComboBox)
{
setBackgroundRole(QPalette::Base);
setAutoFillBackground(true);
m_fileSystemModel->setResolveSymlinks(false);
m_fileSystemModel->setIconProvider(Core::FileIconProvider::iconProvider());
QDir::Filters filters = QDir::AllEntries | QDir::NoDotAndDotDot;
@@ -131,8 +133,14 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent
showOnlyFirstColumn(m_listView);
setFocusProxy(m_listView);
auto selectorWidget = new QWidget(this);
auto selectorLayout = new QVBoxLayout(selectorWidget);
selectorWidget->setLayout(selectorLayout);
selectorLayout->setContentsMargins(0, 0, 0, 0);
selectorLayout->addWidget(m_rootSelector);
auto layout = new QVBoxLayout();
layout->addWidget(m_rootSelector);
layout->addWidget(selectorWidget);
layout->addWidget(m_listView);
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);

View File

@@ -94,11 +94,4 @@ LocalEnvironmentAspect::LocalEnvironmentAspect(RunConfiguration *parent,
this, &LocalEnvironmentAspect::buildEnvironmentHasChanged);
}
LocalEnvironmentAspect *LocalEnvironmentAspect::create(RunConfiguration *parent) const
{
auto result = new LocalEnvironmentAspect(parent, m_baseEnvironmentModifier);
result->setUserEnvironmentChanges(userEnvironmentChanges());
return result;
}
} // namespace ProjectExplorer

View File

@@ -36,7 +36,6 @@ class PROJECTEXPLORER_EXPORT LocalEnvironmentAspect : public EnvironmentAspect
public:
typedef std::function<void(RunConfiguration *, Utils::Environment &)> BaseEnvironmentModifier;
LocalEnvironmentAspect(RunConfiguration *parent, const BaseEnvironmentModifier &modifier);
LocalEnvironmentAspect *create(RunConfiguration *parent) const override;
QList<int> possibleBaseEnvironments() const override;
QString baseEnvironmentDisplayName(int base) const override;

View File

@@ -110,6 +110,14 @@ RunConfigWidget *IRunConfigurationAspect::createConfigurationWidget() const
return m_runConfigWidgetCreator ? m_runConfigWidgetCreator() : nullptr;
}
void IRunConfigurationAspect::copyFrom(IRunConfigurationAspect *source)
{
QTC_ASSERT(source, return);
QVariantMap data;
source->toMap(data);
fromMap(data);
}
void IRunConfigurationAspect::setProjectSettings(ISettingsAspect *settings)
{
m_projectSettings = settings;
@@ -132,13 +140,15 @@ ISettingsAspect *IRunConfigurationAspect::currentSettings() const
void IRunConfigurationAspect::fromMap(const QVariantMap &map)
{
m_projectSettings->fromMap(map);
if (m_projectSettings)
m_projectSettings->fromMap(map);
m_useGlobalSettings = map.value(m_id.toString() + QLatin1String(".UseGlobalSettings"), true).toBool();
}
void IRunConfigurationAspect::toMap(QVariantMap &map) const
{
m_projectSettings->toMap(map);
if (m_projectSettings)
m_projectSettings->toMap(map);
map.insert(m_id.toString() + QLatin1String(".UseGlobalSettings"), m_useGlobalSettings);
}
@@ -147,22 +157,13 @@ void IRunConfigurationAspect::setRunConfigWidgetCreator(const RunConfigWidgetCre
m_runConfigWidgetCreator = runConfigWidgetCreator;
}
IRunConfigurationAspect *IRunConfigurationAspect::clone(RunConfiguration *runConfig) const
{
IRunConfigurationAspect *other = create(runConfig);
if (m_projectSettings)
other->m_projectSettings = m_projectSettings->clone();
other->m_globalSettings = m_globalSettings;
other->m_useGlobalSettings = m_useGlobalSettings;
return other;
}
void IRunConfigurationAspect::resetProjectToGlobalSettings()
{
QTC_ASSERT(m_globalSettings, return);
QVariantMap map;
m_globalSettings->toMap(map);
m_projectSettings->fromMap(map);
if (m_projectSettings)
m_projectSettings->fromMap(map);
}
@@ -223,6 +224,9 @@ RunConfiguration::RunConfiguration(Target *target)
expander->registerVariable(Constants::VAR_CURRENTRUN_NAME,
QCoreApplication::translate("ProjectExplorer", "The currently active run configuration's name."),
[this] { return displayName(); }, false);
for (const AspectFactory &factory : theAspectFactories)
addExtraAspect(factory(this));
}
RunConfiguration::~RunConfiguration()
@@ -233,20 +237,12 @@ RunConfiguration::~RunConfiguration()
void RunConfiguration::initialize(Core::Id id)
{
StatefulProjectConfiguration::initialize(id);
for (const AspectFactory &factory : theAspectFactories)
addExtraAspect(factory(this));
}
void RunConfiguration::copyFrom(const RunConfiguration *source)
{
StatefulProjectConfiguration::copyFrom(source);
foreach (IRunConfigurationAspect *aspect, source->m_aspects) {
IRunConfigurationAspect *clone = aspect->clone(this);
if (clone)
m_aspects.append(clone);
}
QVariantMap data = source->toMap();
fromMap(data);
}
bool RunConfiguration::isActive() const
@@ -560,6 +556,40 @@ public:
bool canStop() const;
void timerEvent(QTimerEvent *ev) override;
void killStartWatchdog()
{
if (startWatchdogTimerId != -1) {
killTimer(startWatchdogTimerId);
startWatchdogTimerId = -1;
}
}
void killStopWatchdog()
{
if (stopWatchdogTimerId != -1) {
killTimer(stopWatchdogTimerId);
stopWatchdogTimerId = -1;
}
}
void startStartWatchdog()
{
killStartWatchdog();
killStopWatchdog();
if (startWatchdogInterval != 0)
startWatchdogTimerId = startTimer(startWatchdogInterval);
}
void startStopWatchdog()
{
killStopWatchdog();
killStartWatchdog();
if (stopWatchdogInterval != 0)
stopWatchdogTimerId = startTimer(stopWatchdogInterval);
}
RunWorker *q;
RunWorkerState state = RunWorkerState::Initialized;
const QPointer<RunControl> runControl;
@@ -1573,17 +1603,21 @@ bool RunWorkerPrivate::canStop() const
void RunWorkerPrivate::timerEvent(QTimerEvent *ev)
{
if (ev->timerId() == startWatchdogTimerId) {
if (startWatchdogCallback)
if (startWatchdogCallback) {
killStartWatchdog();
startWatchdogCallback();
else
} else {
q->reportFailure(RunWorker::tr("Worker start timed out."));
}
return;
}
if (ev->timerId() == stopWatchdogTimerId) {
if (stopWatchdogCallback)
if (stopWatchdogCallback) {
killStopWatchdog();
stopWatchdogCallback();
else
} else {
q->reportFailure(RunWorker::tr("Worker stop timed out."));
}
return;
}
}
@@ -1641,9 +1675,8 @@ RunWorker::~RunWorker()
*/
void RunWorker::initiateStart()
{
if (d->startWatchdogInterval != 0)
d->startWatchdogTimerId = d->startTimer(d->startWatchdogInterval);
d->startStartWatchdog();
d->runControl->d->debugMessage("Initiate start for " + d->id);
start();
}
@@ -1655,8 +1688,7 @@ void RunWorker::initiateStart()
*/
void RunWorker::reportStarted()
{
if (d->startWatchdogInterval != 0)
d->killTimer(d->startWatchdogTimerId);
d->killStartWatchdog();
d->runControl->d->onWorkerStarted(this);
emit started();
}
@@ -1669,9 +1701,7 @@ void RunWorker::reportStarted()
*/
void RunWorker::initiateStop()
{
if (d->stopWatchdogInterval != 0)
d->stopWatchdogTimerId = d->startTimer(d->stopWatchdogInterval);
d->startStopWatchdog();
d->runControl->d->debugMessage("Initiate stop for " + d->id);
stop();
}
@@ -1687,8 +1717,7 @@ void RunWorker::initiateStop()
*/
void RunWorker::reportStopped()
{
if (d->stopWatchdogInterval != 0)
d->killTimer(d->stopWatchdogTimerId);
d->killStopWatchdog();
d->runControl->d->onWorkerStopped(this);
emit stopped();
}
@@ -1702,6 +1731,8 @@ void RunWorker::reportStopped()
*/
void RunWorker::reportDone()
{
d->killStartWatchdog();
d->killStopWatchdog();
switch (d->state) {
case RunWorkerState::Initialized:
QTC_CHECK(false);
@@ -1727,6 +1758,8 @@ void RunWorker::reportDone()
*/
void RunWorker::reportFailure(const QString &msg)
{
d->killStartWatchdog();
d->killStopWatchdog();
d->runControl->d->onWorkerFailed(this, msg);
}

View File

@@ -102,20 +102,20 @@ public:
explicit IRunConfigurationAspect(RunConfiguration *runConfig);
~IRunConfigurationAspect() override;
virtual IRunConfigurationAspect *create(RunConfiguration *runConfig) const = 0;
virtual IRunConfigurationAspect *clone(RunConfiguration *runConfig) const;
using RunConfigWidgetCreator = std::function<RunConfigWidget *()>;
void setRunConfigWidgetCreator(const RunConfigWidgetCreator &runConfigWidgetCreator);
RunConfigWidget *createConfigurationWidget() const;
void copyFrom(IRunConfigurationAspect *other);
void setId(Core::Id id) { m_id = id; }
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
void setSettingsKey(const QString &settingsKey) { m_settingsKey = settingsKey; }
void setProjectSettings(ISettingsAspect *settings);
void setGlobalSettings(ISettingsAspect *settings);
QString displayName() const { return m_displayName; }
Core::Id id() const { return m_id; }
QString displayName() const { return m_displayName; }
QString settingsKey() const { return m_settingsKey; }
bool isUsingGlobalSettings() const { return m_useGlobalSettings; }
void setUsingGlobalSettings(bool value);
void resetProjectToGlobalSettings();
@@ -133,6 +133,7 @@ protected:
private:
Core::Id m_id;
QString m_displayName;
QString m_settingsKey; // Name of data in settings.
bool m_useGlobalSettings = false;
RunConfiguration *m_runConfiguration = nullptr;
ISettingsAspect *m_projectSettings = nullptr; // Owned if present.
@@ -308,7 +309,7 @@ public:
template <class RunConfig>
static RunConfig *cloneHelper(Target *target, const RunConfiguration *source) {
auto runConfig = new RunConfig(target);
runConfig->copyFrom(static_cast<const RunConfig *>(source));
runConfig->copyFrom(source);
return runConfig;
}

View File

@@ -46,23 +46,12 @@ namespace ProjectExplorer {
\class ProjectExplorer::TerminalAspect
*/
TerminalAspect::TerminalAspect(RunConfiguration *runConfig, const QString &key,
bool useTerminal, bool userSet) :
IRunConfigurationAspect(runConfig),
m_useTerminal(useTerminal), m_userSet(userSet), m_checkBox(nullptr), m_key(key)
TerminalAspect::TerminalAspect(RunConfiguration *runConfig, const QString &key, bool useTerminal) :
IRunConfigurationAspect(runConfig), m_useTerminal(useTerminal)
{
setDisplayName(tr("Terminal"));
setId("TerminalAspect");
}
TerminalAspect *TerminalAspect::create(RunConfiguration *runConfig) const
{
return new TerminalAspect(runConfig, m_key, false, false);
}
TerminalAspect *TerminalAspect::clone(RunConfiguration *runConfig) const
{
return new TerminalAspect(runConfig, m_key, m_useTerminal, m_userSet);
setSettingsKey(key);
}
void TerminalAspect::addToMainConfigurationWidget(QWidget *parent, QFormLayout *layout)
@@ -80,8 +69,8 @@ void TerminalAspect::addToMainConfigurationWidget(QWidget *parent, QFormLayout *
void TerminalAspect::fromMap(const QVariantMap &map)
{
if (map.contains(m_key)) {
m_useTerminal = map.value(m_key).toBool();
if (map.contains(settingsKey())) {
m_useTerminal = map.value(settingsKey()).toBool();
m_userSet = true;
} else {
m_userSet = false;
@@ -91,7 +80,7 @@ void TerminalAspect::fromMap(const QVariantMap &map)
void TerminalAspect::toMap(QVariantMap &data) const
{
if (m_userSet)
data.insert(m_key, m_useTerminal);
data.insert(settingsKey(), m_useTerminal);
}
bool TerminalAspect::useTerminal() const
@@ -129,23 +118,11 @@ void TerminalAspect::setRunMode(ApplicationLauncher::Mode runMode)
*/
WorkingDirectoryAspect::WorkingDirectoryAspect(RunConfiguration *runConfig, const QString &key)
: IRunConfigurationAspect(runConfig), m_key(key)
: IRunConfigurationAspect(runConfig)
{
setDisplayName(tr("Working Directory"));
setId("WorkingDirectoryAspect");
}
WorkingDirectoryAspect *WorkingDirectoryAspect::create(RunConfiguration *runConfig) const
{
return new WorkingDirectoryAspect(runConfig, m_key);
}
WorkingDirectoryAspect *WorkingDirectoryAspect::clone(RunConfiguration *runConfig) const
{
auto * const aspect = new WorkingDirectoryAspect(runConfig, m_key);
aspect->m_defaultWorkingDirectory = m_defaultWorkingDirectory;
aspect->m_workingDirectory = m_workingDirectory;
return aspect;
setSettingsKey(key);
}
void WorkingDirectoryAspect::addToMainConfigurationWidget(QWidget *parent, QFormLayout *layout)
@@ -157,7 +134,7 @@ void WorkingDirectoryAspect::addToMainConfigurationWidget(QWidget *parent, QForm
connect(m_resetButton.data(), &QAbstractButton::clicked, this, &WorkingDirectoryAspect::resetPath);
m_chooser = new PathChooser(parent);
m_chooser->setHistoryCompleter(m_key);
m_chooser->setHistoryCompleter(settingsKey());
m_chooser->setExpectedKind(Utils::PathChooser::Directory);
m_chooser->setPromptDialogTitle(tr("Select Working Directory"));
m_chooser->setBaseFileName(m_defaultWorkingDirectory);
@@ -185,7 +162,7 @@ void WorkingDirectoryAspect::addToMainConfigurationWidget(QWidget *parent, QForm
QString WorkingDirectoryAspect::keyForDefaultWd() const
{
return m_key + QLatin1String(".default");
return settingsKey() + ".default";
}
void WorkingDirectoryAspect::resetPath()
@@ -195,7 +172,7 @@ void WorkingDirectoryAspect::resetPath()
void WorkingDirectoryAspect::fromMap(const QVariantMap &map)
{
m_workingDirectory = FileName::fromString(map.value(m_key).toString());
m_workingDirectory = FileName::fromString(map.value(settingsKey()).toString());
m_defaultWorkingDirectory = FileName::fromString(map.value(keyForDefaultWd()).toString());
if (m_workingDirectory.isEmpty())
@@ -204,9 +181,9 @@ void WorkingDirectoryAspect::fromMap(const QVariantMap &map)
void WorkingDirectoryAspect::toMap(QVariantMap &data) const
{
const QString wd
= (m_workingDirectory == m_defaultWorkingDirectory) ? QString() : m_workingDirectory.toString();
data.insert(m_key, wd);
const QString wd = m_workingDirectory == m_defaultWorkingDirectory
? QString() : m_workingDirectory.toString();
data.insert(settingsKey(), wd);
data.insert(keyForDefaultWd(), m_defaultWorkingDirectory.toString());
}
@@ -257,11 +234,12 @@ PathChooser *WorkingDirectoryAspect::pathChooser() const
\class ProjectExplorer::ArgumentsAspect
*/
ArgumentsAspect::ArgumentsAspect(RunConfiguration *runConfig, const QString &key, const QString &arguments)
: IRunConfigurationAspect(runConfig), m_arguments(arguments), m_key(key)
ArgumentsAspect::ArgumentsAspect(RunConfiguration *runConfig, const QString &key)
: IRunConfigurationAspect(runConfig)
{
setDisplayName(tr("Arguments"));
setId("ArgumentsAspect");
setSettingsKey(key);
}
QString ArgumentsAspect::arguments() const
@@ -286,29 +264,19 @@ void ArgumentsAspect::setArguments(const QString &arguments)
void ArgumentsAspect::fromMap(const QVariantMap &map)
{
m_arguments = map.value(m_key).toString();
m_arguments = map.value(settingsKey()).toString();
}
void ArgumentsAspect::toMap(QVariantMap &map) const
{
map.insert(m_key, m_arguments);
}
ArgumentsAspect *ArgumentsAspect::create(RunConfiguration *runConfig) const
{
return new ArgumentsAspect(runConfig, m_key);
}
ArgumentsAspect *ArgumentsAspect::clone(RunConfiguration *runConfig) const
{
return new ArgumentsAspect(runConfig, m_key, m_arguments);
map.insert(settingsKey(), m_arguments);
}
void ArgumentsAspect::addToMainConfigurationWidget(QWidget *parent, QFormLayout *layout)
{
QTC_CHECK(!m_chooser);
m_chooser = new FancyLineEdit(parent);
m_chooser->setHistoryCompleter(m_key);
m_chooser->setHistoryCompleter(settingsKey());
m_chooser->setText(m_arguments);
connect(m_chooser.data(), &QLineEdit::textChanged, this, &ArgumentsAspect::setArguments);

View File

@@ -33,7 +33,6 @@
QT_BEGIN_NAMESPACE
class QCheckBox;
class QFormLayout;
class QLineEdit;
class QToolButton;
QT_END_NAMESPACE
@@ -49,11 +48,8 @@ class PROJECTEXPLORER_EXPORT TerminalAspect : public IRunConfigurationAspect
Q_OBJECT
public:
explicit TerminalAspect(RunConfiguration *rc, const QString &key,
bool useTerminal = false, bool userSet = false);
TerminalAspect *create(RunConfiguration *runConfig) const override;
TerminalAspect *clone(RunConfiguration *runConfig) const override;
TerminalAspect(RunConfiguration *rc, const QString &settingsKey,
bool useTerminal = false);
void addToMainConfigurationWidget(QWidget *parent, QFormLayout *layout);
@@ -75,7 +71,6 @@ private:
bool m_useTerminal = false;
bool m_userSet = false;
QPointer<QCheckBox> m_checkBox; // Owned by RunConfigWidget
QString m_key;
};
class PROJECTEXPLORER_EXPORT WorkingDirectoryAspect : public IRunConfigurationAspect
@@ -83,10 +78,7 @@ class PROJECTEXPLORER_EXPORT WorkingDirectoryAspect : public IRunConfigurationAs
Q_OBJECT
public:
explicit WorkingDirectoryAspect(RunConfiguration *runConfig, const QString &key);
WorkingDirectoryAspect *create(RunConfiguration *runConfig) const override;
WorkingDirectoryAspect *clone(RunConfiguration *runConfig) const override;
explicit WorkingDirectoryAspect(RunConfiguration *runConfig, const QString &settingsKey);
void addToMainConfigurationWidget(QWidget *parent, QFormLayout *layout);
@@ -107,7 +99,6 @@ private:
Utils::FileName m_defaultWorkingDirectory;
QPointer<Utils::PathChooser> m_chooser;
QPointer<QToolButton> m_resetButton;
QString m_key;
};
class PROJECTEXPLORER_EXPORT ArgumentsAspect : public IRunConfigurationAspect
@@ -115,10 +106,7 @@ class PROJECTEXPLORER_EXPORT ArgumentsAspect : public IRunConfigurationAspect
Q_OBJECT
public:
explicit ArgumentsAspect(RunConfiguration *runConfig, const QString &key, const QString &arguments = QString());
ArgumentsAspect *create(RunConfiguration *runConfig) const override;
ArgumentsAspect *clone(RunConfiguration *runConfig) const override;
explicit ArgumentsAspect(RunConfiguration *runConfig, const QString &settingsKey);
void addToMainConfigurationWidget(QWidget *parent, QFormLayout *layout);
@@ -136,7 +124,6 @@ private:
QString m_arguments;
QPointer<Utils::FancyLineEdit> m_chooser;
QString m_key;
};
} // namespace ProjectExplorer

View File

@@ -167,7 +167,6 @@ public:
private:
friend class ProjectExplorer::IRunConfigurationFactory;
void initialize(Core::Id id);
void copyFrom(const PythonRunConfiguration *source);
QString defaultDisplayName() const;
@@ -198,13 +197,6 @@ void PythonRunConfiguration::initialize(Core::Id id)
m_interpreter = exec.isEmpty() ? "python" : exec;
}
void PythonRunConfiguration::copyFrom(const PythonRunConfiguration *source)
{
RunConfiguration::copyFrom(source);
m_interpreter = source->interpreter();
m_mainScript = source->m_mainScript;
}
QVariantMap PythonRunConfiguration::toMap() const
{
QVariantMap map(RunConfiguration::toMap());

View File

@@ -144,21 +144,7 @@ void QbsRunConfiguration::initialize(Core::Id id)
{
RunConfiguration::initialize(id);
m_uniqueProductName = uniqueProductNameFromId(id);
ctor();
}
void QbsRunConfiguration::copyFrom(const QbsRunConfiguration *source)
{
RunConfiguration::copyFrom(source);
m_uniqueProductName = source->m_uniqueProductName;
m_currentInstallStep = nullptr; // no need to copy this, we will get if from the DC anyway.
m_currentBuildStepList = nullptr; // ditto
ctor();
}
void QbsRunConfiguration::ctor()
{
setDefaultDisplayName(defaultDisplayName());
installStepChanged();
}

View File

@@ -71,15 +71,12 @@ signals:
private:
void initialize(Core::Id id);
void copyFrom(const QbsRunConfiguration *source);
void installStepChanged();
void installStepToBeRemoved(int pos);
QString baseWorkingDirectory() const;
QString defaultDisplayName();
void ctor();
void updateTarget();
QString m_uniqueProductName;

View File

@@ -63,19 +63,6 @@ void QmakeAndroidRunConfiguration::initialize(Core::Id id)
AndroidRunConfiguration::initialize(id);
m_proFilePath = pathFromId(id);
ctor();
}
void QmakeAndroidRunConfiguration::copyFrom(const QmakeAndroidRunConfiguration *source)
{
AndroidRunConfiguration::copyFrom(source);
m_proFilePath = source->m_proFilePath;
ctor();
}
void QmakeAndroidRunConfiguration::ctor()
{
setDefaultDisplayName(defaultDisplayName());
QTC_CHECK(!m_proFilePath.isEmpty());
}

View File

@@ -55,14 +55,12 @@ public:
private:
friend class ProjectExplorer::IRunConfigurationFactory;
void initialize(Core::Id id);
void copyFrom(const QmakeAndroidRunConfiguration *source);
bool fromMap(const QVariantMap &map) override;
QVariantMap toMap() const override;
QString defaultDisplayName();
QmakeProjectManager::QmakeProject *qmakeProject() const;
void ctor();
mutable Utils::FileName m_proFilePath;
};

View File

@@ -85,6 +85,12 @@ DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *target)
addExtraAspect(new ArgumentsAspect(this, "Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"));
addExtraAspect(new TerminalAspect(this, "Qt4ProjectManager.Qt4RunConfiguration.UseTerminal"));
addExtraAspect(new WorkingDirectoryAspect(this, "Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"));
QmakeProject *project = qmakeProject();
connect(project, &Project::parsingFinished,
this, &DesktopQmakeRunConfiguration::updateTargetInformation);
connect(project, &QmakeProject::proFilesEvaluated,
this, &DesktopQmakeRunConfiguration::proFileEvaluated);
}
void DesktopQmakeRunConfiguration::initialize(Core::Id id)
@@ -92,17 +98,7 @@ void DesktopQmakeRunConfiguration::initialize(Core::Id id)
RunConfiguration::initialize(id);
m_proFilePath = pathFromId(id);
ctor();
}
void DesktopQmakeRunConfiguration::copyFrom(const DesktopQmakeRunConfiguration *source)
{
RunConfiguration::copyFrom(source);
m_proFilePath = source->m_proFilePath;
m_isUsingDyldImageSuffix = source->m_isUsingDyldImageSuffix;
m_isUsingLibrarySearchPath = source->m_isUsingLibrarySearchPath;
ctor();
updateTargetInformation();
}
void DesktopQmakeRunConfiguration::proFileEvaluated()
@@ -129,19 +125,6 @@ void DesktopQmakeRunConfiguration::updateTargetInformation()
emit effectiveTargetInformationChanged();
}
void DesktopQmakeRunConfiguration::ctor()
{
setDefaultDisplayName(defaultDisplayName());
QmakeProject *project = qmakeProject();
connect(project, &Project::parsingFinished,
this, &DesktopQmakeRunConfiguration::updateTargetInformation);
connect(project, &QmakeProject::proFilesEvaluated,
this, &DesktopQmakeRunConfiguration::proFileEvaluated);
updateTargetInformation();
}
//////
/// DesktopQmakeRunConfigurationWidget
/////

View File

@@ -88,8 +88,6 @@ signals:
protected:
void initialize(Core::Id id);
void copyFrom(const DesktopQmakeRunConfiguration *source);
bool fromMap(const QVariantMap &map) override;
private:
@@ -103,8 +101,6 @@ private:
QmakeProject *qmakeProject() const;
QmakeProFile *proFile() const;
void ctor();
void updateTarget();
Utils::FileName m_proFilePath; // Full path to the Application Pro File

View File

@@ -46,11 +46,5 @@ QmlProfilerRunConfigurationAspect::QmlProfilerRunConfigurationAspect(
setRunConfigWidgetCreator([this] { return new Debugger::AnalyzerRunConfigWidget(this); });
}
ProjectExplorer::IRunConfigurationAspect *QmlProfilerRunConfigurationAspect::create(
ProjectExplorer::RunConfiguration *runConfig) const
{
return new QmlProfilerRunConfigurationAspect(runConfig);
}
} // Internal
} // QmlProfiler

View File

@@ -34,9 +34,6 @@ class QmlProfilerRunConfigurationAspect : public ProjectExplorer::IRunConfigurat
{
public:
QmlProfilerRunConfigurationAspect(ProjectExplorer::RunConfiguration *parent);
ProjectExplorer::IRunConfigurationAspect *create(
ProjectExplorer::RunConfiguration *runConfig) const;
};
} // Internal

View File

@@ -64,9 +64,4 @@ QmlProjectEnvironmentAspect::QmlProjectEnvironmentAspect(ProjectExplorer::RunCon
ProjectExplorer::EnvironmentAspect(rc)
{ }
QmlProjectEnvironmentAspect *QmlProjectEnvironmentAspect::create(ProjectExplorer::RunConfiguration *parent) const
{
return new QmlProjectEnvironmentAspect(parent);
}
} // namespace QmlProjectManager

View File

@@ -35,11 +35,10 @@ class QmlProjectEnvironmentAspect : public ProjectExplorer::EnvironmentAspect
public:
QmlProjectEnvironmentAspect(ProjectExplorer::RunConfiguration *rc);
QmlProjectEnvironmentAspect *create(ProjectExplorer::RunConfiguration *parent) const;
QList<int> possibleBaseEnvironments() const;
QString baseEnvironmentDisplayName(int base) const;
Utils::Environment baseEnvironment() const;
QList<int> possibleBaseEnvironments() const override;
QString baseEnvironmentDisplayName(int base) const override;
Utils::Environment baseEnvironment() const override;
private:
enum BaseEnvironmentBase {

View File

@@ -79,17 +79,6 @@ void QmlProjectRunConfiguration::initialize(Id id)
updateEnabledState();
}
void QmlProjectRunConfiguration::copyFrom(const QmlProjectRunConfiguration *source)
{
RunConfiguration::copyFrom(source);
m_currentFileFilename = source->m_currentFileFilename;
m_mainScriptFilename = source->m_mainScriptFilename;
m_scriptFile = source->m_scriptFile;
m_qmlViewerArgs = source->m_qmlViewerArgs;
updateEnabledState();
}
Runnable QmlProjectRunConfiguration::runnable() const
{
StandardRunnable r;

View File

@@ -78,8 +78,7 @@ signals:
private:
void initialize(Core::Id id);
void copyFrom(const QmlProjectRunConfiguration *source);
virtual bool fromMap(const QVariantMap &map) override;
bool fromMap(const QVariantMap &map) override;
void changeCurrentFile(Core::IEditor* = 0);
void updateEnabledState() final;

View File

@@ -45,17 +45,6 @@ QnxRunConfiguration::QnxRunConfiguration(Target *target)
: RemoteLinuxRunConfiguration(target)
{}
void QnxRunConfiguration::initialize(Core::Id id, const QString &targetName)
{
RemoteLinuxRunConfiguration::initialize(id, targetName);
}
void QnxRunConfiguration::copyFrom(const QnxRunConfiguration *source)
{
RemoteLinuxRunConfiguration::copyFrom(source);
m_qtLibPath = source->m_qtLibPath;
}
Runnable QnxRunConfiguration::runnable() const
{
auto r = RemoteLinuxRunConfiguration::runnable().as<StandardRunnable>();

View File

@@ -37,17 +37,11 @@ class QnxRunConfiguration : public RemoteLinux::RemoteLinuxRunConfiguration
public:
explicit QnxRunConfiguration(ProjectExplorer::Target *target);
ProjectExplorer::Runnable runnable() const override;
QWidget *createConfigurationWidget() override;
QVariantMap toMap() const override;
private:
friend class ProjectExplorer::IRunConfigurationFactory;
void copyFrom(const QnxRunConfiguration *source);
void initialize(Core::Id id, const QString &targetName);
ProjectExplorer::Runnable runnable() const override;
QWidget *createConfigurationWidget() override;
QVariantMap toMap() const override;
bool fromMap(const QVariantMap &map) override;
QString m_qtLibPath;

View File

@@ -45,13 +45,11 @@ enum State { Inactive, Connecting, RunningUname, TestingPorts };
class GenericLinuxDeviceTesterPrivate
{
public:
GenericLinuxDeviceTesterPrivate() : connection(0), state(Inactive) {}
IDevice::ConstPtr deviceConfiguration;
SshConnection *connection;
SshConnection *connection = nullptr;
SshRemoteProcess::Ptr process;
DeviceUsedPortsGatherer portsGatherer;
State state;
State state = Inactive;
};
} // namespace Internal
@@ -105,11 +103,6 @@ void GenericLinuxDeviceTester::stopTest()
setFinished(TestFailure);
}
DeviceUsedPortsGatherer *GenericLinuxDeviceTester::usedPortsGatherer() const
{
return &d->portsGatherer;
}
void GenericLinuxDeviceTester::handleConnected()
{
QTC_ASSERT(d->state == Connecting, return);

View File

@@ -29,10 +29,6 @@
#include <projectexplorer/devicesupport/idevice.h>
namespace ProjectExplorer { class DeviceUsedPortsGatherer; }
namespace QSsh { class SshConnection; }
namespace ProjectExplorer { class DeviceUsedPortsGatherer; }
namespace RemoteLinux {
namespace Internal { class GenericLinuxDeviceTesterPrivate; }
@@ -48,8 +44,6 @@ public:
void testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration);
void stopTest();
ProjectExplorer::DeviceUsedPortsGatherer *usedPortsGatherer() const;
private:
void handleConnected();
void handleConnectionFailure();

View File

@@ -109,18 +109,6 @@ void RemoteLinuxCustomRunConfiguration::initialize()
setDefaultDisplayName(runConfigDefaultDisplayName());
}
void RemoteLinuxCustomRunConfiguration::copyFrom(const RemoteLinuxCustomRunConfiguration *source)
{
RunConfiguration::copyFrom(source);
m_localExecutable = source->m_localExecutable;
m_remoteExecutable = source->m_remoteExecutable;
m_arguments = source->m_arguments;
m_workingDirectory = source->m_workingDirectory;
setDefaultDisplayName(runConfigDefaultDisplayName());
}
bool RemoteLinuxCustomRunConfiguration::isConfigured() const
{
return !m_remoteExecutable.isEmpty();

View File

@@ -37,7 +37,6 @@ public:
explicit RemoteLinuxCustomRunConfiguration(ProjectExplorer::Target *target);
void initialize();
void copyFrom(const RemoteLinuxCustomRunConfiguration *source);
bool fromMap(const QVariantMap &map) override;
QVariantMap toMap() const override;

View File

@@ -55,11 +55,6 @@ RemoteLinuxEnvironmentAspect::RemoteLinuxEnvironmentAspect(ProjectExplorer::RunC
setRunConfigWidgetCreator([this] { return new RemoteLinuxEnvironmentAspectWidget(this); });
}
RemoteLinuxEnvironmentAspect *RemoteLinuxEnvironmentAspect::create(ProjectExplorer::RunConfiguration *parent) const
{
return new RemoteLinuxEnvironmentAspect(parent);
}
QList<int> RemoteLinuxEnvironmentAspect::possibleBaseEnvironments() const
{
return QList<int>() << static_cast<int>(RemoteBaseEnvironment)

View File

@@ -37,7 +37,6 @@ class REMOTELINUX_EXPORT RemoteLinuxEnvironmentAspect : public ProjectExplorer::
public:
RemoteLinuxEnvironmentAspect(ProjectExplorer::RunConfiguration *rc);
RemoteLinuxEnvironmentAspect *create(ProjectExplorer::RunConfiguration *parent) const override;
QList<int> possibleBaseEnvironments() const override;
QString baseEnvironmentDisplayName(int base) const override;

View File

@@ -88,14 +88,6 @@ void RemoteLinuxRunConfiguration::initialize(Core::Id id, const QString &targetN
setDefaultDisplayName(defaultDisplayName());
}
void RemoteLinuxRunConfiguration::copyFrom(const RemoteLinuxRunConfiguration *source)
{
RunConfiguration::copyFrom(source);
*d = *source->d;
setDefaultDisplayName(defaultDisplayName());
}
RemoteLinuxRunConfiguration::~RemoteLinuxRunConfiguration()
{
delete d;

View File

@@ -75,7 +75,6 @@ signals:
protected:
void initialize(Core::Id id, const QString &targetName);
void copyFrom(const RemoteLinuxRunConfiguration *source);
bool fromMap(const QVariantMap &map) override;
QString defaultDisplayName();

View File

@@ -103,11 +103,6 @@ public:
resetProjectToGlobalSettings();
setRunConfigWidgetCreator([this] { return new Debugger::AnalyzerRunConfigWidget(this); });
}
ValgrindRunConfigurationAspect *create(RunConfiguration *parent) const override
{
return new ValgrindRunConfigurationAspect(parent);
}
};
ValgrindPlugin::~ValgrindPlugin()

View File

@@ -959,9 +959,10 @@ public:
struct TempStuff
{
TempStuff(const char *tag) : buildTemp(QString("qt_tst_dumpers_") + tag + '_')
TempStuff(const char *tag)
: buildTemp(QDir::currentPath() + "/qt_tst_dumpers_" + tag + "_XXXXXX")
{
buildPath = QDir::currentPath() + '/' + buildTemp.path();
buildPath = buildTemp.path();
buildTemp.setAutoRemove(false);
QVERIFY(!buildPath.isEmpty());
}
@@ -5335,6 +5336,22 @@ void tst_Dumpers::dumper_data()
+ Check("fbad", "(unknown:24) (24)", "Flags");
QTest::newRow("EnumInClass")
<< Data("struct E {\n"
" enum Enum1 { a1, b1, c1 };\n"
" typedef enum Enum2 { a2, b2, c2 } Enum2;\n"
" typedef enum { a3, b3, c3 } Enum3;\n"
" Enum1 e1 = Enum1(c1 | b1);\n"
" Enum2 e2 = Enum2(c2 | b2);\n"
" Enum3 e3 = Enum3(c3 | b3);\n"
"};\n",
"E e;\n")
+ GdbEngine
+ Check("e.e1", "E::b1 | E::c1 (0x0003)", "E::Enum1")
+ Check("e.e2", "E::b2 | E::c2 (0x0003)", "E::Enum2")
+ Check("e.e3", "E::b3 | E::c3 (0x0003)", "E::Enum3");
QTest::newRow("Array")
<< Data("",
"double a1[3][3];\n"

View File

@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAP=../objects.map
TEST_CASES=tst_codepasting tst_designer_autocomplete tst_designer_edit tst_designer_goto_slot tst_external_sort tst_git_clone tst_git_first_commit tst_git_local
TEST_CASES=tst_codepasting tst_designer_autocomplete tst_designer_edit tst_designer_goto_slot tst_git_clone tst_git_first_commit tst_git_local tst_sort
VERSION=2
WRAPPERS=Qt

View File

@@ -31,16 +31,13 @@ def main():
return
invokeMenuItem("File", "Open File or Project...")
unsortedFile = os.path.join(os.getcwd(), "testdata", "unsorted.txt")
locale = None
if not platform.system() in ('Windows', 'Microsoft'):
locale = {"LC_ALL":"C"}
sorted = getOutputFromCmdline(["sort", unsortedFile], locale).replace("\r", "")
sorted = readFile(os.path.join(os.getcwd(), "testdata", "sorted.txt"))
selectFromFileDialog(unsortedFile)
editor = waitForObject("{type='TextEditor::TextEditorWidget' unnamed='1' "
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 3000)
placeCursorToLine(editor, "bbb")
invokeMenuItem("Edit", "Select All")
invokeMenuItem("Tools", "External", "Text", "Sort Selection")
invokeMenuItem("Edit", "Advanced", "Sort Selected Lines")
test.verify(waitFor("str(editor.plainText) == sorted", 2000),
"Verify that sorted text\n%s\nmatches the expected text\n%s" % (editor.plainText, sorted))
invokeMenuItem('File', 'Revert "unsorted.txt" to Saved')

View File

@@ -0,0 +1,25 @@
aa
!
*
-
12,345
12.345
1A
1a
1a
?
AAA
_
a
a | ls
aa
aa a
aaa
aaa1
aaa2
ab
aba
b > nul
bbb
c >> dir