QbsPM: Use Qt5-style connects

The heavy lifting was done by clazy.

Change-Id: I841454b0815bc697ae2372dbc6d2caa59d7dc3e8
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2016-06-28 23:29:21 +03:00
committed by Orgad Shaneh
parent 76781b40a7
commit a22d8bcaa3
21 changed files with 152 additions and 134 deletions

View File

@@ -51,10 +51,12 @@ CustomQbsPropertiesDialog::CustomQbsPropertiesDialog(const QVariantMap &properti
m_ui->propertiesTable->setItem(currentRow, 1, valueItem); m_ui->propertiesTable->setItem(currentRow, 1, valueItem);
++currentRow; ++currentRow;
} }
connect(m_ui->addButton, SIGNAL(clicked()), SLOT(addProperty())); connect(m_ui->addButton, &QAbstractButton::clicked,
connect(m_ui->removeButton, SIGNAL(clicked()), SLOT(removeSelectedProperty())); this, &CustomQbsPropertiesDialog::addProperty);
connect(m_ui->propertiesTable, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)), connect(m_ui->removeButton, &QAbstractButton::clicked,
SLOT(handleCurrentItemChanged())); this, &CustomQbsPropertiesDialog::removeSelectedProperty);
connect(m_ui->propertiesTable, &QTableWidget::currentItemChanged,
this, &CustomQbsPropertiesDialog::handleCurrentItemChanged);
handleCurrentItemChanged(); handleCurrentItemChanged();
} }

View File

@@ -42,7 +42,7 @@ public:
QVariantMap properties() const; QVariantMap properties() const;
~CustomQbsPropertiesDialog(); ~CustomQbsPropertiesDialog();
private slots: private:
void addProperty(); void addProperty();
void removeSelectedProperty(); void removeSelectedProperty();
void handleCurrentItemChanged(); void handleCurrentItemChanged();

View File

@@ -86,10 +86,9 @@ protected:
QbsBuildConfiguration(ProjectExplorer::Target *target, Core::Id id); QbsBuildConfiguration(ProjectExplorer::Target *target, Core::Id id);
bool fromMap(const QVariantMap &map) override; bool fromMap(const QVariantMap &map) override;
private slots: private:
void buildStepInserted(int pos); void buildStepInserted(int pos);
private:
static QbsBuildConfiguration *setup(ProjectExplorer::Target *t, static QbsBuildConfiguration *setup(ProjectExplorer::Target *t,
const QString &defaultDisplayName, const QString &defaultDisplayName,
const QString &displayName, const QString &displayName,

View File

@@ -43,7 +43,7 @@ class QbsBuildConfigurationWidget : public ProjectExplorer::NamedWidget
public: public:
QbsBuildConfigurationWidget(Internal::QbsBuildConfiguration *bc); QbsBuildConfigurationWidget(Internal::QbsBuildConfiguration *bc);
private slots: private:
void buildDirEdited(); void buildDirEdited();
// Changes triggered from creator // Changes triggered from creator

View File

@@ -112,8 +112,10 @@ bool QbsBuildStep::init(QList<const BuildStep *> &earlierSteps)
m_activeFileTags = bc->activeFileTags(); m_activeFileTags = bc->activeFileTags();
m_products = bc->products(); m_products = bc->products();
connect(m_parser, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat)), connect(m_parser, &ProjectExplorer::IOutputParser::addOutput,
this, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat))); this, [this](const QString &string, ProjectExplorer::BuildStep::OutputFormat format) {
emit addOutput(string, format);
});
connect(m_parser, &ProjectExplorer::IOutputParser::addTask, this, &QbsBuildStep::addTask); connect(m_parser, &ProjectExplorer::IOutputParser::addTask, this, &QbsBuildStep::addTask);
return true; return true;
@@ -259,7 +261,7 @@ void QbsBuildStep::buildingDone(bool success)
void QbsBuildStep::reparsingDone(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; m_parsingProject = false;
if (m_job) { // This was a scheduled reparsing after building. if (m_job) { // This was a scheduled reparsing after building.
finish(); finish();
@@ -398,7 +400,7 @@ void QbsBuildStep::setCleanInstallRoot(bool clean)
void QbsBuildStep::parseProject() void QbsBuildStep::parseProject()
{ {
m_parsingProject = true; m_parsingProject = true;
connect(qbsProject(), SIGNAL(projectParsingDone(bool)), SLOT(reparsingDone(bool))); connect(qbsProject(), &QbsProject::projectParsingDone, this, &QbsBuildStep::reparsingDone);
qbsProject()->parseCurrentBuildConfiguration(); qbsProject()->parseCurrentBuildConfiguration();
} }
@@ -419,15 +421,15 @@ void QbsBuildStep::build()
m_progressBase = 0; m_progressBase = 0;
connect(m_job, SIGNAL(finished(bool,qbs::AbstractJob*)), this, SLOT(buildingDone(bool))); connect(m_job, &qbs::AbstractJob::finished, this, &QbsBuildStep::buildingDone);
connect(m_job, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)), connect(m_job, &qbs::AbstractJob::taskStarted,
this, SLOT(handleTaskStarted(QString,int))); this, &QbsBuildStep::handleTaskStarted);
connect(m_job, SIGNAL(taskProgress(int,qbs::AbstractJob*)), connect(m_job, &qbs::AbstractJob::taskProgress,
this, SLOT(handleProgress(int))); this, &QbsBuildStep::handleProgress);
connect(m_job, SIGNAL(reportCommandDescription(QString,QString)), connect(m_job, &qbs::BuildJob::reportCommandDescription,
this, SLOT(handleCommandDescriptionReport(QString,QString))); this, &QbsBuildStep::handleCommandDescriptionReport);
connect(m_job, SIGNAL(reportProcessResult(qbs::ProcessResult)), connect(m_job, &qbs::BuildJob::reportProcessResult,
this, SLOT(handleProcessResultReport(qbs::ProcessResult))); this, &QbsBuildStep::handleProcessResultReport);
} }
@@ -455,9 +457,12 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
m_step(step), m_step(step),
m_ignoreChange(false) m_ignoreChange(false)
{ {
connect(m_step, SIGNAL(displayNameChanged()), this, SLOT(updateState())); connect(m_step, &ProjectExplorer::ProjectConfiguration::displayNameChanged,
connect(m_step, SIGNAL(qbsConfigurationChanged()), this, SLOT(updateState())); this, &QbsBuildStepConfigWidget::updateState);
connect(m_step, SIGNAL(qbsBuildOptionsChanged()), this, SLOT(updateState())); connect(m_step, &QbsBuildStep::qbsConfigurationChanged,
this, &QbsBuildStepConfigWidget::updateState);
connect(m_step, &QbsBuildStep::qbsBuildOptionsChanged,
this, &QbsBuildStepConfigWidget::updateState);
connect(&QbsProjectManagerSettings::instance(), &QbsProjectManagerSettings::settingsBaseChanged, connect(&QbsProjectManagerSettings::instance(), &QbsProjectManagerSettings::settingsBaseChanged,
this, &QbsBuildStepConfigWidget::updateState); this, &QbsBuildStepConfigWidget::updateState);
connect(step->buildConfiguration()->target(), &ProjectExplorer::Target::buildDirectoryChanged, connect(step->buildConfiguration()->target(), &ProjectExplorer::Target::buildDirectoryChanged,
@@ -474,10 +479,13 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
}); });
m_ui->qmlDebuggingWarningText->setPixmap(Core::Icons::WARNING.pixmap()); m_ui->qmlDebuggingWarningText->setPixmap(Core::Icons::WARNING.pixmap());
connect(m_ui->buildVariantComboBox, SIGNAL(currentIndexChanged(int)), connect(m_ui->buildVariantComboBox,
this, SLOT(changeBuildVariant(int))); static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool))); this, &QbsBuildStepConfigWidget::changeBuildVariant);
connect(m_ui->jobSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeJobCount(int))); 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, connect(m_ui->showCommandLinesCheckBox, &QCheckBox::toggled, this,
&QbsBuildStepConfigWidget::changeShowCommandLines); &QbsBuildStepConfigWidget::changeShowCommandLines);
connect(m_ui->installCheckBox, &QCheckBox::toggled, this, connect(m_ui->installCheckBox, &QCheckBox::toggled, this,
@@ -486,10 +494,10 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
&QbsBuildStepConfigWidget::changeCleanInstallRoot); &QbsBuildStepConfigWidget::changeCleanInstallRoot);
connect(m_ui->forceProbesCheckBox, &QCheckBox::toggled, this, connect(m_ui->forceProbesCheckBox, &QCheckBox::toggled, this,
&QbsBuildStepConfigWidget::changeForceProbes); &QbsBuildStepConfigWidget::changeForceProbes);
connect(m_ui->qmlDebuggingLibraryCheckBox, SIGNAL(toggled(bool)), connect(m_ui->qmlDebuggingLibraryCheckBox, &QAbstractButton::toggled,
this, SLOT(linkQmlDebuggingLibraryChecked(bool))); this, &QbsBuildStepConfigWidget::linkQmlDebuggingLibraryChecked);
connect(QtSupport::QtVersionManager::instance(), SIGNAL(dumpUpdatedFor(Utils::FileName)), connect(QtSupport::QtVersionManager::instance(), &QtSupport::QtVersionManager::dumpUpdatedFor,
this, SLOT(updateQmlDebuggingOption())); this, &QbsBuildStepConfigWidget::updateQmlDebuggingOption);
updateState(); updateState();
} }

View File

@@ -80,7 +80,7 @@ signals:
void qbsConfigurationChanged(); void qbsConfigurationChanged();
void qbsBuildOptionsChanged(); void qbsBuildOptionsChanged();
private slots: private:
void buildingDone(bool success); void buildingDone(bool success);
void reparsingDone(bool success); void reparsingDone(bool success);
void handleTaskStarted(const QString &desciption, int max); void handleTaskStarted(const QString &desciption, int max);
@@ -88,7 +88,6 @@ private slots:
void handleCommandDescriptionReport(const QString &highlight, const QString &message); void handleCommandDescriptionReport(const QString &highlight, const QString &message);
void handleProcessResultReport(const qbs::ProcessResult &result); void handleProcessResultReport(const qbs::ProcessResult &result);
private:
void createTaskAndOutput(ProjectExplorer::Task::TaskType type, void createTaskAndOutput(ProjectExplorer::Task::TaskType type,
const QString &message, const QString &file, int line); const QString &message, const QString &file, int line);
@@ -137,7 +136,7 @@ public:
QString summaryText() const; QString summaryText() const;
QString displayName() const; QString displayName() const;
private slots: private:
void updateState(); void updateState();
void updateQmlDebuggingOption(); void updateQmlDebuggingOption();
void updatePropertyEdit(const QVariantMap &data); void updatePropertyEdit(const QVariantMap &data);
@@ -154,7 +153,6 @@ private slots:
// QML debugging: // QML debugging:
void linkQmlDebuggingLibraryChecked(bool checked); void linkQmlDebuggingLibraryChecked(bool checked);
private:
bool validateProperties(Utils::FancyLineEdit *edit, QString *errorMessage); bool validateProperties(Utils::FancyLineEdit *edit, QString *errorMessage);
Ui::QbsBuildStepConfigWidget *m_ui; Ui::QbsBuildStepConfigWidget *m_ui;

View File

@@ -106,11 +106,11 @@ void QbsCleanStep::run(QFutureInterface<bool> &fi)
m_progressBase = 0; m_progressBase = 0;
connect(m_job, SIGNAL(finished(bool,qbs::AbstractJob*)), this, SLOT(cleaningDone(bool))); connect(m_job, &qbs::AbstractJob::finished, this, &QbsCleanStep::cleaningDone);
connect(m_job, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)), connect(m_job, &qbs::AbstractJob::taskStarted,
this, SLOT(handleTaskStarted(QString,int))); this, &QbsCleanStep::handleTaskStarted);
connect(m_job, SIGNAL(taskProgress(int,qbs::AbstractJob*)), connect(m_job, &qbs::AbstractJob::taskProgress,
this, SLOT(handleProgress(int))); this, &QbsCleanStep::handleProgress);
} }
ProjectExplorer::BuildStepConfigWidget *QbsCleanStep::createConfigWidget() ProjectExplorer::BuildStepConfigWidget *QbsCleanStep::createConfigWidget()
@@ -233,16 +233,20 @@ void QbsCleanStep::setMaxJobs(int jobcount)
QbsCleanStepConfigWidget::QbsCleanStepConfigWidget(QbsCleanStep *step) : QbsCleanStepConfigWidget::QbsCleanStepConfigWidget(QbsCleanStep *step) :
m_step(step) m_step(step)
{ {
connect(m_step, SIGNAL(displayNameChanged()), this, SLOT(updateState())); connect(m_step, &ProjectExplorer::ProjectConfiguration::displayNameChanged,
connect(m_step, SIGNAL(changed()), this, SLOT(updateState())); this, &QbsCleanStepConfigWidget::updateState);
connect(m_step, &QbsCleanStep::changed,
this, &QbsCleanStepConfigWidget::updateState);
setContentsMargins(0, 0, 0, 0); setContentsMargins(0, 0, 0, 0);
m_ui = new Ui::QbsCleanStepConfigWidget; m_ui = new Ui::QbsCleanStepConfigWidget;
m_ui->setupUi(this); m_ui->setupUi(this);
connect(m_ui->dryRunCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeDryRun(bool))); connect(m_ui->dryRunCheckBox, &QAbstractButton::toggled,
connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool))); this, &QbsCleanStepConfigWidget::changeDryRun);
connect(m_ui->keepGoingCheckBox, &QAbstractButton::toggled,
this, &QbsCleanStepConfigWidget::changeKeepGoing);
updateState(); updateState();
} }

View File

@@ -65,12 +65,11 @@ public:
signals: signals:
void changed(); void changed();
private slots: private:
void cleaningDone(bool success); void cleaningDone(bool success);
void handleTaskStarted(const QString &desciption, int max); void handleTaskStarted(const QString &desciption, int max);
void handleProgress(int value); void handleProgress(int value);
private:
void createTaskAndOutput(ProjectExplorer::Task::TaskType type, void createTaskAndOutput(ProjectExplorer::Task::TaskType type,
const QString &message, const QString &file, int line); const QString &message, const QString &file, int line);
@@ -100,14 +99,13 @@ public:
QString summaryText() const; QString summaryText() const;
QString displayName() const; QString displayName() const;
private slots: private:
void updateState(); void updateState();
void changeDryRun(bool dr); void changeDryRun(bool dr);
void changeKeepGoing(bool kg); void changeKeepGoing(bool kg);
void changeJobCount(int jobcount); void changeJobCount(int jobcount);
private:
Ui::QbsCleanStepConfigWidget *m_ui; Ui::QbsCleanStepConfigWidget *m_ui;
QbsCleanStep *m_step; QbsCleanStep *m_step;

View File

@@ -99,11 +99,11 @@ void QbsInstallStep::run(QFutureInterface<bool> &fi)
m_progressBase = 0; m_progressBase = 0;
connect(m_job, SIGNAL(finished(bool,qbs::AbstractJob*)), this, SLOT(installDone(bool))); connect(m_job, &qbs::AbstractJob::finished, this, &QbsInstallStep::installDone);
connect(m_job, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)), connect(m_job, &qbs::AbstractJob::taskStarted,
this, SLOT(handleTaskStarted(QString,int))); this, &QbsInstallStep::handleTaskStarted);
connect(m_job, SIGNAL(taskProgress(int,qbs::AbstractJob*)), connect(m_job, &qbs::AbstractJob::taskProgress,
this, SLOT(handleProgress(int))); this, &QbsInstallStep::handleProgress);
} }
ProjectExplorer::BuildStepConfigWidget *QbsInstallStep::createConfigWidget() ProjectExplorer::BuildStepConfigWidget *QbsInstallStep::createConfigWidget()
@@ -261,8 +261,10 @@ void QbsInstallStep::setKeepGoing(bool kg)
QbsInstallStepConfigWidget::QbsInstallStepConfigWidget(QbsInstallStep *step) : QbsInstallStepConfigWidget::QbsInstallStepConfigWidget(QbsInstallStep *step) :
m_step(step), m_ignoreChange(false) m_step(step), m_ignoreChange(false)
{ {
connect(m_step, SIGNAL(displayNameChanged()), this, SLOT(updateState())); connect(m_step, &ProjectExplorer::ProjectConfiguration::displayNameChanged,
connect(m_step, SIGNAL(changed()), this, SLOT(updateState())); this, &QbsInstallStepConfigWidget::updateState);
connect(m_step, &QbsInstallStep::changed,
this, &QbsInstallStepConfigWidget::updateState);
setContentsMargins(0, 0, 0, 0); setContentsMargins(0, 0, 0, 0);
@@ -275,13 +277,17 @@ QbsInstallStepConfigWidget::QbsInstallStepConfigWidget(QbsInstallStep *step) :
m_ui->installRootChooser->setExpectedKind(Utils::PathChooser::Directory); m_ui->installRootChooser->setExpectedKind(Utils::PathChooser::Directory);
m_ui->installRootChooser->setHistoryCompleter(QLatin1String("Qbs.InstallRoot.History")); m_ui->installRootChooser->setHistoryCompleter(QLatin1String("Qbs.InstallRoot.History"));
connect(m_ui->installRootChooser, SIGNAL(rawPathChanged(QString)), this, connect(m_ui->installRootChooser, &Utils::PathChooser::rawPathChanged, this,
SLOT(changeInstallRoot())); &QbsInstallStepConfigWidget::changeInstallRoot);
connect(m_ui->removeFirstCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeRemoveFirst(bool))); connect(m_ui->removeFirstCheckBox, &QAbstractButton::toggled,
connect(m_ui->dryRunCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeDryRun(bool))); this, &QbsInstallStepConfigWidget::changeRemoveFirst);
connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool))); connect(m_ui->dryRunCheckBox, &QAbstractButton::toggled,
this, &QbsInstallStepConfigWidget::changeDryRun);
connect(m_ui->keepGoingCheckBox, &QAbstractButton::toggled,
this, &QbsInstallStepConfigWidget::changeKeepGoing);
connect(project, SIGNAL(projectParsingDone(bool)), this, SLOT(updateState())); connect(project, &QbsProject::projectParsingDone,
this, &QbsInstallStepConfigWidget::updateState);
updateState(); updateState();
} }

View File

@@ -68,12 +68,11 @@ public:
signals: signals:
void changed(); void changed();
private slots: private:
void installDone(bool success); void installDone(bool success);
void handleTaskStarted(const QString &desciption, int max); void handleTaskStarted(const QString &desciption, int max);
void handleProgress(int value); void handleProgress(int value);
private:
void createTaskAndOutput(ProjectExplorer::Task::TaskType type, void createTaskAndOutput(ProjectExplorer::Task::TaskType type,
const QString &message, const QString &file, int line); const QString &message, const QString &file, int line);
@@ -104,7 +103,7 @@ public:
QString summaryText() const; QString summaryText() const;
QString displayName() const; QString displayName() const;
private slots: private:
void updateState(); void updateState();
void changeInstallRoot(); void changeInstallRoot();

View File

@@ -36,6 +36,8 @@
#include <QMutexLocker> #include <QMutexLocker>
#include <QTimer> #include <QTimer>
using namespace ProjectExplorer;
namespace QbsProjectManager { namespace QbsProjectManager {
namespace Internal { namespace Internal {
@@ -45,9 +47,9 @@ namespace Internal {
QbsLogSink::QbsLogSink(QObject *parent) : QObject(parent) QbsLogSink::QbsLogSink(QObject *parent) : QObject(parent)
{ {
connect(this, SIGNAL(newTask(ProjectExplorer::Task)), connect(this, &QbsLogSink::newTask,
ProjectExplorer::TaskHub::instance(), TaskHub::instance(),
SLOT(addTask(ProjectExplorer::Task)), Qt::QueuedConnection); [](const Task &task) { TaskHub::addTask(task); }, Qt::QueuedConnection);
} }
void QbsLogSink::sendMessages() void QbsLogSink::sendMessages()
@@ -66,11 +68,11 @@ void QbsLogSink::sendMessages()
void QbsLogSink::doPrintWarning(const qbs::ErrorInfo &warning) void QbsLogSink::doPrintWarning(const qbs::ErrorInfo &warning)
{ {
foreach (const qbs::ErrorItem &item, warning.items()) foreach (const qbs::ErrorItem &item, warning.items())
emit newTask(ProjectExplorer::Task(ProjectExplorer::Task::Warning, emit newTask(Task(Task::Warning,
item.description(), item.description(),
Utils::FileName::fromString(item.codeLocation().filePath()), Utils::FileName::fromString(item.codeLocation().filePath()),
item.codeLocation().line(), item.codeLocation().line(),
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); Constants::TASK_CATEGORY_BUILDSYSTEM));
} }
void QbsLogSink::doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag) void QbsLogSink::doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag)

View File

@@ -45,10 +45,9 @@ public:
signals: signals:
void newTask(const ProjectExplorer::Task &task); void newTask(const ProjectExplorer::Task &task);
private slots:
void sendMessages();
private: private:
Q_INVOKABLE void sendMessages();
void doPrintWarning(const qbs::ErrorInfo &warning); void doPrintWarning(const qbs::ErrorInfo &warning);
void doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag); void doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag);

View File

@@ -41,12 +41,10 @@ class QbsParser : public ProjectExplorer::IOutputParser
public: public:
explicit QbsParser(); explicit QbsParser();
private:
void setWorkingDirectory(const QString &workingDirectory); void setWorkingDirectory(const QString &workingDirectory);
public slots:
void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines); void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines);
private:
QDir m_workingDirectory; QDir m_workingDirectory;
}; };

View File

@@ -54,12 +54,10 @@ public:
void apply(); void apply();
private slots: private:
void refreshKitsList(); void refreshKitsList();
void displayCurrentProfile(); void displayCurrentProfile();
void editProfile(); void editProfile();
private:
void setupCustomProperties(const ProjectExplorer::Kit *kit); void setupCustomProperties(const ProjectExplorer::Kit *kit);
void mergeCustomPropertiesIntoModel(); void mergeCustomPropertiesIntoModel();
@@ -123,9 +121,12 @@ QbsProfilesSettingsWidget::QbsProfilesSettingsWidget(QWidget *parent)
m_model.updateSettingsDir(QbsProjectManagerSettings::qbsSettingsBaseDir()); m_model.updateSettingsDir(QbsProjectManagerSettings::qbsSettingsBaseDir());
displayCurrentProfile(); displayCurrentProfile();
}); });
connect(m_ui.expandButton, SIGNAL(clicked()), m_ui.propertiesView, SLOT(expandAll())); connect(m_ui.expandButton, &QAbstractButton::clicked,
connect(m_ui.collapseButton, SIGNAL(clicked()), m_ui.propertiesView, SLOT(collapseAll())); m_ui.propertiesView, &QTreeView::expandAll);
connect(m_ui.editButton, SIGNAL(clicked()), SLOT(editProfile())); connect(m_ui.collapseButton, &QAbstractButton::clicked,
m_ui.propertiesView, &QTreeView::collapseAll);
connect(m_ui.editButton, &QAbstractButton::clicked,
this, &QbsProfilesSettingsWidget::editProfile);
refreshKitsList(); refreshKitsList();
} }
@@ -175,7 +176,9 @@ void QbsProfilesSettingsWidget::refreshKitsList()
else if (hasKits) else if (hasKits)
m_ui.kitsComboBox->setCurrentIndex(0); m_ui.kitsComboBox->setCurrentIndex(0);
displayCurrentProfile(); 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() void QbsProfilesSettingsWidget::displayCurrentProfile()

View File

@@ -117,13 +117,11 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
setProjectContext(Context(Constants::PROJECT_ID)); setProjectContext(Context(Constants::PROJECT_ID));
setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX)); setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX));
connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)), connect(this, &Project::activeTargetChanged, this, &QbsProject::changeActiveTarget);
this, SLOT(changeActiveTarget(ProjectExplorer::Target*))); connect(this, &Project::addedTarget, this, &QbsProject::targetWasAdded);
connect(this, SIGNAL(addedTarget(ProjectExplorer::Target*)), connect(this, &Project::environmentChanged, this, &QbsProject::delayParsing);
this, SLOT(targetWasAdded(ProjectExplorer::Target*)));
connect(this, SIGNAL(environmentChanged()), this, SLOT(delayParsing()));
connect(&m_parsingDelay, SIGNAL(timeout()), this, SLOT(startParsing())); connect(&m_parsingDelay, &QTimer::timeout, this, &QbsProject::startParsing);
} }
QbsProject::~QbsProject() QbsProject::~QbsProject()
@@ -531,9 +529,8 @@ void QbsProject::handleRuleExecutionDone()
void QbsProject::targetWasAdded(Target *t) void QbsProject::targetWasAdded(Target *t)
{ {
connect(t, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)), connect(t, &Target::activeBuildConfigurationChanged, this, &QbsProject::delayParsing);
this, SLOT(delayParsing())); connect(t, &Target::buildDirectoryChanged, this, &QbsProject::delayParsing);
connect(t, SIGNAL(buildDirectoryChanged()), this, SLOT(delayParsing()));
} }
void QbsProject::changeActiveTarget(Target *t) void QbsProject::changeActiveTarget(Target *t)
@@ -547,11 +544,13 @@ void QbsProject::changeActiveTarget(Target *t)
void QbsProject::buildConfigurationChanged(BuildConfiguration *bc) void QbsProject::buildConfigurationChanged(BuildConfiguration *bc)
{ {
if (m_currentBc) 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); m_currentBc = qobject_cast<QbsBuildConfiguration *>(bc);
if (m_currentBc) { if (m_currentBc) {
connect(m_currentBc, SIGNAL(qbsConfigurationChanged()), this, SLOT(delayParsing())); connect(m_currentBc, &QbsBuildConfiguration::qbsConfigurationChanged,
this, &QbsProject::delayParsing);
delayParsing(); delayParsing();
} else { } else {
invalidate(); invalidate();
@@ -640,7 +639,8 @@ void QbsProject::registerQbsProjectParser(QbsProjectParser *p)
if (p) { if (p) {
connect(m_qbsProjectParser, &QbsProjectParser::ruleExecutionDone, connect(m_qbsProjectParser, &QbsProjectParser::ruleExecutionDone,
this, &QbsProject::handleRuleExecutionDone); this, &QbsProject::handleRuleExecutionDone);
connect(m_qbsProjectParser, SIGNAL(done(bool)), this, SLOT(handleQbsParsingDone(bool))); connect(m_qbsProjectParser, &QbsProjectParser::done,
this, &QbsProject::handleQbsParsingDone);
} }
} }

View File

@@ -106,7 +106,7 @@ public:
const qbs::ProductData &product); const qbs::ProductData &product);
static QString uniqueProductName(const qbs::ProductData &product); static QString uniqueProductName(const qbs::ProductData &product);
public slots: public:
void invalidate(); void invalidate();
void delayParsing(); void delayParsing();
@@ -114,7 +114,7 @@ signals:
void projectParsingStarted(); void projectParsingStarted();
void projectParsingDone(bool); void projectParsingDone(bool);
private slots: private:
void handleQbsParsingDone(bool success); void handleQbsParsingDone(bool success);
void targetWasAdded(ProjectExplorer::Target *t); void targetWasAdded(ProjectExplorer::Target *t);
@@ -122,7 +122,6 @@ private slots:
void buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc); void buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc);
void startParsing(); void startParsing();
private:
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override; RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
void parse(const QVariantMap &config, const Utils::Environment &env, const QString &dir); void parse(const QVariantMap &config, const Utils::Environment &env, const QString &dir);

View File

@@ -127,19 +127,22 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command = Core::ActionManager::registerAction(m_reparseQbs, Constants::ACTION_REPARSE_QBS, projectContext); command = Core::ActionManager::registerAction(m_reparseQbs, Constants::ACTION_REPARSE_QBS, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); 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); m_reparseQbsCtx = new QAction(tr("Reparse Qbs"), this);
command = Core::ActionManager::registerAction(m_reparseQbsCtx, Constants::ACTION_REPARSE_QBS_CONTEXT, projectContext); command = Core::ActionManager::registerAction(m_reparseQbsCtx, Constants::ACTION_REPARSE_QBS_CONTEXT, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
mproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); 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); m_buildFileCtx = new QAction(tr("Build"), this);
command = Core::ActionManager::registerAction(m_buildFileCtx, Constants::ACTION_BUILD_FILE_CONTEXT, projectContext); command = Core::ActionManager::registerAction(m_buildFileCtx, Constants::ACTION_BUILD_FILE_CONTEXT, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
mfile->addAction(command, ProjectExplorer::Constants::G_FILE_OTHER); 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\""), m_buildFile = new Utils::ParameterAction(tr("Build File"), tr("Build File \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this); Utils::ParameterAction::AlwaysEnabled, this);
@@ -149,13 +152,14 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command->setDescription(m_buildFile->text()); command->setDescription(m_buildFile->text());
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+B"))); command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+B")));
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); 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); m_buildProductCtx = new QAction(tr("Build"), this);
command = Core::ActionManager::registerAction(m_buildProductCtx, Constants::ACTION_BUILD_PRODUCT_CONTEXT, projectContext); command = Core::ActionManager::registerAction(m_buildProductCtx, Constants::ACTION_BUILD_PRODUCT_CONTEXT, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); 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\""), m_buildProduct = new Utils::ParameterAction(tr("Build Product"), tr("Build Product \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this); Utils::ParameterAction::AlwaysEnabled, this);
@@ -165,13 +169,14 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command->setDescription(m_buildFile->text()); command->setDescription(m_buildFile->text());
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Shift+B"))); command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Shift+B")));
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); 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); m_buildSubprojectCtx = new QAction(tr("Build"), this);
command = Core::ActionManager::registerAction(m_buildSubprojectCtx, Constants::ACTION_BUILD_SUBPROJECT_CONTEXT, projectContext); command = Core::ActionManager::registerAction(m_buildSubprojectCtx, Constants::ACTION_BUILD_SUBPROJECT_CONTEXT, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); 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\""), m_buildSubproject = new Utils::ParameterAction(tr("Build Subproject"), tr("Build Subproject \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this); Utils::ParameterAction::AlwaysEnabled, this);
@@ -181,24 +186,24 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command->setDescription(m_buildFile->text()); command->setDescription(m_buildFile->text());
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B"))); command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B")));
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); 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
connect(ProjectTree::instance(), &ProjectTree::currentNodeChanged, connect(ProjectTree::instance(), &ProjectTree::currentNodeChanged,
this, &QbsProjectManagerPlugin::nodeSelectionChanged); this, &QbsProjectManagerPlugin::nodeSelectionChanged);
connect(BuildManager::instance(), SIGNAL(buildStateChanged(ProjectExplorer::Project*)), connect(BuildManager::instance(), &BuildManager::buildStateChanged,
this, SLOT(buildStateChanged(ProjectExplorer::Project*))); this, &QbsProjectManagerPlugin::buildStateChanged);
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
this, SLOT(currentEditorChanged())); this, &QbsProjectManagerPlugin::currentEditorChanged);
connect(SessionManager::instance(), SIGNAL(projectAdded(ProjectExplorer::Project*)), connect(SessionManager::instance(), &SessionManager::projectAdded,
this, SLOT(projectWasAdded(ProjectExplorer::Project*))); this, &QbsProjectManagerPlugin::projectWasAdded);
connect(SessionManager::instance(), SIGNAL(projectRemoved(ProjectExplorer::Project*)), connect(SessionManager::instance(), &SessionManager::projectRemoved,
this, SLOT(projectWasRemoved())); this, &QbsProjectManagerPlugin::projectWasRemoved);
connect(SessionManager::instance(), SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), connect(SessionManager::instance(), &SessionManager::startupProjectChanged,
this, SLOT(currentProjectWasChanged(ProjectExplorer::Project*))); this, &QbsProjectManagerPlugin::currentProjectWasChanged);
// Run initial setup routines // Run initial setup routines
updateContextActions(); updateContextActions();
@@ -218,8 +223,10 @@ void QbsProjectManagerPlugin::projectWasAdded(Project *project)
if (!qbsProject) if (!qbsProject)
return; return;
connect(qbsProject, SIGNAL(projectParsingStarted()), this, SLOT(parsingStateChanged())); connect(qbsProject, &QbsProject::projectParsingStarted,
connect(qbsProject, SIGNAL(projectParsingDone(bool)), this, SLOT(parsingStateChanged())); this, &QbsProjectManagerPlugin::parsingStateChanged);
connect(qbsProject, &QbsProject::projectParsingDone,
this, &QbsProjectManagerPlugin::parsingStateChanged);
} }
void QbsProjectManagerPlugin::currentProjectWasChanged(Project *project) void QbsProjectManagerPlugin::currentProjectWasChanged(Project *project)

View File

@@ -58,7 +58,7 @@ public:
void extensionsInitialized(); void extensionsInitialized();
private slots: private:
void projectWasAdded(ProjectExplorer::Project *project); void projectWasAdded(ProjectExplorer::Project *project);
void currentProjectWasChanged(ProjectExplorer::Project *project); void currentProjectWasChanged(ProjectExplorer::Project *project);
void projectWasRemoved(); void projectWasRemoved();
@@ -78,7 +78,6 @@ private slots:
void reparseCurrentProject(); void reparseCurrentProject();
void reparseProject(QbsProject *project); void reparseProject(QbsProject *project);
private:
void updateContextActions(); void updateContextActions();
void updateReparseQbsAction(); void updateReparseQbsAction();
void updateBuildActions(); void updateBuildActions();

View File

@@ -111,12 +111,12 @@ void QbsProjectParser::parse(const QVariantMap &config, const Environment &env,
m_qbsSetupProjectJob = m_project.setupProject(params, QbsManager::logSink(), 0); m_qbsSetupProjectJob = m_project.setupProject(params, QbsManager::logSink(), 0);
connect(m_qbsSetupProjectJob, SIGNAL(finished(bool,qbs::AbstractJob*)), connect(m_qbsSetupProjectJob, &qbs::AbstractJob::finished,
this, SLOT(handleQbsParsingDone(bool))); this, &QbsProjectParser::handleQbsParsingDone);
connect(m_qbsSetupProjectJob, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)), connect(m_qbsSetupProjectJob, &qbs::AbstractJob::taskStarted,
this, SLOT(handleQbsParsingTaskSetup(QString,int))); this, &QbsProjectParser::handleQbsParsingTaskSetup);
connect(m_qbsSetupProjectJob, SIGNAL(taskProgress(int,qbs::AbstractJob*)), connect(m_qbsSetupProjectJob, &qbs::AbstractJob::taskProgress,
this, SLOT(handleQbsParsingProgress(int))); this, &QbsProjectParser::handleQbsParsingProgress);
} }
void QbsProjectParser::cancel() void QbsProjectParser::cancel()

View File

@@ -57,12 +57,11 @@ signals:
void done(bool success); void done(bool success);
void ruleExecutionDone(); void ruleExecutionDone();
private slots: private:
void handleQbsParsingDone(bool success); void handleQbsParsingDone(bool success);
void handleQbsParsingProgress(int progress); void handleQbsParsingProgress(int progress);
void handleQbsParsingTaskSetup(const QString &description, int maximumProgressValue); void handleQbsParsingTaskSetup(const QString &description, int maximumProgressValue);
private:
QString pluginsBaseDirectory() const; QString pluginsBaseDirectory() const;
QString resourcesBaseDirectory() const; QString resourcesBaseDirectory() const;
QString libExecDirectory() const; QString libExecDirectory() const;

View File

@@ -85,11 +85,9 @@ signals:
protected: protected:
QbsRunConfiguration(ProjectExplorer::Target *parent, QbsRunConfiguration *source); QbsRunConfiguration(ProjectExplorer::Target *parent, QbsRunConfiguration *source);
private slots: private:
void installStepChanged(); void installStepChanged();
void installStepToBeRemoved(int pos); void installStepToBeRemoved(int pos);
private:
QString baseWorkingDirectory() const; QString baseWorkingDirectory() const;
QString defaultDisplayName(); QString defaultDisplayName();
qbs::InstallOptions installOptions() const; qbs::InstallOptions installOptions() const;