Commit a22d8bca authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

QbsPM: Use Qt5-style connects

The heavy lifting was done by clazy.

Change-Id: I841454b0815bc697ae2372dbc6d2caa59d7dc3e8
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent 76781b40
......@@ -51,10 +51,12 @@ CustomQbsPropertiesDialog::CustomQbsPropertiesDialog(const QVariantMap &properti
m_ui->propertiesTable->setItem(currentRow, 1, valueItem);
++currentRow;
}
connect(m_ui->addButton, SIGNAL(clicked()), SLOT(addProperty()));
connect(m_ui->removeButton, SIGNAL(clicked()), SLOT(removeSelectedProperty()));
connect(m_ui->propertiesTable, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)),
SLOT(handleCurrentItemChanged()));
connect(m_ui->addButton, &QAbstractButton::clicked,
this, &CustomQbsPropertiesDialog::addProperty);
connect(m_ui->removeButton, &QAbstractButton::clicked,
this, &CustomQbsPropertiesDialog::removeSelectedProperty);
connect(m_ui->propertiesTable, &QTableWidget::currentItemChanged,
this, &CustomQbsPropertiesDialog::handleCurrentItemChanged);
handleCurrentItemChanged();
}
......
......@@ -42,7 +42,7 @@ public:
QVariantMap properties() const;
~CustomQbsPropertiesDialog();
private slots:
private:
void addProperty();
void removeSelectedProperty();
void handleCurrentItemChanged();
......
......@@ -86,10 +86,9 @@ protected:
QbsBuildConfiguration(ProjectExplorer::Target *target, Core::Id id);
bool fromMap(const QVariantMap &map) override;
private slots:
private:
void buildStepInserted(int pos);
private:
static QbsBuildConfiguration *setup(ProjectExplorer::Target *t,
const QString &defaultDisplayName,
const QString &displayName,
......
......@@ -43,7 +43,7 @@ class QbsBuildConfigurationWidget : public ProjectExplorer::NamedWidget
public:
QbsBuildConfigurationWidget(Internal::QbsBuildConfiguration *bc);
private slots:
private:
void buildDirEdited();
// Changes triggered from creator
......
......@@ -112,8 +112,10 @@ bool QbsBuildStep::init(QList<const BuildStep *> &earlierSteps)
m_activeFileTags = bc->activeFileTags();
m_products = bc->products();
connect(m_parser, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat)),
this, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat)));
connect(m_parser, &ProjectExplorer::IOutputParser::addOutput,
this, [this](const QString &string, ProjectExplorer::BuildStep::OutputFormat format) {
emit addOutput(string, format);
});
connect(m_parser, &ProjectExplorer::IOutputParser::addTask, this, &QbsBuildStep::addTask);
return true;
......@@ -259,7 +261,7 @@ void QbsBuildStep::buildingDone(bool success)
void QbsBuildStep::reparsingDone(bool success)
{
disconnect(qbsProject(), SIGNAL(projectParsingDone(bool)), this, SLOT(reparsingDone(bool)));
disconnect(qbsProject(), &QbsProject::projectParsingDone, this, &QbsBuildStep::reparsingDone);
m_parsingProject = false;
if (m_job) { // This was a scheduled reparsing after building.
finish();
......@@ -398,7 +400,7 @@ void QbsBuildStep::setCleanInstallRoot(bool clean)
void QbsBuildStep::parseProject()
{
m_parsingProject = true;
connect(qbsProject(), SIGNAL(projectParsingDone(bool)), SLOT(reparsingDone(bool)));
connect(qbsProject(), &QbsProject::projectParsingDone, this, &QbsBuildStep::reparsingDone);
qbsProject()->parseCurrentBuildConfiguration();
}
......@@ -419,15 +421,15 @@ void QbsBuildStep::build()
m_progressBase = 0;
connect(m_job, SIGNAL(finished(bool,qbs::AbstractJob*)), this, SLOT(buildingDone(bool)));
connect(m_job, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)),
this, SLOT(handleTaskStarted(QString,int)));
connect(m_job, SIGNAL(taskProgress(int,qbs::AbstractJob*)),
this, SLOT(handleProgress(int)));
connect(m_job, SIGNAL(reportCommandDescription(QString,QString)),
this, SLOT(handleCommandDescriptionReport(QString,QString)));
connect(m_job, SIGNAL(reportProcessResult(qbs::ProcessResult)),
this, SLOT(handleProcessResultReport(qbs::ProcessResult)));
connect(m_job, &qbs::AbstractJob::finished, this, &QbsBuildStep::buildingDone);
connect(m_job, &qbs::AbstractJob::taskStarted,
this, &QbsBuildStep::handleTaskStarted);
connect(m_job, &qbs::AbstractJob::taskProgress,
this, &QbsBuildStep::handleProgress);
connect(m_job, &qbs::BuildJob::reportCommandDescription,
this, &QbsBuildStep::handleCommandDescriptionReport);
connect(m_job, &qbs::BuildJob::reportProcessResult,
this, &QbsBuildStep::handleProcessResultReport);
}
......@@ -455,9 +457,12 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
m_step(step),
m_ignoreChange(false)
{
connect(m_step, SIGNAL(displayNameChanged()), this, SLOT(updateState()));
connect(m_step, SIGNAL(qbsConfigurationChanged()), this, SLOT(updateState()));
connect(m_step, SIGNAL(qbsBuildOptionsChanged()), this, SLOT(updateState()));
connect(m_step, &ProjectExplorer::ProjectConfiguration::displayNameChanged,
this, &QbsBuildStepConfigWidget::updateState);
connect(m_step, &QbsBuildStep::qbsConfigurationChanged,
this, &QbsBuildStepConfigWidget::updateState);
connect(m_step, &QbsBuildStep::qbsBuildOptionsChanged,
this, &QbsBuildStepConfigWidget::updateState);
connect(&QbsProjectManagerSettings::instance(), &QbsProjectManagerSettings::settingsBaseChanged,
this, &QbsBuildStepConfigWidget::updateState);
connect(step->buildConfiguration()->target(), &ProjectExplorer::Target::buildDirectoryChanged,
......@@ -474,10 +479,13 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
});
m_ui->qmlDebuggingWarningText->setPixmap(Core::Icons::WARNING.pixmap());
connect(m_ui->buildVariantComboBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(changeBuildVariant(int)));
connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool)));
connect(m_ui->jobSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeJobCount(int)));
connect(m_ui->buildVariantComboBox,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &QbsBuildStepConfigWidget::changeBuildVariant);
connect(m_ui->keepGoingCheckBox, &QAbstractButton::toggled,
this, &QbsBuildStepConfigWidget::changeKeepGoing);
connect(m_ui->jobSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &QbsBuildStepConfigWidget::changeJobCount);
connect(m_ui->showCommandLinesCheckBox, &QCheckBox::toggled, this,
&QbsBuildStepConfigWidget::changeShowCommandLines);
connect(m_ui->installCheckBox, &QCheckBox::toggled, this,
......@@ -486,10 +494,10 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
&QbsBuildStepConfigWidget::changeCleanInstallRoot);
connect(m_ui->forceProbesCheckBox, &QCheckBox::toggled, this,
&QbsBuildStepConfigWidget::changeForceProbes);
connect(m_ui->qmlDebuggingLibraryCheckBox, SIGNAL(toggled(bool)),
this, SLOT(linkQmlDebuggingLibraryChecked(bool)));
connect(QtSupport::QtVersionManager::instance(), SIGNAL(dumpUpdatedFor(Utils::FileName)),
this, SLOT(updateQmlDebuggingOption()));
connect(m_ui->qmlDebuggingLibraryCheckBox, &QAbstractButton::toggled,
this, &QbsBuildStepConfigWidget::linkQmlDebuggingLibraryChecked);
connect(QtSupport::QtVersionManager::instance(), &QtSupport::QtVersionManager::dumpUpdatedFor,
this, &QbsBuildStepConfigWidget::updateQmlDebuggingOption);
updateState();
}
......
......@@ -80,7 +80,7 @@ signals:
void qbsConfigurationChanged();
void qbsBuildOptionsChanged();
private slots:
private:
void buildingDone(bool success);
void reparsingDone(bool success);
void handleTaskStarted(const QString &desciption, int max);
......@@ -88,7 +88,6 @@ private slots:
void handleCommandDescriptionReport(const QString &highlight, const QString &message);
void handleProcessResultReport(const qbs::ProcessResult &result);
private:
void createTaskAndOutput(ProjectExplorer::Task::TaskType type,
const QString &message, const QString &file, int line);
......@@ -137,7 +136,7 @@ public:
QString summaryText() const;
QString displayName() const;
private slots:
private:
void updateState();
void updateQmlDebuggingOption();
void updatePropertyEdit(const QVariantMap &data);
......@@ -154,7 +153,6 @@ private slots:
// QML debugging:
void linkQmlDebuggingLibraryChecked(bool checked);
private:
bool validateProperties(Utils::FancyLineEdit *edit, QString *errorMessage);
Ui::QbsBuildStepConfigWidget *m_ui;
......
......@@ -106,11 +106,11 @@ void QbsCleanStep::run(QFutureInterface<bool> &fi)
m_progressBase = 0;
connect(m_job, SIGNAL(finished(bool,qbs::AbstractJob*)), this, SLOT(cleaningDone(bool)));
connect(m_job, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)),
this, SLOT(handleTaskStarted(QString,int)));
connect(m_job, SIGNAL(taskProgress(int,qbs::AbstractJob*)),
this, SLOT(handleProgress(int)));
connect(m_job, &qbs::AbstractJob::finished, this, &QbsCleanStep::cleaningDone);
connect(m_job, &qbs::AbstractJob::taskStarted,
this, &QbsCleanStep::handleTaskStarted);
connect(m_job, &qbs::AbstractJob::taskProgress,
this, &QbsCleanStep::handleProgress);
}
ProjectExplorer::BuildStepConfigWidget *QbsCleanStep::createConfigWidget()
......@@ -233,16 +233,20 @@ void QbsCleanStep::setMaxJobs(int jobcount)
QbsCleanStepConfigWidget::QbsCleanStepConfigWidget(QbsCleanStep *step) :
m_step(step)
{
connect(m_step, SIGNAL(displayNameChanged()), this, SLOT(updateState()));
connect(m_step, SIGNAL(changed()), this, SLOT(updateState()));
connect(m_step, &ProjectExplorer::ProjectConfiguration::displayNameChanged,
this, &QbsCleanStepConfigWidget::updateState);
connect(m_step, &QbsCleanStep::changed,
this, &QbsCleanStepConfigWidget::updateState);
setContentsMargins(0, 0, 0, 0);
m_ui = new Ui::QbsCleanStepConfigWidget;
m_ui->setupUi(this);
connect(m_ui->dryRunCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeDryRun(bool)));
connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool)));
connect(m_ui->dryRunCheckBox, &QAbstractButton::toggled,
this, &QbsCleanStepConfigWidget::changeDryRun);
connect(m_ui->keepGoingCheckBox, &QAbstractButton::toggled,
this, &QbsCleanStepConfigWidget::changeKeepGoing);
updateState();
}
......
......@@ -65,12 +65,11 @@ public:
signals:
void changed();
private slots:
private:
void cleaningDone(bool success);
void handleTaskStarted(const QString &desciption, int max);
void handleProgress(int value);
private:
void createTaskAndOutput(ProjectExplorer::Task::TaskType type,
const QString &message, const QString &file, int line);
......@@ -100,14 +99,13 @@ public:
QString summaryText() const;
QString displayName() const;
private slots:
private:
void updateState();
void changeDryRun(bool dr);
void changeKeepGoing(bool kg);
void changeJobCount(int jobcount);
private:
Ui::QbsCleanStepConfigWidget *m_ui;
QbsCleanStep *m_step;
......
......@@ -99,11 +99,11 @@ void QbsInstallStep::run(QFutureInterface<bool> &fi)
m_progressBase = 0;
connect(m_job, SIGNAL(finished(bool,qbs::AbstractJob*)), this, SLOT(installDone(bool)));
connect(m_job, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)),
this, SLOT(handleTaskStarted(QString,int)));
connect(m_job, SIGNAL(taskProgress(int,qbs::AbstractJob*)),
this, SLOT(handleProgress(int)));
connect(m_job, &qbs::AbstractJob::finished, this, &QbsInstallStep::installDone);
connect(m_job, &qbs::AbstractJob::taskStarted,
this, &QbsInstallStep::handleTaskStarted);
connect(m_job, &qbs::AbstractJob::taskProgress,
this, &QbsInstallStep::handleProgress);
}
ProjectExplorer::BuildStepConfigWidget *QbsInstallStep::createConfigWidget()
......@@ -261,8 +261,10 @@ void QbsInstallStep::setKeepGoing(bool kg)
QbsInstallStepConfigWidget::QbsInstallStepConfigWidget(QbsInstallStep *step) :
m_step(step), m_ignoreChange(false)
{
connect(m_step, SIGNAL(displayNameChanged()), this, SLOT(updateState()));
connect(m_step, SIGNAL(changed()), this, SLOT(updateState()));
connect(m_step, &ProjectExplorer::ProjectConfiguration::displayNameChanged,
this, &QbsInstallStepConfigWidget::updateState);
connect(m_step, &QbsInstallStep::changed,
this, &QbsInstallStepConfigWidget::updateState);
setContentsMargins(0, 0, 0, 0);
......@@ -275,13 +277,17 @@ QbsInstallStepConfigWidget::QbsInstallStepConfigWidget(QbsInstallStep *step) :
m_ui->installRootChooser->setExpectedKind(Utils::PathChooser::Directory);
m_ui->installRootChooser->setHistoryCompleter(QLatin1String("Qbs.InstallRoot.History"));
connect(m_ui->installRootChooser, SIGNAL(rawPathChanged(QString)), this,
SLOT(changeInstallRoot()));
connect(m_ui->removeFirstCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeRemoveFirst(bool)));
connect(m_ui->dryRunCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeDryRun(bool)));
connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool)));
connect(project, SIGNAL(projectParsingDone(bool)), this, SLOT(updateState()));
connect(m_ui->installRootChooser, &Utils::PathChooser::rawPathChanged, this,
&QbsInstallStepConfigWidget::changeInstallRoot);
connect(m_ui->removeFirstCheckBox, &QAbstractButton::toggled,
this, &QbsInstallStepConfigWidget::changeRemoveFirst);
connect(m_ui->dryRunCheckBox, &QAbstractButton::toggled,
this, &QbsInstallStepConfigWidget::changeDryRun);
connect(m_ui->keepGoingCheckBox, &QAbstractButton::toggled,
this, &QbsInstallStepConfigWidget::changeKeepGoing);
connect(project, &QbsProject::projectParsingDone,
this, &QbsInstallStepConfigWidget::updateState);
updateState();
}
......
......@@ -68,12 +68,11 @@ public:
signals:
void changed();
private slots:
private:
void installDone(bool success);
void handleTaskStarted(const QString &desciption, int max);
void handleProgress(int value);
private:
void createTaskAndOutput(ProjectExplorer::Task::TaskType type,
const QString &message, const QString &file, int line);
......@@ -104,7 +103,7 @@ public:
QString summaryText() const;
QString displayName() const;
private slots:
private:
void updateState();
void changeInstallRoot();
......
......@@ -36,6 +36,8 @@
#include <QMutexLocker>
#include <QTimer>
using namespace ProjectExplorer;
namespace QbsProjectManager {
namespace Internal {
......@@ -45,9 +47,9 @@ namespace Internal {
QbsLogSink::QbsLogSink(QObject *parent) : QObject(parent)
{
connect(this, SIGNAL(newTask(ProjectExplorer::Task)),
ProjectExplorer::TaskHub::instance(),
SLOT(addTask(ProjectExplorer::Task)), Qt::QueuedConnection);
connect(this, &QbsLogSink::newTask,
TaskHub::instance(),
[](const Task &task) { TaskHub::addTask(task); }, Qt::QueuedConnection);
}
void QbsLogSink::sendMessages()
......@@ -66,11 +68,11 @@ void QbsLogSink::sendMessages()
void QbsLogSink::doPrintWarning(const qbs::ErrorInfo &warning)
{
foreach (const qbs::ErrorItem &item, warning.items())
emit newTask(ProjectExplorer::Task(ProjectExplorer::Task::Warning,
emit newTask(Task(Task::Warning,
item.description(),
Utils::FileName::fromString(item.codeLocation().filePath()),
item.codeLocation().line(),
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
Constants::TASK_CATEGORY_BUILDSYSTEM));
}
void QbsLogSink::doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag)
......
......@@ -45,10 +45,9 @@ public:
signals:
void newTask(const ProjectExplorer::Task &task);
private slots:
void sendMessages();
private:
Q_INVOKABLE void sendMessages();
void doPrintWarning(const qbs::ErrorInfo &warning);
void doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag);
......
......@@ -41,12 +41,10 @@ class QbsParser : public ProjectExplorer::IOutputParser
public:
explicit QbsParser();
private:
void setWorkingDirectory(const QString &workingDirectory);
public slots:
void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines);
private:
QDir m_workingDirectory;
};
......
......@@ -54,12 +54,10 @@ public:
void apply();
private slots:
private:
void refreshKitsList();
void displayCurrentProfile();
void editProfile();
private:
void setupCustomProperties(const ProjectExplorer::Kit *kit);
void mergeCustomPropertiesIntoModel();
......@@ -123,9 +121,12 @@ QbsProfilesSettingsWidget::QbsProfilesSettingsWidget(QWidget *parent)
m_model.updateSettingsDir(QbsProjectManagerSettings::qbsSettingsBaseDir());
displayCurrentProfile();
});
connect(m_ui.expandButton, SIGNAL(clicked()), m_ui.propertiesView, SLOT(expandAll()));
connect(m_ui.collapseButton, SIGNAL(clicked()), m_ui.propertiesView, SLOT(collapseAll()));
connect(m_ui.editButton, SIGNAL(clicked()), SLOT(editProfile()));
connect(m_ui.expandButton, &QAbstractButton::clicked,
m_ui.propertiesView, &QTreeView::expandAll);
connect(m_ui.collapseButton, &QAbstractButton::clicked,
m_ui.propertiesView, &QTreeView::collapseAll);
connect(m_ui.editButton, &QAbstractButton::clicked,
this, &QbsProfilesSettingsWidget::editProfile);
refreshKitsList();
}
......@@ -175,7 +176,9 @@ void QbsProfilesSettingsWidget::refreshKitsList()
else if (hasKits)
m_ui.kitsComboBox->setCurrentIndex(0);
displayCurrentProfile();
connect(m_ui.kitsComboBox, SIGNAL(currentIndexChanged(int)), SLOT(displayCurrentProfile()));
connect(m_ui.kitsComboBox,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &QbsProfilesSettingsWidget::displayCurrentProfile);
}
void QbsProfilesSettingsWidget::displayCurrentProfile()
......
......@@ -117,13 +117,11 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
setProjectContext(Context(Constants::PROJECT_ID));
setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX));
connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),
this, SLOT(changeActiveTarget(ProjectExplorer::Target*)));
connect(this, SIGNAL(addedTarget(ProjectExplorer::Target*)),
this, SLOT(targetWasAdded(ProjectExplorer::Target*)));
connect(this, SIGNAL(environmentChanged()), this, SLOT(delayParsing()));
connect(this, &Project::activeTargetChanged, this, &QbsProject::changeActiveTarget);
connect(this, &Project::addedTarget, this, &QbsProject::targetWasAdded);
connect(this, &Project::environmentChanged, this, &QbsProject::delayParsing);
connect(&m_parsingDelay, SIGNAL(timeout()), this, SLOT(startParsing()));
connect(&m_parsingDelay, &QTimer::timeout, this, &QbsProject::startParsing);
}
QbsProject::~QbsProject()
......@@ -531,9 +529,8 @@ void QbsProject::handleRuleExecutionDone()
void QbsProject::targetWasAdded(Target *t)
{
connect(t, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
this, SLOT(delayParsing()));
connect(t, SIGNAL(buildDirectoryChanged()), this, SLOT(delayParsing()));
connect(t, &Target::activeBuildConfigurationChanged, this, &QbsProject::delayParsing);
connect(t, &Target::buildDirectoryChanged, this, &QbsProject::delayParsing);
}
void QbsProject::changeActiveTarget(Target *t)
......@@ -547,11 +544,13 @@ void QbsProject::changeActiveTarget(Target *t)
void QbsProject::buildConfigurationChanged(BuildConfiguration *bc)
{
if (m_currentBc)
disconnect(m_currentBc, SIGNAL(qbsConfigurationChanged()), this, SLOT(delayParsing()));
disconnect(m_currentBc, &QbsBuildConfiguration::qbsConfigurationChanged,
this, &QbsProject::delayParsing);
m_currentBc = qobject_cast<QbsBuildConfiguration *>(bc);
if (m_currentBc) {
connect(m_currentBc, SIGNAL(qbsConfigurationChanged()), this, SLOT(delayParsing()));
connect(m_currentBc, &QbsBuildConfiguration::qbsConfigurationChanged,
this, &QbsProject::delayParsing);
delayParsing();
} else {
invalidate();
......@@ -640,7 +639,8 @@ void QbsProject::registerQbsProjectParser(QbsProjectParser *p)
if (p) {
connect(m_qbsProjectParser, &QbsProjectParser::ruleExecutionDone,
this, &QbsProject::handleRuleExecutionDone);
connect(m_qbsProjectParser, SIGNAL(done(bool)), this, SLOT(handleQbsParsingDone(bool)));
connect(m_qbsProjectParser, &QbsProjectParser::done,
this, &QbsProject::handleQbsParsingDone);
}
}
......
......@@ -106,7 +106,7 @@ public:
const qbs::ProductData &product);
static QString uniqueProductName(const qbs::ProductData &product);
public slots:
public:
void invalidate();
void delayParsing();
......@@ -114,7 +114,7 @@ signals:
void projectParsingStarted();
void projectParsingDone(bool);
private slots:
private:
void handleQbsParsingDone(bool success);
void targetWasAdded(ProjectExplorer::Target *t);
......@@ -122,7 +122,6 @@ private slots:
void buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc);
void startParsing();
private:
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
void parse(const QVariantMap &config, const Utils::Environment &env, const QString &dir);
......
......@@ -127,19 +127,22 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command = Core::ActionManager::registerAction(m_reparseQbs, Constants::ACTION_REPARSE_QBS, projectContext);
command->setAttribute(Core::Command::CA_Hide);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
connect(m_reparseQbs, SIGNAL(triggered()), this, SLOT(reparseCurrentProject()));
connect(m_reparseQbs, &QAction::triggered,
this, &QbsProjectManagerPlugin::reparseCurrentProject);
m_reparseQbsCtx = new QAction(tr("Reparse Qbs"), this);
command = Core::ActionManager::registerAction(m_reparseQbsCtx, Constants::ACTION_REPARSE_QBS_CONTEXT, projectContext);
command->setAttribute(Core::Command::CA_Hide);
mproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
connect(m_reparseQbsCtx, SIGNAL(triggered()), this, SLOT(reparseSelectedProject()));
connect(m_reparseQbsCtx, &QAction::triggered,
this, &QbsProjectManagerPlugin::reparseSelectedProject);
m_buildFileCtx = new QAction(tr("Build"), this);
command = Core::ActionManager::registerAction(m_buildFileCtx, Constants::ACTION_BUILD_FILE_CONTEXT, projectContext);
command->setAttribute(Core::Command::CA_Hide);
mfile->addAction(command, ProjectExplorer::Constants::G_FILE_OTHER);
connect(m_buildFileCtx, SIGNAL(triggered()), this, SLOT(buildFileContextMenu()));
connect(m_buildFileCtx, &QAction::triggered,
this, &QbsProjectManagerPlugin::buildFileContextMenu);
m_buildFile = new Utils::ParameterAction(tr("Build File"), tr("Build File \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
......@@ -149,13 +152,14 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command->setDescription(m_buildFile->text());
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+B")));
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
connect(m_buildFile, SIGNAL(triggered()), this, SLOT(buildFile()));
connect(m_buildFile, &QAction::triggered, this, &QbsProjectManagerPlugin::buildFile);
m_buildProductCtx = new QAction(tr("Build"), this);
command = Core::ActionManager::registerAction(m_buildProductCtx, Constants::ACTION_BUILD_PRODUCT_CONTEXT, projectContext);
command->setAttribute(Core::Command::CA_Hide);
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
connect(m_buildProductCtx, SIGNAL(triggered()), this, SLOT(buildProductContextMenu()));
connect(m_buildProductCtx, &QAction::triggered,
this, &QbsProjectManagerPlugin::buildProductContextMenu);
m_buildProduct = new Utils::ParameterAction(tr("Build Product"), tr("Build Product \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
......@@ -165,13 +169,14 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command->setDescription(m_buildFile->text());
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Shift+B")));
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
connect(m_buildProduct, SIGNAL(triggered()), this, SLOT(buildProduct()));
connect(m_buildProduct, &QAction::triggered, this, &QbsProjectManagerPlugin::buildProduct);
m_buildSubprojectCtx = new QAction(tr("Build"), this);
command = Core::ActionManager::registerAction(m_buildSubprojectCtx, Constants::ACTION_BUILD_SUBPROJECT_CONTEXT, projectContext);
command->setAttribute(Core::Command::CA_Hide);
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
connect(m_buildSubprojectCtx, SIGNAL(triggered()), this, SLOT(buildSubprojectContextMenu()));
connect(m_buildSubprojectCtx, &QAction::triggered,
this, &QbsProjectManagerPlugin::buildSubprojectContextMenu);
m_buildSubproject = new Utils::ParameterAction(tr("Build Subproject"), tr("Build Subproject \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
......@@ -181,24 +186,24 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command->setDescription(m_buildFile->text());
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B")));
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
connect(m_buildSubproject, SIGNAL(triggered()), this, SLOT(buildSubproject()));
connect(m_buildSubproject, &QAction::triggered, this, &QbsProjectManagerPlugin::buildSubproject);
// Connect
connect(ProjectTree::instance(), &ProjectTree::currentNodeChanged,
this, &QbsProjectManagerPlugin::nodeSelectionChanged);