Use the Qt5 connection syntax (automated with clazy)
authorOlivier Goffart <ogoffart@woboq.com>
Wed, 20 Sep 2017 08:14:48 +0000 (10:14 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 5 Oct 2017 20:01:35 +0000 (22:01 +0200)
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.

73 files changed:
src/3rdparty/qtsingleapplication/qtlocalpeer.cpp
src/3rdparty/qtsingleapplication/qtsingleapplication.cpp
src/3rdparty/qtsingleapplication/qtsinglecoreapplication.cpp
src/cmd/cmd.cpp
src/common/checksums.cpp
src/gui/accountmanager.cpp
src/gui/accountsettings.cpp
src/gui/accountstate.cpp
src/gui/activitylistmodel.cpp
src/gui/activitywidget.cpp
src/gui/application.cpp
src/gui/authenticationdialog.cpp
src/gui/creds/shibboleth/shibbolethuserjob.cpp
src/gui/creds/shibboleth/shibbolethwebview.cpp
src/gui/creds/shibbolethcredentials.cpp
src/gui/folder.cpp
src/gui/folderman.cpp
src/gui/folderstatusmodel.cpp
src/gui/folderwatcher_linux.cpp
src/gui/folderwizard.cpp
src/gui/generalsettings.cpp
src/gui/ignorelisteditor.cpp
src/gui/issueswidget.cpp
src/gui/lockwatcher.cpp
src/gui/logbrowser.cpp
src/gui/networksettings.cpp
src/gui/notificationwidget.cpp
src/gui/ocsshareejob.cpp
src/gui/ocssharejob.cpp
src/gui/owncloudgui.cpp
src/gui/owncloudsetupwizard.cpp
src/gui/protocolwidget.cpp
src/gui/proxyauthhandler.cpp
src/gui/quotainfo.cpp
src/gui/selectivesyncdialog.cpp
src/gui/servernotificationhandler.cpp
src/gui/settingsdialog.cpp
src/gui/sharedialog.cpp
src/gui/sharee.cpp
src/gui/sharelinkwidget.cpp
src/gui/sharemanager.cpp
src/gui/shareusergroupwidget.cpp
src/gui/socketapi.cpp
src/gui/sslbutton.cpp
src/gui/sslerrordialog.cpp
src/gui/synclogdialog.cpp
src/gui/tooltipupdater.cpp
src/gui/updater/ocupdater.cpp
src/gui/wizard/owncloudadvancedsetuppage.cpp
src/gui/wizard/owncloudconnectionmethoddialog.cpp
src/gui/wizard/owncloudsetuppage.cpp
src/gui/wizard/owncloudshibbolethcredspage.cpp
src/gui/wizard/owncloudwizard.cpp
src/gui/wizard/owncloudwizardresultpage.cpp
src/libsync/abstractnetworkjob.cpp
src/libsync/account.cpp
src/libsync/bandwidthmanager.cpp
src/libsync/connectionvalidator.cpp
src/libsync/creds/httpcredentials.cpp
src/libsync/discoveryphase.cpp
src/libsync/networkjobs.cpp
src/libsync/owncloudpropagator.cpp
src/libsync/owncloudpropagator.h
src/libsync/progressdispatcher.cpp
src/libsync/propagatedownload.cpp
src/libsync/propagateremotedelete.cpp
src/libsync/propagateremotemkdir.cpp
src/libsync/propagateremotemove.cpp
src/libsync/propagateupload.cpp
src/libsync/propagateuploadng.cpp
src/libsync/propagateuploadv1.cpp
src/libsync/syncengine.cpp
src/libsync/syncfilestatustracker.cpp

index 33cca898a031c0c920dcd5fa65022483d6ed04ea..3ebba6e6fd430f76ed763f6eaa5aa3005c893ad0 100644 (file)
@@ -101,7 +101,7 @@ bool QtLocalPeer::isClient()
     bool res = server->listen(socketName);
     if (!res)
         qWarning("QtSingleCoreApplication: listen on local socket failed, %s", qPrintable(server->errorString()));
-    QObject::connect(server, SIGNAL(newConnection()), SLOT(receiveConnection()));
+    QObject::connect(server, &QLocalServer::newConnection, this, &QtLocalPeer::receiveConnection);
     return false;
 }
 
index 9610937ded7aa9b4f827bfeacc631a942fea2ca5..844824cb477e60650c5eada3c529f583b0e974ce 100644 (file)
@@ -95,7 +95,7 @@ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char *
     *pids = 0;
     pidPeer = new QtLocalPeer(this, appId + QLatin1Char('-') +
                               QString::number(QCoreApplication::applicationPid()));
-    connect(pidPeer, SIGNAL(messageReceived(QString,QObject*)), SIGNAL(messageReceived(QString,QObject*)));
+    connect(pidPeer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::messageReceived);
     pidPeer->isClient();
     lockfile.unlock();
 }
@@ -169,9 +169,9 @@ void QtSingleApplication::setActivationWindow(QWidget *aw, bool activateOnMessag
     if (!pidPeer)
         return;
     if (activateOnMessage)
-        connect(pidPeer, SIGNAL(messageReceived(QString,QObject*)), this, SLOT(activateWindow()));
+        connect(pidPeer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::activateWindow);
     else
-        disconnect(pidPeer, SIGNAL(messageReceived(QString,QObject*)), this, SLOT(activateWindow()));
+        disconnect(pidPeer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::activateWindow);
 }
 
 
index 25a511f6c38edf891b6d9f618780c015a8f2e255..e34fd6328ba229c8abe8cfc4a90b1249a77d2a41 100644 (file)
@@ -37,7 +37,7 @@ QtSingleCoreApplication::QtSingleCoreApplication(int &argc, char **argv)
 {
     peer = new QtLocalPeer(this);
     block = false;
-    connect(peer, SIGNAL(messageReceived(QString)), SIGNAL(messageReceived(QString)));
+    connect(peer, &QtLocalPeer::messageReceived, this, &QtSingleCoreApplication::messageReceived);
 }
 
 
@@ -45,7 +45,7 @@ QtSingleCoreApplication::QtSingleCoreApplication(const QString &appId, int &argc
     : QCoreApplication(argc, argv)
 {
     peer = new QtLocalPeer(this, appId);
-    connect(peer, SIGNAL(messageReceived(QString)), SIGNAL(messageReceived(QString)));
+    connect(peer, &QtLocalPeer::messageReceived, this, &QtSingleCoreApplication::messageReceived);
 }
 
 
index d8d836ecf97de60da860c3dd1bc3bb92d036a2ad..b8116b91995f04ce1db5bba48c4f9fb355f5ad3d 100644 (file)
@@ -512,7 +512,7 @@ restart_sync:
     engine.setNetworkLimits(options.uplimit, options.downlimit);
     QObject::connect(&engine, &SyncEngine::finished,
         [&app](bool result) { app.exit(result ? EXIT_SUCCESS : EXIT_FAILURE); });
-    QObject::connect(&engine, SIGNAL(transmissionProgress(ProgressInfo)), &cmd, SLOT(transmissionProgressSlot()));
+    QObject::connect(&engine, &SyncEngine::transmissionProgress, &cmd, &Cmd::transmissionProgressSlot);
 
 
     // Exclude lists
index 6ffb573857dc21bbec2bb963baff74fa961ed0f2..245bcaa37b3321b9ff98563832401b3a6cd69f86 100644 (file)
@@ -151,8 +151,8 @@ QByteArray ComputeChecksum::checksumType() const
 void ComputeChecksum::start(const QString &filePath)
 {
     // Calculate the checksum in a different thread first.
-    connect(&_watcher, SIGNAL(finished()),
-        this, SLOT(slotCalculationDone()),
+    connect(&_watcher, &QFutureWatcherBase::finished,
+        this, &ComputeChecksum::slotCalculationDone,
         Qt::UniqueConnection);
     _watcher.setFuture(QtConcurrent::run(ComputeChecksum::computeNow, filePath, checksumType()));
 }
@@ -208,8 +208,8 @@ void ValidateChecksumHeader::start(const QString &filePath, const QByteArray &ch
 
     auto calculator = new ComputeChecksum(this);
     calculator->setChecksumType(_expectedChecksumType);
-    connect(calculator, SIGNAL(done(QByteArray, QByteArray)),
-        SLOT(slotChecksumCalculated(QByteArray, QByteArray)));
+    connect(calculator, &ComputeChecksum::done,
+        this, &ValidateChecksumHeader::slotChecksumCalculated);
     calculator->start(filePath);
 }
 
index a62e1f30fd3e7f7cd5f271cd00d1cc2415535890..38a0ff1853f65bed7f765262b9fd89c1f9e5b8e8 100644 (file)
@@ -319,8 +319,8 @@ AccountPtr AccountManager::createAccount()
 {
     AccountPtr acc = Account::create();
     acc->setSslErrorHandler(new SslDialogErrorHandler);
-    connect(acc.data(), SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)),
-        ProxyAuthHandler::instance(), SLOT(handleProxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)));
+    connect(acc.data(), &Account::proxyAuthenticationRequired,
+        ProxyAuthHandler::instance(), &ProxyAuthHandler::handleProxyAuthenticationRequired);
     return acc;
 }
 
@@ -359,8 +359,8 @@ QString AccountManager::generateFreeAccountId() const
 void AccountManager::addAccountState(AccountState *accountState)
 {
     QObject::connect(accountState->account().data(),
-        SIGNAL(wantsAccountSaved(Account *)),
-        SLOT(saveAccount(Account *)));
+        &Account::wantsAccountSaved,
+        this, &AccountManager::saveAccount);
 
     AccountStatePtr ptr(accountState);
     _accounts << ptr;
index f40a388895f64ade04f44f2afb5a4a396303e214..8183d4b8f273ad5be0670f3df978656b8ea7d34d 100644 (file)
@@ -139,41 +139,41 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
     ui->_folderList->installEventFilter(mouseCursorChanger);
 
     createAccountToolbox();
-    connect(AccountManager::instance(), SIGNAL(accountAdded(AccountState *)),
-        SLOT(slotAccountAdded(AccountState *)));
-    connect(ui->_folderList, SIGNAL(customContextMenuRequested(QPoint)),
-        this, SLOT(slotCustomContextMenuRequested(QPoint)));
-    connect(ui->_folderList, SIGNAL(clicked(const QModelIndex &)),
-        this, SLOT(slotFolderListClicked(const QModelIndex &)));
-    connect(ui->_folderList, SIGNAL(expanded(QModelIndex)), this, SLOT(refreshSelectiveSyncStatus()));
-    connect(ui->_folderList, SIGNAL(collapsed(QModelIndex)), this, SLOT(refreshSelectiveSyncStatus()));
-    connect(ui->selectiveSyncNotification, SIGNAL(linkActivated(QString)),
-        this, SLOT(slotLinkActivated(QString)));
-    connect(_model, SIGNAL(suggestExpand(QModelIndex)), ui->_folderList, SLOT(expand(QModelIndex)));
-    connect(_model, SIGNAL(dirtyChanged()), this, SLOT(refreshSelectiveSyncStatus()));
+    connect(AccountManager::instance(), &AccountManager::accountAdded,
+        this, &AccountSettings::slotAccountAdded);
+    connect(ui->_folderList, &QWidget::customContextMenuRequested,
+        this, &AccountSettings::slotCustomContextMenuRequested);
+    connect(ui->_folderList, &QAbstractItemView::clicked,
+        this, &AccountSettings::slotFolderListClicked);
+    connect(ui->_folderList, &QTreeView::expanded, this, &AccountSettings::refreshSelectiveSyncStatus);
+    connect(ui->_folderList, &QTreeView::collapsed, this, &AccountSettings::refreshSelectiveSyncStatus);
+    connect(ui->selectiveSyncNotification, &QLabel::linkActivated,
+        this, &AccountSettings::slotLinkActivated);
+    connect(_model, &FolderStatusModel::suggestExpand, ui->_folderList, &QTreeView::expand);
+    connect(_model, &FolderStatusModel::dirtyChanged, this, &AccountSettings::refreshSelectiveSyncStatus);
     refreshSelectiveSyncStatus();
-    connect(_model, SIGNAL(rowsInserted(QModelIndex, int, int)),
-        this, SLOT(refreshSelectiveSyncStatus()));
+    connect(_model, &QAbstractItemModel::rowsInserted,
+        this, &AccountSettings::refreshSelectiveSyncStatus);
 
     QAction *syncNowAction = new QAction(this);
     syncNowAction->setShortcut(QKeySequence(Qt::Key_F6));
-    connect(syncNowAction, SIGNAL(triggered()), SLOT(slotScheduleCurrentFolder()));
+    connect(syncNowAction, &QAction::triggered, this, &AccountSettings::slotScheduleCurrentFolder);
     addAction(syncNowAction);
 
     QAction *syncNowWithRemoteDiscovery = new QAction(this);
     syncNowWithRemoteDiscovery->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_F6));
-    connect(syncNowWithRemoteDiscovery, SIGNAL(triggered()), SLOT(slotScheduleCurrentFolderForceRemoteDiscovery()));
+    connect(syncNowWithRemoteDiscovery, &QAction::triggered, this, &AccountSettings::slotScheduleCurrentFolderForceRemoteDiscovery);
     addAction(syncNowWithRemoteDiscovery);
 
 
-    connect(ui->selectiveSyncApply, SIGNAL(clicked()), _model, SLOT(slotApplySelectiveSync()));
-    connect(ui->selectiveSyncCancel, SIGNAL(clicked()), _model, SLOT(resetFolders()));
-    connect(ui->bigFolderApply, SIGNAL(clicked(bool)), _model, SLOT(slotApplySelectiveSync()));
-    connect(ui->bigFolderSyncAll, SIGNAL(clicked(bool)), _model, SLOT(slotSyncAllPendingBigFolders()));
-    connect(ui->bigFolderSyncNone, SIGNAL(clicked(bool)), _model, SLOT(slotSyncNoPendingBigFolders()));
+    connect(ui->selectiveSyncApply, &QAbstractButton::clicked, _model, &FolderStatusModel::slotApplySelectiveSync);
+    connect(ui->selectiveSyncCancel, &QAbstractButton::clicked, _model, &FolderStatusModel::resetFolders);
+    connect(ui->bigFolderApply, &QAbstractButton::clicked, _model, &FolderStatusModel::slotApplySelectiveSync);
+    connect(ui->bigFolderSyncAll, &QAbstractButton::clicked, _model, &FolderStatusModel::slotSyncAllPendingBigFolders);
+    connect(ui->bigFolderSyncNone, &QAbstractButton::clicked, _model, &FolderStatusModel::slotSyncNoPendingBigFolders);
 
-    connect(FolderMan::instance(), SIGNAL(folderListChanged(Folder::Map)), _model, SLOT(resetFolders()));
-    connect(this, SIGNAL(folderChanged()), _model, SLOT(resetFolders()));
+    connect(FolderMan::instance(), &FolderMan::folderListChanged, _model, &FolderStatusModel::resetFolders);
+    connect(this, &AccountSettings::folderChanged, _model, &FolderStatusModel::resetFolders);
 
 
     QColor color = palette().highlight().color();
@@ -184,8 +184,8 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
     connect(_accountState, &AccountState::stateChanged, this, &AccountSettings::slotAccountStateChanged);
     slotAccountStateChanged();
 
-    connect(&_quotaInfo, SIGNAL(quotaUpdated(qint64, qint64)),
-        this, SLOT(slotUpdateQuota(qint64, qint64)));
+    connect(&_quotaInfo, &QuotaInfo::quotaUpdated,
+        this, &AccountSettings::slotUpdateQuota);
 }
 
 
@@ -194,15 +194,15 @@ void AccountSettings::createAccountToolbox()
     QMenu *menu = new QMenu();
     _addAccountAction = new QAction(tr("Add new"), this);
     menu->addAction(_addAccountAction);
-    connect(_addAccountAction, SIGNAL(triggered(bool)), SLOT(slotOpenAccountWizard()));
+    connect(_addAccountAction, &QAction::triggered, this, &AccountSettings::slotOpenAccountWizard);
 
     _toggleSignInOutAction = new QAction(tr("Log out"), this);
-    connect(_toggleSignInOutAction, SIGNAL(triggered(bool)), SLOT(slotToggleSignInState()));
+    connect(_toggleSignInOutAction, &QAction::triggered, this, &AccountSettings::slotToggleSignInState);
     menu->addAction(_toggleSignInOutAction);
 
     QAction *action = new QAction(tr("Remove"), this);
     menu->addAction(action);
-    connect(action, SIGNAL(triggered(bool)), SLOT(slotDeleteAccount()));
+    connect(action, &QAction::triggered, this, &AccountSettings::slotDeleteAccount);
 
     ui->_accountToolbox->setText(tr("Account") + QLatin1Char(' '));
     ui->_accountToolbox->setMenu(menu);
@@ -268,7 +268,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
         menu->setAttribute(Qt::WA_DeleteOnClose);
 
         QAction *ac = menu->addAction(tr("Open folder"));
-        connect(ac, SIGNAL(triggered(bool)), this, SLOT(slotOpenCurrentLocalSubFolder()));
+        connect(ac, &QAction::triggered, this, &AccountSettings::slotOpenCurrentLocalSubFolder);
 
         QString fileName = _model->data(index, FolderStatusDelegate::FolderPathRole).toString();
         if (!QFile::exists(fileName)) {
@@ -294,12 +294,12 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
     menu->setAttribute(Qt::WA_DeleteOnClose);
 
     QAction *ac = menu->addAction(tr("Open folder"));
-    connect(ac, SIGNAL(triggered(bool)), this, SLOT(slotOpenCurrentFolder()));
+    connect(ac, &QAction::triggered, this, &AccountSettings::slotOpenCurrentFolder);
 
     if (!ui->_folderList->isExpanded(index)) {
         ac = menu->addAction(tr("Choose what to sync"));
         ac->setEnabled(folderConnected);
-        connect(ac, SIGNAL(triggered(bool)), this, SLOT(doExpand()));
+        connect(ac, &QAction::triggered, this, &AccountSettings::doExpand);
     }
 
     if (!folderPaused) {
@@ -308,14 +308,14 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
             ac->setText(tr("Restart sync"));
         }
         ac->setEnabled(folderConnected);
-        connect(ac, SIGNAL(triggered(bool)), this, SLOT(slotForceSyncCurrentFolder()));
+        connect(ac, &QAction::triggered, this, &AccountSettings::slotForceSyncCurrentFolder);
     }
 
     ac = menu->addAction(folderPaused ? tr("Resume sync") : tr("Pause sync"));
-    connect(ac, SIGNAL(triggered(bool)), this, SLOT(slotEnableCurrentFolder()));
+    connect(ac, &QAction::triggered, this, &AccountSettings::slotEnableCurrentFolder);
 
     ac = menu->addAction(tr("Remove folder sync connection"));
-    connect(ac, SIGNAL(triggered(bool)), this, SLOT(slotRemoveCurrentFolder()));
+    connect(ac, &QAction::triggered, this, &AccountSettings::slotRemoveCurrentFolder);
     menu->exec(tv->mapToGlobal(pos));
 }
 
@@ -361,8 +361,8 @@ void AccountSettings::slotAddFolder()
 
     FolderWizard *folderWizard = new FolderWizard(_accountState->account(), this);
 
-    connect(folderWizard, SIGNAL(accepted()), SLOT(slotFolderWizardAccepted()));
-    connect(folderWizard, SIGNAL(rejected()), SLOT(slotFolderWizardRejected()));
+    connect(folderWizard, &QDialog::accepted, this, &AccountSettings::slotFolderWizardAccepted);
+    connect(folderWizard, &QDialog::rejected, this, &AccountSettings::slotFolderWizardRejected);
     folderWizard->open();
 }
 
index a13b8c2272b2372c2ec727502566efadb6fa0ca4..63ad888609c5ebc770ed83286a80808f0bfddd1c 100644 (file)
@@ -38,12 +38,12 @@ AccountState::AccountState(AccountPtr account)
 {
     qRegisterMetaType<AccountState *>("AccountState*");
 
-    connect(account.data(), SIGNAL(invalidCredentials()),
-        SLOT(slotInvalidCredentials()));
-    connect(account.data(), SIGNAL(credentialsFetched(AbstractCredentials *)),
-        SLOT(slotCredentialsFetched(AbstractCredentials *)));
-    connect(account.data(), SIGNAL(credentialsAsked(AbstractCredentials *)),
-        SLOT(slotCredentialsAsked(AbstractCredentials *)));
+    connect(account.data(), &Account::invalidCredentials,
+        this, &AccountState::slotInvalidCredentials);
+    connect(account.data(), &Account::credentialsFetched,
+        this, &AccountState::slotCredentialsFetched);
+    connect(account.data(), &Account::credentialsAsked,
+        this, &AccountState::slotCredentialsAsked);
     _timeSinceLastETagCheck.invalidate();
 }
 
@@ -242,7 +242,7 @@ void AccountState::slotConnectionValidatorResult(ConnectionValidator::Status sta
             qCInfo(lcAccountState) << "AccountState reconnection: delaying for"
                                    << _maintenanceToConnectedDelay << "ms";
             _timeSinceMaintenanceOver.start();
-            QTimer::singleShot(_maintenanceToConnectedDelay + 100, this, SLOT(checkConnectivity()));
+            QTimer::singleShot(_maintenanceToConnectedDelay + 100, this, &AccountState::checkConnectivity);
             return;
         } else if (_timeSinceMaintenanceOver.elapsed() < _maintenanceToConnectedDelay) {
             qCInfo(lcAccountState) << "AccountState reconnection: only"
index f03153483b2ce7dda65224b16dee1f94f5b5f454..d4a6f0eb5d7d586217d7957aaf7e74aa6c4e8c1c 100644 (file)
@@ -124,8 +124,8 @@ void ActivityListModel::startFetchJob(AccountState *s)
         return;
     }
     JsonApiJob *job = new JsonApiJob(s->account(), QLatin1String("ocs/v1.php/cloud/activity"), this);
-    QObject::connect(job, SIGNAL(jsonReceived(QJsonDocument, int)),
-        this, SLOT(slotActivitiesReceived(QJsonDocument, int)));
+    QObject::connect(job, &JsonApiJob::jsonReceived,
+        this, &ActivityListModel::slotActivitiesReceived);
     job->setProperty("AccountStatePtr", QVariant::fromValue<QPointer<AccountState>>(s));
 
     QList<QPair<QString, QString>> params;
index 3d1b9047a726b1940ff51250fe879fbcd62a6557..9091b80bc913de53a40644835fbe97352670f43c 100644 (file)
@@ -81,19 +81,19 @@ ActivityWidget::ActivityWidget(QWidget *parent)
 
     showLabels();
 
-    connect(_model, SIGNAL(activityJobStatusCode(AccountState *, int)),
-        this, SLOT(slotAccountActivityStatus(AccountState *, int)));
+    connect(_model, &ActivityListModel::activityJobStatusCode,
+        this, &ActivityWidget::slotAccountActivityStatus);
 
     _copyBtn = _ui->_dialogButtonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
     _copyBtn->setToolTip(tr("Copy the activity list to the clipboard."));
-    connect(_copyBtn, SIGNAL(clicked()), SIGNAL(copyToClipboard()));
+    connect(_copyBtn, &QAbstractButton::clicked, this, &ActivityWidget::copyToClipboard);
 
-    connect(_model, SIGNAL(rowsInserted(QModelIndex, int, int)), SIGNAL(rowsInserted()));
+    connect(_model, &QAbstractItemModel::rowsInserted, this, &ActivityWidget::rowsInserted);
 
     connect(_ui->_activityList, SIGNAL(activated(QModelIndex)), this,
         SLOT(slotOpenFile(QModelIndex)));
 
-    connect(&_removeTimer, SIGNAL(timeout()), this, SLOT(slotCheckToCleanWidgets()));
+    connect(&_removeTimer, &QTimer::timeout, this, &ActivityWidget::slotCheckToCleanWidgets);
     _removeTimer.setInterval(1000);
 }
 
@@ -260,10 +260,10 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList &list)
             widget = _widgetForNotifId[activity.ident()];
         } else {
             widget = new NotificationWidget(this);
-            connect(widget, SIGNAL(sendNotificationRequest(QString, QString, QByteArray)),
-                this, SLOT(slotSendNotificationRequest(QString, QString, QByteArray)));
-            connect(widget, SIGNAL(requestCleanupAndBlacklist(Activity)),
-                this, SLOT(slotRequestCleanupAndBlacklist(Activity)));
+            connect(widget, &NotificationWidget::sendNotificationRequest,
+                this, &ActivityWidget::slotSendNotificationRequest);
+            connect(widget, &NotificationWidget::requestCleanupAndBlacklist,
+                this, &ActivityWidget::slotRequestCleanupAndBlacklist);
 
             _notificationsLayout->addWidget(widget);
 // _ui->_notifyScroll->setMinimumHeight( widget->height());
@@ -386,8 +386,8 @@ void ActivityWidget::slotSendNotificationRequest(const QString &accountName, con
             QUrl l(link);
             job->setLinkAndVerb(l, verb);
             job->setWidget(theSender);
-            connect(job, SIGNAL(networkError(QNetworkReply *)),
-                this, SLOT(slotNotifyNetworkError(QNetworkReply *)));
+            connect(job, &AbstractNetworkJob::networkError,
+                this, &ActivityWidget::slotNotifyNetworkError);
             connect(job, SIGNAL(jobFinished(QString, int)),
                 this, SLOT(slotNotifyServerFinished(QString, int)));
             job->start();
@@ -515,32 +515,32 @@ ActivitySettings::ActivitySettings(QWidget *parent)
     hbox->addWidget(_tab);
     _activityWidget = new ActivityWidget(this);
     _activityTabId = _tab->addTab(_activityWidget, Theme::instance()->applicationIcon(), tr("Server Activity"));
-    connect(_activityWidget, SIGNAL(copyToClipboard()), this, SLOT(slotCopyToClipboard()));
-    connect(_activityWidget, SIGNAL(hideActivityTab(bool)), this, SLOT(setActivityTabHidden(bool)));
-    connect(_activityWidget, SIGNAL(guiLog(QString, QString)), this, SIGNAL(guiLog(QString, QString)));
-    connect(_activityWidget, SIGNAL(newNotification()), SLOT(slotShowActivityTab()));
+    connect(_activityWidget, &ActivityWidget::copyToClipboard, this, &ActivitySettings::slotCopyToClipboard);
+    connect(_activityWidget, &ActivityWidget::hideActivityTab, this, &ActivitySettings::setActivityTabHidden);
+    connect(_activityWidget, &ActivityWidget::guiLog, this, &ActivitySettings::guiLog);
+    connect(_activityWidget, &ActivityWidget::newNotification, this, &ActivitySettings::slotShowActivityTab);
 
     _protocolWidget = new ProtocolWidget(this);
     _protocolTabId = _tab->addTab(_protocolWidget, Theme::instance()->syncStateIcon(SyncResult::Success), tr("Sync Protocol"));
-    connect(_protocolWidget, SIGNAL(copyToClipboard()), this, SLOT(slotCopyToClipboard()));
+    connect(_protocolWidget, &ProtocolWidget::copyToClipboard, this, &ActivitySettings::slotCopyToClipboard);
 
     _issuesWidget = new IssuesWidget(this);
     _syncIssueTabId = _tab->addTab(_issuesWidget, Theme::instance()->syncStateIcon(SyncResult::Problem), QString());
     slotShowIssueItemCount(0); // to display the label.
-    connect(_issuesWidget, SIGNAL(issueCountUpdated(int)),
-        this, SLOT(slotShowIssueItemCount(int)));
-    connect(_issuesWidget, SIGNAL(copyToClipboard()),
-        this, SLOT(slotCopyToClipboard()));
+    connect(_issuesWidget, &IssuesWidget::issueCountUpdated,
+        this, &ActivitySettings::slotShowIssueItemCount);
+    connect(_issuesWidget, &IssuesWidget::copyToClipboard,
+        this, &ActivitySettings::slotCopyToClipboard);
 
     // Add a progress indicator to spin if the acitivity list is updated.
     _progressIndicator = new QProgressIndicator(this);
     _tab->setCornerWidget(_progressIndicator);
 
-    connect(&_notificationCheckTimer, SIGNAL(timeout()),
-        this, SLOT(slotRegularNotificationCheck()));
+    connect(&_notificationCheckTimer, &QTimer::timeout,
+        this, &ActivitySettings::slotRegularNotificationCheck);
 
     // connect a model signal to stop the animation.
-    connect(_activityWidget, SIGNAL(rowsInserted()), _progressIndicator, SLOT(stopAnimation()));
+    connect(_activityWidget, &ActivityWidget::rowsInserted, _progressIndicator, &QProgressIndicator::stopAnimation);
 
     // We want the protocol be the default
     _tab->setCurrentIndex(1);
index c3521a9b648b9d3f68ee7690b72bdb7a395cff9b..73f79d0b93b7a0781a357f1d35050eba6dc84f1d 100644 (file)
@@ -150,7 +150,7 @@ Application::Application(int &argc, char **argv)
 
     _folderManager.reset(new FolderMan);
 
-    connect(this, SIGNAL(messageReceived(QString, QObject *)), SLOT(slotParseMessage(QString, QObject *)));
+    connect(this, &SharedTools::QtSingleApplication::messageReceived, this, &Application::slotParseMessage);
 
     if (!AccountManager::instance()->restore()) {
         // If there is an error reading the account settings, try again
@@ -176,7 +176,7 @@ Application::Application(int &argc, char **argv)
     setQuitOnLastWindowClosed(false);
 
     _theme->setSystrayUseMonoIcons(cfg.monoIcons());
-    connect(_theme, SIGNAL(systrayUseMonoIconsChanged(bool)), SLOT(slotUseMonoIconsChanged(bool)));
+    connect(_theme, &Theme::systrayUseMonoIconsChanged, this, &Application::slotUseMonoIconsChanged);
 
     FolderMan::instance()->setupFolders();
     _proxy.setupQtProxyFromConfig(); // folders have to be defined first, than we set up the Qt proxy.
@@ -189,23 +189,23 @@ Application::Application(int &argc, char **argv)
     // Enable word wrapping of QInputDialog (#4197)
     setStyleSheet("QInputDialog QLabel { qproperty-wordWrap:1; }");
 
-    connect(AccountManager::instance(), SIGNAL(accountAdded(AccountState *)),
-        SLOT(slotAccountStateAdded(AccountState *)));
-    connect(AccountManager::instance(), SIGNAL(accountRemoved(AccountState *)),
-        SLOT(slotAccountStateRemoved(AccountState *)));
+    connect(AccountManager::instance(), &AccountManager::accountAdded,
+        this, &Application::slotAccountStateAdded);
+    connect(AccountManager::instance(), &AccountManager::accountRemoved,
+        this, &Application::slotAccountStateRemoved);
     foreach (auto ai, AccountManager::instance()->accounts()) {
         slotAccountStateAdded(ai.data());
     }
 
-    connect(FolderMan::instance()->socketApi(), SIGNAL(shareCommandReceived(QString, QString)),
-        _gui, SLOT(slotShowShareDialog(QString, QString)));
+    connect(FolderMan::instance()->socketApi(), &SocketApi::shareCommandReceived,
+        _gui.data(), &ownCloudGui::slotShowShareDialog);
 
     // startup procedure.
-    connect(&_checkConnectionTimer, SIGNAL(timeout()), this, SLOT(slotCheckConnection()));
+    connect(&_checkConnectionTimer, &QTimer::timeout, this, &Application::slotCheckConnection);
     _checkConnectionTimer.setInterval(ConnectionValidator::DefaultCallingIntervalMsec); // check for connection every 32 seconds.
     _checkConnectionTimer.start();
     // Also check immediately
-    QTimer::singleShot(0, this, SLOT(slotCheckConnection()));
+    QTimer::singleShot(0, this, &Application::slotCheckConnection);
 
     // Can't use onlineStateChanged because it is always true on modern systems because of many interfaces
     connect(&_networkConfigurationManager, SIGNAL(configurationChanged(QNetworkConfiguration)),
@@ -213,13 +213,13 @@ Application::Application(int &argc, char **argv)
 
     // Update checks
     UpdaterScheduler *updaterScheduler = new UpdaterScheduler(this);
-    connect(updaterScheduler, SIGNAL(updaterAnnouncement(QString, QString)),
-        _gui, SLOT(slotShowTrayMessage(QString, QString)));
-    connect(updaterScheduler, SIGNAL(requestRestart()),
-        _folderManager.data(), SLOT(slotScheduleAppRestart()));
+    connect(updaterScheduler, &UpdaterScheduler::updaterAnnouncement,
+        _gui.data(), &ownCloudGui::slotShowTrayMessage);
+    connect(updaterScheduler, &UpdaterScheduler::requestRestart,
+        _folderManager.data(), &FolderMan::slotScheduleAppRestart);
 
     // Cleanup at Quit.
-    connect(this, SIGNAL(aboutToQuit()), SLOT(slotCleanup()));
+    connect(this, &QCoreApplication::aboutToQuit, this, &Application::slotCleanup);
 }
 
 Application::~Application()
@@ -237,16 +237,16 @@ Application::~Application()
 void Application::slotAccountStateRemoved(AccountState *accountState)
 {
     if (_gui) {
-        disconnect(accountState, SIGNAL(stateChanged(int)),
-            _gui, SLOT(slotAccountStateChanged()));
-        disconnect(accountState->account().data(), SIGNAL(serverVersionChanged(Account *, QString, QString)),
-            _gui, SLOT(slotTrayMessageIfServerUnsupported(Account *)));
+        disconnect(accountState, &AccountState::stateChanged,
+            _gui.data(), &ownCloudGui::slotAccountStateChanged);
+        disconnect(accountState->account().data(), &Account::serverVersionChanged,
+            _gui.data(), &ownCloudGui::slotTrayMessageIfServerUnsupported);
     }
     if (_folderManager) {
-        disconnect(accountState, SIGNAL(stateChanged(int)),
-            _folderManager.data(), SLOT(slotAccountStateChanged()));
-        disconnect(accountState->account().data(), SIGNAL(serverVersionChanged(Account *, QString, QString)),
-            _folderManager.data(), SLOT(slotServerVersionChanged(Account *)));
+        disconnect(accountState, &AccountState::stateChanged,
+            _folderManager.data(), &FolderMan::slotAccountStateChanged);
+        disconnect(accountState->account().data(), &Account::serverVersionChanged,
+            _folderManager.data(), &FolderMan::slotServerVersionChanged);
     }
 
     // if there is no more account, show the wizard.
@@ -259,14 +259,14 @@ void Application::slotAccountStateRemoved(AccountState *accountState)
 
 void Application::slotAccountStateAdded(AccountState *accountState)
 {
-    connect(accountState, SIGNAL(stateChanged(int)),
-        _gui, SLOT(slotAccountStateChanged()));
-    connect(accountState->account().data(), SIGNAL(serverVersionChanged(Account *, QString, QString)),
-        _gui, SLOT(slotTrayMessageIfServerUnsupported(Account *)));
-    connect(accountState, SIGNAL(stateChanged(int)),
-        _folderManager.data(), SLOT(slotAccountStateChanged()));
-    connect(accountState->account().data(), SIGNAL(serverVersionChanged(Account *, QString, QString)),
-        _folderManager.data(), SLOT(slotServerVersionChanged(Account *)));
+    connect(accountState, &AccountState::stateChanged,
+        _gui.data(), &ownCloudGui::slotAccountStateChanged);
+    connect(accountState->account().data(), &Account::serverVersionChanged,
+        _gui.data(), &ownCloudGui::slotTrayMessageIfServerUnsupported);
+    connect(accountState, &AccountState::stateChanged,
+        _folderManager.data(), &FolderMan::slotAccountStateChanged);
+    connect(accountState->account().data(), &Account::serverVersionChanged,
+        _folderManager.data(), &FolderMan::slotServerVersionChanged);
 
     _gui->slotTrayMessageIfServerUnsupported(accountState->account().data());
 }
index bae0bcd134a31f1529c5ad50c0a38480b62ca3cc..80fea6321c140157cf990c6d10abc7ee0b3cac9c 100644 (file)
@@ -40,8 +40,8 @@ AuthenticationDialog::AuthenticationDialog(const QString &realm, const QString &
     _password->setEchoMode(QLineEdit::Password);
 
     QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
-    connect(box, SIGNAL(accepted()), this, SLOT(accept()));
-    connect(box, SIGNAL(rejected()), this, SLOT(reject()));
+    connect(box, &QDialogButtonBox::accepted, this, &QDialog::accept);
+    connect(box, &QDialogButtonBox::rejected, this, &QDialog::reject);
     lay->addWidget(box);
 }
 
index 743643692974f876463a861b41f75c654132599a..24c164b26b5c0e6c85bed42149a24cbe92400b2b 100644 (file)
@@ -27,7 +27,7 @@ ShibbolethUserJob::ShibbolethUserJob(AccountPtr account, QObject *parent)
     : JsonApiJob(account, QLatin1String("ocs/v1.php/cloud/user"), parent)
 {
     setIgnoreCredentialFailure(true);
-    connect(this, SIGNAL(jsonReceived(QJsonDocument, int)), this, SLOT(slotJsonReceived(QJsonDocument, int)));
+    connect(this, &JsonApiJob::jsonReceived, this, &ShibbolethUserJob::slotJsonReceived);
 }
 
 void ShibbolethUserJob::slotJsonReceived(const QJsonDocument &json, int statusCode)
index 64a1f7c3548a7256e26949acc6d3e052d8f21f85..dbcd340b622609600e7822b030b7296b7b91fb80 100644 (file)
@@ -63,10 +63,10 @@ ShibbolethWebView::ShibbolethWebView(AccountPtr account, QWidget *parent)
     setAttribute(Qt::WA_DeleteOnClose);
 
     QWebPage *page = new UserAgentWebPage(this);
-    connect(page, SIGNAL(loadStarted()),
-        this, SLOT(slotLoadStarted()));
-    connect(page, SIGNAL(loadFinished(bool)),
-        this, SLOT(slotLoadFinished(bool)));
+    connect(page, &QWebPage::loadStarted,
+        this, &ShibbolethWebView::slotLoadStarted);
+    connect(page, &QWebPage::loadFinished,
+        this, &ShibbolethWebView::slotLoadFinished);
 
     // Make sure to accept the same SSL certificate issues as the regular QNAM we use for syncing
     QObject::connect(page->networkAccessManager(), SIGNAL(sslErrors(QNetworkReply *, QList<QSslError>)),
index 6f5641b35908cdb6b85e0a8910debac9dc380b52..32b30083364adea4ab172bd59f9940a714c1971f 100644 (file)
@@ -79,7 +79,7 @@ void ShibbolethCredentials::setAccount(Account *account)
     // When constructed with a cookie (by the wizard), we usually don't know the
     // user name yet. Request it now from the server.
     if (_ready && _user.isEmpty()) {
-        QTimer::singleShot(1234, this, SLOT(slotFetchUser()));
+        QTimer::singleShot(1234, this, &ShibbolethCredentials::slotFetchUser);
     }
 }
 
@@ -96,8 +96,8 @@ QString ShibbolethCredentials::user() const
 QNetworkAccessManager *ShibbolethCredentials::createQNAM() const
 {
     QNetworkAccessManager *qnam(new AccessManager);
-    connect(qnam, SIGNAL(finished(QNetworkReply *)),
-        this, SLOT(slotReplyFinished(QNetworkReply *)));
+    connect(qnam, &QNetworkAccessManager::finished,
+        this, &ShibbolethCredentials::slotReplyFinished);
     return qnam;
 }
 
@@ -145,7 +145,7 @@ void ShibbolethCredentials::fetchFromKeychainHelper()
     job->setInsecureFallback(false);
     job->setKey(keychainKey(_url.toString(), user(),
         _keychainMigration ? QString() : _account->id()));
-    connect(job, SIGNAL(finished(QKeychain::Job *)), SLOT(slotReadJobDone(QKeychain::Job *)));
+    connect(job, &Job::finished, this, &ShibbolethCredentials::slotReadJobDone);
     job->start();
 }
 
@@ -210,7 +210,7 @@ void ShibbolethCredentials::slotFetchUser()
     // We must first do a request to webdav so the session is enabled.
     // (because for some reason we can't access the API without that..  a bug in the server maybe?)
     EntityExistsJob *job = new EntityExistsJob(_account->sharedFromThis(), _account->davPath(), this);
-    connect(job, SIGNAL(exists(QNetworkReply *)), this, SLOT(slotFetchUserHelper()));
+    connect(job, &EntityExistsJob::exists, this, &ShibbolethCredentials::slotFetchUserHelper);
     job->setIgnoreCredentialFailure(true);
     job->start();
 }
@@ -218,7 +218,7 @@ void ShibbolethCredentials::slotFetchUser()
 void ShibbolethCredentials::slotFetchUserHelper()
 {
     ShibbolethUserJob *job = new ShibbolethUserJob(_account->sharedFromThis(), this);
-    connect(job, SIGNAL(userFetched(QString)), this, SLOT(slotUserFetched(QString)));
+    connect(job, &ShibbolethUserJob::userFetched, this, &ShibbolethCredentials::slotUserFetched);
     job->start();
 }
 
@@ -308,9 +308,9 @@ void ShibbolethCredentials::showLoginWindow()
     jar->clearSessionCookies();
 
     _browser = new ShibbolethWebView(_account->sharedFromThis());
-    connect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie)),
-        this, SLOT(onShibbolethCookieReceived(QNetworkCookie)), Qt::QueuedConnection);
-    connect(_browser, SIGNAL(rejected()), this, SLOT(slotBrowserRejected()));
+    connect(_browser.data(), &ShibbolethWebView::shibbolethCookieReceived,
+        this, &ShibbolethCredentials::onShibbolethCookieReceived, Qt::QueuedConnection);
+    connect(_browser.data(), &ShibbolethWebView::rejected, this, &ShibbolethCredentials::slotBrowserRejected);
 
     ownCloudGui::raiseDialog(_browser);
 }
index 864c496bf3c24c1131e714b0a5f34c757942e019..a6e6e3171174a1f00d1b3cd74eb603fa65c79e5a 100644 (file)
@@ -82,32 +82,32 @@ Folder::Folder(const FolderDefinition &definition,
     if (!setIgnoredFiles())
         qCWarning(lcFolder, "Could not read system exclude file");
 
-    connect(_accountState.data(), SIGNAL(isConnectedChanged()), this, SIGNAL(canSyncChanged()));
-    connect(_engine.data(), SIGNAL(rootEtag(QString)), this, SLOT(etagRetreivedFromSyncEngine(QString)));
+    connect(_accountState.data(), &AccountState::isConnectedChanged, this, &Folder::canSyncChanged);
+    connect(_engine.data(), &SyncEngine::rootEtag, this, &Folder::etagRetreivedFromSyncEngine);
 
-    connect(_engine.data(), SIGNAL(started()), SLOT(slotSyncStarted()), Qt::QueuedConnection);
-    connect(_engine.data(), SIGNAL(finished(bool)), SLOT(slotSyncFinished(bool)), Qt::QueuedConnection);
-    connect(_engine.data(), SIGNAL(csyncUnavailable()), SLOT(slotCsyncUnavailable()), Qt::QueuedConnection);
+    connect(_engine.data(), &SyncEngine::started, this, &Folder::slotSyncStarted, Qt::QueuedConnection);
+    connect(_engine.data(), &SyncEngine::finished, this, &Folder::slotSyncFinished, Qt::QueuedConnection);
+    connect(_engine.data(), &SyncEngine::csyncUnavailable, this, &Folder::slotCsyncUnavailable, Qt::QueuedConnection);
 
     //direct connection so the message box is blocking the sync.
-    connect(_engine.data(), SIGNAL(aboutToRemoveAllFiles(SyncFileItem::Direction, bool *)),
-        SLOT(slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool *)));
-    connect(_engine.data(), SIGNAL(aboutToRestoreBackup(bool *)),
-        SLOT(slotAboutToRestoreBackup(bool *)));
-    connect(_engine.data(), SIGNAL(transmissionProgress(ProgressInfo)), this, SLOT(slotTransmissionProgress(ProgressInfo)));
-    connect(_engine.data(), SIGNAL(itemCompleted(const SyncFileItemPtr &)),
-        this, SLOT(slotItemCompleted(const SyncFileItemPtr &)));
-    connect(_engine.data(), SIGNAL(newBigFolder(QString, bool)),
-        this, SLOT(slotNewBigFolderDiscovered(QString, bool)));
-    connect(_engine.data(), SIGNAL(seenLockedFile(QString)), FolderMan::instance(), SLOT(slotSyncOnceFileUnlocks(QString)));
-    connect(_engine.data(), SIGNAL(aboutToPropagate(SyncFileItemVector &)),
-        SLOT(slotLogPropagationStart()));
+    connect(_engine.data(), &SyncEngine::aboutToRemoveAllFiles,
+        this, &Folder::slotAboutToRemoveAllFiles);
+    connect(_engine.data(), &SyncEngine::aboutToRestoreBackup,
+        this, &Folder::slotAboutToRestoreBackup);
+    connect(_engine.data(), &SyncEngine::transmissionProgress, this, &Folder::slotTransmissionProgress);
+    connect(_engine.data(), &SyncEngine::itemCompleted,
+        this, &Folder::slotItemCompleted);
+    connect(_engine.data(), &SyncEngine::newBigFolder,
+        this, &Folder::slotNewBigFolderDiscovered);
+    connect(_engine.data(), &SyncEngine::seenLockedFile, FolderMan::instance(), &FolderMan::slotSyncOnceFileUnlocks);
+    connect(_engine.data(), &SyncEngine::aboutToPropagate,
+        this, &Folder::slotLogPropagationStart);
     connect(_engine.data(), &SyncEngine::syncError, this, &Folder::slotSyncError);
 
     _scheduleSelfTimer.setSingleShot(true);
     _scheduleSelfTimer.setInterval(SyncEngine::minimumFileAgeForUpload);
-    connect(&_scheduleSelfTimer, SIGNAL(timeout()),
-        SLOT(slotScheduleThisFolder()));
+    connect(&_scheduleSelfTimer, &QTimer::timeout,
+        this, &Folder::slotScheduleThisFolder);
 }
 
 Folder::~Folder()
@@ -288,7 +288,7 @@ void Folder::slotRunEtagJob()
     _requestEtagJob = new RequestEtagJob(account, remotePath(), this);
     _requestEtagJob->setTimeout(60 * 1000);
     // check if the etag is different when retrieved
-    QObject::connect(_requestEtagJob, SIGNAL(etagRetreived(QString)), this, SLOT(etagRetreived(QString)));
+    QObject::connect(_requestEtagJob.data(), &RequestEtagJob::etagRetreived, this, &Folder::etagRetreived);
     FolderMan::instance()->slotScheduleETagJob(alias(), _requestEtagJob);
     // The _requestEtagJob is auto deleting itself on finish. Our guard pointer _requestEtagJob will then be null.
 }
@@ -789,7 +789,7 @@ void Folder::slotSyncFinished(bool success)
     // file system change notifications are ignored for that folder. And it takes
     // some time under certain conditions to make the file system notifications
     // all come in.
-    QTimer::singleShot(200, this, SLOT(slotEmitFinishedDelayed()));
+    QTimer::singleShot(200, this, &Folder::slotEmitFinishedDelayed);
 
     _lastSyncDuration = _timeSinceLastSyncStart.elapsed();
     _timeSinceLastSyncDone.start();
index 475eb4f1a432c6e7d8defb4e480786297cd6e67a..6418cd70b1aa4e182763297d09726b0762613abf 100644 (file)
@@ -60,24 +60,24 @@ FolderMan::FolderMan(QObject *parent)
     int polltime = cfg.remotePollInterval();
     qCInfo(lcFolderMan) << "setting remote poll timer interval to" << polltime << "msec";
     _etagPollTimer.setInterval(polltime);
-    QObject::connect(&_etagPollTimer, SIGNAL(timeout()), this, SLOT(slotEtagPollTimerTimeout()));
+    QObject::connect(&_etagPollTimer, &QTimer::timeout, this, &FolderMan::slotEtagPollTimerTimeout);
     _etagPollTimer.start();
 
     _startScheduledSyncTimer.setSingleShot(true);
-    connect(&_startScheduledSyncTimer, SIGNAL(timeout()),
-        SLOT(slotStartScheduledFolderSync()));
+    connect(&_startScheduledSyncTimer, &QTimer::timeout,
+        this, &FolderMan::slotStartScheduledFolderSync);
 
     _timeScheduler.setInterval(5000);
     _timeScheduler.setSingleShot(false);
-    connect(&_timeScheduler, SIGNAL(timeout()),
-        SLOT(slotScheduleFolderByTime()));
+    connect(&_timeScheduler, &QTimer::timeout,
+        this, &FolderMan::slotScheduleFolderByTime);
     _timeScheduler.start();
 
-    connect(AccountManager::instance(), SIGNAL(accountRemoved(AccountState *)),
-        SLOT(slotRemoveFoldersForAccount(AccountState *)));
+    connect(AccountManager::instance(), &AccountManager::accountRemoved,
+        this, &FolderMan::slotRemoveFoldersForAccount);
 
-    connect(_lockWatcher.data(), SIGNAL(fileUnlocked(QString)),
-        SLOT(slotWatchedFileUnlocked(QString)));
+    connect(_lockWatcher.data(), &LockWatcher::fileUnlocked,
+        this, &FolderMan::slotWatchedFileUnlocked);
 }
 
 FolderMan *FolderMan::instance()
@@ -109,18 +109,18 @@ void FolderMan::unloadFolder(Folder *f)
     }
     _folderMap.remove(f->alias());
 
-    disconnect(f, SIGNAL(syncStarted()),
-        this, SLOT(slotFolderSyncStarted()));
-    disconnect(f, SIGNAL(syncFinished(SyncResult)),
-        this, SLOT(slotFolderSyncFinished(SyncResult)));
-    disconnect(f, SIGNAL(syncStateChange()),
-        this, SLOT(slotForwardFolderSyncStateChange()));
-    disconnect(f, SIGNAL(syncPausedChanged(Folder *, bool)),
-        this, SLOT(slotFolderSyncPaused(Folder *, bool)));
+    disconnect(f, &Folder::syncStarted,
+        this, &FolderMan::slotFolderSyncStarted);
+    disconnect(f, &Folder::syncFinished,
+        this, &FolderMan::slotFolderSyncFinished);
+    disconnect(f, &Folder::syncStateChange,
+        this, &FolderMan::slotForwardFolderSyncStateChange);
+    disconnect(f, &Folder::syncPausedChanged,
+        this, &FolderMan::slotFolderSyncPaused);
     disconnect(&f->syncEngine().syncFileStatusTracker(), SIGNAL(fileStatusChanged(const QString &, SyncFileStatus)),
         _socketApi.data(), SLOT(broadcastStatusPushMessage(const QString &, SyncFileStatus)));
-    disconnect(f, SIGNAL(watchedFileChangedExternally(QString)),
-        &f->syncEngine().syncFileStatusTracker(), SLOT(slotPathTouched(QString)));
+    disconnect(f, &Folder::watchedFileChangedExternally,
+        &f->syncEngine().syncFileStatusTracker(), &SyncFileStatusTracker::slotPathTouched);
 }
 
 int FolderMan::unloadAndDeleteAllFolders()
@@ -163,7 +163,7 @@ void FolderMan::registerFolderMonitor(Folder *folder)
         // Connect the pathChanged signal, which comes with the changed path,
         // to the signal mapper which maps to the folder alias. The changed path
         // is lost this way, but we do not need it for the current implementation.
-        connect(fw, SIGNAL(pathChanged(QString)), folder, SLOT(slotWatchedPathChanged(QString)));
+        connect(fw, &FolderWatcher::pathChanged, folder, &Folder::slotWatchedPathChanged);
 
         _folderWatchers.insert(folder->alias(), fw);
     }
@@ -584,7 +584,7 @@ void FolderMan::scheduleFolderNext(Folder *f)
 
 void FolderMan::slotScheduleETagJob(const QString & /*alias*/, RequestEtagJob *job)
 {
-    QObject::connect(job, SIGNAL(destroyed(QObject *)), this, SLOT(slotEtagJobDestroyed(QObject *)));
+    QObject::connect(job, &QObject::destroyed, this, &FolderMan::slotEtagJobDestroyed);
     QMetaObject::invokeMethod(this, "slotRunOneEtagJob", Qt::QueuedConnection);
     // maybe: add to queue
 }
@@ -954,15 +954,15 @@ Folder *FolderMan::addFolderInternal(FolderDefinition folderDefinition,
     }
 
     // See matching disconnects in unloadFolder().
-    connect(folder, SIGNAL(syncStarted()), SLOT(slotFolderSyncStarted()));
-    connect(folder, SIGNAL(syncFinished(SyncResult)), SLOT(slotFolderSyncFinished(SyncResult)));
-    connect(folder, SIGNAL(syncStateChange()), SLOT(slotForwardFolderSyncStateChange()));
-    connect(folder, SIGNAL(syncPausedChanged(Folder *, bool)), SLOT(slotFolderSyncPaused(Folder *, bool)));
-    connect(folder, SIGNAL(canSyncChanged()), SLOT(slotFolderCanSyncChanged()));
+    connect(folder, &Folder::syncStarted, this, &FolderMan::slotFolderSyncStarted);
+    connect(folder, &Folder::syncFinished, this, &FolderMan::slotFolderSyncFinished);
+    connect(folder, &Folder::syncStateChange, this, &FolderMan::slotForwardFolderSyncStateChange);
+    connect(folder, &Folder::syncPausedChanged, this, &FolderMan::slotFolderSyncPaused);
+    connect(folder, &Folder::canSyncChanged, this, &FolderMan::slotFolderCanSyncChanged);
     connect(&folder->syncEngine().syncFileStatusTracker(), SIGNAL(fileStatusChanged(const QString &, SyncFileStatus)),
         _socketApi.data(), SLOT(broadcastStatusPushMessage(const QString &, SyncFileStatus)));
-    connect(folder, SIGNAL(watchedFileChangedExternally(QString)),
-        &folder->syncEngine().syncFileStatusTracker(), SLOT(slotPathTouched(QString)));
+    connect(folder, &Folder::watchedFileChangedExternally,
+        &folder->syncEngine().syncFileStatusTracker(), &SyncFileStatusTracker::slotPathTouched);
 
     registerFolderMonitor(folder);
     return folder;
@@ -1032,10 +1032,10 @@ void FolderMan::removeFolder(Folder *f)
     unloadFolder(f);
     if (currentlyRunning) {
         // We want to schedule the next folder once this is done
-        connect(f, SIGNAL(syncFinished(SyncResult)),
-            SLOT(slotFolderSyncFinished(SyncResult)));
+        connect(f, &Folder::syncFinished,
+            this, &FolderMan::slotFolderSyncFinished);
         // Let the folder delete itself when done.
-        connect(f, SIGNAL(syncFinished(SyncResult)), f, SLOT(deleteLater()));
+        connect(f, &Folder::syncFinished, f, &QObject::deleteLater);
     } else {
         delete f;
     }
index d0c48eddcb4487aa0cf7d21b4b2cdf02ba7430dc..0c593ebdb5b07d9959445fc531f6d32085829c91 100644 (file)
@@ -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)
index 5d2d4e7fd451ea049a765683ec6745a3c47df371..f0e0eb0e48d341e62c0ba4ce49f1cc8257342705 100644 (file)
@@ -34,7 +34,7 @@ FolderWatcherPrivate::FolderWatcherPrivate(FolderWatcher *p, const QString &path
     _fd = inotify_init();
     if (_fd != -1) {
         _socket.reset(new QSocketNotifier(_fd, QSocketNotifier::Read));
-        connect(_socket.data(), SIGNAL(activated(int)), SLOT(slotReceivedNotification(int)));
+        connect(_socket.data(), &QSocketNotifier::activated, this, &FolderWatcherPrivate::slotReceivedNotification);
     } else {
         qCWarning(lcFolderWatcher) << "notify_init() failed: " << strerror(errno);
     }
index 9c0128f5950d2e5aa2017ea2dcd8d50789856313..2a244badd65deb12db0ad4f3c4075a3e5e670ed0 100644 (file)
@@ -62,7 +62,7 @@ FolderWizardLocalPath::FolderWizardLocalPath(const AccountPtr &account)
 {
     _ui.setupUi(this);
     registerField(QLatin1String("sourceFolder*"), _ui.localFolderLineEdit);
-    connect(_ui.localFolderChooseBtn, SIGNAL(clicked()), this, SLOT(slotChooseLocalFolder()));
+    connect(_ui.localFolderChooseBtn, &QAbstractButton::clicked, this, &FolderWizardLocalPath::slotChooseLocalFolder);
     _ui.localFolderChooseBtn->setToolTip(tr("Click to select a local folder to sync."));
 
     QString defaultPath = QDir::homePath() + QLatin1Char('/') + Theme::instance()->appName();
@@ -151,15 +151,15 @@ FolderWizardRemotePath::FolderWizardRemotePath(const AccountPtr &account)
     _ui.folderTreeWidget->setSortingEnabled(true);
     _ui.folderTreeWidget->sortByColumn(0, Qt::AscendingOrder);
 
-    connect(_ui.addFolderButton, SIGNAL(clicked()), SLOT(slotAddRemoteFolder()));
-    connect(_ui.refreshButton, SIGNAL(clicked()), SLOT(slotRefreshFolders()));
-    connect(_ui.folderTreeWidget, SIGNAL(itemExpanded(QTreeWidgetItem *)), SLOT(slotItemExpanded(QTreeWidgetItem *)));
-    connect(_ui.folderTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), SLOT(slotCurrentItemChanged(QTreeWidgetItem *)));
-    connect(_ui.folderEntry, SIGNAL(textEdited(QString)), SLOT(slotFolderEntryEdited(QString)));
+    connect(_ui.addFolderButton, &QAbstractButton::clicked, this, &FolderWizardRemotePath::slotAddRemoteFolder);
+    connect(_ui.refreshButton, &QAbstractButton::clicked, this, &FolderWizardRemotePath::slotRefreshFolders);
+    connect(_ui.folderTreeWidget, &QTreeWidget::itemExpanded, this, &FolderWizardRemotePath::slotItemExpanded);
+    connect(_ui.folderTreeWidget, &QTreeWidget::currentItemChanged, this, &FolderWizardRemotePath::slotCurrentItemChanged);
+    connect(_ui.folderEntry, &QLineEdit::textEdited, this, &FolderWizardRemotePath::slotFolderEntryEdited);
 
     _lscolTimer.setInterval(500);
     _lscolTimer.setSingleShot(true);
-    connect(&_lscolTimer, SIGNAL(timeout()), SLOT(slotLsColFolderEntry()));
+    connect(&_lscolTimer, &QTimer::timeout, this, &FolderWizardRemotePath::slotLsColFolderEntry);
 
     _ui.folderTreeWidget->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
     // Make sure that there will be a scrollbar when the contents is too wide
@@ -200,7 +200,7 @@ void FolderWizardRemotePath::slotCreateRemoteFolder(const QString &folder)
     /* check the owncloud configuration file and query the ownCloud */
     connect(job, SIGNAL(finished(QNetworkReply::NetworkError)),
         SLOT(slotCreateRemoteFolderFinished(QNetworkReply::NetworkError)));
-    connect(job, SIGNAL(networkError(QNetworkReply *)), SLOT(slotHandleMkdirNetworkError(QNetworkReply *)));
+    connect(job, &AbstractNetworkJob::networkError, this, &FolderWizardRemotePath::slotHandleMkdirNetworkError);
     job->start();
 }
 
@@ -373,10 +373,10 @@ void FolderWizardRemotePath::slotLsColFolderEntry()
     // No error handling, no updating, we do this manually
     // because of extra logic in the typed-path case.
     disconnect(job, 0, this, 0);
-    connect(job, SIGNAL(finishedWithError(QNetworkReply *)),
-        SLOT(slotTypedPathError(QNetworkReply *)));
-    connect(job, SIGNAL(directoryListingSubfolders(QStringList)),
-        SLOT(slotTypedPathFound(QStringList)));
+    connect(job, &LsColJob::finishedWithError,
+        this, &FolderWizardRemotePath::slotTypedPathError);
+    connect(job, &LsColJob::directoryListingSubfolders,
+        this, &FolderWizardRemotePath::slotTypedPathFound);
 }
 
 void FolderWizardRemotePath::slotTypedPathFound(const QStringList &subpaths)
@@ -404,10 +404,10 @@ LsColJob *FolderWizardRemotePath::runLsColJob(const QString &path)
 {
     LsColJob *job = new LsColJob(_account, path, this);
     job->setProperties(QList<QByteArray>() << "resourcetype");
-    connect(job, SIGNAL(directoryListingSubfolders(QStringList)),
-        SLOT(slotUpdateDirectories(QStringList)));
-    connect(job, SIGNAL(finishedWithError(QNetworkReply *)),
-        SLOT(slotHandleLsColNetworkError(QNetworkReply *)));
+    connect(job, &LsColJob::directoryListingSubfolders,
+        this, &FolderWizardRemotePath::slotUpdateDirectories);
+    connect(job, &LsColJob::finishedWithError,
+        this, &FolderWizardRemotePath::slotHandleLsColNetworkError);
     job->start();
 
     return job;
index d298b6caebb8ab54f46f4cc2a411d0fd1d25a3fb..5a035c4c2fcec3cf43b741f0dd700125e7d200f7 100644 (file)
@@ -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);
index 3253b2b1e5a0f3ad04cbde4ae5fc9ffe57f1af13..a71a9cde89cfab222074dbf59b408e6b6541d4a5 100644 (file)
@@ -54,11 +54,11 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent)
     readIgnoreFile(cfgFile.excludeFile(ConfigFile::SystemScope), true);
     readIgnoreFile(cfgFile.excludeFile(ConfigFile::UserScope), false);
 
-    connect(this, SIGNAL(accepted()), SLOT(slotUpdateLocalIgnoreList()));
+    connect(this, &QDialog::accepted, this, &IgnoreListEditor::slotUpdateLocalIgnoreList);
     ui->removePushButton->setEnabled(false);
-    connect(ui->tableWidget, SIGNAL(itemSelectionChanged()), SLOT(slotItemSelectionChanged()));
-    connect(ui->removePushButton, SIGNAL(clicked()), SLOT(slotRemoveCurrentItem()));
-    connect(ui->addPushButton, SIGNAL(clicked()), SLOT(slotAddPattern()));
+    connect(ui->tableWidget, &QTableWidget::itemSelectionChanged, this, &IgnoreListEditor::slotItemSelectionChanged);
+    connect(ui->removePushButton, &QAbstractButton::clicked, this, &IgnoreListEditor::slotRemoveCurrentItem);
+    connect(ui->addPushButton, &QAbstractButton::clicked, this, &IgnoreListEditor::slotAddPattern);
 
     ui->tableWidget->resizeColumnsToContents();
     ui->tableWidget->horizontalHeader()->setResizeMode(patternCol, QHeaderView::Stretch);
index 40f2822b71dc46b7e3a1f6c49755d3177d377af8..267098541b771f2152d5156921daed499122bacb 100644 (file)
@@ -44,30 +44,30 @@ IssuesWidget::IssuesWidget(QWidget *parent)
 {
     _ui->setupUi(this);
 
-    connect(ProgressDispatcher::instance(), SIGNAL(progressInfo(QString, ProgressInfo)),
-        this, SLOT(slotProgressInfo(QString, ProgressInfo)));
-    connect(ProgressDispatcher::instance(), SIGNAL(itemCompleted(QString, SyncFileItemPtr)),
-        this, SLOT(slotItemCompleted(QString, SyncFileItemPtr)));
+    connect(ProgressDispatcher::instance(), &ProgressDispatcher::progressInfo,
+        this, &IssuesWidget::slotProgressInfo);
+    connect(ProgressDispatcher::instance(), &ProgressDispatcher::itemCompleted,
+        this, &IssuesWidget::slotItemCompleted);
     connect(ProgressDispatcher::instance(), &ProgressDispatcher::syncError,
         this, &IssuesWidget::addError);
 
-    connect(_ui->_treeWidget, SIGNAL(itemActivated(QTreeWidgetItem *, int)), SLOT(slotOpenFile(QTreeWidgetItem *, int)));
-    connect(_ui->copyIssuesButton, SIGNAL(clicked()), SIGNAL(copyToClipboard()));
+    connect(_ui->_treeWidget, &QTreeWidget::itemActivated, this, &IssuesWidget::slotOpenFile);
+    connect(_ui->copyIssuesButton, &QAbstractButton::clicked, this, &IssuesWidget::copyToClipboard);
 
-    connect(_ui->showIgnores, SIGNAL(toggled(bool)), SLOT(slotRefreshIssues()));
-    connect(_ui->showWarnings, SIGNAL(toggled(bool)), SLOT(slotRefreshIssues()));
+    connect(_ui->showIgnores, &QAbstractButton::toggled, this, &IssuesWidget::slotRefreshIssues);
+    connect(_ui->showWarnings, &QAbstractButton::toggled, this, &IssuesWidget::slotRefreshIssues);
     connect(_ui->filterAccount, SIGNAL(currentIndexChanged(int)), SLOT(slotRefreshIssues()));
     connect(_ui->filterAccount, SIGNAL(currentIndexChanged(int)), SLOT(slotUpdateFolderFilters()));
     connect(_ui->filterFolder, SIGNAL(currentIndexChanged(int)), SLOT(slotRefreshIssues()));
     for (auto account : AccountManager::instance()->accounts()) {
         slotAccountAdded(account.data());
     }
-    connect(AccountManager::instance(), SIGNAL(accountAdded(AccountState *)),
-        SLOT(slotAccountAdded(AccountState *)));
-    connect(AccountManager::instance(), SIGNAL(accountRemoved(AccountState *)),
-        SLOT(slotAccountRemoved(AccountState *)));
-    connect(FolderMan::instance(), SIGNAL(folderListChanged(Folder::Map)),
-        SLOT(slotUpdateFolderFilters()));
+    connect(AccountManager::instance(), &AccountManager::accountAdded,
+        this, &IssuesWidget::slotAccountAdded);
+    connect(AccountManager::instance(), &AccountManager::accountRemoved,
+        this, &IssuesWidget::slotAccountRemoved);
+    connect(FolderMan::instance(), &FolderMan::folderListChanged,
+        this, &IssuesWidget::slotUpdateFolderFilters);
 
 
     // Adjust copyToClipboard() when making changes here!
index da83744a9a90d5dd36318400761c269245f32b7b..cf76c097be01421b13ee205384c09cf499441c5a 100644 (file)
@@ -27,8 +27,8 @@ static const int check_frequency = 20 * 1000; // ms
 LockWatcher::LockWatcher(QObject *parent)
     : QObject(parent)
 {
-    connect(&_timer, SIGNAL(timeout()),
-        SLOT(checkFiles()));
+    connect(&_timer, &QTimer::timeout,
+        this, &LockWatcher::checkFiles);
     _timer.start(check_frequency);
 }
 
index 41b526a3c89fb33ef63eea4e5bdd6009f2ee4a22..a7303b0f076b2b1ec4b9f55dbe77f8a4c1434e82 100644 (file)
@@ -76,7 +76,7 @@ LogBrowser::LogBrowser(QWidget *parent)
     // find button
     QPushButton *findBtn = new QPushButton;
     findBtn->setText(tr("&Find"));
-    connect(findBtn, SIGNAL(clicked()), this, SLOT(slotFind()));
+    connect(findBtn, &QAbstractButton::clicked, this, &LogBrowser::slotFind);
     toolLayout->addWidget(findBtn);
 
     // stretch
@@ -87,12 +87,12 @@ LogBrowser::LogBrowser(QWidget *parent)
 
     // Debug logging
     _logDebugCheckBox = new QCheckBox(tr("&Capture debug messages") + " ");
-    connect(_logDebugCheckBox, SIGNAL(stateChanged(int)), SLOT(slotDebugCheckStateChanged(int)));
+    connect(_logDebugCheckBox, &QCheckBox::stateChanged, this, &LogBrowser::slotDebugCheckStateChanged);
     toolLayout->addWidget(_logDebugCheckBox);
 
     QDialogButtonBox *btnbox = new QDialogButtonBox;
     QPushButton *closeBtn = btnbox->addButton(QDialogButtonBox::Close);
-    connect(closeBtn, SIGNAL(clicked()), this, SLOT(close()));
+    connect(closeBtn, &QAbstractButton::clicked, this, &QWidget::close);
 
     mainLayout->addWidget(btnbox);
 
@@ -101,14 +101,14 @@ LogBrowser::LogBrowser(QWidget *parent)
     _clearBtn->setText(tr("Clear"));
     _clearBtn->setToolTip(tr("Clear the log display."));
     btnbox->addButton(_clearBtn, QDialogButtonBox::ActionRole);
-    connect(_clearBtn, SIGNAL(clicked()), this, SLOT(slotClearLog()));
+    connect(_clearBtn, &QAbstractButton::clicked, this, &LogBrowser::slotClearLog);
 
     // save Button
     _saveBtn = new QPushButton;
     _saveBtn->setText(tr("S&ave"));
     _saveBtn->setToolTip(tr("Save the log file to a file on disk for debugging."));
     btnbox->addButton(_saveBtn, QDialogButtonBox::ActionRole);
-    connect(_saveBtn, SIGNAL(clicked()), this, SLOT(slotSave()));
+    connect(_saveBtn, &QAbstractButton::clicked, this, &LogBrowser::slotSave);
 
     setLayout(mainLayout);
 
@@ -116,11 +116,11 @@ LogBrowser::LogBrowser(QWidget *parent)
 
     Logger::instance()->setLogWindowActivated(true);
     // Direct connection for log coming from this thread, and queued for the one in a different thread
-    connect(Logger::instance(), SIGNAL(logWindowLog(QString)), this, SLOT(slotNewLog(QString)), Qt::AutoConnection);
+    connect(Logger::instance(), &Logger::logWindowLog, this, &LogBrowser::slotNewLog, Qt::AutoConnection);
 
     QAction *showLogWindow = new QAction(this);
     showLogWindow->setShortcut(QKeySequence("F12"));
-    connect(showLogWindow, SIGNAL(triggered()), SLOT(close()));
+    connect(showLogWindow, &QAction::triggered, this, &QWidget::close);
     addAction(showLogWindow);
 
     ConfigFile cfg;
index b135bbea23ff5352a311778a1739065058f311a8..eb19f7193b3dd1d636ea0f2f214eebb3a78de7d9 100644 (file)
@@ -45,13 +45,13 @@ NetworkSettings::NetworkSettings(QWidget *parent)
     _ui->userLineEdit->setEnabled(true);
     _ui->passwordLineEdit->setEnabled(true);
     _ui->authWidgets->setEnabled(_ui->authRequiredcheckBox->isChecked());
-    connect(_ui->authRequiredcheckBox, SIGNAL(toggled(bool)),
-        _ui->authWidgets, SLOT(setEnabled(bool)));
+    connect(_ui->authRequiredcheckBox, &QAbstractButton::toggled,
+        _ui->authWidgets, &QWidget::setEnabled);
 
-    connect(_ui->manualProxyRadioButton, SIGNAL(toggled(bool)),
-        _ui->manualSettings, SLOT(setEnabled(bool)));
-    connect(_ui->manualProxyRadioButton, SIGNAL(toggled(bool)),
-        _ui->typeComboBox, SLOT(setEnabled(bool)));
+    connect(_ui->manualProxyRadioButton, &QAbstractButton::toggled,
+        _ui->manualSettings, &QWidget::setEnabled);
+    connect(_ui->manualProxyRadioButton, &QAbstractButton::toggled,
+        _ui->typeComboBox, &QWidget::setEnabled);
 
     loadProxySettings();
     loadBWLimitSettings();
@@ -59,18 +59,18 @@ NetworkSettings::NetworkSettings(QWidget *parent)
     // proxy
     connect(_ui->typeComboBox, SIGNAL(currentIndexChanged(int)), SLOT(saveProxySettings()));
     connect(_ui->proxyButtonGroup, SIGNAL(buttonClicked(int)), SLOT(saveProxySettings()));
-    connect(_ui->hostLineEdit, SIGNAL(editingFinished()), SLOT(saveProxySettings()));
-    connect(_ui->userLineEdit, SIGNAL(editingFinished()), SLOT(saveProxySettings()));
-    connect(_ui->passwordLineEdit, SIGNAL(editingFinished()), SLOT(saveProxySettings()));
-    connect(_ui->portSpinBox, SIGNAL(editingFinished()), SLOT(saveProxySettings()));
-    connect(_ui->authRequiredcheckBox, SIGNAL(toggled(bool)), SLOT(saveProxySettings()));
-
-    connect(_ui->uploadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings()));
-    connect(_ui->noUploadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings()));
-    connect(_ui->autoUploadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings()));
-    connect(_ui->downloadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings()));
-    connect(_ui->noDownloadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings()));
-    connect(_ui->autoDownloadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings()));
+    connect(_ui->hostLineEdit, &QLineEdit::editingFinished, this, &NetworkSettings::saveProxySettings);
+    connect(_ui->userLineEdit, &QLineEdit::editingFinished, this, &NetworkSettings::saveProxySettings);
+    connect(_ui->passwordLineEdit, &QLineEdit::editingFinished, this, &NetworkSettings::saveProxySettings);
+    connect(_ui->portSpinBox, &QAbstractSpinBox::editingFinished, this, &NetworkSettings::saveProxySettings);
+    connect(_ui->authRequiredcheckBox, &QAbstractButton::toggled, this, &NetworkSettings::saveProxySettings);
+
+    connect(_ui->uploadLimitRadioButton, &QAbstractButton::clicked, this, &NetworkSettings::saveBWLimitSettings);
+    connect(_ui->noUploadLimitRadioButton, &QAbstractButton::clicked, this, &NetworkSettings::saveBWLimitSettings);
+    connect(_ui->autoUploadLimitRadioButton, &QAbstractButton::clicked, this, &NetworkSettings::saveBWLimitSettings);
+    connect(_ui->downloadLimitRadioButton, &QAbstractButton::clicked, this, &NetworkSettings::saveBWLimitSettings);
+    connect(_ui->noDownloadLimitRadioButton, &QAbstractButton::clicked, this, &NetworkSettings::saveBWLimitSettings);
+    connect(_ui->autoDownloadLimitRadioButton, &QAbstractButton::clicked, this, &NetworkSettings::saveBWLimitSettings);
     connect(_ui->downloadSpinBox, SIGNAL(valueChanged(int)), SLOT(saveBWLimitSettings()));
     connect(_ui->uploadSpinBox, SIGNAL(valueChanged(int)), SLOT(saveBWLimitSettings()));
 }
index bcada1075a577a02ede4844fe5163f8da8b8682a..dbf8c18ff2eec3019cc4a4261a58653500405ac6 100644 (file)
@@ -66,13 +66,13 @@ void NotificationWidget::setActivity(const Activity &activity)
         // in case there is no action defined, do a close button.
         QPushButton *b = _ui._buttonBox->addButton(QDialogButtonBox::Close);
         b->setDefault(true);
-        connect(b, SIGNAL(clicked()), this, SLOT(slotButtonClicked()));
+        connect(b, &QAbstractButton::clicked, this, &NotificationWidget::slotButtonClicked);
         _buttons.append(b);
     } else {
         foreach (auto link, activity._links) {
             QPushButton *b = _ui._buttonBox->addButton(link._label, QDialogButtonBox::AcceptRole);
             b->setDefault(link._isPrimary);
-            connect(b, SIGNAL(clicked()), this, SLOT(slotButtonClicked()));
+            connect(b, &QAbstractButton::clicked, this, &NotificationWidget::slotButtonClicked);
             _buttons.append(b);
         }
     }
index b359201c009ab1026a1f9bcc7281bd8b56956c20..40bb70d916495278be4a2f2f40d3183f47c2010e 100644 (file)
@@ -20,7 +20,7 @@ OcsShareeJob::OcsShareeJob(AccountPtr account)
     : OcsJob(account)
 {
     setPath("ocs/v1.php/apps/files_sharing/api/v1/sharees");
-    connect(this, SIGNAL(jobFinished(QJsonDocument)), SLOT(jobDone(QJsonDocument)));
+    connect(this, &OcsJob::jobFinished, this, &OcsShareeJob::jobDone);
 }
 
 void OcsShareeJob::getSharees(const QString &search,
index 9b93ee99f77b5da6a12794f3b9b4b2e35652ef0b..5202254618bc89e42c8bee65946528ae4de183e7 100644 (file)
@@ -25,7 +25,7 @@ OcsShareJob::OcsShareJob(AccountPtr account)
     : OcsJob(account)
 {
     setPath("ocs/v1.php/apps/files_sharing/api/v1/shares");
-    connect(this, SIGNAL(jobFinished(QJsonDocument)), this, SLOT(jobDone(QJsonDocument)));
+    connect(this, &OcsJob::jobFinished, this, &OcsShareJob::jobDone);
 }
 
 void OcsShareJob::getShares(const QString &path)
index 225cbf3b34194673ff3c6625aed114ee97a71c66..ad9b7bf9def31a3a72490af8685bbf4a9ff2aa52 100644 (file)
@@ -70,8 +70,8 @@ ownCloudGui::ownCloudGui(Application *parent)
     // for the beginning, set the offline icon until the account was verified
     _tray->setIcon(Theme::instance()->folderOfflineIcon(/*systray?*/ true, /*currently visible?*/ false));
 
-    connect(_tray.data(), SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
-        SLOT(slotTrayClicked(QSystemTrayIcon::ActivationReason)));
+    connect(_tray.data(), &QSystemTrayIcon::activated,
+        this, &ownCloudGui::slotTrayClicked);
 
     setupActions();
     setupContextMenu();
@@ -79,24 +79,24 @@ ownCloudGui::ownCloudGui(Application *parent)
     _tray->show();
 
     ProgressDispatcher *pd = ProgressDispatcher::instance();
-    connect(pd, SIGNAL(progressInfo(QString, ProgressInfo)), this,
-        SLOT(slotUpdateProgress(QString, ProgressInfo)));
+    connect(pd, &ProgressDispatcher::progressInfo, this,
+        &ownCloudGui::slotUpdateProgress);
 
     FolderMan *folderMan = FolderMan::instance();
-    connect(folderMan, SIGNAL(folderSyncStateChange(Folder *)),
-        this, SLOT(slotSyncStateChange(Folder *)));
-
-    connect(AccountManager::instance(), SIGNAL(accountAdded(AccountState *)),
-        SLOT(updateContextMenuNeeded()));
-    connect(AccountManager::instance(), SIGNAL(accountRemoved(AccountState *)),
-        SLOT(updateContextMenuNeeded()));
-
-    connect(Logger::instance(), SIGNAL(guiLog(QString, QString)),
-        SLOT(slotShowTrayMessage(QString, QString)));
-    connect(Logger::instance(), SIGNAL(optionalGuiLog(QString, QString)),
-        SLOT(slotShowOptionalTrayMessage(QString, QString)));
-    connect(Logger::instance(), SIGNAL(guiMessage(QString, QString)),
-        SLOT(slotShowGuiMessage(QString, QString)));
+    connect(folderMan, &FolderMan::folderSyncStateChange,
+        this, &ownCloudGui::slotSyncStateChange);
+
+    connect(AccountManager::instance(), &AccountManager::accountAdded,
+        this, &ownCloudGui::updateContextMenuNeeded);
+    connect(AccountManager::instance(), &AccountManager::accountRemoved,
+        this, &ownCloudGui::updateContextMenuNeeded);
+
+    connect(Logger::instance(), &Logger::guiLog,
+        this, &ownCloudGui::slotShowTrayMessage);
+    connect(Logger::instance(), &Logger::optionalGuiLog,
+        this, &ownCloudGui::slotShowOptionalTrayMessage);
+    connect(Logger::instance(), &Logger::guiMessage,
+        this, &ownCloudGui::slotShowGuiMessage);
 }
 
 // This should rather be in application.... or rather in ConfigFile?
@@ -302,7 +302,7 @@ void ownCloudGui::addAccountContextMenu(AccountStatePtr accountState, QMenu *men
     }
     auto actionOpenoC = menu->addAction(browserOpen);
     actionOpenoC->setProperty(propertyAccountC, QVariant::fromValue(accountState->account()));
-    QObject::connect(actionOpenoC, SIGNAL(triggered(bool)), SLOT(slotOpenOwnCloud()));
+    QObject::connect(actionOpenoC, &QAction::triggered, this, &ownCloudGui::slotOpenOwnCloud);
 
     FolderMan *folderMan = FolderMan::instance();
     bool firstFolder = true;
@@ -336,22 +336,22 @@ void ownCloudGui::addAccountContextMenu(AccountStatePtr accountState, QMenu *men
         if (onePaused) {
             QAction *enable = menu->addAction(tr("Unpause all folders"));
             enable->setProperty(propertyAccountC, QVariant::fromValue(accountState));
-            connect(enable, SIGNAL(triggered(bool)), SLOT(slotUnpauseAllFolders()));
+            connect(enable, &QAction::triggered, this, &ownCloudGui::slotUnpauseAllFolders);
         }
         if (!allPaused) {
             QAction *enable = menu->addAction(tr("Pause all folders"));
             enable->setProperty(propertyAccountC, QVariant::fromValue(accountState));
-            connect(enable, SIGNAL(triggered(bool)), SLOT(slotPauseAllFolders()));
+            connect(enable, &QAction::triggered, this, &ownCloudGui::slotPauseAllFolders);
         }
 
         if (accountState->isSignedOut()) {
             QAction *signin = menu->addAction(tr("Log in..."));
             signin->setProperty(propertyAccountC, QVariant::fromValue(accountState));
-            connect(signin, SIGNAL(triggered()), this, SLOT(slotLogin()));
+            connect(signin, &QAction::triggered, this, &ownCloudGui::slotLogin);
         } else {
             QAction *signout = menu->addAction(tr("Log out"));
             signout->setProperty(propertyAccountC, QVariant::fromValue(accountState));
-            connect(signout, SIGNAL(triggered()), this, SLOT(slotLogout()));
+            connect(signout, &QAction::triggered, this, &ownCloudGui::slotLogout);
         }
     }
 }
@@ -462,7 +462,7 @@ void ownCloudGui::setupContextMenu()
     // When the qdbusmenuWorkaround is necessary, we can't do on-demand updates
     // because the workaround is to hide and show the tray icon.
     if (_qdbusmenuWorkaround) {
-        connect(&_workaroundBatchTrayUpdate, SIGNAL(timeout()), SLOT(updateContextMenu()));
+        connect(&_workaroundBatchTrayUpdate, &QTimer::timeout, this, &ownCloudGui::updateContextMenu);
         _workaroundBatchTrayUpdate.setInterval(30 * 1000);
         _workaroundBatchTrayUpdate.setSingleShot(true);
     } else {
@@ -473,7 +473,7 @@ void ownCloudGui::setupContextMenu()
         connect(_contextMenu.data(), SIGNAL(aboutToShow()), SLOT(slotContextMenuAboutToShow()));
         connect(_contextMenu.data(), SIGNAL(aboutToHide()), SLOT(slotContextMenuAboutToHide()));
 #else
-        connect(_contextMenu.data(), SIGNAL(aboutToShow()), SLOT(updateContextMenu()));
+        connect(_contextMenu.data(), &QMenu::aboutToShow, this, &ownCloudGui::updateContextMenu);
 #endif
     }
 
@@ -576,7 +576,7 @@ void ownCloudGui::updateContextMenu()
             text = tr("Unpause synchronization");
         }
         QAction *action = _contextMenu->addAction(text);
-        connect(action, SIGNAL(triggered(bool)), SLOT(slotUnpauseAllFolders()));
+        connect(action, &QAction::triggered, this, &ownCloudGui::slotUnpauseAllFolders);
     }
     if (atLeastOneNotPaused) {
         QString text;
@@ -586,7 +586,7 @@ void ownCloudGui::updateContextMenu()
             text = tr("Pause synchronization");
         }
         QAction *action = _contextMenu->addAction(text);
-        connect(action, SIGNAL(triggered(bool)), SLOT(slotPauseAllFolders()));
+        connect(action, &QAction::triggered, this, &ownCloudGui::slotPauseAllFolders);
     }
     if (atLeastOneSignedIn) {
         if (accountList.count() > 1) {
@@ -686,18 +686,18 @@ void ownCloudGui::setupActions()
     _actionRecent = new QAction(tr("Details..."), this);
     _actionRecent->setEnabled(true);
 
-    QObject::connect(_actionRecent, SIGNAL(triggered(bool)), SLOT(slotShowSyncProtocol()));
-    QObject::connect(_actionSettings, SIGNAL(triggered(bool)), SLOT(slotShowSettings()));
-    QObject::connect(_actionNewAccountWizard, SIGNAL(triggered(bool)), SLOT(slotNewAccountWizard()));
+    QObject::connect(_actionRecent, &QAction::triggered, this, &ownCloudGui::slotShowSyncProtocol);
+    QObject::connect(_actionSettings, &QAction::triggered, this, &ownCloudGui::slotShowSettings);
+    QObject::connect(_actionNewAccountWizard, &QAction::triggered, this, &ownCloudGui::slotNewAccountWizard);
     _actionHelp = new QAction(tr("Help"), this);
-    QObject::connect(_actionHelp, SIGNAL(triggered(bool)), SLOT(slotHelp()));
+    QObject::connect(_actionHelp, &QAction::triggered, this, &ownCloudGui::slotHelp);
     _actionQuit = new QAction(tr("Quit %1").arg(Theme::instance()->appNameGUI()), this);
     QObject::connect(_actionQuit, SIGNAL(triggered(bool)), _app, SLOT(quit()));
 
     _actionLogin = new QAction(tr("Log in..."), this);
-    connect(_actionLogin, SIGNAL(triggered()), this, SLOT(slotLogin()));
+    connect(_actionLogin, &QAction::triggered, this, &ownCloudGui::slotLogin);
     _actionLogout = new QAction(tr("Log out"), this);
-    connect(_actionLogout, SIGNAL(triggered()), this, SLOT(slotLogout()));
+    connect(_actionLogout, &QAction::triggered, this, &ownCloudGui::slotLogout);
 
     if (_app->debugMode()) {
         _actionCrash = new QAction(tr("Crash now", "Only shows in debug mode to allow testing the crash handler"), this);
@@ -742,7 +742,7 @@ void ownCloudGui::slotUpdateProgress(const QString &folder, const ProgressInfo &
                                        .arg(progress._currentDiscoveredFolder));
         }
     } else if (progress.status() == ProgressInfo::Done) {
-        QTimer::singleShot(2000, this, SLOT(slotDisplayIdle()));
+        QTimer::singleShot(2000, this, &ownCloudGui::slotDisplayIdle);
     }
     if (progress.status() != ProgressInfo::Propagation) {
         return;
@@ -1036,7 +1036,7 @@ void ownCloudGui::slotShowShareDialog(const QString &sharePath, const QString &l
         w->setAttribute(Qt::WA_DeleteOnClose, true);
 
         _shareDialogs[localPath] = w;
-        connect(w, SIGNAL(destroyed(QObject *)), SLOT(slotRemoveDestroyedShareDialogs()));
+        connect(w, &QObject::destroyed, this, &ownCloudGui::slotRemoveDestroyedShareDialogs);
     }
     raiseDialog(w);
 }
index 33e55cb14b8368ae855b2dbf082e5d46c2a1b58d..86a0c19ad885d62cc50d11cb7f1dff7c6f3e87f7 100644 (file)
@@ -44,19 +44,19 @@ OwncloudSetupWizard::OwncloudSetupWizard(QObject *parent)
     , _ocWizard(new OwncloudWizard)
     , _remoteFolder()
 {
-    connect(_ocWizard, SIGNAL(determineAuthType(const QString &)),
-        this, SLOT(slotDetermineAuthType(const QString &)));
-    connect(_ocWizard, SIGNAL(connectToOCUrl(const QString &)),
-        this, SLOT(slotConnectToOCUrl(const QString &)));
-    connect(_ocWizard, SIGNAL(createLocalAndRemoteFolders(QString, QString)),
-        this, SLOT(slotCreateLocalAndRemoteFolders(QString, QString)));
+    connect(_ocWizard, &OwncloudWizard::determineAuthType,
+        this, &OwncloudSetupWizard::slotDetermineAuthType);
+    connect(_ocWizard, &OwncloudWizard::connectToOCUrl,
+        this, &OwncloudSetupWizard::slotConnectToOCUrl);
+    connect(_ocWizard, &OwncloudWizard::createLocalAndRemoteFolders,
+        this, &OwncloudSetupWizard::slotCreateLocalAndRemoteFolders);
     /* basicSetupFinished might be called from a reply from the network.
        slotAssistantFinished might destroy the temporary QNetworkAccessManager.
        Therefore Qt::QueuedConnection is required */
-    connect(_ocWizard, SIGNAL(basicSetupFinished(int)),
-        this, SLOT(slotAssistantFinished(int)), Qt::QueuedConnection);
-    connect(_ocWizard, SIGNAL(finished(int)), SLOT(deleteLater()));
-    connect(_ocWizard, SIGNAL(skipFolderConfiguration()), SLOT(slotSkipFolderConfiguration()));
+    connect(_ocWizard, &OwncloudWizard::basicSetupFinished,
+        this, &OwncloudSetupWizard::slotAssistantFinished, Qt::QueuedConnection);
+    connect(_ocWizard, &QDialog::finished, this, &QObject::deleteLater);
+    connect(_ocWizard, &OwncloudWizard::skipFolderConfiguration, this, &OwncloudSetupWizard::slotSkipFolderConfiguration);
 }
 
 OwncloudSetupWizard::~OwncloudSetupWizard()
@@ -202,9 +202,9 @@ void OwncloudSetupWizard::slotContinueDetermineAuth()
         [this, account]() {
             CheckServerJob *job = new CheckServerJob(account, this);
             job->setIgnoreCredentialFailure(true);
-            connect(job, SIGNAL(instanceFound(QUrl, QJsonObject)), SLOT(slotOwnCloudFoundAuth(QUrl, QJsonObject)));
-            connect(job, SIGNAL(instanceNotFound(QNetworkReply *)), SLOT(slotNoOwnCloudFoundAuth(QNetworkReply *)));
-            connect(job, SIGNAL(timeout(const QUrl &)), SLOT(slotNoOwnCloudFoundAuthTimeout(const QUrl &)));
+            connect(job, &CheckServerJob::instanceFound, this, &OwncloudSetupWizard::slotOwnCloudFoundAuth);
+            connect(job, &CheckServerJob::instanceNotFound, this, &OwncloudSetupWizard::slotNoOwnCloudFoundAuth);
+            connect(job, &CheckServerJob::timeout, this, &OwncloudSetupWizard::slotNoOwnCloudFoundAuthTimeout);
             job->setTimeout((account->url().scheme() == "https") ? 30 * 1000 : 10 * 1000);
             job->start();
         });
@@ -310,8 +310,8 @@ void OwncloudSetupWizard::testOwnCloudConnect()
     // so don't automatically follow redirects.
     job->setFollowRedirects(false);
     job->setProperties(QList<QByteArray>() << "getlastmodified");
-    connect(job, SIGNAL(result(QVariantMap)), _ocWizard, SLOT(successfulStep()));
-    connect(job, SIGNAL(finishedWithError()), this, SLOT(slotAuthError()));
+    connect(job, &PropfindJob::result, _ocWizard, &OwncloudWizard::successfulStep);
+    connect(job, &PropfindJob::finishedWithError, this, &OwncloudSetupWizard::slotAuthError);
     job->start();
 }
 
@@ -429,7 +429,7 @@ void OwncloudSetupWizard::slotCreateLocalAndRemoteFolders(const QString &localFo
     }
     if (nextStep) {
         EntityExistsJob *job = new EntityExistsJob(_ocWizard->account(), _ocWizard->account()->davPath() + remoteFolder, this);
-        connect(job, SIGNAL(exists(QNetworkReply *)), SLOT(slotRemoteFolderExists(QNetworkReply *)));
+        connect(job, &EntityExistsJob::exists, this, &OwncloudSetupWizard::slotRemoteFolderExists);
         job->start();
     } else {
         finalizeSetup(false);
@@ -602,8 +602,8 @@ void OwncloudSetupWizard::slotSkipFolderConfiguration()
 {
     applyAccountChanges();
 
-    disconnect(_ocWizard, SIGNAL(basicSetupFinished(int)),
-        this, SLOT(slotAssistantFinished(int)));
+    disconnect(_ocWizard, &OwncloudWizard::basicSetupFinished,
+        this, &OwncloudSetupWizard::slotAssistantFinished);
     _ocWizard->close();
     emit ownCloudWizardDone(QDialog::Accepted);
 }
index 75b8aaa5290e68ff55562f6ab0d8fd8851d85902..f3a52dff6ff7e8313ced2a27050280d5b233a0b7 100644 (file)
@@ -38,10 +38,10 @@ ProtocolWidget::ProtocolWidget(QWidget *parent)
 {
     _ui->setupUi(this);
 
-    connect(ProgressDispatcher::instance(), SIGNAL(itemCompleted(QString, SyncFileItemPtr)),
-        this, SLOT(slotItemCompleted(QString, SyncFileItemPtr)));
+    connect(ProgressDispatcher::instance(), &ProgressDispatcher::itemCompleted,
+        this, &ProtocolWidget::slotItemCompleted);
 
-    connect(_ui->_treeWidget, SIGNAL(itemActivated(QTreeWidgetItem *, int)), SLOT(slotOpenFile(QTreeWidgetItem *, int)));
+    connect(_ui->_treeWidget, &QTreeWidget::itemActivated, this, &ProtocolWidget::slotOpenFile);
 
     // Adjust copyToClipboard() when making changes here!
     QStringList header;
@@ -74,7 +74,7 @@ ProtocolWidget::ProtocolWidget(QWidget *parent)
     QPushButton *copyBtn = _ui->_dialogButtonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
     copyBtn->setToolTip(tr("Copy the activity list to the clipboard."));
     copyBtn->setEnabled(true);
-    connect(copyBtn, SIGNAL(clicked()), SIGNAL(copyToClipboard()));
+    connect(copyBtn, &QAbstractButton::clicked, this, &ProtocolWidget::copyToClipboard);
 }
 
 ProtocolWidget::~ProtocolWidget()
index 5b7d7382da9d85d6d9c098c6443caebaafa91ce3..f2ccd97ac2c182a6978f9ef01cbe5c7c23495c55 100644 (file)
@@ -131,8 +131,8 @@ void ProxyAuthHandler::handleProxyAuthenticationRequired(
     sending_qnam = qnam_alive.data();
     if (sending_qnam) {
         _gaveCredentialsTo.insert(sending_qnam);
-        connect(sending_qnam, SIGNAL(destroyed(QObject *)),
-            SLOT(slotSenderDestroyed(QObject *)));
+        connect(sending_qnam, &QObject::destroyed,
+            this, &ProxyAuthHandler::slotSenderDestroyed);
     }
 }
 
@@ -194,8 +194,8 @@ bool ProxyAuthHandler::getCredsFromKeychain()
         _readPasswordJob->setInsecureFallback(false);
         _readPasswordJob->setKey(keychainPasswordKey());
         _readPasswordJob->setAutoDelete(false);
-        connect(_readPasswordJob.data(), SIGNAL(finished(QKeychain::Job *)),
-            SLOT(slotKeychainJobDone()));
+        connect(_readPasswordJob.data(), &QKeychain::Job::finished,
+            this, &ProxyAuthHandler::slotKeychainJobDone);
         _keychainJobRunning = true;
         _readPasswordJob->start();
     }
@@ -242,7 +242,7 @@ void ProxyAuthHandler::storeCredsInKeychain()
     job->setKey(keychainPasswordKey());
     job->setTextData(_password);
     job->setAutoDelete(false);
-    connect(job, SIGNAL(finished(QKeychain::Job *)), SLOT(slotKeychainJobDone()));
+    connect(job, &QKeychain::Job::finished, this, &ProxyAuthHandler::slotKeychainJobDone);
     _keychainJobRunning = true;
     job->start();
 
index 1eb1066cc9d9bc0fad95e2a08d7b3c0093d3cd1f..0368eefbe64e5d80160ab840cce1e09fe469d6de 100644 (file)
@@ -36,9 +36,9 @@ QuotaInfo::QuotaInfo(AccountState *accountState, QObject *parent)
     , _lastQuotaUsedBytes(0)
     , _active(false)
 {
-    connect(accountState, SIGNAL(stateChanged(int)),
-        SLOT(slotAccountStateChanged()));
-    connect(&_jobRestartTimer, SIGNAL(timeout()), SLOT(slotCheckQuota()));
+    connect(accountState, &AccountState::stateChanged,
+        this, &QuotaInfo::slotAccountStateChanged);
+    connect(&_jobRestartTimer, &QTimer::timeout, this, &QuotaInfo::slotCheckQuota);
     _jobRestartTimer.setSingleShot(true);
 }
 
@@ -101,8 +101,8 @@ void QuotaInfo::slotCheckQuota()
     _job = new PropfindJob(account, quotaBaseFolder(), this);
     _job->setProperties(QList<QByteArray>() << "quota-available-bytes"
                                             << "quota-used-bytes");
-    connect(_job, SIGNAL(result(QVariantMap)), SLOT(slotUpdateLastQuota(QVariantMap)));
-    connect(_job, SIGNAL(networkError(QNetworkReply *)), SLOT(slotRequestFailed()));
+    connect(_job.data(), &PropfindJob::result, this, &QuotaInfo::slotUpdateLastQuota);
+    connect(_job.data(), &AbstractNetworkJob::networkError, this, &QuotaInfo::slotRequestFailed);
     _job->start();
 }
 
index a9c96cb779371e055f960bb68ceebff2f1dc42a5..1457967f7e9f29931e1ed858a097d45da44f7dd1 100644 (file)
@@ -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);
 }
 
index afbd66ddff2fb4bb6395aed9264dd32f3f4ebe8a..7c69bf59933d936de86b36edaf6ff85fee20a314 100644 (file)
@@ -48,8 +48,8 @@ void ServerNotificationHandler::slotFetchNotifications(AccountState *ptr)
 
     // if the previous notification job has finished, start next.
     _notificationJob = new JsonApiJob(ptr->account(), QLatin1String("ocs/v2.php/apps/notifications/api/v1/notifications"), this);
-    QObject::connect(_notificationJob.data(), SIGNAL(jsonReceived(QJsonDocument, int)),
-        this, SLOT(slotNotificationsReceived(QJsonDocument, int)));
+    QObject::connect(_notificationJob.data(), &JsonApiJob::jsonReceived,
+        this, &ServerNotificationHandler::slotNotificationsReceived);
     _notificationJob->setProperty("AccountStatePtr", QVariant::fromValue<AccountState *>(ptr));
 
     _notificationJob->start();
index 2ea52e921240d784d97102225640f4fa01277bcf..f67dcaca0a6b75651bef0f6a72adf15f62443d43 100644 (file)
@@ -109,8 +109,8 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
     _toolBar->addAction(_activityAction);
     _activitySettings = new ActivitySettings;
     _ui->stack->addWidget(_activitySettings);
-    connect(_activitySettings, SIGNAL(guiLog(QString, QString)), _gui,
-        SLOT(slotShowOptionalTrayMessage(QString, QString)));
+    connect(_activitySettings, &ActivitySettings::guiLog, _gui,
+        &ownCloudGui::slotShowOptionalTrayMessage);
     _activitySettings->setNotificationRefreshInterval(cfg.notificationRefreshInterval());
 
     QAction *generalAction = createColorAwareAction(QLatin1String(":/client/resources/settings.png"), tr("General"));
@@ -129,24 +129,24 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
     _actionGroupWidgets.insert(generalAction, generalSettings);
     _actionGroupWidgets.insert(networkAction, networkSettings);
 
-    connect(_actionGroup, SIGNAL(triggered(QAction *)), SLOT(slotSwitchPage(QAction *)));
+    connect(_actionGroup, &QActionGroup::triggered, this, &SettingsDialog::slotSwitchPage);
 
-    connect(AccountManager::instance(), SIGNAL(accountAdded(AccountState *)),
-        this, SLOT(accountAdded(AccountState *)));
-    connect(AccountManager::instance(), SIGNAL(accountRemoved(AccountState *)),
-        this, SLOT(accountRemoved(AccountState *)));
+    connect(AccountManager::instance(), &AccountManager::accountAdded,
+        this, &SettingsDialog::accountAdded);
+    connect(AccountManager::instance(), &AccountManager::accountRemoved,
+        this, &SettingsDialog::accountRemoved);
     foreach (auto ai, AccountManager::instance()->accounts()) {
         accountAdded(ai.data());
     }
 
-    QTimer::singleShot(1, this, SLOT(showFirstPage()));
+    QTimer::singleShot(1, this, &SettingsDialog::showFirstPage);
 
     QPushButton *closeButton = _ui->buttonBox->button(QDialogButtonBox::Close);
     connect(closeButton, SIGNAL(clicked()), SLOT(accept()));
 
     QAction *showLogWindow = new QAction(this);
     showLogWindow->setShortcut(QKeySequence("F12"));
-    connect(showLogWindow, SIGNAL(triggered()), gui, SLOT(slotToggleLogBrowser()));
+    connect(showLogWindow, &QAction::triggered, gui, &ownCloudGui::slotToggleLogBrowser);
     addAction(showLogWindow);
 
     customizeStyle();
@@ -245,11 +245,11 @@ void SettingsDialog::accountAdded(AccountState *s)
     _actionGroupWidgets.insert(accountAction, accountSettings);
     _actionForAccount.insert(s->account().data(), accountAction);
 
-    connect(accountSettings, SIGNAL(folderChanged()), _gui, SLOT(slotFoldersChanged()));
-    connect(accountSettings, SIGNAL(openFolderAlias(const QString &)),
-        _gui, SLOT(slotFolderOpenAction(QString)));
-    connect(accountSettings, SIGNAL(showIssuesList(QString)), SLOT(showIssuesList(QString)));
-    connect(s->account().data(), SIGNAL(accountChangedAvatar()), SLOT(slotAccountAvatarChanged()));
+    connect(accountSettings, &AccountSettings::folderChanged, _gui, &ownCloudGui::slotFoldersChanged);
+    connect(accountSettings, &AccountSettings::openFolderAlias,
+        _gui, &ownCloudGui::slotFolderOpenAction);
+    connect(accountSettings, &AccountSettings::showIssuesList, this, &SettingsDialog::showIssuesList);
+    connect(s->account().data(), &Account::accountChangedAvatar, this, &SettingsDialog::slotAccountAvatarChanged);
 
     slotRefreshActivity(s);
 }
index aa47598e92ebc70078cde82258ea39fbdc8ad2c0..a81d20894b0466b42f7bc951007f73344f4654f2 100644 (file)
@@ -58,10 +58,10 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState,
     _ui->setupUi(this);
 
     QPushButton *closeButton = _ui->buttonBox->button(QDialogButtonBox::Close);
-    connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
+    connect(closeButton, &QAbstractButton::clicked, this, &QWidget::close);
 
     // We want to act on account state changes
-    connect(_accountState, SIGNAL(stateChanged(int)), SLOT(slotAccountStateChanged(int)));
+    connect(_accountState.data(), &AccountState::stateChanged, this, &ShareDialog::slotAccountStateChanged);
 
     // Because people press enter in the dialog and we don't want to close for that
     closeButton->setDefault(false);
@@ -118,7 +118,7 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState,
 
     if (QFileInfo(_localPath).isFile()) {
         ThumbnailJob *job = new ThumbnailJob(_sharePath, _accountState->account(), this);
-        connect(job, SIGNAL(jobFinished(int, QByteArray)), SLOT(slotThumbnailFetched(int, QByteArray)));
+        connect(job, &ThumbnailJob::jobFinished, this, &ShareDialog::slotThumbnailFetched);
         job->start();
     }
 
@@ -135,8 +135,8 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState,
         << "http://open-collaboration-services.org/ns:share-permissions"
         << "http://owncloud.org/ns:privatelink");
     job->setTimeout(10 * 1000);
-    connect(job, SIGNAL(result(QVariantMap)), SLOT(slotPropfindReceived(QVariantMap)));
-    connect(job, SIGNAL(finishedWithError(QNetworkReply *)), SLOT(slotPropfindError()));
+    connect(job, &PropfindJob::result, this, &ShareDialog::slotPropfindReceived);
+    connect(job, &PropfindJob::finishedWithError, this, &ShareDialog::slotPropfindError);
     job->start();
 }
 
index 2d1ca4d498ff375e660a2d3dd7bffe3598e5b8ac..e1cec2ff125878f2cddfcb02f81a377c4824f0e3 100644 (file)
@@ -72,8 +72,8 @@ void ShareeModel::fetch(const QString &search, const ShareeSet &blacklist)
     _search = search;
     _shareeBlacklist = blacklist;
     OcsShareeJob *job = new OcsShareeJob(_account);
-    connect(job, SIGNAL(shareeJobFinished(QJsonDocument)), SLOT(shareesFetched(QJsonDocument)));
-    connect(job, SIGNAL(ocsError(int, QString)), SIGNAL(displayErrorMessage(int, QString)));
+    connect(job, &OcsShareeJob::shareeJobFinished, this, &ShareeModel::shareesFetched);
+    connect(job, &OcsJob::ocsError, this, &ShareeModel::displayErrorMessage);
     job->getSharees(_search, _type, 1, 50);
 }
 
index bba3151bbbc3017541a838968595e60ddcb05dd6..3f542c0d38519d6b6fe8b26605e7219496454491 100644 (file)
@@ -71,18 +71,18 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
     _ui->layout_editing->addWidget(_pi_editing, 0, 2);
     _ui->horizontalLayout_expire->insertWidget(_ui->horizontalLayout_expire->count() - 1, _pi_date);
 
-    connect(_ui->nameLineEdit, SIGNAL(returnPressed()), SLOT(slotShareNameEntered()));
-    connect(_ui->createShareButton, SIGNAL(clicked(bool)), SLOT(slotShareNameEntered()));
-    connect(_ui->linkShares, SIGNAL(itemSelectionChanged()), SLOT(slotShareSelectionChanged()));
-    connect(_ui->linkShares, SIGNAL(itemChanged(QTableWidgetItem *)), SLOT(slotNameEdited(QTableWidgetItem *)));
-    connect(_ui->checkBox_password, SIGNAL(clicked()), this, SLOT(slotCheckBoxPasswordClicked()));
-    connect(_ui->lineEdit_password, SIGNAL(returnPressed()), this, SLOT(slotPasswordReturnPressed()));
-    connect(_ui->lineEdit_password, SIGNAL(textChanged(QString)), this, SLOT(slotPasswordChanged(QString)));
-    connect(_ui->pushButton_setPassword, SIGNAL(clicked(bool)), SLOT(slotPasswordReturnPressed()));
-    connect(_ui->checkBox_expire, SIGNAL(clicked()), this, SLOT(slotCheckBoxExpireClicked()));
-    connect(_ui->calendar, SIGNAL(dateChanged(QDate)), SLOT(slotExpireDateChanged(QDate)));
-    connect(_ui->checkBox_editing, SIGNAL(clicked()), this, SLOT(slotPermissionsCheckboxClicked()));
-    connect(_ui->checkBox_fileListing, SIGNAL(clicked(bool)), this, SLOT(slotPermissionsCheckboxClicked()));
+    connect(_ui->nameLineEdit, &QLineEdit::returnPressed, this, &ShareLinkWidget::slotShareNameEntered);
+    connect(_ui->createShareButton, &QAbstractButton::clicked, this, &ShareLinkWidget::slotShareNameEntered);
+    connect(_ui->linkShares, &QTableWidget::itemSelectionChanged, this, &ShareLinkWidget::slotShareSelectionChanged);
+    connect(_ui->linkShares, &QTableWidget::itemChanged, this, &ShareLinkWidget::slotNameEdited);
+    connect(_ui->checkBox_password, &QAbstractButton::clicked, this, &ShareLinkWidget::slotCheckBoxPasswordClicked);
+    connect(_ui->lineEdit_password, &QLineEdit::returnPressed, this, &ShareLinkWidget::slotPasswordReturnPressed);
+    connect(_ui->lineEdit_password, &QLineEdit::textChanged, this, &ShareLinkWidget::slotPasswordChanged);
+    connect(_ui->pushButton_setPassword, &QAbstractButton::clicked, this, &ShareLinkWidget::slotPasswordReturnPressed);
+    connect(_ui->checkBox_expire, &QAbstractButton::clicked, this, &ShareLinkWidget::slotCheckBoxExpireClicked);
+    connect(_ui->calendar, &QDateTimeEdit::dateChanged, this, &ShareLinkWidget::slotExpireDateChanged);
+    connect(_ui->checkBox_editing, &QAbstractButton::clicked, this, &ShareLinkWidget::slotPermissionsCheckboxClicked);
+    connect(_ui->checkBox_fileListing, &QAbstractButton::clicked, this, &ShareLinkWidget::slotPermissionsCheckboxClicked);
 
     _ui->errorLabel->hide();
 
@@ -156,8 +156,8 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
     // Prepare sharing menu
 
     _shareLinkMenu = new QMenu(this);
-    connect(_shareLinkMenu, SIGNAL(triggered(QAction *)),
-        SLOT(slotShareLinkActionTriggered(QAction *)));
+    connect(_shareLinkMenu, &QMenu::triggered,
+        this, &ShareLinkWidget::slotShareLinkActionTriggered);
     _openLinkAction = _shareLinkMenu->addAction(tr("Open link in browser"));
     _copyLinkAction = _shareLinkMenu->addAction(tr("Copy link to clipboard"));
     _copyDirectLinkAction = _shareLinkMenu->addAction(tr("Copy link to clipboard (direct download)"));
@@ -169,10 +169,10 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
      */
     if (sharingPossible) {
         _manager = new ShareManager(_account, this);
-        connect(_manager, SIGNAL(sharesFetched(QList<QSharedPointer<Share>>)), SLOT(slotSharesFetched(QList<QSharedPointer<Share>>)));
+        connect(_manager, &ShareManager::sharesFetched, this, &ShareLinkWidget::slotSharesFetched);
         connect(_manager, SIGNAL(linkShareCreated(QSharedPointer<LinkShare>)), SLOT(slotCreateShareFetched(const QSharedPointer<LinkShare>)));
-        connect(_manager, SIGNAL(linkShareRequiresPassword(QString)), SLOT(slotCreateShareRequiresPassword(QString)));
-        connect(_manager, SIGNAL(serverError(int, QString)), SLOT(slotServerError(int, QString)));
+        connect(_manager, &ShareManager::linkShareRequiresPassword, this, &ShareLinkWidget::slotCreateShareRequiresPassword);
+        connect(_manager, &ShareManager::serverError, this, &ShareLinkWidget::slotServerError);
     }
 }
 
@@ -218,13 +218,13 @@ void ShareLinkWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shar
         auto linkShare = qSharedPointerDynamicCast<LinkShare>(share);
 
         // Connect all shares signals to gui slots
-        connect(share.data(), SIGNAL(serverError(int, QString)), SLOT(slotServerError(int, QString)));
-        connect(share.data(), SIGNAL(shareDeleted()), SLOT(slotDeleteShareFetched()));
+        connect(share.data(), &Share::serverError, this, &ShareLinkWidget::slotServerError);
+        connect(share.data(), &Share::shareDeleted, this, &ShareLinkWidget::slotDeleteShareFetched);
         connect(share.data(), SIGNAL(expireDateSet()), SLOT(slotExpireSet()));
         connect(share.data(), SIGNAL(publicUploadSet()), SLOT(slotPermissionsSet()));
         connect(share.data(), SIGNAL(passwordSet()), SLOT(slotPasswordSet()));
         connect(share.data(), SIGNAL(passwordSetError(int, QString)), SLOT(slotPasswordSetError(int, QString)));
-        connect(share.data(), SIGNAL(permissionsSet()), SLOT(slotPermissionsSet()));
+        connect(share.data(), &Share::permissionsSet, this, &ShareLinkWidget::slotPermissionsSet);
 
         // Build the table row
         auto row = table->rowCount();
@@ -247,13 +247,13 @@ void ShareLinkWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shar
         auto shareButton = new QToolButton;
         shareButton->setText("...");
         shareButton->setProperty(propertyShareC, QVariant::fromValue(linkShare));
-        connect(shareButton, SIGNAL(clicked(bool)), SLOT(slotShareLinkButtonClicked()));
+        connect(shareButton, &QAbstractButton::clicked, this, &ShareLinkWidget::slotShareLinkButtonClicked);
         table->setCellWidget(row, 1, shareButton);
 
         auto deleteButton = new QToolButton;
         deleteButton->setIcon(deleteIcon);
         deleteButton->setProperty(propertyShareC, QVariant::fromValue(linkShare));
-        connect(deleteButton, SIGNAL(clicked(bool)), SLOT(slotDeleteShareClicked()));
+        connect(deleteButton, &QAbstractButton::clicked, this, &ShareLinkWidget::slotDeleteShareClicked);
         table->setCellWidget(row, 2, deleteButton);
 
         // Reestablish the previous selection
index 37c39839fa0771d6d24d08c0ff5e76ac261aa97c..95a976451829b3c117999a78769964eb611adea4 100644 (file)
@@ -72,8 +72,8 @@ QSharedPointer<Sharee> Share::getShareWith() const
 void Share::setPermissions(Permissions permissions)
 {
     OcsShareJob *job = new OcsShareJob(_account);
-    connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotPermissionsSet(QJsonDocument, QVariant)));
-    connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString)));
+    connect(job, &OcsShareJob::shareJobFinished, this, &Share::slotPermissionsSet);
+    connect(job, &OcsJob::ocsError, this, &Share::slotOcsError);
     job->setPermissions(getId(), permissions);
 }
 
@@ -91,8 +91,8 @@ Share::Permissions Share::getPermissions() const
 void Share::deleteShare()
 {
     OcsShareJob *job = new OcsShareJob(_account);
-    connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotDeleted()));
-    connect(job, SIGNAL(ocsError(int, const QString &)), SLOT(slotOcsError(int, const QString &)));
+    connect(job, &OcsShareJob::shareJobFinished, this, &Share::slotDeleted);
+    connect(job, &OcsJob::ocsError, this, &Share::slotOcsError);
     job->deleteShare(getId());
 }
 
@@ -164,8 +164,8 @@ QString LinkShare::getName() const
 void LinkShare::setName(const QString &name)
 {
     OcsShareJob *job = new OcsShareJob(_account);
-    connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotNameSet(QJsonDocument, QVariant)));
-    connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString)));
+    connect(job, &OcsShareJob::shareJobFinished, this, &LinkShare::slotNameSet);
+    connect(job, &OcsJob::ocsError, this, &LinkShare::slotOcsError);
     job->setName(getId(), name);
 }
 
@@ -177,8 +177,8 @@ QString LinkShare::getToken() const
 void LinkShare::setPassword(const QString &password)
 {
     OcsShareJob *job = new OcsShareJob(_account);
-    connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotPasswordSet(QJsonDocument, QVariant)));
-    connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotSetPasswordError(int, QString)));
+    connect(job, &OcsShareJob::shareJobFinished, this, &LinkShare::slotPasswordSet);
+    connect(job, &OcsJob::ocsError, this, &LinkShare::slotSetPasswordError);
     job->setPassword(getId(), password);
 }
 
@@ -191,8 +191,8 @@ void LinkShare::slotPasswordSet(const QJsonDocument &, const QVariant &value)
 void LinkShare::setExpireDate(const QDate &date)
 {
     OcsShareJob *job = new OcsShareJob(_account);
-    connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotExpireDateSet(QJsonDocument, QVariant)));
-    connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString)));
+    connect(job, &OcsShareJob::shareJobFinished, this, &LinkShare::slotExpireDateSet);
+    connect(job, &OcsJob::ocsError, this, &LinkShare::slotOcsError);
     job->setExpireDate(getId(), date);
 }
 
@@ -234,8 +234,8 @@ void ShareManager::createLinkShare(const QString &path,
     const QString &password)
 {
     OcsShareJob *job = new OcsShareJob(_account);
-    connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotLinkShareCreated(QJsonDocument)));
-    connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString)));
+    connect(job, &OcsShareJob::shareJobFinished, this, &ShareManager::slotLinkShareCreated);
+    connect(job, &OcsJob::ocsError, this, &ShareManager::slotOcsError);
     job->createLinkShare(path, name, password);
 }
 
@@ -276,8 +276,8 @@ void ShareManager::createShare(const QString &path,
     continuation.permissions = permissions;
     _jobContinuation[job] = QVariant::fromValue(continuation);
 
-    connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotCreateShare(QJsonDocument)));
-    connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString)));
+    connect(job, &OcsShareJob::shareJobFinished, this, &ShareManager::slotCreateShare);
+    connect(job, &OcsJob::ocsError, this, &ShareManager::slotOcsError);
     job->getSharedWithMe();
 }
 
@@ -308,8 +308,8 @@ void ShareManager::slotCreateShare(const QJsonDocument &reply)
     }
 
     OcsShareJob *job = new OcsShareJob(_account);
-    connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotShareCreated(QJsonDocument)));
-    connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString)));
+    connect(job, &OcsShareJob::shareJobFinished, this, &ShareManager::slotShareCreated);
+    connect(job, &OcsJob::ocsError, this, &ShareManager::slotOcsError);
     job->createShare(cont.path, cont.shareType, cont.shareWith, cont.permissions);
 }
 
@@ -325,8 +325,8 @@ void ShareManager::slotShareCreated(const QJsonDocument &reply)
 void ShareManager::fetchShares(const QString &path)
 {
     OcsShareJob *job = new OcsShareJob(_account);
-    connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotSharesFetched(QJsonDocument)));
-    connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString)));
+    connect(job, &OcsShareJob::shareJobFinished, this, &ShareManager::slotSharesFetched);
+    connect(job, &OcsJob::ocsError, this, &ShareManager::slotOcsError);
     job->getShares(path);
 }
 
index 5b505f21a34220f92d8a4b6b13c84dbf5b7fc451..848ecfbfb9535da96c58c77e04e1c7ef2e6f51a0 100644 (file)
@@ -71,8 +71,8 @@ ShareUserGroupWidget::ShareUserGroupWidget(AccountPtr account,
     _completerModel = new ShareeModel(_account,
         _isFile ? QLatin1String("file") : QLatin1String("folder"),
         _completer);
-    connect(_completerModel, SIGNAL(shareesReady()), this, SLOT(slotShareesReady()));
-    connect(_completerModel, SIGNAL(displayErrorMessage(int, QString)), this, SLOT(displayError(int, QString)));
+    connect(_completerModel, &ShareeModel::shareesReady, this, &ShareUserGroupWidget::slotShareesReady);
+    connect(_completerModel, &ShareeModel::displayErrorMessage, this, &ShareUserGroupWidget::displayError);
 
     _completer->setModel(_completerModel);
     _completer->setCaseSensitivity(Qt::CaseInsensitive);
@@ -80,11 +80,11 @@ ShareUserGroupWidget::ShareUserGroupWidget(AccountPtr account,
     _ui->shareeLineEdit->setCompleter(_completer);
 
     _manager = new ShareManager(_account, this);
-    connect(_manager, SIGNAL(sharesFetched(QList<QSharedPointer<Share>>)), SLOT(slotSharesFetched(QList<QSharedPointer<Share>>)));
-    connect(_manager, SIGNAL(shareCreated(QSharedPointer<Share>)), SLOT(getShares()));
-    connect(_manager, SIGNAL(serverError(int, QString)), this, SLOT(displayError(int, QString)));
-    connect(_ui->shareeLineEdit, SIGNAL(returnPressed()), SLOT(slotLineEditReturn()));
-    connect(_ui->privateLinkText, SIGNAL(linkActivated(QString)), SLOT(slotPrivateLinkShare()));
+    connect(_manager, &ShareManager::sharesFetched, this, &ShareUserGroupWidget::slotSharesFetched);
+    connect(_manager, &ShareManager::shareCreated, this, &ShareUserGroupWidget::getShares);
+    connect(_manager, &ShareManager::serverError, this, &ShareUserGroupWidget::displayError);
+    connect(_ui->shareeLineEdit, &QLineEdit::returnPressed, this, &ShareUserGroupWidget::slotLineEditReturn);
+    connect(_ui->privateLinkText, &QLabel::linkActivated, this, &ShareUserGroupWidget::slotPrivateLinkShare);
 
     // By making the next two QueuedConnections we can override
     // the strings the completer sets on the line edit.
@@ -94,9 +94,9 @@ ShareUserGroupWidget::ShareUserGroupWidget(AccountPtr account,
         Qt::QueuedConnection);
 
     // Queued connection so this signal is recieved after textChanged
-    connect(_ui->shareeLineEdit, SIGNAL(textEdited(QString)),
-        this, SLOT(slotLineEditTextEdited(QString)), Qt::QueuedConnection);
-    connect(&_completionTimer, SIGNAL(timeout()), this, SLOT(searchForSharees()));
+    connect(_ui->shareeLineEdit, &QLineEdit::textEdited,
+        this, &ShareUserGroupWidget::slotLineEditTextEdited, Qt::QueuedConnection);
+    connect(&_completionTimer, &QTimer::timeout, this, &ShareUserGroupWidget::searchForSharees);
     _completionTimer.setSingleShot(true);
     _completionTimer.setInterval(600);
 
@@ -192,8 +192,8 @@ void ShareUserGroupWidget::slotSharesFetched(const QList<QSharedPointer<Share>>
             }
 
             ShareUserLine *s = new ShareUserLine(share, _maxSharingPermissions, _isFile, _ui->scrollArea);
-            connect(s, SIGNAL(resizeRequested()), this, SLOT(slotAdjustScrollWidgetSize()));
-            connect(s, SIGNAL(visualDeletionDone()), this, SLOT(getShares()));
+            connect(s, &ShareUserLine::resizeRequested, this, &ShareUserGroupWidget::slotAdjustScrollWidgetSize);
+            connect(s, &ShareUserLine::visualDeletionDone, this, &ShareUserGroupWidget::getShares);
             layout->addWidget(s);
 
             x++;
@@ -390,11 +390,11 @@ ShareUserLine::ShareUserLine(QSharedPointer<Share> share,
     _ui->permissionsEdit->setEnabled(maxSharingPermissions
         & (SharePermissionCreate | SharePermissionUpdate | SharePermissionDelete));
 
-    connect(_permissionUpdate, SIGNAL(triggered(bool)), SLOT(slotPermissionsChanged()));
-    connect(_permissionCreate, SIGNAL(triggered(bool)), SLOT(slotPermissionsChanged()));
-    connect(_permissionDelete, SIGNAL(triggered(bool)), SLOT(slotPermissionsChanged()));
-    connect(_ui->permissionShare, SIGNAL(clicked(bool)), SLOT(slotPermissionsChanged()));
-    connect(_ui->permissionsEdit, SIGNAL(clicked(bool)), SLOT(slotEditPermissionsChanged()));
+    connect(_permissionUpdate, &QAction::triggered, this, &ShareUserLine::slotPermissionsChanged);
+    connect(_permissionCreate, &QAction::triggered, this, &ShareUserLine::slotPermissionsChanged);
+    connect(_permissionDelete, &QAction::triggered, this, &ShareUserLine::slotPermissionsChanged);
+    connect(_ui->permissionShare, &QAbstractButton::clicked, this, &ShareUserLine::slotPermissionsChanged);
+    connect(_ui->permissionsEdit, &QAbstractButton::clicked, this, &ShareUserLine::slotEditPermissionsChanged);
 
     /*
      * We don't show permssion share for federated shares with server <9.1
@@ -407,8 +407,8 @@ ShareUserLine::ShareUserLine(QSharedPointer<Share> share,
         _ui->permissionToolButton->setVisible(false);
     }
 
-    connect(share.data(), SIGNAL(permissionsSet()), SLOT(slotPermissionsSet()));
-    connect(share.data(), SIGNAL(shareDeleted()), SLOT(slotShareDeleted()));
+    connect(share.data(), &Share::permissionsSet, this, &ShareUserLine::slotPermissionsSet);
+    connect(share.data(), &Share::shareDeleted, this, &ShareUserLine::slotShareDeleted);
 
     _ui->deleteShareButton->setIcon(QIcon::fromTheme(QLatin1String("user-trash"),
         QIcon(QLatin1String(":/client/resources/delete.png"))));
@@ -509,8 +509,8 @@ void ShareUserLine::slotShareDeleted()
     animation->setStartValue(height());
     animation->setEndValue(0);
 
-    connect(animation, SIGNAL(finished()), SLOT(slotDeleteAnimationFinished()));
-    connect(animation, SIGNAL(valueChanged(QVariant)), this, SIGNAL(resizeRequested()));
+    connect(animation, &QAbstractAnimation::finished, this, &ShareUserLine::slotDeleteAnimationFinished);
+    connect(animation, &QVariantAnimation::valueChanged, this, &ShareUserLine::resizeRequested);
 
     animation->start();
 }
index 0073e6154b1663e7a0b62d0d681d8d3325cb9a72..b46ff1c21481e525d7f6da9e659fdcd5c3c1d93f 100644 (file)
@@ -207,10 +207,10 @@ SocketApi::SocketApi(QObject *parent)
         qCInfo(lcSocketApi) << "server started, listening at " << socketPath;
     }
 
-    connect(&_localServer, SIGNAL(newConnection()), this, SLOT(slotNewConnection()));
+    connect(&_localServer, &QLocalServer::newConnection, this, &SocketApi::slotNewConnection);
 
     // folder watcher
-    connect(FolderMan::instance(), SIGNAL(folderSyncStateChange(Folder *)), this, SLOT(slotUpdateFolderView(Folder *)));
+    connect(FolderMan::instance(), &FolderMan::folderSyncStateChange, this, &SocketApi::slotUpdateFolderView);
 }
 
 SocketApi::~SocketApi()
@@ -230,9 +230,9 @@ void SocketApi::slotNewConnection()
         return;
     }
     qCInfo(lcSocketApi) << "New connection" << socket;
-    connect(socket, SIGNAL(readyRead()), this, SLOT(slotReadSocket()));
+    connect(socket, &QIODevice::readyRead, this, &SocketApi::slotReadSocket);
     connect(socket, SIGNAL(disconnected()), this, SLOT(onLostConnection()));
-    connect(socket, SIGNAL(destroyed(QObject *)), this, SLOT(slotSocketDestroyed(QObject *)));
+    connect(socket, &QObject::destroyed, this, &SocketApi::slotSocketDestroyed);
     ASSERT(socket->readAll().isEmpty());
 
     _listeners.append(SocketListener(socket));
index e6c87e1f3fb25e2e0591a95fac3d7bf624eeb5e7..b1a16317cf892175a96bf0052f7a2758b1482b66 100644 (file)
@@ -35,8 +35,8 @@ SslButton::SslButton(QWidget *parent)
     setAutoRaise(true);
 
     _menu = new QMenu(this);
-    QObject::connect(_menu, SIGNAL(aboutToShow()),
-        this, SLOT(slotUpdateMenu()));
+    QObject::connect(_menu, &QMenu::aboutToShow,
+        this, &SslButton::slotUpdateMenu);
 }
 
 QString SslButton::protoToString(QSsl::SslProtocol proto)
index 83ebcffe8f8c8e5682cc10713d1a60aee73c509c..bd4c9b45b4eb49841043ad7fbc1c2ce33ccfcb5c 100644 (file)
@@ -68,13 +68,13 @@ SslErrorDialog::SslErrorDialog(AccountPtr account, QWidget *parent)
     QPushButton *cancelButton =
         _ui->_dialogButtonBox->button(QDialogButtonBox::Cancel);
     okButton->setEnabled(false);
-    connect(_ui->_cbTrustConnect, SIGNAL(clicked(bool)),
-        okButton, SLOT(setEnabled(bool)));
+    connect(_ui->_cbTrustConnect, &QAbstractButton::clicked,
+        okButton, &QWidget::setEnabled);
 
     if (okButton) {
         okButton->setDefault(true);
-        connect(okButton, SIGNAL(clicked()), SLOT(accept()));
-        connect(cancelButton, SIGNAL(clicked()), SLOT(reject()));
+        connect(okButton, &QAbstractButton::clicked, this, &QDialog::accept);
+        connect(cancelButton, &QAbstractButton::clicked, this, &QDialog::reject);
     }
 }
 
index d57f288518796e5a0950768a919f8029d8027e40..eb58721d8c3440676fdd91f61baf5df09513e465 100644 (file)
@@ -41,7 +41,7 @@ SyncLogDialog::SyncLogDialog(QWidget *parent, ProtocolWidget *protoWidget)
 
     QPushButton *closeButton = _ui->buttonBox->button(QDialogButtonBox::Close);
     if (closeButton) {
-        connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
+        connect(closeButton, &QAbstractButton::clicked, this, &QWidget::close);
     }
 }
 
index 30f12a39c713f89509b7c3ec11df1b97bf7e9a49..205dfc64fb377e17285cc85d41bf21c47789ec75 100644 (file)
@@ -24,8 +24,8 @@ ToolTipUpdater::ToolTipUpdater(QTreeView *treeView)
     : QObject(treeView)
     , _treeView(treeView)
 {
-    connect(_treeView->model(), SIGNAL(dataChanged(QModelIndex, QModelIndex, QVector<int>)),
-        SLOT(dataChanged(QModelIndex, QModelIndex, QVector<int>)));
+    connect(_treeView->model(), &QAbstractItemModel::dataChanged,
+        this, &ToolTipUpdater::dataChanged);
     _treeView->viewport()->installEventFilter(this);
 }
 
index f1b3e1efde9109101b6788d224e58bc54566566e..8a5a9eff85f7f7cadf9ed0159f24578c5c4b3b00 100644 (file)
@@ -39,18 +39,18 @@ static const char autoUpdateAttemptedC[] = "Updater/autoUpdateAttempted";
 UpdaterScheduler::UpdaterScheduler(QObject *parent)
     : QObject(parent)
 {
-    connect(&_updateCheckTimer, SIGNAL(timeout()),
-        this, SLOT(slotTimerFired()));
+    connect(&_updateCheckTimer, &QTimer::timeout,
+        this, &UpdaterScheduler::slotTimerFired);
 
     // Note: the sparkle-updater is not an OCUpdater
     if (OCUpdater *updater = qobject_cast<OCUpdater *>(Updater::instance())) {
-        connect(updater, SIGNAL(newUpdateAvailable(QString, QString)),
-            this, SIGNAL(updaterAnnouncement(QString, QString)));
-        connect(updater, SIGNAL(requestRestart()), SIGNAL(requestRestart()));
+        connect(updater, &OCUpdater::newUpdateAvailable,
+            this, &UpdaterScheduler::updaterAnnouncement);
+        connect(updater, &OCUpdater::requestRestart, this, &UpdaterScheduler::requestRestart);
     }
 
     // at startup, do a check in any case.
-    QTimer::singleShot(3000, this, SLOT(slotTimerFired()));
+    QTimer::singleShot(3000, this, &UpdaterScheduler::slotTimerFired);
 
     ConfigFile cfg;
     auto checkInterval = cfg.updateCheckInterval();
@@ -194,9 +194,9 @@ void OCUpdater::slotStartInstaller()
 void OCUpdater::checkForUpdate()
 {
     QNetworkReply *reply = _accessManager->get(QNetworkRequest(_updateUrl));
-    connect(_timeoutWatchdog, SIGNAL(timeout()), this, SLOT(slotTimedOut()));
+    connect(_timeoutWatchdog, &QTimer::timeout, this, &OCUpdater::slotTimedOut);
     _timeoutWatchdog->start(30 * 1000);
-    connect(reply, SIGNAL(finished()), this, SLOT(slotVersionInfoArrived()));
+    connect(reply, &QNetworkReply::finished, this, &OCUpdater::slotVersionInfoArrived);
 
     setDownloadState(CheckingServer);
 }
@@ -303,8 +303,8 @@ void NSISUpdater::versionInfoArrived(const UpdateInfo &info)
                 setDownloadState(DownloadComplete);
             } else {
                 QNetworkReply *reply = qnam()->get(QNetworkRequest(QUrl(url)));
-                connect(reply, SIGNAL(readyRead()), SLOT(slotWriteFile()));
-                connect(reply, SIGNAL(finished()), SLOT(slotDownloadFinished()));
+                connect(reply, &QIODevice::readyRead, this, &NSISUpdater::slotWriteFile);
+                connect(reply, &QNetworkReply::finished, this, &NSISUpdater::slotDownloadFinished);
                 setDownloadState(Downloading);
                 _file.reset(new QTemporaryFile);
                 _file->setAutoRemove(true);
@@ -353,11 +353,11 @@ void NSISUpdater::showDialog(const UpdateInfo &info)
     QPushButton *reject = bb->addButton(tr("Skip this time"), QDialogButtonBox::AcceptRole);
     QPushButton *getupdate = bb->addButton(tr("Get update"), QDialogButtonBox::AcceptRole);
 
-    connect(skip, SIGNAL(clicked()), msgBox, SLOT(reject()));
-    connect(reject, SIGNAL(clicked()), msgBox, SLOT(reject()));
-    connect(getupdate, SIGNAL(clicked()), msgBox, SLOT(accept()));
+    connect(skip, &QAbstractButton::clicked, msgBox, &QDialog::reject);
+    connect(reject, &QAbstractButton::clicked, msgBox, &QDialog::reject);
+    connect(getupdate, &QAbstractButton::clicked, msgBox, &QDialog::accept);
 
-    connect(skip, SIGNAL(clicked()), SLOT(slotSetSeenVersion()));
+    connect(skip, &QAbstractButton::clicked, this, &NSISUpdater::slotSetSeenVersion);
     connect(getupdate, SIGNAL(clicked()), SLOT(slotOpenUpdateUrl()));
 
     layout->addWidget(bb);
index 9bc1b60c309ed2ff69e4c0b7a0943793996f6f73..a181faac0cd494af3aa2e94d721fef4519019870 100644 (file)
@@ -54,12 +54,12 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
     stopSpinner();
     setupCustomization();
 
-    connect(_ui.pbSelectLocalFolder, SIGNAL(clicked()), SLOT(slotSelectFolder()));
+    connect(_ui.pbSelectLocalFolder, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectFolder);
     setButtonText(QWizard::NextButton, tr("Connect..."));
 
-    connect(_ui.rSyncEverything, SIGNAL(clicked()), SLOT(slotSyncEverythingClicked()));
-    connect(_ui.rSelectiveSync, SIGNAL(clicked()), SLOT(slotSelectiveSyncClicked()));
-    connect(_ui.bSelectiveSync, SIGNAL(clicked()), SLOT(slotSelectiveSyncClicked()));
+    connect(_ui.rSyncEverything, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSyncEverythingClicked);
+    connect(_ui.rSelectiveSync, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
+    connect(_ui.bSelectiveSync, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
 
     QIcon appIcon = theme->applicationIcon();
     _ui.lServerIcon->setText(QString());
@@ -120,13 +120,13 @@ void OwncloudAdvancedSetupPage::initializePage()
     auto quotaJob = new PropfindJob(acc, _remoteFolder, this);
     quotaJob->setProperties(QList<QByteArray>() << "http://owncloud.org/ns:size");
 
-    connect(quotaJob, SIGNAL(result(QVariantMap)), SLOT(slotQuotaRetrieved(QVariantMap)));
+    connect(quotaJob, &PropfindJob::result, this, &OwncloudAdvancedSetupPage::slotQuotaRetrieved);
     quotaJob->start();
 
 
     if (Theme::instance()->wizardSelectiveSyncDefaultNothing()) {
         _selectiveSyncBlacklist = QStringList("/");
-        QTimer::singleShot(0, this, SLOT(slotSelectiveSyncClicked()));
+        QTimer::singleShot(0, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
     }
 
     ConfigFile cfgFile;
index 3e40f1546a4b095c958280cb2967580ffdb3e849..2c4bd12a51067b377644b3634434ec269b69c15b 100644 (file)
@@ -24,9 +24,9 @@ OwncloudConnectionMethodDialog::OwncloudConnectionMethodDialog(QWidget *parent)
 {
     ui->setupUi(this);
 
-    connect(ui->btnNoTLS, SIGNAL(clicked(bool)), this, SLOT(returnNoTLS()));
-    connect(ui->btnClientSideTLS, SIGNAL(clicked(bool)), this, SLOT(returnClientSideTLS()));
-    connect(ui->btnBack, SIGNAL(clicked(bool)), this, SLOT(returnBack()));
+    connect(ui->btnNoTLS, &QAbstractButton::clicked, this, &OwncloudConnectionMethodDialog::returnNoTLS);
+    connect(ui->btnClientSideTLS, &QAbstractButton::clicked, this, &OwncloudConnectionMethodDialog::returnClientSideTLS);
+    connect(ui->btnBack, &QAbstractButton::clicked, this, &OwncloudConnectionMethodDialog::returnBack);
 }
 
 void OwncloudConnectionMethodDialog::setUrl(const QUrl &url)
index 31a3bbc8ed355414d180dc76ad613673f8cd48cd..4440fe21a5bcd1d338a94ac3583a5d68da0e3057 100644 (file)
@@ -66,8 +66,8 @@ OwncloudSetupPage::OwncloudSetupPage(QWidget *parent)
     setupCustomization();
 
     slotUrlChanged(QLatin1String("")); // don't jitter UI
-    connect(_ui.leUrl, SIGNAL(textChanged(QString)), SLOT(slotUrlChanged(QString)));
-    connect(_ui.leUrl, SIGNAL(editingFinished()), SLOT(slotUrlEditFinished()));
+    connect(_ui.leUrl, &QLineEdit::textChanged, this, &OwncloudSetupPage::slotUrlChanged);
+    connect(_ui.leUrl, &QLineEdit::editingFinished, this, &OwncloudSetupPage::slotUrlEditFinished);
 
     addCertDial = new AddCertificateDialog(this);
 }
@@ -268,7 +268,7 @@ void OwncloudSetupPage::setErrorString(const QString &err, bool retryHTTPonly)
                 } break;
                 case OwncloudConnectionMethodDialog::Client_Side_TLS:
                     addCertDial->show();
-                    connect(addCertDial, SIGNAL(accepted()), this, SLOT(slotCertificateAccepted()));
+                    connect(addCertDial, &QDialog::accepted, this, &OwncloudSetupPage::slotCertificateAccepted);
                     break;
                 case OwncloudConnectionMethodDialog::Closed:
                 case OwncloudConnectionMethodDialog::Back:
index 9d88555a615dd3e664f7cb04fc8c5540bab3effd..1467ea54901d29fe638035305fdc7fbfc4b479df 100644 (file)
@@ -49,10 +49,10 @@ void OwncloudShibbolethCredsPage::setupBrowser()
     qnam->setCookieJar(jar);
 
     _browser = new ShibbolethWebView(account);
-    connect(_browser, SIGNAL(shibbolethCookieReceived(const QNetworkCookie &)),
-        this, SLOT(slotShibbolethCookieReceived(const QNetworkCookie &)), Qt::QueuedConnection);
-    connect(_browser, SIGNAL(rejected()),
-        this, SLOT(slotBrowserRejected()));
+    connect(_browser.data(), &ShibbolethWebView::shibbolethCookieReceived,
+        this, &OwncloudShibbolethCredsPage::slotShibbolethCookieReceived, Qt::QueuedConnection);
+    connect(_browser.data(), &ShibbolethWebView::rejected,
+        this, &OwncloudShibbolethCredsPage::slotBrowserRejected);
 
     _browser->move(ocWizard->x(), ocWizard->y());
     _browser->show();
index a1c24bbd445b82c2120b8acd0f45ee61aa4619d0..f1397c9b565c8c4f2c39fb7ced993a0cc971c887 100644 (file)
@@ -62,22 +62,22 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
     setPage(WizardCommon::Page_AdvancedSetup, _advancedSetupPage);
     setPage(WizardCommon::Page_Result, _resultPage);
 
-    connect(this, SIGNAL(finished(int)), SIGNAL(basicSetupFinished(int)));
+    connect(this, &QDialog::finished, this, &OwncloudWizard::basicSetupFinished);
 
     // note: start Id is set by the calling class depending on if the
     // welcome text is to be shown or not.
     setWizardStyle(QWizard::ModernStyle);
 
-    connect(this, SIGNAL(currentIdChanged(int)), SLOT(slotCurrentPageChanged(int)));
-    connect(_setupPage, SIGNAL(determineAuthType(QString)), SIGNAL(determineAuthType(QString)));
-    connect(_httpCredsPage, SIGNAL(connectToOCUrl(QString)), SIGNAL(connectToOCUrl(QString)));
-    connect(_browserCredsPage, SIGNAL(connectToOCUrl(QString)), SIGNAL(connectToOCUrl(QString)));
+    connect(this, &QWizard::currentIdChanged, this, &OwncloudWizard::slotCurrentPageChanged);
+    connect(_setupPage, &OwncloudSetupPage::determineAuthType, this, &OwncloudWizard::determineAuthType);
+    connect(_httpCredsPage, &OwncloudHttpCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
+    connect(_browserCredsPage, &OwncloudOAuthCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
 #ifndef NO_SHIBBOLETH
-    connect(_shibbolethCredsPage, SIGNAL(connectToOCUrl(QString)), SIGNAL(connectToOCUrl(QString)));
+    connect(_shibbolethCredsPage, &OwncloudShibbolethCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
 #endif
-    connect(_advancedSetupPage, SIGNAL(createLocalAndRemoteFolders(QString, QString)),
-        SIGNAL(createLocalAndRemoteFolders(QString, QString)));
-    connect(this, SIGNAL(customButtonClicked(int)), this, SIGNAL(skipFolderConfiguration()));
+    connect(_advancedSetupPage, &OwncloudAdvancedSetupPage::createLocalAndRemoteFolders,
+        this, &OwncloudWizard::createLocalAndRemoteFolders);
+    connect(this, &QWizard::customButtonClicked, this, &OwncloudWizard::skipFolderConfiguration);
 
 
     Theme *theme = Theme::instance();
@@ -193,7 +193,7 @@ void OwncloudWizard::slotCurrentPageChanged(int id)
     }
 
     if (id == WizardCommon::Page_Result) {
-        disconnect(this, SIGNAL(finished(int)), this, SIGNAL(basicSetupFinished(int)));
+        disconnect(this, &QDialog::finished, this, &OwncloudWizard::basicSetupFinished);
         emit basicSetupFinished(QDialog::Accepted);
         appendToConfigurationLog(QString::null);
         // Immediately close on show, we currently don't want this page anymore
index 4610b409dca7a0397cb4be9d0d9b55e2512114de..71764e35cb00aa7851b7b7cf470b82c66a902f68 100644 (file)
@@ -41,7 +41,7 @@ OwncloudWizardResultPage::OwncloudWizardResultPage()
     _ui.pbOpenLocal->setIcon(QIcon(QLatin1String(":/client/resources/folder-sync.png")));
     _ui.pbOpenLocal->setIconSize(QSize(48, 48));
     _ui.pbOpenLocal->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
-    connect(_ui.pbOpenLocal, SIGNAL(clicked()), SLOT(slotOpenLocal()));
+    connect(_ui.pbOpenLocal, &QAbstractButton::clicked, this, &OwncloudWizardResultPage::slotOpenLocal);
 
     Theme *theme = Theme::instance();
     QIcon appIcon = theme->applicationIcon();
@@ -49,7 +49,7 @@ OwncloudWizardResultPage::OwncloudWizardResultPage()
     _ui.pbOpenServer->setIcon(appIcon.pixmap(48));
     _ui.pbOpenServer->setIconSize(QSize(48, 48));
     _ui.pbOpenServer->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
-    connect(_ui.pbOpenServer, SIGNAL(clicked()), SLOT(slotOpenServer()));
+    connect(_ui.pbOpenServer, &QAbstractButton::clicked, this, &OwncloudWizardResultPage::slotOpenServer);
     setupCustomization();
 }
 
index 14f8b1dda8075be2e825f6f1eff29be6f7d19519..41d61b30713279657c663b52a4f1944cef73f090 100644 (file)
@@ -52,15 +52,15 @@ AbstractNetworkJob::AbstractNetworkJob(AccountPtr account, const QString &path,
 {
     _timer.setSingleShot(true);
     _timer.setInterval(OwncloudPropagator::httpTimeout() * 1000); // default to 5 minutes.
-    connect(&_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));
+    connect(&_timer, &QTimer::timeout, this, &AbstractNetworkJob::slotTimeout);
 
-    connect(this, SIGNAL(networkActivity()), SLOT(resetTimeout()));
+    connect(this, &AbstractNetworkJob::networkActivity, this, &AbstractNetworkJob::resetTimeout);
 
     // Network activity on the propagator jobs (GET/PUT) keeps all requests alive.
     // This is a workaround for OC instances which only support one
     // parallel up and download
     if (_account) {
-        connect(_account.data(), SIGNAL(propagatorNetworkActivity()), SLOT(resetTimeout()));
+        connect(_account.data(), &Account::propagatorNetworkActivity, this, &AbstractNetworkJob::resetTimeout);
     }
 }
 
@@ -103,13 +103,13 @@ void AbstractNetworkJob::setPath(const QString &path)
 
 void AbstractNetworkJob::setupConnections(QNetworkReply *reply)
 {
-    connect(reply, SIGNAL(finished()), SLOT(slotFinished()));
-    connect(reply, SIGNAL(encrypted()), SIGNAL(networkActivity()));
-    connect(reply->manager(), SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)), SIGNAL(networkActivity()));
-    connect(reply, SIGNAL(sslErrors(QList<QSslError>)), SIGNAL(networkActivity()));
-    connect(reply, SIGNAL(metaDataChanged()), SIGNAL(networkActivity()));
-    connect(reply, SIGNAL(downloadProgress(qint64, qint64)), SIGNAL(networkActivity()));
-    connect(reply, SIGNAL(uploadProgress(qint64, qint64)), SIGNAL(networkActivity()));
+    connect(reply, &QNetworkReply::finished, this, &AbstractNetworkJob::slotFinished);
+    connect(reply, &QNetworkReply::encrypted, this, &AbstractNetworkJob::networkActivity);
+    connect(reply->manager(), &QNetworkAccessManager::proxyAuthenticationRequired, this, &AbstractNetworkJob::networkActivity);
+    connect(reply, &QNetworkReply::sslErrors, this, &AbstractNetworkJob::networkActivity);
+    connect(reply, &QNetworkReply::metaDataChanged, this, &AbstractNetworkJob::networkActivity);
+    connect(reply, &QNetworkReply::downloadProgress, this, &AbstractNetworkJob::networkActivity);
+    connect(reply, &QNetworkReply::uploadProgress, this, &AbstractNetworkJob::networkActivity);
 }
 
 QNetworkReply *AbstractNetworkJob::addTimer(QNetworkReply *reply)
index 589b8e5bd1f3b5956c3a3daee66eb576fcde58d5..4c5f8a4116f422b5fa1c637380cc3c1de93fc82b 100644 (file)
@@ -150,12 +150,12 @@ void Account::setCredentials(AbstractCredentials *cred)
     }
     connect(_am.data(), SIGNAL(sslErrors(QNetworkReply *, QList<QSslError>)),
         SLOT(slotHandleSslErrors(QNetworkReply *, QList<QSslError>)));
-    connect(_am.data(), SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)),
-        SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)));
-    connect(_credentials.data(), SIGNAL(fetched()),
-        SLOT(slotCredentialsFetched()));
-    connect(_credentials.data(), SIGNAL(asked()),
-        SLOT(slotCredentialsAsked()));
+    connect(_am.data(), &QNetworkAccessManager::proxyAuthenticationRequired,
+        this, &Account::proxyAuthenticationRequired);
+    connect(_credentials.data(), &AbstractCredentials::fetched,
+        this, &Account::slotCredentialsFetched);
+    connect(_credentials.data(), &AbstractCredentials::asked,
+        this, &Account::slotCredentialsAsked);
 }
 
 QUrl Account::davUrl() const
@@ -213,8 +213,8 @@ void Account::resetNetworkAccessManager()
     _am->setCookieJar(jar); // takes ownership of the old cookie jar
     connect(_am.data(), SIGNAL(sslErrors(QNetworkReply *, QList<QSslError>)),
         SLOT(slotHandleSslErrors(QNetworkReply *, QList<QSslError>)));
-    connect(_am.data(), SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)),
-        SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)));
+    connect(_am.data(), &QNetworkAccessManager::proxyAuthenticationRequired,
+        this, &Account::proxyAuthenticationRequired);
 }
 
 QNetworkAccessManager *Account::networkAccessManager()
index 97cbddd213697dc6dc9e56c677e68ce83388ac06..0393b353f780fa3d5cec48a3b3b4080c6608449e 100644 (file)
@@ -56,34 +56,34 @@ BandwidthManager::BandwidthManager(OwncloudPropagator *p)
     _currentUploadLimit = _propagator->_uploadLimit.fetchAndAddAcquire(0);
     _currentDownloadLimit = _propagator->_downloadLimit.fetchAndAddAcquire(0);
 
-    QObject::connect(&_switchingTimer, SIGNAL(timeout()), this, SLOT(switchingTimerExpired()));
+    QObject::connect(&_switchingTimer, &QTimer::timeout, this, &BandwidthManager::switchingTimerExpired);
     _switchingTimer.setInterval(10 * 1000);
     _switchingTimer.start();
     QMetaObject::invokeMethod(this, "switchingTimerExpired", Qt::QueuedConnection);
 
     // absolute uploads/downloads
-    QObject::connect(&_absoluteLimitTimer, SIGNAL(timeout()), this, SLOT(absoluteLimitTimerExpired()));
+    QObject::connect(&_absoluteLimitTimer, &QTimer::timeout, this, &BandwidthManager::absoluteLimitTimerExpired);
     _absoluteLimitTimer.setInterval(1000);
     _absoluteLimitTimer.start();
 
     // Relative uploads
-    QObject::connect(&_relativeUploadMeasuringTimer, SIGNAL(timeout()),
-        this, SLOT(relativeUploadMeasuringTimerExpired()));
+    QObject::connect(&_relativeUploadMeasuringTimer, &QTimer::timeout,
+        this, &BandwidthManager::relativeUploadMeasuringTimerExpired);
     _relativeUploadMeasuringTimer.setInterval(relativeLimitMeasuringTimerIntervalMsec);
     _relativeUploadMeasuringTimer.start();
     _relativeUploadMeasuringTimer.setSingleShot(true); // will be restarted from the delay timer
-    QObject::connect(&_relativeUploadDelayTimer, SIGNAL(timeout()),
-        this, SLOT(relativeUploadDelayTimerExpired()));
+    QObject::connect(&_relativeUploadDelayTimer, &QTimer::timeout,
+        this, &BandwidthManager::relativeUploadDelayTimerExpired);
     _relativeUploadDelayTimer.setSingleShot(true); // will be restarted from the measuring timer
 
     // Relative downloads
-    QObject::connect(&_relativeDownloadMeasuringTimer, SIGNAL(timeout()),
-        this, SLOT(relativeDownloadMeasuringTimerExpired()));
+    QObject::connect(&_relativeDownloadMeasuringTimer, &QTimer::timeout,
+        this, &BandwidthManager::relativeDownloadMeasuringTimerExpired);
     _relativeDownloadMeasuringTimer.setInterval(relativeLimitMeasuringTimerIntervalMsec);
     _relativeDownloadMeasuringTimer.start();
     _relativeDownloadMeasuringTimer.setSingleShot(true); // will be restarted from the delay timer
-    QObject::connect(&_relativeDownloadDelayTimer, SIGNAL(timeout()),
-        this, SLOT(relativeDownloadDelayTimerExpired()));
+    QObject::connect(&_relativeDownloadDelayTimer, &QTimer::timeout,
+        this, &BandwidthManager::relativeDownloadDelayTimerExpired);
     _relativeDownloadDelayTimer.setSingleShot(true); // will be restarted from the measuring timer
 }
 
index f2bae6638c2bc17f56b195f25fd22f2e5c904385..fd454e68ffe95ed8f15fad769b229be70f60a856 100644 (file)
@@ -116,9 +116,9 @@ void ConnectionValidator::slotCheckServerAndAuth()
     CheckServerJob *checkJob = new CheckServerJob(_account, this);
     checkJob->setTimeout(timeoutToUseMsec);
     checkJob->setIgnoreCredentialFailure(true);
-    connect(checkJob, SIGNAL(instanceFound(QUrl, QJsonObject)), SLOT(slotStatusFound(QUrl, QJsonObject)));
-    connect(checkJob, SIGNAL(instanceNotFound(QNetworkReply *)), SLOT(slotNoStatusFound(QNetworkReply *)));
-    connect(checkJob, SIGNAL(timeout(QUrl)), SLOT(slotJobTimeout(QUrl)));
+    connect(checkJob, &CheckServerJob::instanceFound, this, &ConnectionValidator::slotStatusFound);
+    connect(checkJob, &CheckServerJob::instanceNotFound, this, &ConnectionValidator::slotNoStatusFound);
+    connect(checkJob, &CheckServerJob::timeout, this, &ConnectionValidator::slotJobTimeout);
     checkJob->start();
 }
 
@@ -154,7 +154,7 @@ void ConnectionValidator::slotStatusFound(const QUrl &url, const QJsonObject &in
     }
 
     // now check the authentication
-    QTimer::singleShot( 0, this, SLOT( checkAuthentication() ));
+    QTimer::singleShot(0, this, &ConnectionValidator::checkAuthentication);
 }
 
 // status.php could not be loaded (network or server issue!).
@@ -201,8 +201,8 @@ void ConnectionValidator::checkAuthentication()
     PropfindJob *job = new PropfindJob(_account, "/", this);
     job->setTimeout(timeoutToUseMsec);
     job->setProperties(QList<QByteArray>() << "getlastmodified");
-    connect(job, SIGNAL(result(QVariantMap)), SLOT(slotAuthSuccess()));
-    connect(job, SIGNAL(finishedWithError(QNetworkReply *)), SLOT(slotAuthFailed(QNetworkReply *)));
+    connect(job, &PropfindJob::result, this, &ConnectionValidator::slotAuthSuccess);
+    connect(job, &PropfindJob::finishedWithError, this, &ConnectionValidator::slotAuthFailed);
     job->start();
 }
 
@@ -249,7 +249,7 @@ void ConnectionValidator::checkServerCapabilities()
 {
     JsonApiJob *job = new JsonApiJob(_account, QLatin1String("ocs/v1.php/cloud/capabilities"), this);
     job->setTimeout(timeoutToUseMsec);
-    QObject::connect(job, SIGNAL(jsonReceived(QJsonDocument, int)), this, SLOT(slotCapabilitiesRecieved(QJsonDocument)));
+    QObject::connect(job, &JsonApiJob::jsonReceived, this, &ConnectionValidator::slotCapabilitiesRecieved);
     job->start();
 }
 
@@ -272,7 +272,7 @@ void ConnectionValidator::fetchUser()
 {
     JsonApiJob *job = new JsonApiJob(_account, QLatin1String("ocs/v1.php/cloud/user"), this);
     job->setTimeout(timeoutToUseMsec);
-    QObject::connect(job, SIGNAL(jsonReceived(QJsonDocument, int)), this, SLOT(slotUserFetched(QJsonDocument)));
+    QObject::connect(job, &JsonApiJob::jsonReceived, this, &ConnectionValidator::slotUserFetched);
     job->start();
 }
 
@@ -312,7 +312,7 @@ void ConnectionValidator::slotUserFetched(const QJsonDocument &json)
 
         AvatarJob *job = new AvatarJob(_account, this);
         job->setTimeout(20 * 1000);
-        QObject::connect(job, SIGNAL(avatarPixmap(QImage)), this, SLOT(slotAvatarImage(QImage)));
+        QObject::connect(job, &AvatarJob::avatarPixmap, this, &ConnectionValidator::slotAvatarImage);
 
         job->start();
     }
index a40890424741dffe3fc71d8a140d2904dc020d43..52e96edf3f9f4b6fbf6022d9dac9b8ee08220459 100644 (file)
@@ -147,8 +147,8 @@ QNetworkAccessManager *HttpCredentials::createQNAM() const
 {
     AccessManager *qnam = new HttpCredentialsAccessManager(this);
 
-    connect(qnam, SIGNAL(authenticationRequired(QNetworkReply *, QAuthenticator *)),
-        this, SLOT(slotAuthentication(QNetworkReply *, QAuthenticator *)));
+    connect(qnam, &QNetworkAccessManager::authenticationRequired,
+        this, &HttpCredentials::slotAuthentication);
 
     return qnam;
 }
@@ -198,7 +198,7 @@ void HttpCredentials::fetchFromKeychainHelper()
     addSettingsToJob(_account, job);
     job->setInsecureFallback(false);
     job->setKey(kck);
-    connect(job, SIGNAL(finished(QKeychain::Job *)), SLOT(slotReadClientCertPEMJobDone(QKeychain::Job *)));
+    connect(job, &Job::finished, this, &HttpCredentials::slotReadClientCertPEMJobDone);
     job->start();
 }
 
@@ -238,7 +238,7 @@ void HttpCredentials::slotReadClientCertPEMJobDone(QKeychain::Job *incoming)
     addSettingsToJob(_account, job);
     job->setInsecureFallback(false);
     job->setKey(kck);
-    connect(job, SIGNAL(finished(QKeychain::Job *)), SLOT(slotReadClientKeyPEMJobDone(QKeychain::Job *)));
+    connect(job, &Job::finished, this, &HttpCredentials::slotReadClientKeyPEMJobDone);
     job->start();
 }
 
@@ -273,7 +273,7 @@ void HttpCredentials::slotReadClientKeyPEMJobDone(QKeychain::Job *incoming)
     addSettingsToJob(_account, job);
     job->setInsecureFallback(false);
     job->setKey(kck);
-    connect(job, SIGNAL(finished(QKeychain::Job *)), SLOT(slotReadJobDone(QKeychain::Job *)));
+    connect(job, &Job::finished, this, &HttpCredentials::slotReadJobDone);
     job->start();
 }
 
@@ -419,7 +419,7 @@ void HttpCredentials::invalidateToken()
     // indirectly) from QNetworkAccessManagerPrivate::authenticationRequired, which itself
     // is a called from a BlockingQueuedConnection from the Qt HTTP thread. And clearing the
     // cache needs to synchronize again with the HTTP thread.
-    QTimer::singleShot(0, _account, SLOT(clearQNAMCache()));
+    QTimer::singleShot(0, _account, &Account::clearQNAMCache);
 }
 
 void HttpCredentials::forgetSensitiveData()
@@ -446,7 +446,7 @@ void HttpCredentials::persist()
     WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
     addSettingsToJob(_account, job);
     job->setInsecureFallback(false);
-    connect(job, SIGNAL(finished(QKeychain::Job *)), SLOT(slotWriteClientCertPEMJobDone(QKeychain::Job *)));
+    connect(job, &Job::finished, this, &HttpCredentials::slotWriteClientCertPEMJobDone);
     job->setKey(keychainKey(_account->url().toString(), _user + clientCertificatePEMC, _account->id()));
     job->setBinaryData(_clientSslCertificate.toPem());
     job->start();
@@ -459,7 +459,7 @@ void HttpCredentials::slotWriteClientCertPEMJobDone(Job *incomingJob)
     WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
     addSettingsToJob(_account, job);
     job->setInsecureFallback(false);
-    connect(job, SIGNAL(finished(QKeychain::Job *)), SLOT(slotWriteClientKeyPEMJobDone(QKeychain::Job *)));
+    connect(job, &Job::finished, this, &HttpCredentials::slotWriteClientKeyPEMJobDone);
     job->setKey(keychainKey(_account->url().toString(), _user + clientKeyPEMC, _account->id()));
     job->setBinaryData(_clientSslKey.toPem());
     job->start();
@@ -471,7 +471,7 @@ void HttpCredentials::slotWriteClientKeyPEMJobDone(Job *incomingJob)
     WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
     addSettingsToJob(_account, job);
     job->setInsecureFallback(false);
-    connect(job, SIGNAL(finished(QKeychain::Job *)), SLOT(slotWriteJobDone(QKeychain::Job *)));
+    connect(job, &Job::finished, this, &HttpCredentials::slotWriteJobDone);
     job->setKey(keychainKey(_account->url().toString(), _user, _account->id()));
     job->setTextData(isUsingOAuth() ? _refreshToken : _password);
     job->start();
index a4345c58a1688f921f9e76187941a43329aacd1b..537e6ee02191e8ef07d460ccea878fa942fd8178 100644 (file)
@@ -282,10 +282,10 @@ void DiscoverySingleDirectoryJob::start()
 
     lsColJob->setProperties(props);
 
-    QObject::connect(lsColJob, SIGNAL(directoryListingIterated(QString, QMap<QString, QString>)),
-        this, SLOT(directoryListingIteratedSlot(QString, QMap<QString, QString>)));
-    QObject::connect(lsColJob, SIGNAL(finishedWithError(QNetworkReply *)), this, SLOT(lsJobFinishedWithErrorSlot(QNetworkReply *)));
-    QObject::connect(lsColJob, SIGNAL(finishedWithoutError()), this, SLOT(lsJobFinishedWithoutErrorSlot()));
+    QObject::connect(lsColJob, &LsColJob::directoryListingIterated,
+        this, &DiscoverySingleDirectoryJob::directoryListingIteratedSlot);
+    QObject::connect(lsColJob, &LsColJob::finishedWithError, this, &DiscoverySingleDirectoryJob::lsJobFinishedWithErrorSlot);
+    QObject::connect(lsColJob, &LsColJob::finishedWithoutError, this, &DiscoverySingleDirectoryJob::lsJobFinishedWithoutErrorSlot);
     lsColJob->start();
 
     _lsColJob = lsColJob;
@@ -469,11 +469,11 @@ void DiscoveryMainThread::setupHooks(DiscoveryJob *discoveryJob, const QString &
     _discoveryJob = discoveryJob;
     _pathPrefix = pathPrefix;
 
-    connect(discoveryJob, SIGNAL(doOpendirSignal(QString, DiscoveryDirectoryResult *)),
-        this, SLOT(doOpendirSlot(QString, DiscoveryDirectoryResult *)),
+    connect(discoveryJob, &DiscoveryJob::doOpendirSignal,
+        this, &DiscoveryMainThread::doOpendirSlot,
         Qt::QueuedConnection);
-    connect(discoveryJob, SIGNAL(doGetSizeSignal(QString, qint64 *)),
-        this, SLOT(doGetSizeSlot(QString, qint64 *)),
+    connect(discoveryJob, &DiscoveryJob::doGetSizeSignal,
+        this, &DiscoveryMainThread::doGetSizeSlot,
         Qt::QueuedConnection);
 }
 
@@ -499,16 +499,16 @@ void DiscoveryMainThread::doOpendirSlot(const QString &subPath, DiscoveryDirecto
 
     // Schedule the DiscoverySingleDirectoryJob
     _singleDirJob = new DiscoverySingleDirectoryJob(_account, fullPath, this);
-    QObject::connect(_singleDirJob, SIGNAL(finishedWithResult()),
-        this, SLOT(singleDirectoryJobResultSlot()));
-    QObject::connect(_singleDirJob, SIGNAL(finishedWithError(int, QString)),
-        this, SLOT(singleDirectoryJobFinishedWithErrorSlot(int, QString)));
-    QObject::connect(_singleDirJob, SIGNAL(firstDirectoryPermissions(QString)),
-        this, SLOT(singleDirectoryJobFirstDirectoryPermissionsSlot(QString)));
-    QObject::connect(_singleDirJob, SIGNAL(etagConcatenation(QString)),
-        this, SIGNAL(etagConcatenation(QString)));
-    QObject::connect(_singleDirJob, SIGNAL(etag(QString)),
-        this, SIGNAL(etag(QString)));
+    QObject::connect(_singleDirJob.data(), &DiscoverySingleDirectoryJob::finishedWithResult,
+        this, &DiscoveryMainThread::singleDirectoryJobResultSlot);
+    QObject::connect(_singleDirJob.data(), &DiscoverySingleDirectoryJob::finishedWithError,
+        this, &DiscoveryMainThread::singleDirectoryJobFinishedWithErrorSlot);
+    QObject::connect(_singleDirJob.data(), &DiscoverySingleDirectoryJob::firstDirectoryPermissions,
+        this, &DiscoveryMainThread::singleDirectoryJobFirstDirectoryPermissionsSlot);
+    QObject::connect(_singleDirJob.data(), &DiscoverySingleDirectoryJob::etagConcatenation,
+        this, &DiscoveryMainThread::etagConcatenation);
+    QObject::connect(_singleDirJob.data(), &DiscoverySingleDirectoryJob::etag,
+        this, &DiscoveryMainThread::etag);
 
     if (!_firstFolderProcessed) {
         _singleDirJob->setIsRootPath();
@@ -584,10 +584,10 @@ void DiscoveryMainThread::doGetSizeSlot(const QString &path, qint64 *result)
     auto propfindJob = new PropfindJob(_account, fullPath, this);
     propfindJob->setProperties(QList<QByteArray>() << "resourcetype"
                                                    << "http://owncloud.org/ns:size");
-    QObject::connect(propfindJob, SIGNAL(finishedWithError()),
-        this, SLOT(slotGetSizeFinishedWithError()));
-    QObject::connect(propfindJob, SIGNAL(result(QVariantMap)),
-        this, SLOT(slotGetSizeResult(QVariantMap)));
+    QObject::connect(propfindJob, &PropfindJob::finishedWithError,
+        this, &DiscoveryMainThread::slotGetSizeFinishedWithError);
+    QObject::connect(propfindJob, &PropfindJob::result,
+        this, &DiscoveryMainThread::slotGetSizeResult);
     propfindJob->start();
 }
 
index 3a87571cf94ccc45680e9c613f1ecf4efcc0f8bc..3af0f6c21fc3d34b2e8ae2c9c315f4cf891d8077 100644 (file)
@@ -362,14 +362,14 @@ bool LsColJob::finished()
     int httpCode = reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
     if (httpCode == 207 && contentType.contains("application/xml; charset=utf-8")) {
         LsColXMLParser parser;
-        connect(&parser, SIGNAL(directoryListingSubfolders(const QStringList &)),
-            this, SIGNAL(directoryListingSubfolders(const QStringList &)));
-        connect(&parser, SIGNAL(directoryListingIterated(const QString &, const QMap<QString, QString> &)),
-            this, SIGNAL(directoryListingIterated(const QString &, const QMap<QString, QString> &)));
-        connect(&parser, SIGNAL(finishedWithError(QNetworkReply *)),
-            this, SIGNAL(finishedWithError(QNetworkReply *)));
-        connect(&parser, SIGNAL(finishedWithoutError()),
-            this, SIGNAL(finishedWithoutError()));
+        connect(&parser, &LsColXMLParser::directoryListingSubfolders,
+            this, &LsColJob::directoryListingSubfolders);
+        connect(&parser, &LsColXMLParser::directoryListingIterated,
+            this, &LsColJob::directoryListingIterated);
+        connect(&parser, &LsColXMLParser::finishedWithError,
+            this, &LsColJob::finishedWithError);
+        connect(&parser, &LsColXMLParser::finishedWithoutError,
+            this, &LsColJob::finishedWithoutError);
 
         QString expectedPath = reply()->request().url().path(); // something like "/owncloud/remote.php/webdav/folder"
         if (!parser.parse(reply()->readAll(), &_sizes, expectedPath)) {
@@ -400,16 +400,16 @@ CheckServerJob::CheckServerJob(AccountPtr account, QObject *parent)
     , _permanentRedirects(0)
 {
     setIgnoreCredentialFailure(true);
-    connect(this, SIGNAL(redirected(QNetworkReply *, QUrl, int)),
-        SLOT(slotRedirected(QNetworkReply *, QUrl, int)));
+    connect(this, &AbstractNetworkJob::redirected,
+        this, &CheckServerJob::slotRedirected);
 }
 
 void CheckServerJob::start()
 {
     _serverUrl = account()->url();
     sendRequest("GET", Utility::concatUrlPath(_serverUrl, path()));
-    connect(reply(), SIGNAL(metaDataChanged()), this, SLOT(metaDataChangedSlot()));
-    connect(reply(), SIGNAL(encrypted()), this, SLOT(encryptedSlot()));
+    connect(reply(), &QNetworkReply::metaDataChanged, this, &CheckServerJob::metaDataChangedSlot);
+    connect(reply(), &QNetworkReply::encrypted, this, &CheckServerJob::encryptedSlot);
     AbstractNetworkJob::start();
 }
 
index 346d61e8656dc437cdf513cfe34e77f0554316e0..46c3899ae1702faf11bf6c5abedc5f7a955b6459 100644 (file)
@@ -331,8 +331,8 @@ bool PropagateItemJob::checkForProblemsWithShared(int httpStatusCode, const QStr
         if (newJob) {
             newJob->setRestoreJobMsg(msg);
             _restoreJob.reset(newJob);
-            connect(_restoreJob.data(), SIGNAL(finished(SyncFileItem::Status)),
-                this, SLOT(slotRestoreJobFinished(SyncFileItem::Status)));
+            connect(_restoreJob.data(), &PropagatorJob::finished,
+                this, &PropagateItemJob::slotRestoreJobFinished);
             QMetaObject::invokeMethod(newJob, "start");
         }
         return true;
@@ -521,7 +521,7 @@ void OwncloudPropagator::start(const SyncFileItemVector &items)
         _rootJob->appendJob(it);
     }
 
-    connect(_rootJob.data(), SIGNAL(finished(SyncFileItem::Status)), this, SLOT(emitFinished(SyncFileItem::Status)));
+    connect(_rootJob.data(), &PropagatorJob::finished, this, &OwncloudPropagator::emitFinished);
 
     scheduleNextJob();
 }
@@ -654,7 +654,7 @@ QString OwncloudPropagator::getFilePath(const QString &tmp_file_name) const
 
 void OwncloudPropagator::scheduleNextJob()
 {
-    QTimer::singleShot(0, this, SLOT(scheduleNextJobImpl()));
+    QTimer::singleShot(0, this, &OwncloudPropagator::scheduleNextJobImpl);
 }
 
 void OwncloudPropagator::scheduleNextJobImpl()
@@ -854,9 +854,9 @@ PropagateDirectory::PropagateDirectory(OwncloudPropagator *propagator, const Syn
     , _subJobs(propagator)
 {
     if (_firstJob) {
-        connect(_firstJob.data(), SIGNAL(finished(SyncFileItem::Status)), this, SLOT(slotFirstJobFinished(SyncFileItem::Status)));
+        connect(_firstJob.data(), &PropagatorJob::finished, this, &PropagateDirectory::slotFirstJobFinished);
     }
-    connect(&_subJobs, SIGNAL(finished(SyncFileItem::Status)), this, SLOT(slotSubJobsFinished(SyncFileItem::Status)));
+    connect(&_subJobs, &PropagatorJob::finished, this, &PropagateDirectory::slotSubJobsFinished);
 }
 
 PropagatorJob::JobParallelism PropagateDirectory::parallelism()
@@ -968,7 +968,7 @@ void CleanupPollsJob::start()
     if (record.isValid()) {
         SyncFileItemPtr item = SyncFileItem::fromSyncJournalFileRecord(record);
         PollJob *job = new PollJob(_account, info._url, item, _journal, _localPath, this);
-        connect(job, SIGNAL(finishedSignal()), SLOT(slotPollFinished()));
+        connect(job, &PollJob::finishedSignal, this, &CleanupPollsJob::slotPollFinished);
         job->start();
     }
 }
index f62fd58a993a9c3725f90d12067fb604ee165c28..605614902f2d5025aed1c17aa2bfec793a34d38c 100644 (file)
@@ -221,7 +221,7 @@ private slots:
     bool possiblyRunNextJob(PropagatorJob *next)
     {
         if (next->_state == NotYetStarted) {
-            connect(next, SIGNAL(finished(SyncFileItem::Status)), this, SLOT(slotSubJobFinished(SyncFileItem::Status)));
+            connect(next, &PropagatorJob::finished, this, &PropagatorCompositeJob::slotSubJobFinished);
         }
         return next->scheduleSelfOrChild();
     }
index df6417e4ada02b01851293e3b8440433ad532767..bfdc0521bcc2420b60bd31c2428c6d58aa8c6d2a 100644 (file)
@@ -130,7 +130,7 @@ void ProgressDispatcher::setProgressInfo(const QString &folder, const ProgressIn
 
 ProgressInfo::ProgressInfo()
 {
-    connect(&_updateEstimatesTimer, SIGNAL(timeout()), SLOT(updateEstimates()));
+    connect(&_updateEstimatesTimer, &QTimer::timeout, this, &ProgressInfo::updateEstimates);
     reset();
 }
 
index 3e6b8898aad99a30de0c25720769fdf9d9b14136..812c01316c0fe295489a0007b66918809f3ea16a 100644 (file)
@@ -137,10 +137,10 @@ void GETFileJob::start()
         qCWarning(lcGetJob) << " Network error: " << errorString();
     }
 
-    connect(reply(), SIGNAL(metaDataChanged()), this, SLOT(slotMetaDataChanged()));
-    connect(reply(), SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
-    connect(reply(), SIGNAL(downloadProgress(qint64, qint64)), this, SIGNAL(downloadProgress(qint64, qint64)));
-    connect(this, SIGNAL(networkActivity()), account().data(), SIGNAL(propagatorNetworkActivity()));
+    connect(reply(), &QNetworkReply::metaDataChanged, this, &GETFileJob::slotMetaDataChanged);
+    connect(reply(), &QIODevice::readyRead, this, &GETFileJob::slotReadyRead);
+    connect(reply(), &QNetworkReply::downloadProgress, this, &GETFileJob::downloadProgress);
+    connect(this, &AbstractNetworkJob::networkActivity, account().data(), &Account::propagatorNetworkActivity);
 
     AbstractNetworkJob::start();
 }
@@ -356,8 +356,8 @@ void PropagateDownloadFile::start()
         qCDebug(lcPropagateDownload) << _item->_file << "may not need download, computing checksum";
         auto computeChecksum = new ComputeChecksum(this);
         computeChecksum->setChecksumType(parseChecksumHeaderType(_item->_checksumHeader));
-        connect(computeChecksum, SIGNAL(done(QByteArray, QByteArray)),
-            SLOT(conflictChecksumComputed(QByteArray, QByteArray)));
+        connect(computeChecksum, &ComputeChecksum::done,
+            this, &PropagateDownloadFile::conflictChecksumComputed);
         computeChecksum->start(propagator()->getFilePath(_item->_file));
         return;
     }
@@ -478,8 +478,8 @@ void PropagateDownloadFile::startDownload()
             &_tmpFile, headers, expectedEtagForResume, _resumeStart, this);
     }
     _job->setBandwidthManager(&propagator()->_bandwidthManager);
-    connect(_job, SIGNAL(finishedSignal()), this, SLOT(slotGetFinished()));
-    connect(_job, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(slotDownloadProgress(qint64, qint64)));
+    connect(_job.data(), &GETFileJob::finishedSignal, this, &PropagateDownloadFile::slotGetFinished);
+    connect(_job.data(), &GETFileJob::downloadProgress, this, &PropagateDownloadFile::slotDownloadProgress);
     propagator()->_activeJobList.append(this);
     _job->start();
 }
@@ -620,10 +620,10 @@ void PropagateDownloadFile::slotGetFinished()
     // will also emit the validated() signal to continue the flow in slot transmissionChecksumValidated()
     // as this is (still) also correct.
     ValidateChecksumHeader *validator = new ValidateChecksumHeader(this);
-    connect(validator, SIGNAL(validated(QByteArray, QByteArray)),
-        SLOT(transmissionChecksumValidated(QByteArray, QByteArray)));
-    connect(validator, SIGNAL(validationFailed(QString)),
-        SLOT(slotChecksumFail(QString)));
+    connect(validator, &ValidateChecksumHeader::validated,
+        this, &PropagateDownloadFile::transmissionChecksumValidated);
+    connect(validator, &ValidateChecksumHeader::validationFailed,
+        this, &PropagateDownloadFile::slotChecksumFail);
     auto checksumHeader = job->reply()->rawHeader(checkSumHeaderC);
     validator->start(_tmpFile.fileName(), checksumHeader);
 }
@@ -750,8 +750,8 @@ void PropagateDownloadFile::transmissionChecksumValidated(const QByteArray &chec
     auto computeChecksum = new ComputeChecksum(this);
     computeChecksum->setChecksumType(theContentChecksumType);
 
-    connect(computeChecksum, SIGNAL(done(QByteArray, QByteArray)),
-        SLOT(contentChecksumComputed(QByteArray, QByteArray)));
+    connect(computeChecksum, &ComputeChecksum::done,
+        this, &PropagateDownloadFile::contentChecksumComputed);
     computeChecksum->start(_tmpFile.fileName());
 }
 
index 0ace61790cbb856a51e04a0ec5daa9cfb8615ee9..2e7d03b2215e60e9d5744365ac482e3f33b0c6ed 100644 (file)
@@ -70,7 +70,7 @@ void PropagateRemoteDelete::start()
     _job = new DeleteJob(propagator()->account(),
         propagator()->_remoteFolder + _item->_file,
         this);
-    connect(_job, SIGNAL(finishedSignal()), this, SLOT(slotDeleteJobFinished()));
+    connect(_job.data(), &DeleteJob::finishedSignal, this, &PropagateRemoteDelete::slotDeleteJobFinished);
     propagator()->_activeJobList.append(this);
     _job->start();
 }
index 4772f42eb417a6daa501549284d2c5972be7c852..fb0869a2b303e2bc08446d3e94cae1b4cf512b7d 100644 (file)
@@ -111,8 +111,8 @@ void PropagateRemoteMkdir::slotMkcolJobFinished()
         auto propfindJob = new PropfindJob(_job->account(), _job->path(), this);
         propfindJob->setProperties(QList<QByteArray>() << "getetag"
                                                        << "http://owncloud.org/ns:id");
-        QObject::connect(propfindJob, SIGNAL(result(QVariantMap)), this, SLOT(propfindResult(QVariantMap)));
-        QObject::connect(propfindJob, SIGNAL(finishedWithError()), this, SLOT(propfindError()));
+        QObject::connect(propfindJob, &PropfindJob::result, this, &PropagateRemoteMkdir::propfindResult);
+        QObject::connect(propfindJob, &PropfindJob::finishedWithError, this, &PropagateRemoteMkdir::propfindError);
         propfindJob->start();
         _job = propfindJob;
         return;
index b347b0ab00993f0fded0c40bb5abd97e6f770d9e..db8ab18368ee472bb107f3d6cd047c450e820856 100644 (file)
@@ -112,7 +112,7 @@ void PropagateRemoteMove::start()
     _job = new MoveJob(propagator()->account(),
         propagator()->_remoteFolder + _item->_file,
         destination, this);
-    connect(_job, SIGNAL(finishedSignal()), this, SLOT(slotMoveJobFinished()));
+    connect(_job.data(), &MoveJob::finishedSignal, this, &PropagateRemoteMove::slotMoveJobFinished);
     propagator()->_activeJobList.append(this);
     _job->start();
 }
index 05ec97a00447075f89192d12ab88f34b43139161..5ba8a5c6b3060451ff65339f1d3fe1a9f4591619 100644 (file)
@@ -85,8 +85,8 @@ void PUTFileJob::start()
         qCWarning(lcPutJob) << " Network error: " << reply()->errorString();
     }
 
-    connect(reply(), SIGNAL(uploadProgress(qint64, qint64)), this, SIGNAL(uploadProgress(qint64, qint64)));
-    connect(this, SIGNAL(networkActivity()), account().data(), SIGNAL(propagatorNetworkActivity()));
+    connect(reply(), &QNetworkReply::uploadProgress, this, &PUTFileJob::uploadProgress);
+    connect(this, &AbstractNetworkJob::networkActivity, account().data(), &Account::propagatorNetworkActivity);
     _requestTimer.start();
     AbstractNetworkJob::start();
 }
@@ -98,7 +98,7 @@ void PollJob::start()
     QUrl finalUrl = QUrl::fromUserInput(accountUrl.scheme() + QLatin1String("://") + accountUrl.authority()
         + (path().startsWith('/') ? QLatin1String("") : QLatin1String("/")) + path());
     sendRequest("GET", finalUrl);
-    connect(reply(), SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(resetTimeout()));
+    connect(reply(), &QNetworkReply::downloadProgress, this, &AbstractNetworkJob::resetTimeout);
     AbstractNetworkJob::start();
 }
 
@@ -197,8 +197,8 @@ void PropagateUploadFileCommon::start()
         propagator()->_remoteFolder + _item->_file,
         this);
     _jobs.append(job);
-    connect(job, SIGNAL(finishedSignal()), SLOT(slotComputeContentChecksum()));
-    connect(job, SIGNAL(destroyed(QObject *)), SLOT(slotJobDestroyed(QObject *)));
+    connect(job, &DeleteJob::finishedSignal, this, &PropagateUploadFileCommon::slotComputeContentChecksum);
+    connect(job, &QObject::destroyed, this, &PropagateUploadFileCommon::slotJobDestroyed);
     job->start();
 }
 
@@ -232,10 +232,10 @@ void PropagateUploadFileCommon::slotComputeContentChecksum()
     auto computeChecksum = new ComputeChecksum(this);
     computeChecksum->setChecksumType(checksumType);
 
-    connect(computeChecksum, SIGNAL(done(QByteArray, QByteArray)),
-        SLOT(slotComputeTransmissionChecksum(QByteArray, QByteArray)));
-    connect(computeChecksum, SIGNAL(done(QByteArray, QByteArray)),
-        computeChecksum, SLOT(deleteLater()));
+    connect(computeChecksum, &ComputeChecksum::done,
+        this, &PropagateUploadFileCommon::slotComputeTransmissionChecksum);
+    connect(computeChecksum, &ComputeChecksum::done,
+        computeChecksum, &QObject::deleteLater);
     computeChecksum->start(filePath);
 }
 
@@ -264,10 +264,10 @@ void PropagateUploadFileCommon::slotComputeTransmissionChecksum(const QByteArray
         computeChecksum->setChecksumType(QByteArray());
     }
 
-    connect(computeChecksum, SIGNAL(done(QByteArray, QByteArray)),
-        SLOT(slotStartUpload(QByteArray, QByteArray)));
-    connect(computeChecksum, SIGNAL(done(QByteArray, QByteArray)),
-        computeChecksum, SLOT(deleteLater()));
+    connect(computeChecksum, &ComputeChecksum::done,
+        this, &PropagateUploadFileCommon::slotStartUpload);
+    connect(computeChecksum, &ComputeChecksum::done,
+        computeChecksum, &QObject::deleteLater);
     const QString filePath = propagator()->getFilePath(_item->_file);
     computeChecksum->start(filePath);
 }
@@ -465,7 +465,7 @@ void PropagateUploadFileCommon::startPollJob(const QString &path)
 {
     PollJob *job = new PollJob(propagator()->account(), path, _item,
         propagator()->_journal, propagator()->_localDir, this);
-    connect(job, SIGNAL(finishedSignal()), SLOT(slotPollFinished()));
+    connect(job, &PollJob::finishedSignal, this, &PropagateUploadFileCommon::slotPollFinished);
     SyncJournalDb::PollInfo info;
     info._file = _item->_file;
     info._url = path;
index 4afdad38b291b946cd223b9a74a25361f92e0114..379726672371e8ade736e12ec7549a1726a343ac 100644 (file)
@@ -90,12 +90,12 @@ void PropagateUploadFileNG::doStartUpload()
         _jobs.append(job);
         job->setProperties(QList<QByteArray>() << "resourcetype"
                                                << "getcontentlength");
-        connect(job, SIGNAL(finishedWithoutError()), this, SLOT(slotPropfindFinished()));
-        connect(job, SIGNAL(finishedWithError(QNetworkReply *)),
-            this, SLOT(slotPropfindFinishedWithError()));
-        connect(job, SIGNAL(destroyed(QObject *)), this, SLOT(slotJobDestroyed(QObject *)));
-        connect(job, SIGNAL(directoryListingIterated(QString, QMap<QString, QString>)),
-            this, SLOT(slotPropfindIterate(QString, QMap<QString, QString>)));
+        connect(job, &LsColJob::finishedWithoutError, this, &PropagateUploadFileNG::slotPropfindFinished);
+        connect(job, &LsColJob::finishedWithError,
+            this, &PropagateUploadFileNG::slotPropfindFinishedWithError);
+        connect(job, &QObject::destroyed, this, &PropagateUploadFileCommon::slotJobDestroyed);
+        connect(job, &LsColJob::directoryListingIterated,
+            this, &PropagateUploadFileNG::slotPropfindIterate);
         job->start();
         return;
     } else if (progressInfo._valid) {
@@ -159,7 +159,7 @@ void PropagateUploadFileNG::slotPropfindFinished()
         // with corruptions if there are too many chunks, or if we abort and there are still stale chunks.
         for (auto it = _serverChunks.begin(); it != _serverChunks.end(); ++it) {
             auto job = new DeleteJob(propagator()->account(), Utility::concatUrlPath(chunkUrl(), it->originalName), this);
-            QObject::connect(job, SIGNAL(finishedSignal()), this, SLOT(slotDeleteJobFinished()));
+            QObject::connect(job, &DeleteJob::finishedSignal, this, &PropagateUploadFileNG::slotDeleteJobFinished);
             _jobs.append(job);
             job->start();
         }
@@ -238,7 +238,7 @@ void PropagateUploadFileNG::startNewUpload()
 
     connect(job, SIGNAL(finished(QNetworkReply::NetworkError)),
         this, SLOT(slotMkColFinished(QNetworkReply::NetworkError)));
-    connect(job, SIGNAL(destroyed(QObject *)), this, SLOT(slotJobDestroyed(QObject *)));
+    connect(job, &QObject::destroyed, this, &PropagateUploadFileCommon::slotJobDestroyed);
     job->start();
 }
 
@@ -292,8 +292,8 @@ void PropagateUploadFileNG::startNextChunk()
         auto job = new MoveJob(propagator()->account(), Utility::concatUrlPath(chunkUrl(), "/.file"),
             destination, headers, this);
         _jobs.append(job);
-        connect(job, SIGNAL(finishedSignal()), this, SLOT(slotMoveJobFinished()));
-        connect(job, SIGNAL(destroyed(QObject *)), this, SLOT(slotJobDestroyed(QObject *)));
+        connect(job, &MoveJob::finishedSignal, this, &PropagateUploadFileNG::slotMoveJobFinished);
+        connect(job, &QObject::destroyed, this, &PropagateUploadFileCommon::slotJobDestroyed);
         propagator()->_activeJobList.append(this);
         job->start();
         return;
@@ -324,12 +324,12 @@ void PropagateUploadFileNG::startNextChunk()
     // job takes ownership of device via a QScopedPointer. Job deletes itself when finishing
     PUTFileJob *job = new PUTFileJob(propagator()->account(), url, device, headers, _currentChunk, this);
     _jobs.append(job);
-    connect(job, SIGNAL(finishedSignal()), this, SLOT(slotPutFinished()));
-    connect(job, SIGNAL(uploadProgress(qint64, qint64)),
-        this, SLOT(slotUploadProgress(qint64, qint64)));
+    connect(job, &PUTFileJob::finishedSignal, this, &PropagateUploadFileNG::slotPutFinished);
+    connect(job, &PUTFileJob::uploadProgress,
+        this, &PropagateUploadFileNG::slotUploadProgress);
     connect(job, SIGNAL(uploadProgress(qint64, qint64)),
         device, SLOT(slotJobUploadProgress(qint64, qint64)));
-    connect(job, SIGNAL(destroyed(QObject *)), this, SLOT(slotJobDestroyed(QObject *)));
+    connect(job, &QObject::destroyed, this, &PropagateUploadFileCommon::slotJobDestroyed);
     job->start();
     propagator()->_activeJobList.append(this);
     _currentChunk++;
index 790023a6404a63585e7931e569515e41033afc2e..b03ac6d9e0056a4a9273108d84e57f531eca4ca6 100644 (file)
@@ -126,10 +126,10 @@ void PropagateUploadFileV1::startNextChunk()
     // job takes ownership of device via a QScopedPointer. Job deletes itself when finishing
     PUTFileJob *job = new PUTFileJob(propagator()->account(), propagator()->_remoteFolder + path, device, headers, _currentChunk, this);
     _jobs.append(job);
-    connect(job, SIGNAL(finishedSignal()), this, SLOT(slotPutFinished()));
-    connect(job, SIGNAL(uploadProgress(qint64, qint64)), this, SLOT(slotUploadProgress(qint64, qint64)));
+    connect(job, &PUTFileJob::finishedSignal, this, &PropagateUploadFileV1::slotPutFinished);
+    connect(job, &PUTFileJob::uploadProgress, this, &PropagateUploadFileV1::slotUploadProgress);
     connect(job, SIGNAL(uploadProgress(qint64, qint64)), device, SLOT(slotJobUploadProgress(qint64, qint64)));
-    connect(job, SIGNAL(destroyed(QObject *)), this, SLOT(slotJobDestroyed(QObject *)));
+    connect(job, &QObject::destroyed, this, &PropagateUploadFileCommon::slotJobDestroyed);
     job->start();
     propagator()->_activeJobList.append(this);
     _currentChunk++;
index b133df1158d18ab98d3a9f40a2431d73d2e5272b..b4b10d4052f14d60cc9d81e214b9f909e2e7a6ed 100644 (file)
@@ -95,7 +95,7 @@ SyncEngine::SyncEngine(AccountPtr account, const QString &localPath,
 
     _clearTouchedFilesTimer.setSingleShot(true);
     _clearTouchedFilesTimer.setInterval(30 * 1000);
-    connect(&_clearTouchedFilesTimer, SIGNAL(timeout()), SLOT(slotClearTouchedFiles()));
+    connect(&_clearTouchedFilesTimer, &QTimer::timeout, this, &SyncEngine::slotClearTouchedFiles);
 
     _thread.setObjectName("SyncEngine_Thread");
 }
@@ -731,8 +731,8 @@ void SyncEngine::startSync()
             qCInfo(lcEngine) << "Finish Poll jobs before starting a sync";
             CleanupPollsJob *job = new CleanupPollsJob(pollInfos, _account,
                 _journal, _localPath, this);
-            connect(job, SIGNAL(finished()), this, SLOT(startSync()));
-            connect(job, SIGNAL(aborted(QString)), this, SLOT(slotCleanPollsJobAborted(QString)));
+            connect(job, &CleanupPollsJob::finished, this, &SyncEngine::startSync);
+            connect(job, &CleanupPollsJob::aborted, this, &SyncEngine::slotCleanPollsJobAborted);
             job->start();
             return;
         }
@@ -845,13 +845,13 @@ void SyncEngine::startSync()
 
     _discoveryMainThread = new DiscoveryMainThread(account());
     _discoveryMainThread->setParent(this);
-    connect(this, SIGNAL(finished(bool)), _discoveryMainThread, SLOT(deleteLater()));
+    connect(this, &SyncEngine::finished, _discoveryMainThread.data(), &QObject::deleteLater);
     qCInfo(lcEngine) << "Server" << account()->serverVersion()
                      << (account()->isHttp2Supported() ? "Using HTTP/2" : "");
     if (account()->rootEtagChangesNotOnlySubFolderEtags()) {
-        connect(_discoveryMainThread, SIGNAL(etag(QString)), this, SLOT(slotRootEtagReceived(QString)));
+        connect(_discoveryMainThread.data(), &DiscoveryMainThread::etag, this, &SyncEngine::slotRootEtagReceived);
     } else {
-        connect(_discoveryMainThread, SIGNAL(etagConcatenation(QString)), this, SLOT(slotRootEtagReceived(QString)));
+        connect(_discoveryMainThread.data(), &DiscoveryMainThread::etagConcatenation, this, &SyncEngine::slotRootEtagReceived);
     }
 
     DiscoveryJob *discoveryJob = new DiscoveryJob(_csync_ctx.data());
@@ -868,12 +868,12 @@ void SyncEngine::startSync()
 
     discoveryJob->_syncOptions = _syncOptions;
     discoveryJob->moveToThread(&_thread);
-    connect(discoveryJob, SIGNAL(finished(int)), this, SLOT(slotDiscoveryJobFinished(int)));
-    connect(discoveryJob, SIGNAL(folderDiscovered(bool, QString)),
-        this, SLOT(slotFolderDiscovered(bool, QString)));
+    connect(discoveryJob, &DiscoveryJob::finished, this, &SyncEngine::slotDiscoveryJobFinished);
+    connect(discoveryJob, &DiscoveryJob::folderDiscovered,
+        this, &SyncEngine::slotFolderDiscovered);
 
-    connect(discoveryJob, SIGNAL(newBigFolder(QString, bool)),
-        this, SIGNAL(newBigFolder(QString, bool)));
+    connect(discoveryJob, &DiscoveryJob::newBigFolder,
+        this, &SyncEngine::newBigFolder);
 
 
     // This is used for the DiscoveryJob to be able to request the main thread/
@@ -1038,15 +1038,15 @@ void SyncEngine::slotDiscoveryJobFinished(int discoveryResult)
     _propagator = QSharedPointer<OwncloudPropagator>(
         new OwncloudPropagator(_account, _localPath, _remotePath, _journal));
     _propagator->setSyncOptions(_syncOptions);
-    connect(_propagator.data(), SIGNAL(itemCompleted(const SyncFileItemPtr &)),
-        this, SLOT(slotItemCompleted(const SyncFileItemPtr &)));
-    connect(_propagator.data(), SIGNAL(progress(const SyncFileItem &, quint64)),
-        this, SLOT(slotProgress(const SyncFileItem &, quint64)));
-    connect(_propagator.data(), SIGNAL(finished(bool)), this, SLOT(slotFinished(bool)), Qt::QueuedConnection);
-    connect(_propagator.data(), SIGNAL(seenLockedFile(QString)), SIGNAL(seenLockedFile(QString)));
-    connect(_propagator.data(), SIGNAL(touchedFile(QString)), SLOT(slotAddTouchedFile(QString)));
-    connect(_propagator.data(), SIGNAL(insufficientLocalStorage()), SLOT(slotInsufficientLocalStorage()));
-    connect(_propagator.data(), SIGNAL(insufficientRemoteStorage()), SLOT(slotInsufficientRemoteStorage()));
+    connect(_propagator.data(), &OwncloudPropagator::itemCompleted,
+        this, &SyncEngine::slotItemCompleted);
+    connect(_propagator.data(), &OwncloudPropagator::progress,
+        this, &SyncEngine::slotProgress);
+    connect(_propagator.data(), &OwncloudPropagator::finished, this, &SyncEngine::slotFinished, Qt::QueuedConnection);
+    connect(_propagator.data(), &OwncloudPropagator::seenLockedFile, this, &SyncEngine::seenLockedFile);
+    connect(_propagator.data(), &OwncloudPropagator::touchedFile, this, &SyncEngine::slotAddTouchedFile);
+    connect(_propagator.data(), &OwncloudPropagator::insufficientLocalStorage, this, &SyncEngine::slotInsufficientLocalStorage);
+    connect(_propagator.data(), &OwncloudPropagator::insufficientRemoteStorage, this, &SyncEngine::slotInsufficientRemoteStorage);
 
     // apply the network limits to the propagator
     setNetworkLimits(_uploadLimit, _downloadLimit);
index 7b40b60716582e59be971afa0cb027bae545da9a..4db5b72fcc243adb375d1d529d7913b42e79e368 100644 (file)
@@ -111,13 +111,13 @@ static inline bool showWarningInSocketApi(const SyncFileItem &item)
 SyncFileStatusTracker::SyncFileStatusTracker(SyncEngine *syncEngine)
     : _syncEngine(syncEngine)
 {
-    connect(syncEngine, SIGNAL(aboutToPropagate(SyncFileItemVector &)),
-        SLOT(slotAboutToPropagate(SyncFileItemVector &)));
-    connect(syncEngine, SIGNAL(itemCompleted(const SyncFileItemPtr &)),
-        SLOT(slotItemCompleted(const SyncFileItemPtr &)));
-    connect(syncEngine, SIGNAL(finished(bool)), SLOT(slotSyncFinished()));
-    connect(syncEngine, SIGNAL(started()), SLOT(slotSyncEngineRunningChanged()));
-    connect(syncEngine, SIGNAL(finished(bool)), SLOT(slotSyncEngineRunningChanged()));
+    connect(syncEngine, &SyncEngine::aboutToPropagate,
+        this, &SyncFileStatusTracker::slotAboutToPropagate);
+    connect(syncEngine, &SyncEngine::itemCompleted,
+        this, &SyncFileStatusTracker::slotItemCompleted);
+    connect(syncEngine, &SyncEngine::finished, this, &SyncFileStatusTracker::slotSyncFinished);
+    connect(syncEngine, &SyncEngine::started, this, &SyncFileStatusTracker::slotSyncEngineRunningChanged);
+    connect(syncEngine, &SyncEngine::finished, this, &SyncFileStatusTracker::slotSyncEngineRunningChanged);
 }
 
 SyncFileStatus SyncFileStatusTracker::fileStatus(const QString &relativePath)