Port to new connect api

Change-Id: I873a36601d54065b61d0666558b93dc839ad0dfc
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Montel Laurent
2015-01-30 11:02:24 +01:00
committed by hjk
parent f1ac9cd56d
commit 063251ebbc
39 changed files with 287 additions and 240 deletions

View File

@@ -37,8 +37,8 @@ static const char settingsSuffixKey[] = "CodeStyleSettings";
CppCodeStylePreferences::CppCodeStylePreferences(QObject *parent) :
ICodeStylePreferences(parent)
{
connect(this, SIGNAL(currentValueChanged(QVariant)),
this, SLOT(slotCurrentValueChanged(QVariant)));
connect(this, &CppCodeStylePreferences::currentValueChanged,
this, &CppCodeStylePreferences::slotCurrentValueChanged);
}
QVariant CppCodeStylePreferences::value() const

View File

@@ -282,48 +282,48 @@ CppCodeStylePreferencesWidget::CppCodeStylePreferencesWidget(QWidget *parent)
setVisualizeWhitespace(true);
connect(m_ui->tabSettingsWidget, SIGNAL(settingsChanged(TextEditor::TabSettings)),
this, SLOT(slotTabSettingsChanged(TextEditor::TabSettings)));
connect(m_ui->indentBlockBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentBlockBody, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentClassBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentNamespaceBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentEnumBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentNamespaceBody, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentSwitchLabels, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentCaseStatements, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentCaseBlocks, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentCaseBreak, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentAccessSpecifiers, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentDeclarationsRelativeToAccessSpecifiers, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentFunctionBody, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentFunctionBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->extraPaddingConditions, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->alignAssignments, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->bindStarToIdentifier, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->bindStarToTypeName, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->bindStarToLeftSpecifier, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->bindStarToRightSpecifier, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->tabSettingsWidget, &TextEditor::TabSettingsWidget::settingsChanged,
this, &CppCodeStylePreferencesWidget::slotTabSettingsChanged);
connect(m_ui->indentBlockBraces, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentBlockBody, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentClassBraces, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentNamespaceBraces, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentEnumBraces, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentNamespaceBody, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentSwitchLabels, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentCaseStatements, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentCaseBlocks, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentCaseBreak, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentAccessSpecifiers, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentDeclarationsRelativeToAccessSpecifiers, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentFunctionBody, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentFunctionBraces, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->extraPaddingConditions, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->alignAssignments, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->bindStarToIdentifier, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->bindStarToTypeName, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->bindStarToLeftSpecifier, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->bindStarToRightSpecifier, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
m_ui->categoryTab->setCurrentIndex(0);
@@ -340,8 +340,8 @@ void CppCodeStylePreferencesWidget::setCodeStyle(CppTools::CppCodeStylePreferenc
// code preferences
m_preferences = codeStylePreferences;
connect(m_preferences, SIGNAL(currentTabSettingsChanged(TextEditor::TabSettings)),
this, SLOT(setTabSettings(TextEditor::TabSettings)));
connect(m_preferences, &CppCodeStylePreferences::currentTabSettingsChanged,
this, &CppCodeStylePreferencesWidget::setTabSettings);
connect(m_preferences, SIGNAL(currentCodeStyleSettingsChanged(CppTools::CppCodeStyleSettings)),
this, SLOT(setCodeStyleSettings(CppTools::CppCodeStyleSettings)));
connect(m_preferences, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences*)),

View File

@@ -42,7 +42,7 @@
using namespace Core;
using namespace CppTools;
using namespace CppTools::Internal;
using namespace ProjectExplorer;
namespace CppTools {
namespace Internal {
@@ -140,8 +140,7 @@ CppIncludesFilter::CppIncludesFilter()
setIncludedByDefault(true);
setPriority(ILocatorFilter::Low);
connect(ProjectExplorer::ProjectExplorerPlugin::instance(),
&ProjectExplorer::ProjectExplorerPlugin::fileListChanged,
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::fileListChanged,
this, &CppIncludesFilter::markOutdated);
connect(CppModelManager::instance(), &CppModelManager::documentUpdated,
this, &CppIncludesFilter::markOutdated);

View File

@@ -152,11 +152,11 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
JsExpander::registerQObjectForJs(QLatin1String("Cpp"), new CppToolsJsExtension);
CppLocatorData *locatorData = new CppLocatorData;
connect(modelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
locatorData, SLOT(onDocumentUpdated(CPlusPlus::Document::Ptr)));
connect(modelManager, &CppModelManager::documentUpdated,
locatorData, &CppLocatorData::onDocumentUpdated);
connect(modelManager, SIGNAL(aboutToRemoveFiles(QStringList)),
locatorData, SLOT(onAboutToRemoveFiles(QStringList)));
connect(modelManager, &CppModelManager::aboutToRemoveFiles,
locatorData, &CppLocatorData::onAboutToRemoveFiles);
addAutoReleasedObject(locatorData);
addAutoReleasedObject(new CppLocatorFilter(locatorData));
@@ -184,7 +184,8 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
Command *command = ActionManager::registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context, true);
command->setDefaultKeySequence(QKeySequence(Qt::Key_F4));
mcpptools->addAction(command);
connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource()));
connect(switchAction, &QAction::triggered,
this, &CppToolsPlugin::switchHeaderSource);
QAction *openInNextSplitAction = new QAction(tr("Open Corresponding Header/Source in Next Split"), this);
command = ActionManager::registerAction(openInNextSplitAction, Constants::OPEN_HEADER_SOURCE_IN_NEXT_SPLIT, context, true);
@@ -192,7 +193,8 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
? tr("Meta+E, F4")
: tr("Ctrl+E, F4")));
mcpptools->addAction(command);
connect(openInNextSplitAction, SIGNAL(triggered()), this, SLOT(switchHeaderSourceInNextSplit()));
connect(openInNextSplitAction, &QAction::triggered,
this, &CppToolsPlugin::switchHeaderSourceInNextSplit);
Utils::MacroExpander *expander = Utils::globalMacroExpander();
expander->registerVariable("Cpp:LicenseTemplate",

View File

@@ -60,13 +60,14 @@ ModelManagerTestHelper::ModelManagerTestHelper(QObject *parent) :
CppModelManager *mm = CppModelManager::instance();
assert(mm);
connect(this, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)),
mm, SLOT(onAboutToRemoveProject(ProjectExplorer::Project*)));
connect(this, SIGNAL(projectAdded(ProjectExplorer::Project*)),
mm, SLOT(onProjectAdded(ProjectExplorer::Project*)));
connect(mm, SIGNAL(sourceFilesRefreshed(QSet<QString>)),
this, SLOT(sourceFilesRefreshed(QSet<QString>)));
connect(mm, SIGNAL(gcFinished()), this, SLOT(gcFinished()));
connect(this, &ModelManagerTestHelper::aboutToRemoveProject,
mm, &CppModelManager::onAboutToRemoveProject);
connect(this, &ModelManagerTestHelper::projectAdded,
mm, &CppModelManager::onProjectAdded);
connect(mm, &CppModelManager::sourceFilesRefreshed,
this, &ModelManagerTestHelper::sourceFilesRefreshed);
connect(mm, &CppModelManager::gcFinished,
this, &ModelManagerTestHelper::gcFinished);
cleanup();
Tests::VerifyCleanCppModelManager::verify();

View File

@@ -53,8 +53,7 @@ StringTable::StringTable()
m_gcCountDown.setObjectName(QLatin1String("StringTable::m_gcCountDown"));
m_gcCountDown.setSingleShot(true);
m_gcCountDown.setInterval(GCTimeOut);
connect(&m_gcCountDown, SIGNAL(timeout()),
this, SLOT(startGC()));
connect(&m_gcCountDown, &QTimer::timeout, this, &StringTable::startGC);
}
QString StringTable::insert(const QString &string)

View File

@@ -313,7 +313,8 @@ QWidget *QmlConsoleItemDelegate::createEditor(QWidget *parent,
{
QmlConsoleEdit *editor = new QmlConsoleEdit(index, parent);
connect(editor, SIGNAL(editingFinished()), this, SLOT(commitAndCloseEditor()));
connect(editor, &QmlConsoleEdit::editingFinished,
this, &QmlConsoleItemDelegate::commitAndCloseEditor);
return editor;
}

View File

@@ -73,22 +73,23 @@ QmlConsolePane::QmlConsolePane(QObject *parent)
m_proxyModel = new QmlConsoleProxyModel(this);
m_proxyModel->setSourceModel(QmlConsoleModel::qmlConsoleItemModel());
connect(QmlConsoleModel::qmlConsoleItemModel(),
SIGNAL(selectEditableRow(QModelIndex,QItemSelectionModel::SelectionFlags)),
&QmlConsoleItemModel::selectEditableRow,
m_proxyModel,
SLOT(selectEditableRow(QModelIndex,QItemSelectionModel::SelectionFlags)));
&QmlConsoleProxyModel::selectEditableRow);
//Scroll to bottom when rows matching current filter settings are inserted
//Not connecting rowsRemoved as the only way to remove rows is to clear the
//model which will automatically reset the view.
connect(QmlConsoleModel::qmlConsoleItemModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
m_proxyModel, SLOT(onRowsInserted(QModelIndex,int,int)));
connect(QmlConsoleModel::qmlConsoleItemModel(), &QAbstractItemModel::rowsInserted,
m_proxyModel, &QmlConsoleProxyModel::onRowsInserted);
m_consoleView->setModel(m_proxyModel);
connect(m_proxyModel,
SIGNAL(setCurrentIndex(QModelIndex,QItemSelectionModel::SelectionFlags)),
m_consoleView->selectionModel(),
SLOT(setCurrentIndex(QModelIndex,QItemSelectionModel::SelectionFlags)));
connect(m_proxyModel, SIGNAL(scrollToBottom()), m_consoleView, SLOT(onScrollToBottom()));
connect(m_proxyModel, &QmlConsoleProxyModel::scrollToBottom,
m_consoleView, &QmlConsoleView::onScrollToBottom);
m_itemDelegate = new QmlConsoleItemDelegate(this);
connect(m_consoleView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
@@ -111,7 +112,8 @@ QmlConsolePane::QmlConsolePane(QObject *parent)
m_showDebugButtonAction->setToolTip(tr("Show debug, log, and info messages."));
m_showDebugButtonAction->setCheckable(true);
m_showDebugButtonAction->setIcon(QIcon(QLatin1String(Core::Constants::ICON_INFO)));
connect(m_showDebugButtonAction, SIGNAL(toggled(bool)), m_proxyModel, SLOT(setShowLogs(bool)));
connect(m_showDebugButtonAction, &Utils::SavedAction::toggled,
m_proxyModel, &QmlConsoleProxyModel::setShowLogs);
m_showDebugButton->setDefaultAction(m_showDebugButtonAction);
m_showWarningButton = new QToolButton(m_consoleWidget);
@@ -123,8 +125,8 @@ QmlConsolePane::QmlConsolePane(QObject *parent)
m_showWarningButtonAction->setToolTip(tr("Show warning messages."));
m_showWarningButtonAction->setCheckable(true);
m_showWarningButtonAction->setIcon(QIcon(QLatin1String(Core::Constants::ICON_WARNING)));
connect(m_showWarningButtonAction, SIGNAL(toggled(bool)), m_proxyModel,
SLOT(setShowWarnings(bool)));
connect(m_showWarningButtonAction, &Utils::SavedAction::toggled,
m_proxyModel, &QmlConsoleProxyModel::setShowWarnings);
m_showWarningButton->setDefaultAction(m_showWarningButtonAction);
m_showErrorButton = new QToolButton(m_consoleWidget);
@@ -136,8 +138,7 @@ QmlConsolePane::QmlConsolePane(QObject *parent)
m_showErrorButtonAction->setToolTip(tr("Show error messages."));
m_showErrorButtonAction->setCheckable(true);
m_showErrorButtonAction->setIcon(QIcon(QLatin1String(Core::Constants::ICON_ERROR)));
connect(m_showErrorButtonAction, SIGNAL(toggled(bool)), m_proxyModel,
SLOT(setShowErrors(bool)));
connect(m_showErrorButtonAction, &Utils::SavedAction::toggled, m_proxyModel, &QmlConsoleProxyModel::setShowErrors);
m_showErrorButton->setDefaultAction(m_showErrorButtonAction);
m_spacer = new QWidget(m_consoleWidget);

View File

@@ -129,7 +129,7 @@ QmlConsoleView::QmlConsoleView(QWidget *parent) :
horizontalScrollBar()->setSingleStep(20);
verticalScrollBar()->setSingleStep(20);
connect(this, SIGNAL(activated(QModelIndex)), SLOT(onRowActivated(QModelIndex)));
connect(this, &QmlConsoleView::activated, this, &QmlConsoleView::onRowActivated);
}
void QmlConsoleView::onScrollToBottom()

View File

@@ -88,8 +88,8 @@ void QmlJSCodeStylePreferencesWidget::setPreferences(TextEditor::ICodeStylePrefe
m_preferences = preferences;
m_ui->tabPreferencesWidget->setPreferences(preferences);
if (m_preferences)
connect(m_preferences, SIGNAL(currentTabSettingsChanged(TextEditor::TabSettings)),
this, SLOT(slotSettingsChanged()));
connect(m_preferences, &TextEditor::ICodeStylePreferences::currentTabSettingsChanged,
this, &QmlJSCodeStylePreferencesWidget::slotSettingsChanged);
updatePreview();
}

View File

@@ -46,10 +46,10 @@ LocatorData::LocatorData(QObject *parent)
{
QmlJS::ModelManagerInterface *manager = QmlJS::ModelManagerInterface::instance();
connect(manager, SIGNAL(documentUpdated(QmlJS::Document::Ptr)),
this, SLOT(onDocumentUpdated(QmlJS::Document::Ptr)));
connect(manager, SIGNAL(aboutToRemoveFiles(QStringList)),
this, SLOT(onAboutToRemoveFiles(QStringList)));
connect(manager, &QmlJS::ModelManagerInterface::documentUpdated,
this, &LocatorData::onDocumentUpdated);
connect(manager, &QmlJS::ModelManagerInterface::aboutToRemoveFiles,
this, &LocatorData::onAboutToRemoveFiles);
}
LocatorData::~LocatorData()

View File

@@ -108,7 +108,8 @@ bool QmlJSToolsPlugin::initialize(const QStringList &arguments, QString *error)
Context globalContext(Core::Constants::C_GLOBAL);
Command *cmd = ActionManager::registerAction(
m_resetCodeModelAction, Constants::RESET_CODEMODEL, globalContext);
connect(m_resetCodeModelAction, SIGNAL(triggered()), m_modelManager, SLOT(resetCodeModel()));
connect(m_resetCodeModelAction, &QAction::triggered,
m_modelManager, &ModelManager::resetCodeModel);
mqmljstools->addAction(cmd);
// watch task progress

View File

@@ -89,8 +89,8 @@ Core::BaseFileWizard *QmlApplicationWizard::create(QWidget *parent, const Wizard
{
QmlApplicationWizardDialog *wizardDialog = new QmlApplicationWizardDialog(parent, parameters);
connect(wizardDialog, SIGNAL(projectParametersChanged(QString,QString)), m_qmlApp,
SLOT(setProjectNameAndBaseDirectory(QString,QString)));
connect(wizardDialog, &QmlApplicationWizardDialog::projectParametersChanged,
m_qmlApp, &QmlApp::setProjectNameAndBaseDirectory);
wizardDialog->setPath(parameters.defaultPath());

View File

@@ -100,7 +100,7 @@ void QmlProject::addedTarget(ProjectExplorer::Target *target)
void QmlProject::onActiveTargetChanged(ProjectExplorer::Target *target)
{
if (m_activeTarget)
disconnect(m_activeTarget, SIGNAL(kitChanged()), this, SLOT(onKitChanged()));
disconnect(m_activeTarget, &ProjectExplorer::Target::kitChanged, this, &QmlProject::onKitChanged);
m_activeTarget = target;
if (m_activeTarget)
connect(target, SIGNAL(kitChanged()), this, SLOT(onKitChanged()));
@@ -397,11 +397,9 @@ bool QmlProject::fromMap(const QVariantMap &map)
foreach (Target *t, targets())
addedTarget(t);
connect(this, SIGNAL(addedTarget(ProjectExplorer::Target*)),
this, SLOT(addedTarget(ProjectExplorer::Target*)));
connect(this, &QmlProject::addedTarget, this, &QmlProject::addedTarget);
connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),
this, SLOT(onActiveTargetChanged(ProjectExplorer::Target*)));
connect(this, &QmlProject::activeTargetChanged, this, &QmlProject::onActiveTargetChanged);
onActiveTargetChanged(activeTarget());

View File

@@ -71,13 +71,15 @@ QmlProjectRunConfigurationWidget::QmlProjectRunConfigurationWidget(QmlProjectRun
m_fileListCombo = new QComboBox;
m_fileListCombo->setModel(m_fileListModel);
connect(m_fileListCombo, SIGNAL(activated(int)), this, SLOT(setMainScript(int)));
connect(m_fileListCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &QmlProjectRunConfigurationWidget::setMainScript);
connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(fileListChanged()),
SLOT(updateFileComboBox()));
QLineEdit *qmlViewerArgs = new QLineEdit;
qmlViewerArgs->setText(rc->m_qmlViewerArgs);
connect(qmlViewerArgs, SIGNAL(textChanged(QString)), this, SLOT(onViewerArgsChanged()));
connect(qmlViewerArgs, &QLineEdit::textChanged,
this, &QmlProjectRunConfigurationWidget::onViewerArgsChanged);
form->addRow(tr("Arguments:"), qmlViewerArgs);
form->addRow(tr("Main QML file:"), m_fileListCombo);

View File

@@ -78,7 +78,8 @@ void AbstractPackagingStep::ctor()
connect(target(), SIGNAL(deploymentDataChanged()), SLOT(setDeploymentDataModified()));
setDeploymentDataModified();
connect(this, SIGNAL(unmodifyDeploymentData()), this, SLOT(setDeploymentDataUnmodified()));
connect(this, &AbstractPackagingStep::unmodifyDeploymentData,
this, &AbstractPackagingStep::setDeploymentDataUnmodified);
}
AbstractPackagingStep::~AbstractPackagingStep()
@@ -92,8 +93,8 @@ void AbstractPackagingStep::handleBuildConfigurationChanged()
disconnect(d->currentBuildConfiguration, 0, this, 0);
d->currentBuildConfiguration = target()->activeBuildConfiguration();
if (d->currentBuildConfiguration) {
connect(d->currentBuildConfiguration, SIGNAL(buildDirectoryChanged()), this,
SIGNAL(packageFilePathChanged()));
connect(d->currentBuildConfiguration, &BuildConfiguration::buildDirectoryChanged,
this, &AbstractPackagingStep::packageFilePathChanged);
}
emit packageFilePathChanged();
}

View File

@@ -274,12 +274,13 @@ void AbstractRemoteLinuxDeployService::handleDeviceSetupDone(bool success)
d->state = Connecting;
d->connection = QSsh::acquireConnection(deviceConfiguration()->sshParameters());
connect(d->connection, SIGNAL(error(QSsh::SshError)),
SLOT(handleConnectionFailure()));
connect(d->connection, &SshConnection::error,
this, &AbstractRemoteLinuxDeployService::handleConnectionFailure);
if (d->connection->state() == SshConnection::Connected) {
handleConnected();
} else {
connect(d->connection, SIGNAL(connected()), SLOT(handleConnected()));
connect(d->connection, &SshConnection::connected,
this, &AbstractRemoteLinuxDeployService::handleConnected);
emit progressMessage(tr("Connecting to device..."));
if (d->connection->state() == SshConnection::Unconnected)
d->connection->connectToHost();

View File

@@ -97,8 +97,10 @@ void AbstractRemoteLinuxRunSupport::handleRemoteSetupRequested()
{
QTC_ASSERT(d->state == Inactive, return);
d->state = GatheringPorts;
connect(&d->portsGatherer, SIGNAL(error(QString)), SLOT(handlePortsGathererError(QString)));
connect(&d->portsGatherer, SIGNAL(portListReady()), SLOT(handlePortListReady()));
connect(&d->portsGatherer, &DeviceUsedPortsGatherer::error,
this, &AbstractRemoteLinuxRunSupport::handlePortsGathererError);
connect(&d->portsGatherer, &DeviceUsedPortsGatherer::portListReady,
this, &AbstractRemoteLinuxRunSupport::handlePortListReady);
d->portsGatherer.start(d->device);
}

View File

@@ -116,8 +116,10 @@ void AbstractUploadAndInstallPackageService::doDeploy()
d->state = Uploading;
const QString fileName = Utils::FileName::fromString(packageFilePath()).fileName();
const QString remoteFilePath = uploadDir() + QLatin1Char('/') + fileName;
connect(d->uploader, SIGNAL(progress(QString)), SIGNAL(progressMessage(QString)));
connect(d->uploader, SIGNAL(uploadFinished(QString)), SLOT(handleUploadFinished(QString)));
connect(d->uploader, &PackageUploader::progress,
this, &AbstractUploadAndInstallPackageService::progressMessage);
connect(d->uploader, &PackageUploader::uploadFinished,
this, &AbstractUploadAndInstallPackageService::handleUploadFinished);
d->uploader->uploadPackage(connection(), packageFilePath(), remoteFilePath);
}

View File

@@ -78,9 +78,10 @@ void GenericLinuxDeviceTester::testDevice(const IDevice::ConstPtr &deviceConfigu
d->deviceConfiguration = deviceConfiguration;
d->connection = new SshConnection(deviceConfiguration->sshParameters(), this);
connect(d->connection, SIGNAL(connected()), SLOT(handleConnected()));
connect(d->connection, SIGNAL(error(QSsh::SshError)),
SLOT(handleConnectionFailure()));
connect(d->connection, &SshConnection::connected,
this, &GenericLinuxDeviceTester::handleConnected);
connect(d->connection, &SshConnection::error,
this, &GenericLinuxDeviceTester::handleConnectionFailure);
emit progressMessage(tr("Connecting to host..."));
d->state = Connecting;
@@ -147,8 +148,10 @@ void GenericLinuxDeviceTester::handleProcessFinished(int exitStatus)
emit progressMessage(QString::fromUtf8(d->process->readAllStandardOutput()));
}
connect(&d->portsGatherer, SIGNAL(error(QString)), SLOT(handlePortsGatheringError(QString)));
connect(&d->portsGatherer, SIGNAL(portListReady()), SLOT(handlePortListReady()));
connect(&d->portsGatherer, &DeviceUsedPortsGatherer::error,
this, &GenericLinuxDeviceTester::handlePortsGatheringError);
connect(&d->portsGatherer, &DeviceUsedPortsGatherer::portListReady,
this, &GenericLinuxDeviceTester::handlePortListReady);
emit progressMessage(tr("Checking if specified ports are available..."));
d->state = TestingPorts;

View File

@@ -59,7 +59,8 @@ void PackageUploader::uploadPackage(SshConnection *connection,
m_localFilePath = localFilePath;
m_remoteFilePath = remoteFilePath;
m_connection = connection;
connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionFailure()));
connect(m_connection, &QSsh::SshConnection::error,
this, &PackageUploader::handleConnectionFailure);
m_uploader = m_connection->createSftpChannel();
connect(m_uploader.data(), SIGNAL(initialized()), this,
SLOT(handleSftpChannelInitialized()));

View File

@@ -75,9 +75,12 @@ PublicKeyDeploymentDialog::PublicKeyDeploymentDialog(const IDevice::ConstPtr &de
d->done = false;
setLabelText(tr("Deploying..."));
setValue(0);
connect(this, SIGNAL(canceled()), SLOT(handleCanceled()));
connect(&d->keyDeployer, SIGNAL(error(QString)), SLOT(handleDeploymentError(QString)));
connect(&d->keyDeployer, SIGNAL(finishedSuccessfully()), SLOT(handleDeploymentSuccess()));
connect(this, &PublicKeyDeploymentDialog::canceled,
this, &PublicKeyDeploymentDialog::handleCanceled);
connect(&d->keyDeployer, &SshKeyDeployer::error,
this, &PublicKeyDeploymentDialog::handleDeploymentError);
connect(&d->keyDeployer, &SshKeyDeployer::finishedSuccessfully,
this, &PublicKeyDeploymentDialog::handleDeploymentSuccess);
d->keyDeployer.deployPublicKey(deviceConfig->sshParameters(), publicKeyFileName);
}

View File

@@ -96,8 +96,8 @@ RemoteLinuxAnalyzeSupport::RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfi
{
connect(d->runControl, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)),
SLOT(handleRemoteSetupRequested()));
connect(&d->outputParser, SIGNAL(waitingForConnectionOnPort(quint16)),
SLOT(remoteIsRunning()));
connect(&d->outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort,
this, &RemoteLinuxAnalyzeSupport::remoteIsRunning);
}
RemoteLinuxAnalyzeSupport::~RemoteLinuxAnalyzeSupport()
@@ -133,12 +133,18 @@ void RemoteLinuxAnalyzeSupport::startExecution()
setState(StartingRunner);
DeviceApplicationRunner *runner = appRunner();
connect(runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteErrorOutput(QByteArray)));
connect(runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray)));
connect(runner, SIGNAL(remoteProcessStarted()), SLOT(handleRemoteProcessStarted()));
connect(runner, SIGNAL(finished(bool)), SLOT(handleAppRunnerFinished(bool)));
connect(runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString)));
connect(runner, SIGNAL(reportError(QString)), SLOT(handleAppRunnerError(QString)));
connect(runner, &DeviceApplicationRunner::remoteStderr,
this, &RemoteLinuxAnalyzeSupport::handleRemoteErrorOutput);
connect(runner, &DeviceApplicationRunner::remoteStdout,
this, &RemoteLinuxAnalyzeSupport::handleRemoteOutput);
connect(runner, &DeviceApplicationRunner::remoteProcessStarted,
this, &RemoteLinuxAnalyzeSupport::handleRemoteProcessStarted);
connect(runner, &DeviceApplicationRunner::finished,
this, &RemoteLinuxAnalyzeSupport::handleAppRunnerFinished);
connect(runner, &DeviceApplicationRunner::reportProgress,
this, &RemoteLinuxAnalyzeSupport::handleProgressReport);
connect(runner, &DeviceApplicationRunner::reportError,
this, &RemoteLinuxAnalyzeSupport::handleAppRunnerError);
const QStringList args = arguments()
<< QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(d->qmlPort);

View File

@@ -129,8 +129,10 @@ bool RemoteLinuxCheckForFreeDiskSpaceService::isDeploymentPossible(QString *whyN
void RemoteLinuxCheckForFreeDiskSpaceService::doDeploy()
{
d->processRunner = new QSsh::SshRemoteProcessRunner;
connect(d->processRunner, SIGNAL(processClosed(int)), SLOT(handleProcessFinished()));
connect(d->processRunner, SIGNAL(readyReadStandardError()), SLOT(handleStdErr()));
connect(d->processRunner, &QSsh::SshRemoteProcessRunner::processClosed,
this, &RemoteLinuxCheckForFreeDiskSpaceService::handleProcessFinished);
connect(d->processRunner, &QSsh::SshRemoteProcessRunner::readyReadStandardError,
this, &RemoteLinuxCheckForFreeDiskSpaceService::handleStdErr);
const QString command = QString::fromLatin1("df -k %1 |tail -n 1 |sed 's/ */ /g' "
"|cut -d ' ' -f 4").arg(d->pathToCheck);
d->processRunner->run(command.toUtf8(), deviceConfiguration()->sshParameters());

View File

@@ -168,10 +168,13 @@ void LinuxDeviceDebugSupport::startExecution()
d->gdbserverOutput.clear();
DeviceApplicationRunner *runner = appRunner();
connect(runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteErrorOutput(QByteArray)));
connect(runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray)));
connect(runner, &DeviceApplicationRunner::remoteStderr,
this, &LinuxDeviceDebugSupport::handleRemoteErrorOutput);
connect(runner, &DeviceApplicationRunner::remoteStdout,
this, &LinuxDeviceDebugSupport::handleRemoteOutput);
if (d->qmlDebugging && !d->cppDebugging)
connect(runner, SIGNAL(remoteProcessStarted()), SLOT(handleRemoteProcessStarted()));
connect(runner, &DeviceApplicationRunner::remoteProcessStarted,
this, &LinuxDeviceDebugSupport::handleRemoteProcessStarted);
QStringList args = arguments();
QString command;
@@ -190,9 +193,12 @@ void LinuxDeviceDebugSupport::startExecution()
args.append(QString::fromLatin1(":%1").arg(d->gdbServerPort));
}
connect(runner, SIGNAL(finished(bool)), SLOT(handleAppRunnerFinished(bool)));
connect(runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString)));
connect(runner, SIGNAL(reportError(QString)), SLOT(handleAppRunnerError(QString)));
connect(runner, &DeviceApplicationRunner::finished,
this, &LinuxDeviceDebugSupport::handleAppRunnerFinished);
connect(runner, &DeviceApplicationRunner::reportProgress,
this, &LinuxDeviceDebugSupport::handleProgressReport);
connect(runner, &DeviceApplicationRunner::reportError,
this, &LinuxDeviceDebugSupport::handleAppRunnerError);
runner->setEnvironment(environment());
runner->setWorkingDirectory(workingDirectory());
runner->start(device(), command, args);

View File

@@ -50,9 +50,11 @@ RemoteLinuxEnvironmentAspectWidget::RemoteLinuxEnvironmentAspectWidget(RemoteLin
{
QPushButton *button = fetchButton();
button->setText(FetchEnvButtonText);
connect(button, SIGNAL(clicked()), this, SLOT(fetchEnvironment()));
connect(deviceEnvReader, SIGNAL(finished()), this, SLOT(fetchEnvironmentFinished()));
connect(deviceEnvReader, SIGNAL(error(QString)), this, SLOT(fetchEnvironmentError(QString)));
connect(button, &QPushButton::clicked, this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironment);
connect(deviceEnvReader, &Internal::RemoteLinuxEnvironmentReader::finished,
this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironmentFinished);
connect(deviceEnvReader, &Internal::RemoteLinuxEnvironmentReader::error,
this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironmentError);
}
RemoteLinuxEnvironmentAspect *RemoteLinuxEnvironmentAspectWidget::aspect() const
@@ -68,8 +70,10 @@ QPushButton *RemoteLinuxEnvironmentAspectWidget::fetchButton() const
void RemoteLinuxEnvironmentAspectWidget::fetchEnvironment()
{
QPushButton *button = fetchButton();
disconnect(button, SIGNAL(clicked()), this, SLOT(fetchEnvironment()));
connect(button, SIGNAL(clicked()), this, SLOT(stopFetchEnvironment()));
disconnect(button, &QPushButton::clicked,
this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironment);
connect(button, &QPushButton::clicked,
this, &RemoteLinuxEnvironmentAspectWidget::stopFetchEnvironment);
button->setText(tr("Cancel Fetch Operation"));
deviceEnvReader->start();
}
@@ -77,8 +81,10 @@ void RemoteLinuxEnvironmentAspectWidget::fetchEnvironment()
void RemoteLinuxEnvironmentAspectWidget::fetchEnvironmentFinished()
{
QPushButton *button = fetchButton();
disconnect(button, SIGNAL(clicked()), this, SLOT(stopFetchEnvironment()));
connect(button, SIGNAL(clicked()), this, SLOT(fetchEnvironment()));
disconnect(button, &QPushButton::clicked,
this, &RemoteLinuxEnvironmentAspectWidget::stopFetchEnvironment);
connect(button, &QPushButton::clicked,
this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironment);
button->setText(FetchEnvButtonText);
aspect()->setRemoteEnvironment(deviceEnvReader->remoteEnvironment());
}

View File

@@ -58,8 +58,10 @@ void RemoteLinuxEnvironmentReader::start()
return;
m_stop = false;
m_deviceProcess = device->createProcess(this);
connect(m_deviceProcess, SIGNAL(error(QProcess::ProcessError)), SLOT(handleError()));
connect(m_deviceProcess, SIGNAL(finished()), SLOT(remoteProcessFinished()));
connect(m_deviceProcess, &ProjectExplorer::DeviceProcess::error,
this, &RemoteLinuxEnvironmentReader::handleError);
connect(m_deviceProcess, &ProjectExplorer::DeviceProcess::finished,
this, &RemoteLinuxEnvironmentReader::remoteProcessFinished);
m_deviceProcess->start(QLatin1String("env"));
}

View File

@@ -70,10 +70,14 @@ void AbstractRemoteLinuxPackageInstaller::installPackage(const IDevice::ConstPtr
prepareInstallation();
if (!d->installer)
d->installer = new SshRemoteProcessRunner(this);
connect(d->installer, SIGNAL(connectionError()), SLOT(handleConnectionError()));
connect(d->installer, SIGNAL(readyReadStandardOutput()), SLOT(handleInstallerOutput()));
connect(d->installer, SIGNAL(readyReadStandardError()), SLOT(handleInstallerErrorOutput()));
connect(d->installer, SIGNAL(processClosed(int)), SLOT(handleInstallationFinished(int)));
connect(d->installer, &QSsh::SshRemoteProcessRunner::connectionError,
this, &AbstractRemoteLinuxPackageInstaller::handleConnectionError);
connect(d->installer, &QSsh::SshRemoteProcessRunner::readyReadStandardOutput,
this, &AbstractRemoteLinuxPackageInstaller::handleInstallerOutput);
connect(d->installer, &QSsh::SshRemoteProcessRunner::readyReadStandardError,
this, &AbstractRemoteLinuxPackageInstaller::handleInstallerErrorOutput);
connect(d->installer, &QSsh::SshRemoteProcessRunner::processClosed,
this, &AbstractRemoteLinuxPackageInstaller::handleInstallationFinished);
QString cmdLine = installCommandLine(packageFilePath);
if (removePackageFile)

View File

@@ -88,8 +88,8 @@ RemoteLinuxRunConfigurationWidget::RemoteLinuxRunConfigurationWidget(RemoteLinux
mainLayout->setMargin(0);
addGenericWidgets(mainLayout);
connect(d->runConfiguration, SIGNAL(enabledChanged()),
SLOT(runConfigurationEnabledChange()));
connect(d->runConfiguration, &RemoteLinuxRunConfiguration::enabledChanged,
this, &RemoteLinuxRunConfigurationWidget::runConfigurationEnabledChange);
runConfigurationEnabledChange();
}
@@ -157,16 +157,18 @@ void RemoteLinuxRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayou
d->workingDirLineEdit.setText(d->runConfiguration->workingDirectory());
d->genericWidgetsLayout.addRow(tr("Working directory:"), &d->workingDirLineEdit);
connect(&d->argsLineEdit, SIGNAL(textEdited(QString)), SLOT(argumentsEdited(QString)));
connect(d->runConfiguration, SIGNAL(targetInformationChanged()), this,
SLOT(updateTargetInformation()));
connect(d->runConfiguration, SIGNAL(deploySpecsChanged()), SLOT(handleDeploySpecsChanged()));
connect(&d->useAlternateCommandBox, SIGNAL(toggled(bool)),
SLOT(handleUseAlternateCommandChanged()));
connect(&d->alternateCommand, SIGNAL(textEdited(QString)),
SLOT(handleAlternateCommandChanged()));
connect(&d->workingDirLineEdit, SIGNAL(textEdited(QString)),
SLOT(handleWorkingDirectoryChanged()));
connect(&d->argsLineEdit, &QLineEdit::textEdited,
this, &RemoteLinuxRunConfigurationWidget::argumentsEdited);
connect(d->runConfiguration, &RemoteLinuxRunConfiguration::targetInformationChanged,
this, &RemoteLinuxRunConfigurationWidget::updateTargetInformation);
connect(d->runConfiguration, &RemoteLinuxRunConfiguration::deploySpecsChanged,
this, &RemoteLinuxRunConfigurationWidget::handleDeploySpecsChanged);
connect(&d->useAlternateCommandBox, &QCheckBox::toggled,
this, &RemoteLinuxRunConfigurationWidget::handleUseAlternateCommandChanged);
connect(&d->alternateCommand, &QLineEdit::textEdited,
this, &RemoteLinuxRunConfigurationWidget::handleAlternateCommandChanged);
connect(&d->workingDirLineEdit, &QLineEdit::textEdited,
this, &RemoteLinuxRunConfigurationWidget::handleWorkingDirectoryChanged);
handleDeploySpecsChanged();
handleUseAlternateCommandChanged();
}

View File

@@ -80,12 +80,16 @@ void RemoteLinuxRunControl::start()
d->running = true;
emit started();
d->runner.disconnect(this);
connect(&d->runner, SIGNAL(reportError(QString)), SLOT(handleErrorMessage(QString)));
connect(&d->runner, SIGNAL(remoteStderr(QByteArray)),
SLOT(handleRemoteErrorOutput(QByteArray)));
connect(&d->runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray)));
connect(&d->runner, SIGNAL(finished(bool)), SLOT(handleRunnerFinished()));
connect(&d->runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString)));
connect(&d->runner, &ProjectExplorer::DeviceApplicationRunner::reportError,
this, &RemoteLinuxRunControl::handleErrorMessage);
connect(&d->runner, &ProjectExplorer::DeviceApplicationRunner::remoteStderr,
this, &RemoteLinuxRunControl::handleRemoteErrorOutput);
connect(&d->runner, &ProjectExplorer::DeviceApplicationRunner::remoteStdout,
this, &RemoteLinuxRunControl::handleRemoteOutput);
connect(&d->runner, &ProjectExplorer::DeviceApplicationRunner::finished,
this, &RemoteLinuxRunControl::handleRunnerFinished);
connect(&d->runner, &ProjectExplorer::DeviceApplicationRunner::reportProgress,
this, &RemoteLinuxRunControl::handleProgressReport);
d->runner.setEnvironment(d->environment);
d->runner.setWorkingDirectory(d->workingDir);
d->runner.start(d->device, d->remoteExecutable, d->arguments);

View File

@@ -47,8 +47,10 @@ RemoteLinuxSignalOperation::RemoteLinuxSignalOperation(
RemoteLinuxSignalOperation::~RemoteLinuxSignalOperation()
{
if (m_runner) {
connect(m_runner, SIGNAL(processClosed(int)), m_runner, SLOT(deleteLater()));
connect(m_runner, SIGNAL(connectionError()), m_runner, SLOT(deleteLater()));
connect(m_runner, &QSsh::SshRemoteProcessRunner::processClosed,
m_runner, &QSsh::SshRemoteProcessRunner::deleteLater);
connect(m_runner, &QSsh::SshRemoteProcessRunner::connectionError,
m_runner, &QSsh::SshRemoteProcessRunner::deleteLater);
}
}

View File

@@ -67,8 +67,10 @@ void SshKeyDeployer::deployPublicKey(const SshConnectionParameters &sshParams,
return;
}
connect(&d->deployProcess, SIGNAL(connectionError()), SLOT(handleConnectionFailure()));
connect(&d->deployProcess, SIGNAL(processClosed(int)), SLOT(handleKeyUploadFinished(int)));
connect(&d->deployProcess, &SshRemoteProcessRunner::connectionError,
this, &SshKeyDeployer::handleConnectionFailure);
connect(&d->deployProcess, &SshRemoteProcessRunner::processClosed,
this, &SshKeyDeployer::handleKeyUploadFinished);
const QByteArray command = "test -d .ssh "
"|| mkdir .ssh && chmod 0700 .ssh && echo '"
+ reader.data() + "' >> .ssh/authorized_keys && chmod 0600 .ssh/authorized_keys";

View File

@@ -48,9 +48,11 @@ CallgrindRunControl::CallgrindRunControl(const AnalyzerStartParameters &sp,
: ValgrindRunControl(sp, runConfiguration)
, m_markAsPaused(false)
{
connect(&m_runner, SIGNAL(finished()), this, SLOT(slotFinished()));
connect(&m_runner, &Valgrind::Callgrind::CallgrindRunner::finished,
this, &CallgrindRunControl::slotFinished);
connect(m_runner.parser(), SIGNAL(parserDataReady()), this, SLOT(slotFinished()));
connect(&m_runner, SIGNAL(statusMessage(QString)), SLOT(showStatusMessage(QString)));
connect(&m_runner, &Valgrind::Callgrind::CallgrindRunner::statusMessage,
this, &CallgrindRunControl::showStatusMessage);
}
void CallgrindRunControl::showStatusMessage(const QString &msg)

View File

@@ -52,12 +52,12 @@ MemcheckRunControl::MemcheckRunControl(const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration)
: ValgrindRunControl(sp, runConfiguration)
{
connect(&m_parser, SIGNAL(error(Valgrind::XmlProtocol::Error)),
SIGNAL(parserError(Valgrind::XmlProtocol::Error)));
connect(&m_parser, SIGNAL(suppressionCount(QString,qint64)),
SIGNAL(suppressionCount(QString,qint64)));
connect(&m_parser, SIGNAL(internalError(QString)),
SIGNAL(internalParserError(QString)));
connect(&m_parser, &XmlProtocol::ThreadedParser::error,
this, &MemcheckRunControl::parserError);
connect(&m_parser, &XmlProtocol::ThreadedParser::suppressionCount,
this, &MemcheckRunControl::suppressionCount);
connect(&m_parser, &XmlProtocol::ThreadedParser::internalError,
this, &MemcheckRunControl::internalParserError);
}
QString MemcheckRunControl::progressTitle() const

View File

@@ -187,8 +187,7 @@ QWidget *MemcheckErrorDelegate::createDetailsWidget(const QFont & font,
errorLocation(errorIndex, error, /*link=*/ true,
/*absolutePath=*/ false, linkStyle),
linkStyle));
connect(errorLabel, &QLabel::linkActivated,
this, &MemcheckErrorDelegate::openLinkInEditor);
connect(errorLabel, &QLabel::linkActivated, this, &MemcheckErrorDelegate::openLinkInEditor);
layout->addWidget(errorLabel);
const QVector<Stack> stacks = error.stacks();
@@ -223,8 +222,7 @@ QWidget *MemcheckErrorDelegate::createDetailsWidget(const QFont & font,
QFont fixedPitchFont = font;
fixedPitchFont.setFixedPitch(true);
frameLabel->setFont(fixedPitchFont);
connect(frameLabel, &QLabel::linkActivated,
this, &MemcheckErrorDelegate::openLinkInEditor);
connect(frameLabel, &QLabel::linkActivated, this, &MemcheckErrorDelegate::openLinkInEditor);
// pad frameNr to 2 chars since only 50 frames max are supported by valgrind
const QString displayText = displayTextTemplate
.arg(frameNr++, 2).arg(frameName);

View File

@@ -250,12 +250,12 @@ void MemcheckTool::updateFromSettings()
m_filterProjectAction->setChecked(!m_settings->filterExternalIssues());
m_errorView->settingsChanged(m_settings);
connect(m_settings, SIGNAL(visibleErrorKindsChanged(QList<int>)),
m_errorProxyModel, SLOT(setAcceptedKinds(QList<int>)));
connect(m_settings, &ValgrindBaseSettings::visibleErrorKindsChanged,
m_errorProxyModel, &MemcheckErrorFilterProxyModel::setAcceptedKinds);
m_errorProxyModel->setAcceptedKinds(m_settings->visibleErrorKinds());
connect(m_settings, SIGNAL(filterExternalIssuesChanged(bool)),
m_errorProxyModel, SLOT(setFilterExternalIssues(bool)));
connect(m_settings, &ValgrindBaseSettings::filterExternalIssuesChanged,
m_errorProxyModel, &MemcheckErrorFilterProxyModel::setFilterExternalIssues);
m_errorProxyModel->setFilterExternalIssues(m_settings->filterExternalIssues());
}
@@ -283,7 +283,7 @@ void MemcheckTool::maybeActiveRunConfigurationChanged()
// now make the new settings current, update and connect input widgets
m_settings = settings;
QTC_ASSERT(m_settings, return);
connect(m_settings, SIGNAL(destroyed(QObject*)), SLOT(settingsDestroyed(QObject*)));
connect(m_settings, &ValgrindBaseSettings::destroyed, this, &MemcheckTool::settingsDestroyed);
updateFromSettings();
}
@@ -381,7 +381,7 @@ QWidget *MemcheckTool::createWidgets()
action = new QAction(this);
action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_OPENFILE)));
action->setToolTip(tr("Load External XML Log File"));
connect(action, SIGNAL(triggered(bool)), this, SLOT(loadExternalXmlLogFile()));
connect(action, &QAction::triggered, this, &MemcheckTool::loadExternalXmlLogFile);
button = new QToolButton;
button->setDefaultAction(action);
layout->addWidget(button);
@@ -421,7 +421,7 @@ QWidget *MemcheckTool::createWidgets()
m_filterMenu->addSeparator();
m_filterMenu->addAction(m_filterProjectAction);
m_filterMenu->addAction(m_suppressionSeparator);
connect(m_filterMenu, SIGNAL(triggered(QAction*)), SLOT(updateErrorFilter()));
connect(m_filterMenu, &QMenu::triggered, this, &MemcheckTool::updateErrorFilter);
filterButton->setMenu(m_filterMenu);
layout->addWidget(filterButton);
@@ -440,13 +440,10 @@ AnalyzerRunControl *MemcheckTool::createRunControl(const AnalyzerStartParameters
MemcheckRunControl *engine = new MemcheckRunControl(sp, runConfiguration);
connect(engine, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)),
this, SLOT(engineStarting(const Analyzer::AnalyzerRunControl*)));
connect(engine, SIGNAL(parserError(Valgrind::XmlProtocol::Error)),
this, SLOT(parserError(Valgrind::XmlProtocol::Error)));
connect(engine, SIGNAL(internalParserError(QString)),
this, SLOT(internalParserError(QString)));
connect(engine, SIGNAL(finished()), this, SLOT(engineFinished()));
connect(engine, &MemcheckRunControl::starting, this, &MemcheckTool::engineStarting);
connect(engine, &MemcheckRunControl::parserError, this, &MemcheckTool::parserError);
connect(engine, &MemcheckRunControl::internalParserError, this, &MemcheckTool::internalParserError);
connect(engine, &MemcheckRunControl::finished, this, &MemcheckTool::engineFinished);
return engine;
}
@@ -470,8 +467,7 @@ void MemcheckTool::engineStarting(const AnalyzerRunControl *engine)
QAction *action = m_filterMenu->addAction(Utils::FileName::fromString(file).fileName());
action->setToolTip(file);
action->setData(file);
connect(action, SIGNAL(triggered(bool)),
this, SLOT(suppressionActionTriggered()));
connect(action, &QAction::triggered, this, &MemcheckTool::suppressionActionTriggered);
m_suppressionActions.append(action);
}
}
@@ -515,12 +511,10 @@ void MemcheckTool::loadExternalXmlLogFile()
}
ThreadedParser *parser = new ThreadedParser;
connect(parser, SIGNAL(error(Valgrind::XmlProtocol::Error)),
this, SLOT(parserError(Valgrind::XmlProtocol::Error)));
connect(parser, SIGNAL(internalError(QString)),
this, SLOT(internalParserError(QString)));
connect(parser, SIGNAL(finished()), this, SLOT(loadingExternalXmlLogFileFinished()));
connect(parser, SIGNAL(finished()), parser, SLOT(deleteLater()));
connect(parser, &ThreadedParser::error, this, &MemcheckTool::parserError);
connect(parser, &ThreadedParser::internalError, this, &MemcheckTool::internalParserError);
connect(parser, &ThreadedParser::finished, this, &MemcheckTool::loadingExternalXmlLogFileFinished);
connect(parser, &ThreadedParser::finished, parser, &ThreadedParser::deleteLater);
parser->parse(logFile); // ThreadedParser owns the file
}

View File

@@ -63,14 +63,14 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings,
m_ui->valgrindExeChooser->setPromptDialogTitle(tr("Valgrind Command"));
updateUi();
connect(m_settings, SIGNAL(changed()), this, SLOT(updateUi()));
connect(m_settings, &ValgrindBaseSettings::changed, this, &ValgrindConfigWidget::updateUi);
connect(m_ui->valgrindExeChooser, SIGNAL(changed(QString)),
m_settings, SLOT(setValgrindExecutable(QString)));
connect(m_ui->valgrindExeChooser, &Utils::PathChooser::changed,
m_settings, &ValgrindBaseSettings::setValgrindExecutable);
connect(m_settings, SIGNAL(valgrindExecutableChanged(QString)),
m_ui->valgrindExeChooser, SLOT(setPath(QString)));
connect(m_ui->smcDetectionComboBox, SIGNAL(currentIndexChanged(int)),
m_settings, SLOT(setSelfModifyingCodeDetection(int)));
connect(m_ui->smcDetectionComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
m_settings, &ValgrindBaseSettings::setSelfModifyingCodeDetection);
if (Utils::HostOsInfo::isWindowsHost()) {
// FIXME: On Window we know that we don't have a local valgrind
@@ -82,38 +82,38 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings,
//
// Callgrind
//
connect(m_ui->enableCacheSim, SIGNAL(toggled(bool)),
m_settings, SLOT(setEnableCacheSim(bool)));
connect(m_ui->enableCacheSim, &QCheckBox::toggled,
m_settings, &ValgrindBaseSettings::setEnableCacheSim);
connect(m_settings, SIGNAL(enableCacheSimChanged(bool)),
m_ui->enableCacheSim, SLOT(setChecked(bool)));
connect(m_ui->enableBranchSim, SIGNAL(toggled(bool)),
m_settings, SLOT(setEnableBranchSim(bool)));
connect(m_ui->enableBranchSim, &QCheckBox::toggled,
m_settings, &ValgrindBaseSettings::setEnableBranchSim);
connect(m_settings, SIGNAL(enableBranchSimChanged(bool)),
m_ui->enableBranchSim, SLOT(setChecked(bool)));
connect(m_ui->collectSystime, SIGNAL(toggled(bool)),
m_settings, SLOT(setCollectSystime(bool)));
connect(m_ui->collectSystime, &QCheckBox::toggled,
m_settings, &ValgrindBaseSettings::setCollectSystime);
connect(m_settings, SIGNAL(collectSystimeChanged(bool)),
m_ui->collectSystime, SLOT(setChecked(bool)));
connect(m_ui->collectBusEvents, SIGNAL(toggled(bool)),
m_settings, SLOT(setCollectBusEvents(bool)));
connect(m_ui->collectBusEvents, &QCheckBox::toggled,
m_settings, &ValgrindBaseSettings::setCollectBusEvents);
connect(m_settings, SIGNAL(collectBusEventsChanged(bool)),
m_ui->collectBusEvents, SLOT(setChecked(bool)));
connect(m_ui->enableEventToolTips, SIGNAL(toggled(bool)),
m_settings, SLOT(setEnableEventToolTips(bool)));
connect(m_ui->enableEventToolTips, &QGroupBox::toggled,
m_settings, &ValgrindBaseSettings::setEnableEventToolTips);
connect(m_settings, SIGNAL(enableEventToolTipsChanged(bool)),
m_ui->enableEventToolTips, SLOT(setChecked(bool)));
connect(m_ui->minimumInclusiveCostRatio, SIGNAL(valueChanged(double)),
m_settings, SLOT(setMinimumInclusiveCostRatio(double)));
connect(m_ui->minimumInclusiveCostRatio, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
m_settings, &ValgrindBaseSettings::setMinimumInclusiveCostRatio);
connect(m_settings, SIGNAL(minimumInclusiveCostRatioChanged(double)),
m_ui->minimumInclusiveCostRatio, SLOT(setValue(double)));
connect(m_ui->visualisationMinimumInclusiveCostRatio, SIGNAL(valueChanged(double)),
m_settings, SLOT(setVisualisationMinimumInclusiveCostRatio(double)));
connect(m_ui->visualisationMinimumInclusiveCostRatio, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
m_settings, &ValgrindBaseSettings::setVisualisationMinimumInclusiveCostRatio);
connect(m_settings, SIGNAL(visualisationMinimumInclusiveCostRatioChanged(double)),
m_ui->visualisationMinimumInclusiveCostRatio, SLOT(setValue(double)));
@@ -123,36 +123,32 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings,
m_ui->suppressionList->setModel(m_model);
m_ui->suppressionList->setSelectionMode(QAbstractItemView::MultiSelection);
connect(m_ui->addSuppression, SIGNAL(clicked()),
this, SLOT(slotAddSuppression()));
connect(m_ui->removeSuppression, SIGNAL(clicked()),
this, SLOT(slotRemoveSuppression()));
connect(m_ui->addSuppression, &QPushButton::clicked, this, &ValgrindConfigWidget::slotAddSuppression);
connect(m_ui->removeSuppression, &QPushButton::clicked, this, &ValgrindConfigWidget::slotRemoveSuppression);
connect(m_ui->numCallers, SIGNAL(valueChanged(int)), m_settings, SLOT(setNumCallers(int)));
connect(m_ui->numCallers, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
m_settings, &ValgrindBaseSettings::setNumCallers);
connect(m_settings, SIGNAL(numCallersChanged(int)), m_ui->numCallers, SLOT(setValue(int)));
connect(m_ui->leakCheckOnFinish, SIGNAL(currentIndexChanged(int)),
m_settings, SLOT(setLeakCheckOnFinish(int)));
connect(m_ui->leakCheckOnFinish, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
m_settings, &ValgrindBaseSettings::setLeakCheckOnFinish);
connect(m_settings, SIGNAL(leakCheckOnFinishChanged(int)),
m_ui->leakCheckOnFinish, SLOT(setCurrentIndex(int)));
connect(m_ui->showReachable, SIGNAL(toggled(bool)),
m_settings, SLOT(setShowReachable(bool)));
connect(m_ui->showReachable, &QCheckBox::toggled, m_settings, &ValgrindBaseSettings::setShowReachable);
connect(m_settings, SIGNAL(showReachableChanged(bool)),
m_ui->showReachable, SLOT(setChecked(bool)));
connect(m_ui->trackOrigins, SIGNAL(toggled(bool)),
m_settings, SLOT(setTrackOrigins(bool)));
connect(m_ui->trackOrigins, &QCheckBox::toggled, m_settings, &ValgrindBaseSettings::setTrackOrigins);
connect(m_settings, SIGNAL(trackOriginsChanged(bool)),
m_ui->trackOrigins, SLOT(setChecked(bool)));
connect(m_settings, SIGNAL(suppressionFilesRemoved(QStringList)),
this, SLOT(slotSuppressionsRemoved(QStringList)));
connect(m_settings, SIGNAL(suppressionFilesAdded(QStringList)),
this, SLOT(slotSuppressionsAdded(QStringList)));
connect(m_settings, &ValgrindBaseSettings::suppressionFilesRemoved,
this, &ValgrindConfigWidget::slotSuppressionsRemoved);
connect(m_settings, &ValgrindBaseSettings::suppressionFilesAdded,
this, &ValgrindConfigWidget::slotSuppressionsAdded);
connect(m_ui->suppressionList->selectionModel(),
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
connect(m_ui->suppressionList->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(slotSuppressionSelectionChanged()));
slotSuppressionSelectionChanged();

View File

@@ -79,8 +79,10 @@ bool ValgrindRunControl::startEngine()
FutureProgress *fp = ProgressManager::addTimedTask(m_progress, progressTitle(), "valgrind", 100);
fp->setKeepOnFinish(FutureProgress::HideOnFinish);
connect(fp, SIGNAL(canceled()), this, SLOT(handleProgressCanceled()));
connect(fp, SIGNAL(finished()), this, SLOT(handleProgressFinished()));
connect(fp, &FutureProgress::canceled,
this, &ValgrindRunControl::handleProgressCanceled);
connect(fp, &FutureProgress::finished,
this, &ValgrindRunControl::handleProgressFinished);
m_progress.reportStarted();
const AnalyzerStartParameters &sp = startParameters();
@@ -101,11 +103,12 @@ bool ValgrindRunControl::startEngine()
run->setStartMode(sp.startMode);
run->setLocalRunMode(sp.localRunMode);
connect(run, SIGNAL(processOutputReceived(QString,Utils::OutputFormat)),
SLOT(receiveProcessOutput(QString,Utils::OutputFormat)));
connect(run, SIGNAL(processErrorReceived(QString,QProcess::ProcessError)),
SLOT(receiveProcessError(QString,QProcess::ProcessError)));
connect(run, SIGNAL(finished()), SLOT(runnerFinished()));
connect(run, &ValgrindRunner::processOutputReceived,
this, &ValgrindRunControl::receiveProcessOutput);
connect(run, &ValgrindRunner::processErrorReceived,
this, &ValgrindRunControl::receiveProcessError);
connect(run, &ValgrindRunner::finished,
this, &ValgrindRunControl::runnerFinished);
if (!run->start()) {
m_progress.cancel();

View File

@@ -188,7 +188,8 @@ void ValgrindPlugin::extensionsInitialized()
QAction *action = new QAction(tr("Profile Costs of This Function and Its Callees"), this);
action->setIcon(QIcon(QLatin1String(Analyzer::Constants::ANALYZER_CONTROL_START_ICON)));
connect(action, SIGNAL(triggered()), m_callgrindTool, SLOT(handleShowCostsOfFunction()));
connect(action, &QAction::triggered, m_callgrindTool,
&CallgrindTool::handleShowCostsOfFunction);
Command *cmd = ActionManager::registerAction(action, "Analyzer.Callgrind.ShowCostsOfFunction",
analyzerContext);
editorContextMenu->addAction(cmd);