From c701506348f757a139c612d018465bf421835644 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Thu, 29 Jan 2015 18:37:56 +0100 Subject: [PATCH] Use new qt5 connect api Change-Id: I7841baa54c9861275269981892e18d6b8fa58f3b Reviewed-by: hjk --- .../coreplugin/locator/directoryfilter.cpp | 16 ++++---- .../coreplugin/locator/ilocatorfilter.cpp | 4 +- src/plugins/coreplugin/locator/locator.cpp | 4 +- .../locator/locatorsettingspage.cpp | 12 +++--- src/plugins/cpaster/cpasterplugin.cpp | 7 ++-- src/plugins/cpaster/kdepasteprotocol.cpp | 8 ++-- src/plugins/cpaster/pastebindotcaprotocol.cpp | 8 ++-- .../cpaster/pastebindotcomprotocol.cpp | 6 +-- src/plugins/cpaster/pasteview.cpp | 6 +-- src/plugins/cpaster/protocol.cpp | 2 +- src/plugins/cpaster/urlopenprotocol.cpp | 3 +- src/plugins/debugger/gdb/coregdbadapter.cpp | 8 ++-- src/plugins/debugger/gdb/gdbengine.cpp | 14 +++---- .../debugger/gdb/remotegdbserveradapter.cpp | 16 ++++---- .../debugger/gdb/startgdbserverdialog.cpp | 21 ++++++---- src/plugins/debugger/gdb/termgdbadapter.cpp | 9 +++-- src/plugins/debugger/qml/qmladapter.cpp | 40 ++++++++++--------- .../debugger/qml/qmlinspectoragent.cpp | 19 ++++----- .../debugger/qml/qmlv8debuggerclient.cpp | 3 +- .../debugger/qml/qscriptdebuggerclient.cpp | 3 +- .../shared/cdbsymbolpathlisteditor.cpp | 4 +- 21 files changed, 116 insertions(+), 97 deletions(-) diff --git a/src/plugins/coreplugin/locator/directoryfilter.cpp b/src/plugins/coreplugin/locator/directoryfilter.cpp index 1310e416f9f..bc6e290a55c 100644 --- a/src/plugins/coreplugin/locator/directoryfilter.cpp +++ b/src/plugins/coreplugin/locator/directoryfilter.cpp @@ -96,14 +96,14 @@ bool DirectoryFilter::openConfigDialog(QWidget *parent, bool &needsRefresh) m_dialog = &dialog; m_ui.setupUi(&dialog); dialog.setWindowTitle(tr("Filter Configuration")); - connect(m_ui.addButton, SIGNAL(clicked()), - this, SLOT(addDirectory()), Qt::DirectConnection); - connect(m_ui.editButton, SIGNAL(clicked()), - this, SLOT(editDirectory()), Qt::DirectConnection); - connect(m_ui.removeButton, SIGNAL(clicked()), - this, SLOT(removeDirectory()), Qt::DirectConnection); - connect(m_ui.directoryList, SIGNAL(itemSelectionChanged()), - this, SLOT(updateOptionButtons()), Qt::DirectConnection); + connect(m_ui.addButton, &QPushButton::clicked, + this, &DirectoryFilter::addDirectory, Qt::DirectConnection); + connect(m_ui.editButton, &QPushButton::clicked, + this, &DirectoryFilter::editDirectory, Qt::DirectConnection); + connect(m_ui.removeButton, &QPushButton::clicked, + this, &DirectoryFilter::removeDirectory, Qt::DirectConnection); + connect(m_ui.directoryList, &QListWidget::itemSelectionChanged, + this, &DirectoryFilter::updateOptionButtons, Qt::DirectConnection); m_ui.nameEdit->setText(displayName()); m_ui.nameEdit->selectAll(); m_ui.directoryList->clear(); diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.cpp b/src/plugins/coreplugin/locator/ilocatorfilter.cpp index 6bd9f911691..7217b6f4b02 100644 --- a/src/plugins/coreplugin/locator/ilocatorfilter.cpp +++ b/src/plugins/coreplugin/locator/ilocatorfilter.cpp @@ -106,8 +106,8 @@ bool ILocatorFilter::openConfigDialog(QWidget *parent, bool &needsRefresh) QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); - connect(buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); + connect(buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept); + connect(buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject); vlayout->addLayout(hlayout); vlayout->addStretch(); diff --git a/src/plugins/coreplugin/locator/locator.cpp b/src/plugins/coreplugin/locator/locator.cpp index 622318a520f..6818308ec33 100644 --- a/src/plugins/coreplugin/locator/locator.cpp +++ b/src/plugins/coreplugin/locator/locator.cpp @@ -101,7 +101,7 @@ void Locator::initialize(CorePlugin *corePlugin, const QStringList &, QString *) Command *cmd = ActionManager::registerAction(action, Constants::LOCATE, Context(Constants::C_GLOBAL)); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+K"))); - connect(action, SIGNAL(triggered()), this, SLOT(openLocator())); + connect(action, &QAction::triggered, this, &Locator::openLocator); connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updatePlaceholderText())); updatePlaceholderText(cmd); @@ -308,7 +308,7 @@ void Locator::refresh(QList filters) QFuture task = QtConcurrent::run(&ILocatorFilter::refresh, filters); FutureProgress *progress = ProgressManager::addTask(task, tr("Updating Locator Caches"), Constants::TASK_INDEX); - connect(progress, SIGNAL(finished()), this, SLOT(saveSettings())); + connect(progress, &FutureProgress::finished, this, &Locator::saveSettings); } } // namespace Internal diff --git a/src/plugins/coreplugin/locator/locatorsettingspage.cpp b/src/plugins/coreplugin/locator/locatorsettingspage.cpp index affeb07556b..98ffb510712 100644 --- a/src/plugins/coreplugin/locator/locatorsettingspage.cpp +++ b/src/plugins/coreplugin/locator/locatorsettingspage.cpp @@ -61,16 +61,16 @@ QWidget *LocatorSettingsPage::widget() m_widget = new QWidget; m_ui.setupUi(m_widget); m_ui.refreshInterval->setToolTip(m_ui.refreshIntervalLabel->toolTip()); - connect(m_ui.filterList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), - this, SLOT(updateButtonStates())); + connect(m_ui.filterList, &QListWidget::currentItemChanged, + this, &LocatorSettingsPage::updateButtonStates); connect(m_ui.filterList, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(configureFilter(QListWidgetItem*))); connect(m_ui.editButton, SIGNAL(clicked()), this, SLOT(configureFilter())); - connect(m_ui.addButton, SIGNAL(clicked()), - this, SLOT(addCustomFilter())); - connect(m_ui.removeButton, SIGNAL(clicked()), - this, SLOT(removeCustomFilter())); + connect(m_ui.addButton, &QPushButton::clicked, + this, &LocatorSettingsPage::addCustomFilter); + connect(m_ui.removeButton, &QPushButton::clicked, + this, &LocatorSettingsPage::removeCustomFilter); m_ui.refreshInterval->setValue(m_plugin->refreshInterval()); m_filters = m_plugin->filters(); diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index e4a34d49fb0..e94a6bce24b 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -147,8 +147,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *errorMe } m_urlOpen = new UrlOpenProtocol; - connect(m_urlOpen, SIGNAL(fetchDone(QString,QString,bool)), - this, SLOT(finishFetch(QString,QString,bool))); + connect(m_urlOpen, &Protocol::fetchDone, this, &CodepasterPlugin::finishFetch); //register actions @@ -171,12 +170,12 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *errorMe m_fetchAction = new QAction(tr("Fetch Snippet..."), this); command = Core::ActionManager::registerAction(m_fetchAction, "CodePaster.Fetch", globalcontext); command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+C,Meta+F") : tr("Alt+C,Alt+F"))); - connect(m_fetchAction, SIGNAL(triggered()), this, SLOT(fetch())); + connect(m_fetchAction, &QAction::triggered, this, &CodepasterPlugin::fetch); cpContainer->addAction(command); m_fetchUrlAction = new QAction(tr("Fetch from URL..."), this); command = Core::ActionManager::registerAction(m_fetchUrlAction, "CodePaster.FetchUrl", globalcontext); - connect(m_fetchUrlAction, SIGNAL(triggered()), this, SLOT(fetchUrl())); + connect(m_fetchUrlAction, &QAction::triggered, this, &CodepasterPlugin::fetchUrl); cpContainer->addAction(command); addAutoReleasedObject(new CodePasterService); diff --git a/src/plugins/cpaster/kdepasteprotocol.cpp b/src/plugins/cpaster/kdepasteprotocol.cpp index 0824d867994..22f9993965d 100644 --- a/src/plugins/cpaster/kdepasteprotocol.cpp +++ b/src/plugins/cpaster/kdepasteprotocol.cpp @@ -133,7 +133,7 @@ void StickyNotesPasteProtocol::paste(const QString &text, } m_pasteReply = httpPost(m_hostUrl + QLatin1String("api/json/create"), pasteData); - connect(m_pasteReply, SIGNAL(finished()), this, SLOT(pasteFinished())); + connect(m_pasteReply, &QNetworkReply::finished, this, &StickyNotesPasteProtocol::pasteFinished); if (debug) qDebug() << "paste: sending " << m_pasteReply << pasteData; } @@ -196,7 +196,8 @@ void StickyNotesPasteProtocol::fetch(const QString &id) qDebug() << "fetch: sending " << url; m_fetchReply = httpGet(url); - connect(m_fetchReply, SIGNAL(finished()), this, SLOT(fetchFinished())); + connect(m_fetchReply, &QNetworkReply::finished, + this, &StickyNotesPasteProtocol::fetchFinished); } // Parse: '143228foo1320661026text @@ -227,7 +228,8 @@ void StickyNotesPasteProtocol::list() // Trailing slash is important to prevent redirection. QString url = m_hostUrl + QLatin1String("api/json/list"); m_listReply = httpGet(url); - connect(m_listReply, SIGNAL(finished()), this, SLOT(listFinished())); + connect(m_listReply, &QNetworkReply::finished, + this, &StickyNotesPasteProtocol::listFinished); if (debug) qDebug() << "list: sending " << url << m_listReply; } diff --git a/src/plugins/cpaster/pastebindotcaprotocol.cpp b/src/plugins/cpaster/pastebindotcaprotocol.cpp index 902ffd0fa48..18fd78a303d 100644 --- a/src/plugins/cpaster/pastebindotcaprotocol.cpp +++ b/src/plugins/cpaster/pastebindotcaprotocol.cpp @@ -98,7 +98,8 @@ void PasteBinDotCaProtocol::fetch(const QString &id) link.insert(0, url); } m_fetchReply = httpGet(link); - connect(m_fetchReply, SIGNAL(finished()), this, SLOT(fetchFinished())); + connect(m_fetchReply, &QNetworkReply::finished, + this, &PasteBinDotCaProtocol::fetchFinished); m_fetchId = id; } @@ -138,7 +139,8 @@ void PasteBinDotCaProtocol::paste(const QString &text, // fire request const QString link = QLatin1String(internalUrlC) + QLatin1String("quiet-paste.php"); m_pasteReply = httpPost(link, data); - connect(m_pasteReply, SIGNAL(finished()), this, SLOT(pasteFinished())); + connect(m_pasteReply, &QNetworkReply::finished, + this, &PasteBinDotCaProtocol::pasteFinished); } void PasteBinDotCaProtocol::pasteFinished() @@ -177,7 +179,7 @@ void PasteBinDotCaProtocol::list() { QTC_ASSERT(!m_listReply, return); m_listReply = httpGet(QLatin1String(urlC)); - connect(m_listReply, SIGNAL(finished()), this, SLOT(listFinished())); + connect(m_listReply, &QNetworkReply::finished, this, &PasteBinDotCaProtocol::listFinished); } bool PasteBinDotCaProtocol::checkConfiguration(QString *errorMessage) diff --git a/src/plugins/cpaster/pastebindotcomprotocol.cpp b/src/plugins/cpaster/pastebindotcomprotocol.cpp index c451dcf2d16..ba8eb6afcaf 100644 --- a/src/plugins/cpaster/pastebindotcomprotocol.cpp +++ b/src/plugins/cpaster/pastebindotcomprotocol.cpp @@ -136,7 +136,7 @@ void PasteBinDotComProtocol::paste(const QString &text, pasteData += QUrl::toPercentEncoding(fixNewLines(text)); // fire request m_pasteReply = httpPost(QLatin1String(PASTEBIN_BASE) + QLatin1String(PASTEBIN_API), pasteData); - connect(m_pasteReply, SIGNAL(finished()), this, SLOT(pasteFinished())); + connect(m_pasteReply, &QNetworkReply::finished, this, &PasteBinDotComProtocol::pasteFinished); if (debug) qDebug() << "paste: sending " << m_pasteReply << pasteData; } @@ -167,7 +167,7 @@ void PasteBinDotComProtocol::fetch(const QString &id) qDebug() << "fetch: sending " << link; m_fetchReply = httpGet(link); - connect(m_fetchReply, SIGNAL(finished()), this, SLOT(fetchFinished())); + connect(m_fetchReply, &QNetworkReply::finished, this, &PasteBinDotComProtocol::fetchFinished); m_fetchId = id; } @@ -212,7 +212,7 @@ void PasteBinDotComProtocol::list() const QString url = QLatin1String(PASTEBIN_BASE) + QLatin1String(PASTEBIN_ARCHIVE); m_listReply = httpGet(url); - connect(m_listReply, SIGNAL(finished()), this, SLOT(listFinished())); + connect(m_listReply, &QNetworkReply::finished, this, &PasteBinDotComProtocol::listFinished); if (debug) qDebug() << "list: sending " << url << m_listReply; } diff --git a/src/plugins/cpaster/pasteview.cpp b/src/plugins/cpaster/pasteview.cpp index dd5510a06f3..c7567fd616d 100644 --- a/src/plugins/cpaster/pasteview.cpp +++ b/src/plugins/cpaster/pasteview.cpp @@ -55,12 +55,12 @@ PasteView::PasteView(const QList &protocols, m_ui.setupUi(this); m_ui.buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Paste")); - connect(m_ui.uiPatchList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(contentChanged())); + connect(m_ui.uiPatchList, &QListWidget::itemChanged, this, &PasteView::contentChanged); foreach (const Protocol *p, protocols) m_ui.protocolBox->addItem(p->name()); - connect(m_ui.protocolBox, SIGNAL(currentIndexChanged(int)), - this, SLOT(protocolChanged(int))); + connect(m_ui.protocolBox, static_cast(&QComboBox::currentIndexChanged), + this, &PasteView::protocolChanged); } PasteView::~PasteView() diff --git a/src/plugins/cpaster/protocol.cpp b/src/plugins/cpaster/protocol.cpp index fef3b8226e8..7adf12aefbb 100644 --- a/src/plugins/cpaster/protocol.cpp +++ b/src/plugins/cpaster/protocol.cpp @@ -223,7 +223,7 @@ bool NetworkProtocol::httpStatus(QString url, QString *errorMessage, bool useHtt // User canceled, discard and be happy. if (!reply->isFinished()) { QNetworkReply *replyPtr = reply.take(); - connect(replyPtr, SIGNAL(finished()), replyPtr, SLOT(deleteLater())); + connect(replyPtr, &QNetworkReply::finished, replyPtr, &QNetworkReply::deleteLater); return false; } // Passed diff --git a/src/plugins/cpaster/urlopenprotocol.cpp b/src/plugins/cpaster/urlopenprotocol.cpp index fbaa149a442..95108854d7a 100644 --- a/src/plugins/cpaster/urlopenprotocol.cpp +++ b/src/plugins/cpaster/urlopenprotocol.cpp @@ -55,7 +55,8 @@ void UrlOpenProtocol::fetch(const QString &url) { QTC_ASSERT(!m_fetchReply, return); m_fetchReply = httpGet(url); - connect(m_fetchReply, SIGNAL(finished()), this, SLOT(fetchFinished())); + connect(m_fetchReply, &QNetworkReply::finished, + this, &UrlOpenProtocol::fetchFinished); } void UrlOpenProtocol::fetchFinished() diff --git a/src/plugins/debugger/gdb/coregdbadapter.cpp b/src/plugins/debugger/gdb/coregdbadapter.cpp index 64f4d87d2cd..4168166a291 100644 --- a/src/plugins/debugger/gdb/coregdbadapter.cpp +++ b/src/plugins/debugger/gdb/coregdbadapter.cpp @@ -304,7 +304,8 @@ void GdbCoreEngine::unpackCoreIfNeeded() m_coreUnpackProcess = new QProcess(this); m_coreUnpackProcess->setWorkingDirectory(QDir::tempPath()); m_coreUnpackProcess->start(QLatin1String("lzop"), arguments); - connect(m_coreUnpackProcess, SIGNAL(finished(int)), SLOT(continueSetupEngine())); + connect(m_coreUnpackProcess, static_cast(&QProcess::finished), + this, &GdbCoreEngine::continueSetupEngine); } else if (m_coreName.endsWith(QLatin1String(".gz"))) { m_tempCoreName = tempCoreFilename(); showMessage(msg.arg(m_tempCoreName)); @@ -314,8 +315,9 @@ void GdbCoreEngine::unpackCoreIfNeeded() m_coreUnpackProcess = new QProcess(this); m_coreUnpackProcess->setWorkingDirectory(QDir::tempPath()); m_coreUnpackProcess->start(QLatin1String("gzip"), arguments); - connect(m_coreUnpackProcess, SIGNAL(readyRead()), SLOT(writeCoreChunk())); - connect(m_coreUnpackProcess, SIGNAL(finished(int)), SLOT(continueSetupEngine())); + connect(m_coreUnpackProcess, &QProcess::readyRead, this, &GdbCoreEngine::writeCoreChunk); + connect(m_coreUnpackProcess, static_cast(&QProcess::finished), + this, &GdbCoreEngine::continueSetupEngine); } else { continueSetupEngine(); } diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 0c541070500..019ebaad858 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -232,7 +232,7 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters) //ExtensionSystem::PluginManager::addObject(m_debugInfoTaskHandler); m_commandTimer.setSingleShot(true); - connect(&m_commandTimer, SIGNAL(timeout()), SLOT(commandTimeout())); + connect(&m_commandTimer, &QTimer::timeout, this, &GdbEngine::commandTimeout); connect(action(AutoDerefPointers), SIGNAL(valueChanged(QVariant)), SLOT(reloadLocals())); @@ -4195,14 +4195,10 @@ void GdbEngine::startGdb(const QStringList &args) gdbArgs << _("-n"); gdbArgs += args; - connect(m_gdbProc, SIGNAL(error(QProcess::ProcessError)), - SLOT(handleGdbError(QProcess::ProcessError))); - connect(m_gdbProc, SIGNAL(finished(int,QProcess::ExitStatus)), - SLOT(handleGdbFinished(int,QProcess::ExitStatus))); - connect(m_gdbProc, SIGNAL(readyReadStandardOutput()), - SLOT(readGdbStandardOutput())); - connect(m_gdbProc, SIGNAL(readyReadStandardError()), - SLOT(readGdbStandardError())); + connect(m_gdbProc, &GdbProcess::error, this, &GdbEngine::handleGdbError); + connect(m_gdbProc, &GdbProcess::finished, this, &GdbEngine::handleGdbFinished); + connect(m_gdbProc, &GdbProcess::readyReadStandardOutput, this, &GdbEngine::readGdbStandardOutput); + connect(m_gdbProc, &GdbProcess::readyReadStandardError, this, &GdbEngine::readGdbStandardError); showMessage(_("STARTING ") + m_gdb + _(" ") + gdbArgs.join(QLatin1Char(' '))); m_gdbProc->start(m_gdb, gdbArgs); diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp index 9a3f0075e88..e4cf21a0cb5 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp @@ -64,14 +64,14 @@ GdbRemoteServerEngine::GdbRemoteServerEngine(const DebuggerStartParameters &star { if (Utils::HostOsInfo::isWindowsHost()) m_gdbProc->setUseCtrlCStub(startParameters.useCtrlCStub); // This is only set for QNX/BlackBerry - connect(&m_uploadProc, SIGNAL(error(QProcess::ProcessError)), - SLOT(uploadProcError(QProcess::ProcessError))); - connect(&m_uploadProc, SIGNAL(readyReadStandardOutput()), - SLOT(readUploadStandardOutput())); - connect(&m_uploadProc, SIGNAL(readyReadStandardError()), - SLOT(readUploadStandardError())); - connect(&m_uploadProc, SIGNAL(finished(int)), - SLOT(uploadProcFinished())); + connect(&m_uploadProc, static_cast(&QProcess::error), + this, &GdbRemoteServerEngine::uploadProcError); + connect(&m_uploadProc, &QProcess::readyReadStandardOutput, + this, &GdbRemoteServerEngine::readUploadStandardOutput); + connect(&m_uploadProc, &QProcess::readyReadStandardError, + this, &GdbRemoteServerEngine::readUploadStandardError); + connect(&m_uploadProc, static_cast(&QProcess::finished), + this, &GdbRemoteServerEngine::uploadProcFinished); } void GdbRemoteServerEngine::setupEngine() diff --git a/src/plugins/debugger/gdb/startgdbserverdialog.cpp b/src/plugins/debugger/gdb/startgdbserverdialog.cpp index 462deb61282..5efa865cbf2 100644 --- a/src/plugins/debugger/gdb/startgdbserverdialog.cpp +++ b/src/plugins/debugger/gdb/startgdbserverdialog.cpp @@ -103,8 +103,10 @@ void GdbServerStarter::portGathererError(const QString &text) void GdbServerStarter::run() { QTC_ASSERT(d->device, return); - connect(&d->gatherer, SIGNAL(error(QString)), SLOT(portGathererError(QString))); - connect(&d->gatherer, SIGNAL(portListReady()), SLOT(portListReady())); + connect(&d->gatherer, &DeviceUsedPortsGatherer::error, + this, &GdbServerStarter::portGathererError); + connect(&d->gatherer, &DeviceUsedPortsGatherer::portListReady, + this, &GdbServerStarter::portListReady); d->gatherer.start(d->device); } @@ -118,11 +120,16 @@ void GdbServerStarter::portListReady() return; } - connect(&d->runner, SIGNAL(connectionError()), SLOT(handleConnectionError())); - connect(&d->runner, SIGNAL(processStarted()), SLOT(handleProcessStarted())); - connect(&d->runner, SIGNAL(readyReadStandardOutput()), SLOT(handleProcessOutputAvailable())); - connect(&d->runner, SIGNAL(readyReadStandardError()), SLOT(handleProcessErrorOutput())); - connect(&d->runner, SIGNAL(processClosed(int)), SLOT(handleProcessClosed(int))); + connect(&d->runner, &SshRemoteProcessRunner::connectionError, + this, &GdbServerStarter::handleConnectionError); + connect(&d->runner, &SshRemoteProcessRunner::processStarted, + this, &GdbServerStarter::handleProcessStarted); + connect(&d->runner, &SshRemoteProcessRunner::readyReadStandardOutput, + this, &GdbServerStarter::handleProcessOutputAvailable); + connect(&d->runner, &SshRemoteProcessRunner::readyReadStandardError, + this, &GdbServerStarter::handleProcessErrorOutput); + connect(&d->runner, &SshRemoteProcessRunner::processClosed, + this, &GdbServerStarter::handleProcessClosed); QByteArray gdbServerPath = d->device->debugServerPath().toUtf8(); if (gdbServerPath.isEmpty()) diff --git a/src/plugins/debugger/gdb/termgdbadapter.cpp b/src/plugins/debugger/gdb/termgdbadapter.cpp index ed09de635bc..d373705d80d 100644 --- a/src/plugins/debugger/gdb/termgdbadapter.cpp +++ b/src/plugins/debugger/gdb/termgdbadapter.cpp @@ -94,9 +94,12 @@ void GdbTermEngine::setupEngine() // Set environment + dumper preload. m_stubProc.setEnvironment(startParameters().environment); - connect(&m_stubProc, SIGNAL(processError(QString)), SLOT(stubError(QString))); - connect(&m_stubProc, SIGNAL(processStarted()), SLOT(stubStarted())); - connect(&m_stubProc, SIGNAL(stubStopped()), SLOT(stubExited())); + connect(&m_stubProc, &Utils::ConsoleProcess::processError, + this, &GdbTermEngine::stubError); + connect(&m_stubProc, &Utils::ConsoleProcess::processStarted, + this, &GdbTermEngine::stubStarted); + connect(&m_stubProc, &Utils::ConsoleProcess::stubStopped, + this, &GdbTermEngine::stubExited); // FIXME: Starting the stub implies starting the inferior. This is // fairly unclean as far as the state machine and error reporting go. diff --git a/src/plugins/debugger/qml/qmladapter.cpp b/src/plugins/debugger/qml/qmladapter.cpp index c9cad1ccfc1..ce72e7c7bde 100644 --- a/src/plugins/debugger/qml/qmladapter.cpp +++ b/src/plugins/debugger/qml/qmladapter.cpp @@ -57,21 +57,25 @@ QmlAdapter::QmlAdapter(DebuggerEngine *engine, QObject *parent) { m_connectionTimer.setInterval(4000); m_connectionTimer.setSingleShot(true); - connect(&m_connectionTimer, SIGNAL(timeout()), SLOT(checkConnectionState())); + connect(&m_connectionTimer, &QTimer::timeout, this, &QmlAdapter::checkConnectionState); m_conn = new QmlDebugConnection(this); - connect(m_conn, SIGNAL(stateMessage(QString)), SLOT(showConnectionStateMessage(QString))); - connect(m_conn, SIGNAL(errorMessage(QString)), SLOT(showConnectionErrorMessage(QString))); - connect(m_conn, SIGNAL(error(QDebugSupport::Error)), - SLOT(connectionErrorOccurred(QDebugSupport::Error))); - connect(m_conn, SIGNAL(opened()), &m_connectionTimer, SLOT(stop())); - connect(m_conn, SIGNAL(opened()), SIGNAL(connected())); - connect(m_conn, SIGNAL(closed()), SIGNAL(disconnected())); + connect(m_conn, &QmlDebug::QmlDebugConnection::stateMessage, + this, &QmlAdapter::showConnectionStateMessage); + connect(m_conn, &QmlDebug::QmlDebugConnection::errorMessage, + this, &QmlAdapter::showConnectionErrorMessage); + connect(m_conn, &QmlDebug::QmlDebugConnection::error, + this, &QmlAdapter::connectionErrorOccurred); + connect(m_conn, &QmlDebug::QmlDebugConnection::opened, + &m_connectionTimer, &QTimer::stop); + connect(m_conn, &QmlDebug::QmlDebugConnection::opened, + this, &QmlAdapter::connected); + connect(m_conn, &QmlDebug::QmlDebugConnection::closed, + this, &QmlAdapter::disconnected); createDebuggerClients(); m_msgClient = new QDebugMessageClient(m_conn); - connect(m_msgClient, SIGNAL(newState(QmlDebug::QmlDebugClient::State)), - this, SLOT(clientStateChanged(QmlDebug::QmlDebugClient::State))); + connect(m_msgClient, &QmlDebug::QDebugMessageClient::newState, this, &QmlAdapter::clientStateChanged); } @@ -150,16 +154,16 @@ bool QmlAdapter::isConnected() const void QmlAdapter::createDebuggerClients() { QScriptDebuggerClient *debugClient1 = new QScriptDebuggerClient(m_conn); - connect(debugClient1, SIGNAL(newState(QmlDebug::QmlDebugClient::State)), - this, SLOT(clientStateChanged(QmlDebug::QmlDebugClient::State))); - connect(debugClient1, SIGNAL(newState(QmlDebug::QmlDebugClient::State)), - this, SLOT(debugClientStateChanged(QmlDebug::QmlDebugClient::State))); + connect(debugClient1, &QScriptDebuggerClient::newState, + this, &QmlAdapter::clientStateChanged); + connect(debugClient1, &QScriptDebuggerClient::newState, + this, &QmlAdapter::debugClientStateChanged); QmlV8DebuggerClient *debugClient2 = new QmlV8DebuggerClient(m_conn); - connect(debugClient2, SIGNAL(newState(QmlDebug::QmlDebugClient::State)), - this, SLOT(clientStateChanged(QmlDebug::QmlDebugClient::State))); - connect(debugClient2, SIGNAL(newState(QmlDebug::QmlDebugClient::State)), - this, SLOT(debugClientStateChanged(QmlDebug::QmlDebugClient::State))); + connect(debugClient2, &QmlV8DebuggerClient::newState, + this, &QmlAdapter::clientStateChanged); + connect(debugClient2, &QmlV8DebuggerClient::newState, + this, &QmlAdapter::debugClientStateChanged); m_debugClients.insert(debugClient1->name(),debugClient1); m_debugClients.insert(debugClient2->name(),debugClient2); diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp index b3945ffd3b1..cbb329d521e 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.cpp +++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp @@ -68,7 +68,8 @@ QmlInspectorAgent::QmlInspectorAgent(DebuggerEngine *engine, QObject *parent) SIGNAL(valueChanged(QVariant)), SLOT(updateState())); m_delayQueryTimer.setSingleShot(true); m_delayQueryTimer.setInterval(100); - connect(&m_delayQueryTimer, SIGNAL(timeout()), SLOT(queryEngineContext())); + connect(&m_delayQueryTimer, &QTimer::timeout, + this, &QmlInspectorAgent::queryEngineContext); } quint32 QmlInspectorAgent::queryExpressionResult(int debugId, @@ -395,14 +396,14 @@ void QmlInspectorAgent::setEngineClient(BaseEngineDebugClient *client) m_engineClient = client; if (m_engineClient) { - connect(m_engineClient, SIGNAL(newState(QmlDebug::QmlDebugClient::State)), - this, SLOT(updateState())); - connect(m_engineClient, SIGNAL(result(quint32,QVariant,QByteArray)), - this, SLOT(onResult(quint32,QVariant,QByteArray))); - connect(m_engineClient, SIGNAL(newObject(int,int,int)), - this, SLOT(newObject(int,int,int))); - connect(m_engineClient, SIGNAL(valueChanged(int,QByteArray,QVariant)), - this, SLOT(onValueChanged(int,QByteArray,QVariant))); + connect(m_engineClient, &QmlDebug::BaseEngineDebugClient::newState, + this, &QmlInspectorAgent::updateState); + connect(m_engineClient, &QmlDebug::BaseEngineDebugClient::result, + this, &QmlInspectorAgent::onResult); + connect(m_engineClient, &QmlDebug::BaseEngineDebugClient::newObject, + this, &QmlInspectorAgent::newObject); + connect(m_engineClient, &QmlDebug::BaseEngineDebugClient::valueChanged, + this, &QmlInspectorAgent::onValueChanged); } updateState(); diff --git a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp index 08a512dc166..bb85b673aa8 100644 --- a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp +++ b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp @@ -982,7 +982,8 @@ void QmlV8DebuggerClient::expandObject(const QByteArray &iname, quint64 objectId void QmlV8DebuggerClient::setEngine(QmlEngine *engine) { d->engine = engine; - connect(this, SIGNAL(stackFrameCompleted()), engine, SIGNAL(stackFrameCompleted())); + connect(this, &QmlV8DebuggerClient::stackFrameCompleted, + engine, &QmlEngine::stackFrameCompleted); } void QmlV8DebuggerClient::getSourceFiles() diff --git a/src/plugins/debugger/qml/qscriptdebuggerclient.cpp b/src/plugins/debugger/qml/qscriptdebuggerclient.cpp index 82dbe4d1f78..4dac16302d1 100644 --- a/src/plugins/debugger/qml/qscriptdebuggerclient.cpp +++ b/src/plugins/debugger/qml/qscriptdebuggerclient.cpp @@ -582,7 +582,8 @@ void QScriptDebuggerClient::insertLocalsAndWatches(QList &locals, void QScriptDebuggerClient::setEngine(QmlEngine *engine) { d->engine = engine; - connect(this, SIGNAL(stackFrameCompleted()), engine, SIGNAL(stackFrameCompleted())); + connect(this, &QScriptDebuggerClient::stackFrameCompleted, + engine, &DebuggerEngine::stackFrameCompleted); } void QScriptDebuggerClientPrivate::logSendMessage(const QString &msg) const diff --git a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp index 77ce4174e29..eb471d6c1d8 100644 --- a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp +++ b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp @@ -68,8 +68,8 @@ CacheDirectoryDialog::CacheDirectoryDialog(QWidget *parent) : setLayout(mainLayout); - connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(m_buttonBox, &QDialogButtonBox::accepted, this, &CacheDirectoryDialog::accept); + connect(m_buttonBox, &QDialogButtonBox::rejected, this, &CacheDirectoryDialog::reject); } void CacheDirectoryDialog::setPath(const QString &p)