Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2017-09-20 11:14:48 +0300
committerOlivier Goffart <olivier@woboq.com>2017-09-21 15:05:39 +0300
commitff4213b59f223b60e87e70af2db6201986f76df8 (patch)
tree98398cd1a1014b9ef1c47457b9139ccf3a546ace /src/gui/folderstatusmodel.cpp
parentc4e51247d833d4f08df7036fe4a7823a6f6e0ff6 (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/folderstatusmodel.cpp')
-rw-r--r--src/gui/folderstatusmodel.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp
index d0c48eddc..0c593ebdb 100644
--- a/src/gui/folderstatusmodel.cpp
+++ b/src/gui/folderstatusmodel.cpp
@@ -67,10 +67,10 @@ void FolderStatusModel::setAccountState(const AccountState *accountState)
_folders.clear();
_accountState = accountState;
- connect(FolderMan::instance(), SIGNAL(folderSyncStateChange(Folder *)),
- SLOT(slotFolderSyncStateChange(Folder *)), Qt::UniqueConnection);
- connect(FolderMan::instance(), SIGNAL(scheduleQueueChanged()),
- SLOT(slotFolderScheduleQueueChanged()), Qt::UniqueConnection);
+ connect(FolderMan::instance(), &FolderMan::folderSyncStateChange,
+ this, &FolderStatusModel::slotFolderSyncStateChange, Qt::UniqueConnection);
+ connect(FolderMan::instance(), &FolderMan::scheduleQueueChanged,
+ this, &FolderStatusModel::slotFolderScheduleQueueChanged, Qt::UniqueConnection);
auto folders = FolderMan::instance()->map();
foreach (auto f, folders) {
@@ -85,8 +85,8 @@ void FolderStatusModel::setAccountState(const AccountState *accountState)
info._checked = Qt::PartiallyChecked;
_folders << info;
- connect(f, SIGNAL(progressInfo(ProgressInfo)), this, SLOT(slotSetProgress(ProgressInfo)), Qt::UniqueConnection);
- connect(f, SIGNAL(newBigFolderDiscovered(QString)), this, SLOT(slotNewBigFolder()), Qt::UniqueConnection);
+ connect(f, &Folder::progressInfo, this, &FolderStatusModel::slotSetProgress, Qt::UniqueConnection);
+ connect(f, &Folder::newBigFolderDiscovered, this, &FolderStatusModel::slotNewBigFolder, Qt::UniqueConnection);
}
// Sort by header text
@@ -556,12 +556,12 @@ void FolderStatusModel::fetchMore(const QModelIndex &parent)
<< "http://owncloud.org/ns:size"
<< "http://owncloud.org/ns:permissions");
job->setTimeout(60 * 1000);
- connect(job, SIGNAL(directoryListingSubfolders(QStringList)),
- SLOT(slotUpdateDirectories(QStringList)));
- connect(job, SIGNAL(finishedWithError(QNetworkReply *)),
- this, SLOT(slotLscolFinishedWithError(QNetworkReply *)));
- connect(job, SIGNAL(directoryListingIterated(const QString &, const QMap<QString, QString> &)),
- this, SLOT(slotGatherPermissions(const QString &, const QMap<QString, QString> &)));
+ connect(job, &LsColJob::directoryListingSubfolders,
+ this, &FolderStatusModel::slotUpdateDirectories);
+ connect(job, &LsColJob::finishedWithError,
+ this, &FolderStatusModel::slotLscolFinishedWithError);
+ connect(job, &LsColJob::directoryListingIterated,
+ this, &FolderStatusModel::slotGatherPermissions);
job->start();
@@ -570,7 +570,7 @@ void FolderStatusModel::fetchMore(const QModelIndex &parent)
// Show 'fetching data...' hint after a while.
_fetchingItems[persistentIndex].start();
- QTimer::singleShot(1000, this, SLOT(slotShowFetchProgress()));
+ QTimer::singleShot(1000, this, &FolderStatusModel::slotShowFetchProgress);
}
void FolderStatusModel::slotGatherPermissions(const QString &href, const QMap<QString, QString> &map)