Commit 063251eb authored by Montel Laurent's avatar Montel Laurent Committed by hjk

Port to new connect api

Change-Id: I873a36601d54065b61d0666558b93dc839ad0dfc
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent f1ac9cd5
......@@ -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
......
......@@ -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*)),
......
......@@ -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);
......
......@@ -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",
......
......@@ -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();
......
......@@ -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)
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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()
......
......@@ -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();
}
......
......@@ -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()
......
......@@ -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
......
......@@ -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());
......
......@@ -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());
......
......@@ -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);
......
......@@ -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();
}
......
......@@ -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();
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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()));
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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());
......
......@@ -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));
}