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

github.com/owncloud/client.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/generalsettings.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/generalsettings.cpp')
-rw-r--r--src/gui/generalsettings.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp
index d298b6cae..5a035c4c2 100644
--- a/src/gui/generalsettings.cpp
+++ b/src/gui/generalsettings.cpp
@@ -42,11 +42,11 @@ GeneralSettings::GeneralSettings(QWidget *parent)
{
_ui->setupUi(this);
- connect(_ui->desktopNotificationsCheckBox, SIGNAL(toggled(bool)),
- SLOT(slotToggleOptionalDesktopNotifications(bool)));
+ connect(_ui->desktopNotificationsCheckBox, &QAbstractButton::toggled,
+ this, &GeneralSettings::slotToggleOptionalDesktopNotifications);
_ui->autostartCheckBox->setChecked(Utility::hasLaunchOnStartup(Theme::instance()->appName()));
- connect(_ui->autostartCheckBox, SIGNAL(toggled(bool)), SLOT(slotToggleLaunchOnStartup(bool)));
+ connect(_ui->autostartCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::slotToggleLaunchOnStartup);
// setup about section
QString about = Theme::instance()->about();
@@ -63,11 +63,11 @@ GeneralSettings::GeneralSettings(QWidget *parent)
slotUpdateInfo();
// misc
- connect(_ui->monoIconsCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
- connect(_ui->crashreporterCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
- connect(_ui->newFolderLimitCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
+ connect(_ui->monoIconsCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
+ connect(_ui->crashreporterCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
+ connect(_ui->newFolderLimitCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
connect(_ui->newFolderLimitSpinBox, SIGNAL(valueChanged(int)), SLOT(saveMiscSettings()));
- connect(_ui->newExternalStorage, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
+ connect(_ui->newExternalStorage, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
#ifndef WITH_CRASHREPORTER
_ui->crashreporterCheckBox->setVisible(false);
@@ -84,10 +84,10 @@ GeneralSettings::GeneralSettings(QWidget *parent)
// is no point in offering an option
_ui->monoIconsCheckBox->setVisible(Theme::instance()->monoIconsAvailable());
- connect(_ui->ignoredFilesButton, SIGNAL(clicked()), SLOT(slotIgnoreFilesEditor()));
+ connect(_ui->ignoredFilesButton, &QAbstractButton::clicked, this, &GeneralSettings::slotIgnoreFilesEditor);
// accountAdded means the wizard was finished and the wizard might change some options.
- connect(AccountManager::instance(), SIGNAL(accountAdded(AccountState *)), this, SLOT(loadMiscSettings()));
+ connect(AccountManager::instance(), &AccountManager::accountAdded, this, &GeneralSettings::loadMiscSettings);
}
GeneralSettings::~GeneralSettings()
@@ -124,8 +124,8 @@ void GeneralSettings::slotUpdateInfo()
}
if (updater) {
- connect(updater, SIGNAL(downloadStateChanged()), SLOT(slotUpdateInfo()), Qt::UniqueConnection);
- connect(_ui->restartButton, SIGNAL(clicked()), updater, SLOT(slotStartInstaller()), Qt::UniqueConnection);
+ connect(updater, &OCUpdater::downloadStateChanged, this, &GeneralSettings::slotUpdateInfo, Qt::UniqueConnection);
+ connect(_ui->restartButton, &QAbstractButton::clicked, updater, &OCUpdater::slotStartInstaller, Qt::UniqueConnection);
connect(_ui->restartButton, SIGNAL(clicked()), qApp, SLOT(quit()), Qt::UniqueConnection);
_ui->updateStateLabel->setText(updater->statusString());
_ui->restartButton->setVisible(updater->downloadState() == OCUpdater::DownloadComplete);