diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2017-09-20 11:14:48 +0300 |
---|---|---|
committer | Olivier Goffart <olivier@woboq.com> | 2017-09-21 15:05:39 +0300 |
commit | ff4213b59f223b60e87e70af2db6201986f76df8 (patch) | |
tree | 98398cd1a1014b9ef1c47457b9139ccf3a546ace /src/gui/selectivesyncdialog.cpp | |
parent | c4e51247d833d4f08df7036fe4a7823a6f6e0ff6 (diff) |
Use the Qt5 connection syntax (automated with clazy)
This is motivated by the fact that QMetaObject::noralizeSignature takes 7.35%
CPU of the LargeSyncBench. (Mostly from ABstractNetworkJob::setupConnections and
PropagateUploadFileV1::startNextChunk). It could be fixed by using normalized
signature in the connection statement, but i tought it was a good oportunity
to modernize the code.
This commit only contains calls that were automatically converted with clazy.
Diffstat (limited to 'src/gui/selectivesyncdialog.cpp')
-rw-r--r-- | src/gui/selectivesyncdialog.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gui/selectivesyncdialog.cpp b/src/gui/selectivesyncdialog.cpp index a9c96cb77..1457967f7 100644 --- a/src/gui/selectivesyncdialog.cpp +++ b/src/gui/selectivesyncdialog.cpp @@ -83,10 +83,10 @@ SelectiveSyncWidget::SelectiveSyncWidget(AccountPtr account, QWidget *parent) layout->addWidget(_folderTree); - connect(_folderTree, SIGNAL(itemExpanded(QTreeWidgetItem *)), - SLOT(slotItemExpanded(QTreeWidgetItem *))); - connect(_folderTree, SIGNAL(itemChanged(QTreeWidgetItem *, int)), - SLOT(slotItemChanged(QTreeWidgetItem *, int))); + connect(_folderTree, &QTreeWidget::itemExpanded, + this, &SelectiveSyncWidget::slotItemExpanded); + connect(_folderTree, &QTreeWidget::itemChanged, + this, &SelectiveSyncWidget::slotItemChanged); _folderTree->setSortingEnabled(true); _folderTree->sortByColumn(0, Qt::AscendingOrder); _folderTree->setColumnCount(2); @@ -107,10 +107,10 @@ void SelectiveSyncWidget::refreshFolders() LsColJob *job = new LsColJob(_account, _folderPath, this); job->setProperties(QList<QByteArray>() << "resourcetype" << "http://owncloud.org/ns:size"); - connect(job, SIGNAL(directoryListingSubfolders(QStringList)), - this, SLOT(slotUpdateDirectories(QStringList))); - connect(job, SIGNAL(finishedWithError(QNetworkReply *)), - this, SLOT(slotLscolFinishedWithError(QNetworkReply *))); + connect(job, &LsColJob::directoryListingSubfolders, + this, &SelectiveSyncWidget::slotUpdateDirectories); + connect(job, &LsColJob::finishedWithError, + this, &SelectiveSyncWidget::slotLscolFinishedWithError); job->start(); _folderTree->clear(); _loading->show(); @@ -291,8 +291,8 @@ void SelectiveSyncWidget::slotItemExpanded(QTreeWidgetItem *item) LsColJob *job = new LsColJob(_account, prefix + dir, this); job->setProperties(QList<QByteArray>() << "resourcetype" << "http://owncloud.org/ns:size"); - connect(job, SIGNAL(directoryListingSubfolders(QStringList)), - SLOT(slotUpdateDirectories(QStringList))); + connect(job, &LsColJob::directoryListingSubfolders, + this, &SelectiveSyncWidget::slotUpdateDirectories); job->start(); } @@ -440,7 +440,7 @@ SelectiveSyncDialog::SelectiveSyncDialog(AccountPtr account, Folder *folder, QWi _okButton->setEnabled(false); } // Make sure we don't get crashes if the folder is destroyed while we are still open - connect(_folder, SIGNAL(destroyed(QObject *)), this, SLOT(deleteLater())); + connect(_folder, &QObject::destroyed, this, &QObject::deleteLater); } SelectiveSyncDialog::SelectiveSyncDialog(AccountPtr account, const QString &folder, @@ -463,7 +463,7 @@ void SelectiveSyncDialog::init(const AccountPtr &account) connect(_okButton, SIGNAL(clicked()), this, SLOT(accept())); QPushButton *button; button = buttonBox->addButton(QDialogButtonBox::Cancel); - connect(button, SIGNAL(clicked()), this, SLOT(reject())); + connect(button, &QAbstractButton::clicked, this, &QDialog::reject); layout->addWidget(buttonBox); } |