summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Angelaccio <elvis.angelaccio@kdemail.net>2016-08-07 17:18:53 (GMT)
committerElvis Angelaccio <elvis.angelaccio@kdemail.net>2016-08-07 17:41:53 (GMT)
commite2c392833bae3dddca3c7baba104cd435eefc545 (patch)
tree8f26bdcf3e48088a26a9437f95acaee34657822d
parent8fe13adce4b73f2f681a5a0c4074189655a9e1bb (diff)
Port some more connect() calls to the new syntax
We need to use a lambda for CliInterface::readStdout slot, because its argument is not compatible with the signal.
-rw-r--r--app/main.cpp4
-rw-r--r--kerfuffle/cliinterface.cpp4
-rw-r--r--part/part.cpp10
3 files changed, 10 insertions, 8 deletions
diff --git a/app/main.cpp b/app/main.cpp
index 2153a60..36e2a1c 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -199,7 +199,7 @@ int main(int argc, char **argv)
AddToArchive *addToArchiveJob = new AddToArchive(&application);
application.setQuitOnLastWindowClosed(false);
- application.connect(addToArchiveJob, SIGNAL(result(KJob*)), SLOT(quit()), Qt::QueuedConnection);
+ QObject::connect(addToArchiveJob, &KJob::result, &application, &QCoreApplication::quit, Qt::QueuedConnection);
if (parser.isSet(QStringLiteral("changetofirstpath"))) {
qCDebug(ARK) << "Setting changetofirstpath";
@@ -237,7 +237,7 @@ int main(int argc, char **argv)
BatchExtract *batchJob = new BatchExtract(&application);
application.setQuitOnLastWindowClosed(false);
- application.connect(batchJob, SIGNAL(result(KJob*)), SLOT(quit()), Qt::QueuedConnection);
+ QObject::connect(batchJob, &KJob::result, &application, &QCoreApplication::quit, Qt::QueuedConnection);
for (int i = 0; i < urls.count(); ++i) {
qCDebug(ARK) << "Adding url" << QUrl::fromUserInput(urls.at(i), QString(), QUrl::AssumeLocalFile);
diff --git a/kerfuffle/cliinterface.cpp b/kerfuffle/cliinterface.cpp
index e981347..b2cc09b 100644
--- a/kerfuffle/cliinterface.cpp
+++ b/kerfuffle/cliinterface.cpp
@@ -265,7 +265,9 @@ bool CliInterface::runProcess(const QStringList& programNames, const QStringList
m_process->setNextOpenMode(QIODevice::ReadWrite | QIODevice::Unbuffered | QIODevice::Text);
m_process->setProgram(programPath, arguments);
- connect(m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(readStdout()));
+ connect(m_process, &QProcess::readyReadStandardOutput, this, [=]() {
+ readStdout();
+ });
if (m_operationMode == Copy) {
// Extraction jobs need a dedicated post-processing function.
diff --git a/part/part.cpp b/part/part.cpp
index 14054e6..1ea34e9 100644
--- a/part/part.cpp
+++ b/part/part.cpp
@@ -331,14 +331,14 @@ void Part::setupActions()
m_openFileAction->setText(i18nc("open a file with external program", "&Open"));
m_openFileAction->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
m_openFileAction->setToolTip(i18nc("@info:tooltip", "Click to open the selected file with the associated application"));
- connect(m_openFileAction, SIGNAL(triggered(bool)), m_signalMapper, SLOT(map()));
+ connect(m_openFileAction, &QAction::triggered, m_signalMapper, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map));
m_signalMapper->setMapping(m_openFileAction, OpenFile);
m_openFileWithAction = actionCollection()->addAction(QStringLiteral("openfilewith"));
m_openFileWithAction->setText(i18nc("open a file with external program", "Open &With..."));
m_openFileWithAction->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
m_openFileWithAction->setToolTip(i18nc("@info:tooltip", "Click to open the selected file with an external program"));
- connect(m_openFileWithAction, SIGNAL(triggered(bool)), m_signalMapper, SLOT(map()));
+ connect(m_openFileWithAction, &QAction::triggered, m_signalMapper, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map));
m_signalMapper->setMapping(m_openFileWithAction, OpenFileWith);
m_previewAction = actionCollection()->addAction(QStringLiteral("preview"));
@@ -346,7 +346,7 @@ void Part::setupActions()
m_previewAction->setIcon(QIcon::fromTheme(QStringLiteral("document-preview-archive")));
m_previewAction->setToolTip(i18nc("@info:tooltip", "Click to preview the selected file"));
actionCollection()->setDefaultShortcut(m_previewAction, Qt::CTRL + Qt::Key_P);
- connect(m_previewAction, SIGNAL(triggered(bool)), m_signalMapper, SLOT(map()));
+ connect(m_previewAction, &QAction::triggered, m_signalMapper, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map));
m_signalMapper->setMapping(m_previewAction, Preview);
m_extractArchiveAction = actionCollection()->addAction(QStringLiteral("extract_all"));
@@ -370,8 +370,8 @@ void Part::setupActions()
m_addFilesAction->setText(i18n("Add &Files..."));
m_addFilesAction->setToolTip(i18nc("@info:tooltip", "Click to add files to the archive"));
actionCollection()->setDefaultShortcut(m_addFilesAction, Qt::ALT + Qt::Key_A);
- connect(m_addFilesAction, SIGNAL(triggered(bool)),
- this, SLOT(slotAddFiles()));
+ connect(m_addFilesAction, &QAction::triggered,
+ this, static_cast<void (Part::*)()>(&Part::slotAddFiles));
m_deleteFilesAction = actionCollection()->addAction(QStringLiteral("delete"));
m_deleteFilesAction->setIcon(QIcon::fromTheme(QStringLiteral("archive-remove")));