Use the Qt5 connection syntax (automated with clazy)

This is motivated by the fact that QMetaObject::noralizeSignature takes 7.35%
CPU of the LargeSyncBench. (Mostly from ABstractNetworkJob::setupConnections and
PropagateUploadFileV1::startNextChunk). It could be fixed by using normalized
signature in the connection statement, but i tought it was a good oportunity
to modernize the code.

This commit only contains calls that were automatically converted with clazy.
This commit is contained in:
Olivier Goffart 2017-09-20 10:14:48 +02:00 committed by Roeland Jago Douma
parent 3143b32aa5
commit 7aca2352be
No known key found for this signature in database
GPG key ID: F941078878347C0C
73 changed files with 652 additions and 652 deletions

View file

@ -101,7 +101,7 @@ bool QtLocalPeer::isClient()
bool res = server->listen(socketName); bool res = server->listen(socketName);
if (!res) if (!res)
qWarning("QtSingleCoreApplication: listen on local socket failed, %s", qPrintable(server->errorString())); 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; return false;
} }

View file

@ -95,7 +95,7 @@ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char *
*pids = 0; *pids = 0;
pidPeer = new QtLocalPeer(this, appId + QLatin1Char('-') + pidPeer = new QtLocalPeer(this, appId + QLatin1Char('-') +
QString::number(QCoreApplication::applicationPid())); QString::number(QCoreApplication::applicationPid()));
connect(pidPeer, SIGNAL(messageReceived(QString,QObject*)), SIGNAL(messageReceived(QString,QObject*))); connect(pidPeer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::messageReceived);
pidPeer->isClient(); pidPeer->isClient();
lockfile.unlock(); lockfile.unlock();
} }
@ -169,9 +169,9 @@ void QtSingleApplication::setActivationWindow(QWidget *aw, bool activateOnMessag
if (!pidPeer) if (!pidPeer)
return; return;
if (activateOnMessage) if (activateOnMessage)
connect(pidPeer, SIGNAL(messageReceived(QString,QObject*)), this, SLOT(activateWindow())); connect(pidPeer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::activateWindow);
else else
disconnect(pidPeer, SIGNAL(messageReceived(QString,QObject*)), this, SLOT(activateWindow())); disconnect(pidPeer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::activateWindow);
} }

View file

@ -37,7 +37,7 @@ QtSingleCoreApplication::QtSingleCoreApplication(int &argc, char **argv)
{ {
peer = new QtLocalPeer(this); peer = new QtLocalPeer(this);
block = false; 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) : QCoreApplication(argc, argv)
{ {
peer = new QtLocalPeer(this, appId); peer = new QtLocalPeer(this, appId);
connect(peer, SIGNAL(messageReceived(QString)), SIGNAL(messageReceived(QString))); connect(peer, &QtLocalPeer::messageReceived, this, &QtSingleCoreApplication::messageReceived);
} }

View file

@ -512,7 +512,7 @@ restart_sync:
engine.setNetworkLimits(options.uplimit, options.downlimit); engine.setNetworkLimits(options.uplimit, options.downlimit);
QObject::connect(&engine, &SyncEngine::finished, QObject::connect(&engine, &SyncEngine::finished,
[&app](bool result) { app.exit(result ? EXIT_SUCCESS : EXIT_FAILURE); }); [&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 // Exclude lists

View file

@ -151,8 +151,8 @@ QByteArray ComputeChecksum::checksumType() const
void ComputeChecksum::start(const QString &filePath) void ComputeChecksum::start(const QString &filePath)
{ {
// Calculate the checksum in a different thread first. // Calculate the checksum in a different thread first.
connect(&_watcher, SIGNAL(finished()), connect(&_watcher, &QFutureWatcherBase::finished,
this, SLOT(slotCalculationDone()), this, &ComputeChecksum::slotCalculationDone,
Qt::UniqueConnection); Qt::UniqueConnection);
_watcher.setFuture(QtConcurrent::run(ComputeChecksum::computeNow, filePath, checksumType())); _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); auto calculator = new ComputeChecksum(this);
calculator->setChecksumType(_expectedChecksumType); calculator->setChecksumType(_expectedChecksumType);
connect(calculator, SIGNAL(done(QByteArray, QByteArray)), connect(calculator, &ComputeChecksum::done,
SLOT(slotChecksumCalculated(QByteArray, QByteArray))); this, &ValidateChecksumHeader::slotChecksumCalculated);
calculator->start(filePath); calculator->start(filePath);
} }

View file

@ -319,8 +319,8 @@ AccountPtr AccountManager::createAccount()
{ {
AccountPtr acc = Account::create(); AccountPtr acc = Account::create();
acc->setSslErrorHandler(new SslDialogErrorHandler); acc->setSslErrorHandler(new SslDialogErrorHandler);
connect(acc.data(), SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)), connect(acc.data(), &Account::proxyAuthenticationRequired,
ProxyAuthHandler::instance(), SLOT(handleProxyAuthenticationRequired(QNetworkProxy, QAuthenticator *))); ProxyAuthHandler::instance(), &ProxyAuthHandler::handleProxyAuthenticationRequired);
return acc; return acc;
} }
@ -359,8 +359,8 @@ QString AccountManager::generateFreeAccountId() const
void AccountManager::addAccountState(AccountState *accountState) void AccountManager::addAccountState(AccountState *accountState)
{ {
QObject::connect(accountState->account().data(), QObject::connect(accountState->account().data(),
SIGNAL(wantsAccountSaved(Account *)), &Account::wantsAccountSaved,
SLOT(saveAccount(Account *))); this, &AccountManager::saveAccount);
AccountStatePtr ptr(accountState); AccountStatePtr ptr(accountState);
_accounts << ptr; _accounts << ptr;

View file

@ -139,41 +139,41 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
ui->_folderList->installEventFilter(mouseCursorChanger); ui->_folderList->installEventFilter(mouseCursorChanger);
createAccountToolbox(); createAccountToolbox();
connect(AccountManager::instance(), SIGNAL(accountAdded(AccountState *)), connect(AccountManager::instance(), &AccountManager::accountAdded,
SLOT(slotAccountAdded(AccountState *))); this, &AccountSettings::slotAccountAdded);
connect(ui->_folderList, SIGNAL(customContextMenuRequested(QPoint)), connect(ui->_folderList, &QWidget::customContextMenuRequested,
this, SLOT(slotCustomContextMenuRequested(QPoint))); this, &AccountSettings::slotCustomContextMenuRequested);
connect(ui->_folderList, SIGNAL(clicked(const QModelIndex &)), connect(ui->_folderList, &QAbstractItemView::clicked,
this, SLOT(slotFolderListClicked(const QModelIndex &))); this, &AccountSettings::slotFolderListClicked);
connect(ui->_folderList, SIGNAL(expanded(QModelIndex)), this, SLOT(refreshSelectiveSyncStatus())); connect(ui->_folderList, &QTreeView::expanded, this, &AccountSettings::refreshSelectiveSyncStatus);
connect(ui->_folderList, SIGNAL(collapsed(QModelIndex)), this, SLOT(refreshSelectiveSyncStatus())); connect(ui->_folderList, &QTreeView::collapsed, this, &AccountSettings::refreshSelectiveSyncStatus);
connect(ui->selectiveSyncNotification, SIGNAL(linkActivated(QString)), connect(ui->selectiveSyncNotification, &QLabel::linkActivated,
this, SLOT(slotLinkActivated(QString))); this, &AccountSettings::slotLinkActivated);
connect(_model, SIGNAL(suggestExpand(QModelIndex)), ui->_folderList, SLOT(expand(QModelIndex))); connect(_model, &FolderStatusModel::suggestExpand, ui->_folderList, &QTreeView::expand);
connect(_model, SIGNAL(dirtyChanged()), this, SLOT(refreshSelectiveSyncStatus())); connect(_model, &FolderStatusModel::dirtyChanged, this, &AccountSettings::refreshSelectiveSyncStatus);
refreshSelectiveSyncStatus(); refreshSelectiveSyncStatus();
connect(_model, SIGNAL(rowsInserted(QModelIndex, int, int)), connect(_model, &QAbstractItemModel::rowsInserted,
this, SLOT(refreshSelectiveSyncStatus())); this, &AccountSettings::refreshSelectiveSyncStatus);
QAction *syncNowAction = new QAction(this); QAction *syncNowAction = new QAction(this);
syncNowAction->setShortcut(QKeySequence(Qt::Key_F6)); syncNowAction->setShortcut(QKeySequence(Qt::Key_F6));
connect(syncNowAction, SIGNAL(triggered()), SLOT(slotScheduleCurrentFolder())); connect(syncNowAction, &QAction::triggered, this, &AccountSettings::slotScheduleCurrentFolder);
addAction(syncNowAction); addAction(syncNowAction);
QAction *syncNowWithRemoteDiscovery = new QAction(this); QAction *syncNowWithRemoteDiscovery = new QAction(this);
syncNowWithRemoteDiscovery->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_F6)); syncNowWithRemoteDiscovery->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_F6));
connect(syncNowWithRemoteDiscovery, SIGNAL(triggered()), SLOT(slotScheduleCurrentFolderForceRemoteDiscovery())); connect(syncNowWithRemoteDiscovery, &QAction::triggered, this, &AccountSettings::slotScheduleCurrentFolderForceRemoteDiscovery);
addAction(syncNowWithRemoteDiscovery); addAction(syncNowWithRemoteDiscovery);
connect(ui->selectiveSyncApply, SIGNAL(clicked()), _model, SLOT(slotApplySelectiveSync())); connect(ui->selectiveSyncApply, &QAbstractButton::clicked, _model, &FolderStatusModel::slotApplySelectiveSync);
connect(ui->selectiveSyncCancel, SIGNAL(clicked()), _model, SLOT(resetFolders())); connect(ui->selectiveSyncCancel, &QAbstractButton::clicked, _model, &FolderStatusModel::resetFolders);
connect(ui->bigFolderApply, SIGNAL(clicked(bool)), _model, SLOT(slotApplySelectiveSync())); connect(ui->bigFolderApply, &QAbstractButton::clicked, _model, &FolderStatusModel::slotApplySelectiveSync);
connect(ui->bigFolderSyncAll, SIGNAL(clicked(bool)), _model, SLOT(slotSyncAllPendingBigFolders())); connect(ui->bigFolderSyncAll, &QAbstractButton::clicked, _model, &FolderStatusModel::slotSyncAllPendingBigFolders);
connect(ui->bigFolderSyncNone, SIGNAL(clicked(bool)), _model, SLOT(slotSyncNoPendingBigFolders())); connect(ui->bigFolderSyncNone, &QAbstractButton::clicked, _model, &FolderStatusModel::slotSyncNoPendingBigFolders);
connect(FolderMan::instance(), SIGNAL(folderListChanged(Folder::Map)), _model, SLOT(resetFolders())); connect(FolderMan::instance(), &FolderMan::folderListChanged, _model, &FolderStatusModel::resetFolders);
connect(this, SIGNAL(folderChanged()), _model, SLOT(resetFolders())); connect(this, &AccountSettings::folderChanged, _model, &FolderStatusModel::resetFolders);
QColor color = palette().highlight().color(); QColor color = palette().highlight().color();
@ -184,8 +184,8 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
connect(_accountState, &AccountState::stateChanged, this, &AccountSettings::slotAccountStateChanged); connect(_accountState, &AccountState::stateChanged, this, &AccountSettings::slotAccountStateChanged);
slotAccountStateChanged(); slotAccountStateChanged();
connect(&_quotaInfo, SIGNAL(quotaUpdated(qint64, qint64)), connect(&_quotaInfo, &QuotaInfo::quotaUpdated,
this, SLOT(slotUpdateQuota(qint64, qint64))); this, &AccountSettings::slotUpdateQuota);
} }
@ -194,15 +194,15 @@ void AccountSettings::createAccountToolbox()
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
_addAccountAction = new QAction(tr("Add new"), this); _addAccountAction = new QAction(tr("Add new"), this);
menu->addAction(_addAccountAction); menu->addAction(_addAccountAction);
connect(_addAccountAction, SIGNAL(triggered(bool)), SLOT(slotOpenAccountWizard())); connect(_addAccountAction, &QAction::triggered, this, &AccountSettings::slotOpenAccountWizard);
_toggleSignInOutAction = new QAction(tr("Log out"), this); _toggleSignInOutAction = new QAction(tr("Log out"), this);
connect(_toggleSignInOutAction, SIGNAL(triggered(bool)), SLOT(slotToggleSignInState())); connect(_toggleSignInOutAction, &QAction::triggered, this, &AccountSettings::slotToggleSignInState);
menu->addAction(_toggleSignInOutAction); menu->addAction(_toggleSignInOutAction);
QAction *action = new QAction(tr("Remove"), this); QAction *action = new QAction(tr("Remove"), this);
menu->addAction(action); 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->setText(tr("Account") + QLatin1Char(' '));
ui->_accountToolbox->setMenu(menu); ui->_accountToolbox->setMenu(menu);
@ -268,7 +268,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
menu->setAttribute(Qt::WA_DeleteOnClose); menu->setAttribute(Qt::WA_DeleteOnClose);
QAction *ac = menu->addAction(tr("Open folder")); 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(); QString fileName = _model->data(index, FolderStatusDelegate::FolderPathRole).toString();
if (!QFile::exists(fileName)) { if (!QFile::exists(fileName)) {
@ -294,12 +294,12 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
menu->setAttribute(Qt::WA_DeleteOnClose); menu->setAttribute(Qt::WA_DeleteOnClose);
QAction *ac = menu->addAction(tr("Open folder")); 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)) { if (!ui->_folderList->isExpanded(index)) {
ac = menu->addAction(tr("Choose what to sync")); ac = menu->addAction(tr("Choose what to sync"));
ac->setEnabled(folderConnected); ac->setEnabled(folderConnected);
connect(ac, SIGNAL(triggered(bool)), this, SLOT(doExpand())); connect(ac, &QAction::triggered, this, &AccountSettings::doExpand);
} }
if (!folderPaused) { if (!folderPaused) {
@ -308,14 +308,14 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
ac->setText(tr("Restart sync")); ac->setText(tr("Restart sync"));
} }
ac->setEnabled(folderConnected); 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")); 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")); 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)); menu->exec(tv->mapToGlobal(pos));
} }
@ -361,8 +361,8 @@ void AccountSettings::slotAddFolder()
FolderWizard *folderWizard = new FolderWizard(_accountState->account(), this); FolderWizard *folderWizard = new FolderWizard(_accountState->account(), this);
connect(folderWizard, SIGNAL(accepted()), SLOT(slotFolderWizardAccepted())); connect(folderWizard, &QDialog::accepted, this, &AccountSettings::slotFolderWizardAccepted);
connect(folderWizard, SIGNAL(rejected()), SLOT(slotFolderWizardRejected())); connect(folderWizard, &QDialog::rejected, this, &AccountSettings::slotFolderWizardRejected);
folderWizard->open(); folderWizard->open();
} }

View file

@ -38,12 +38,12 @@ AccountState::AccountState(AccountPtr account)
{ {
qRegisterMetaType<AccountState *>("AccountState*"); qRegisterMetaType<AccountState *>("AccountState*");
connect(account.data(), SIGNAL(invalidCredentials()), connect(account.data(), &Account::invalidCredentials,
SLOT(slotInvalidCredentials())); this, &AccountState::slotInvalidCredentials);
connect(account.data(), SIGNAL(credentialsFetched(AbstractCredentials *)), connect(account.data(), &Account::credentialsFetched,
SLOT(slotCredentialsFetched(AbstractCredentials *))); this, &AccountState::slotCredentialsFetched);
connect(account.data(), SIGNAL(credentialsAsked(AbstractCredentials *)), connect(account.data(), &Account::credentialsAsked,
SLOT(slotCredentialsAsked(AbstractCredentials *))); this, &AccountState::slotCredentialsAsked);
_timeSinceLastETagCheck.invalidate(); _timeSinceLastETagCheck.invalidate();
} }
@ -242,7 +242,7 @@ void AccountState::slotConnectionValidatorResult(ConnectionValidator::Status sta
qCInfo(lcAccountState) << "AccountState reconnection: delaying for" qCInfo(lcAccountState) << "AccountState reconnection: delaying for"
<< _maintenanceToConnectedDelay << "ms"; << _maintenanceToConnectedDelay << "ms";
_timeSinceMaintenanceOver.start(); _timeSinceMaintenanceOver.start();
QTimer::singleShot(_maintenanceToConnectedDelay + 100, this, SLOT(checkConnectivity())); QTimer::singleShot(_maintenanceToConnectedDelay + 100, this, &AccountState::checkConnectivity);
return; return;
} else if (_timeSinceMaintenanceOver.elapsed() < _maintenanceToConnectedDelay) { } else if (_timeSinceMaintenanceOver.elapsed() < _maintenanceToConnectedDelay) {
qCInfo(lcAccountState) << "AccountState reconnection: only" qCInfo(lcAccountState) << "AccountState reconnection: only"

View file

@ -124,8 +124,8 @@ void ActivityListModel::startFetchJob(AccountState *s)
return; return;
} }
JsonApiJob *job = new JsonApiJob(s->account(), QLatin1String("ocs/v1.php/cloud/activity"), this); JsonApiJob *job = new JsonApiJob(s->account(), QLatin1String("ocs/v1.php/cloud/activity"), this);
QObject::connect(job, SIGNAL(jsonReceived(QJsonDocument, int)), QObject::connect(job, &JsonApiJob::jsonReceived,
this, SLOT(slotActivitiesReceived(QJsonDocument, int))); this, &ActivityListModel::slotActivitiesReceived);
job->setProperty("AccountStatePtr", QVariant::fromValue<QPointer<AccountState>>(s)); job->setProperty("AccountStatePtr", QVariant::fromValue<QPointer<AccountState>>(s));
QList<QPair<QString, QString>> params; QList<QPair<QString, QString>> params;

View file

@ -81,19 +81,19 @@ ActivityWidget::ActivityWidget(QWidget *parent)
showLabels(); showLabels();
connect(_model, SIGNAL(activityJobStatusCode(AccountState *, int)), connect(_model, &ActivityListModel::activityJobStatusCode,
this, SLOT(slotAccountActivityStatus(AccountState *, int))); this, &ActivityWidget::slotAccountActivityStatus);
_copyBtn = _ui->_dialogButtonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole); _copyBtn = _ui->_dialogButtonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
_copyBtn->setToolTip(tr("Copy the activity list to the clipboard.")); _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, connect(_ui->_activityList, SIGNAL(activated(QModelIndex)), this,
SLOT(slotOpenFile(QModelIndex))); SLOT(slotOpenFile(QModelIndex)));
connect(&_removeTimer, SIGNAL(timeout()), this, SLOT(slotCheckToCleanWidgets())); connect(&_removeTimer, &QTimer::timeout, this, &ActivityWidget::slotCheckToCleanWidgets);
_removeTimer.setInterval(1000); _removeTimer.setInterval(1000);
} }
@ -260,10 +260,10 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList &list)
widget = _widgetForNotifId[activity.ident()]; widget = _widgetForNotifId[activity.ident()];
} else { } else {
widget = new NotificationWidget(this); widget = new NotificationWidget(this);
connect(widget, SIGNAL(sendNotificationRequest(QString, QString, QByteArray)), connect(widget, &NotificationWidget::sendNotificationRequest,
this, SLOT(slotSendNotificationRequest(QString, QString, QByteArray))); this, &ActivityWidget::slotSendNotificationRequest);
connect(widget, SIGNAL(requestCleanupAndBlacklist(Activity)), connect(widget, &NotificationWidget::requestCleanupAndBlacklist,
this, SLOT(slotRequestCleanupAndBlacklist(Activity))); this, &ActivityWidget::slotRequestCleanupAndBlacklist);
_notificationsLayout->addWidget(widget); _notificationsLayout->addWidget(widget);
// _ui->_notifyScroll->setMinimumHeight( widget->height()); // _ui->_notifyScroll->setMinimumHeight( widget->height());
@ -386,8 +386,8 @@ void ActivityWidget::slotSendNotificationRequest(const QString &accountName, con
QUrl l(link); QUrl l(link);
job->setLinkAndVerb(l, verb); job->setLinkAndVerb(l, verb);
job->setWidget(theSender); job->setWidget(theSender);
connect(job, SIGNAL(networkError(QNetworkReply *)), connect(job, &AbstractNetworkJob::networkError,
this, SLOT(slotNotifyNetworkError(QNetworkReply *))); this, &ActivityWidget::slotNotifyNetworkError);
connect(job, SIGNAL(jobFinished(QString, int)), connect(job, SIGNAL(jobFinished(QString, int)),
this, SLOT(slotNotifyServerFinished(QString, int))); this, SLOT(slotNotifyServerFinished(QString, int)));
job->start(); job->start();
@ -515,32 +515,32 @@ ActivitySettings::ActivitySettings(QWidget *parent)
hbox->addWidget(_tab); hbox->addWidget(_tab);
_activityWidget = new ActivityWidget(this); _activityWidget = new ActivityWidget(this);
_activityTabId = _tab->addTab(_activityWidget, Theme::instance()->applicationIcon(), tr("Server Activity")); _activityTabId = _tab->addTab(_activityWidget, Theme::instance()->applicationIcon(), tr("Server Activity"));
connect(_activityWidget, SIGNAL(copyToClipboard()), this, SLOT(slotCopyToClipboard())); connect(_activityWidget, &ActivityWidget::copyToClipboard, this, &ActivitySettings::slotCopyToClipboard);
connect(_activityWidget, SIGNAL(hideActivityTab(bool)), this, SLOT(setActivityTabHidden(bool))); connect(_activityWidget, &ActivityWidget::hideActivityTab, this, &ActivitySettings::setActivityTabHidden);
connect(_activityWidget, SIGNAL(guiLog(QString, QString)), this, SIGNAL(guiLog(QString, QString))); connect(_activityWidget, &ActivityWidget::guiLog, this, &ActivitySettings::guiLog);
connect(_activityWidget, SIGNAL(newNotification()), SLOT(slotShowActivityTab())); connect(_activityWidget, &ActivityWidget::newNotification, this, &ActivitySettings::slotShowActivityTab);
_protocolWidget = new ProtocolWidget(this); _protocolWidget = new ProtocolWidget(this);
_protocolTabId = _tab->addTab(_protocolWidget, Theme::instance()->syncStateIcon(SyncResult::Success), tr("Sync Protocol")); _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); _issuesWidget = new IssuesWidget(this);
_syncIssueTabId = _tab->addTab(_issuesWidget, Theme::instance()->syncStateIcon(SyncResult::Problem), QString()); _syncIssueTabId = _tab->addTab(_issuesWidget, Theme::instance()->syncStateIcon(SyncResult::Problem), QString());
slotShowIssueItemCount(0); // to display the label. slotShowIssueItemCount(0); // to display the label.
connect(_issuesWidget, SIGNAL(issueCountUpdated(int)), connect(_issuesWidget, &IssuesWidget::issueCountUpdated,
this, SLOT(slotShowIssueItemCount(int))); this, &ActivitySettings::slotShowIssueItemCount);
connect(_issuesWidget, SIGNAL(copyToClipboard()), connect(_issuesWidget, &IssuesWidget::copyToClipboard,
this, SLOT(slotCopyToClipboard())); this, &ActivitySettings::slotCopyToClipboard);
// Add a progress indicator to spin if the acitivity list is updated. // Add a progress indicator to spin if the acitivity list is updated.
_progressIndicator = new QProgressIndicator(this); _progressIndicator = new QProgressIndicator(this);
_tab->setCornerWidget(_progressIndicator); _tab->setCornerWidget(_progressIndicator);
connect(&_notificationCheckTimer, SIGNAL(timeout()), connect(&_notificationCheckTimer, &QTimer::timeout,
this, SLOT(slotRegularNotificationCheck())); this, &ActivitySettings::slotRegularNotificationCheck);
// connect a model signal to stop the animation. // 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 // We want the protocol be the default
_tab->setCurrentIndex(1); _tab->setCurrentIndex(1);

View file

@ -150,7 +150,7 @@ Application::Application(int &argc, char **argv)
_folderManager.reset(new FolderMan); _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 (!AccountManager::instance()->restore()) {
// If there is an error reading the account settings, try again // If there is an error reading the account settings, try again
@ -176,7 +176,7 @@ Application::Application(int &argc, char **argv)
setQuitOnLastWindowClosed(false); setQuitOnLastWindowClosed(false);
_theme->setSystrayUseMonoIcons(cfg.monoIcons()); _theme->setSystrayUseMonoIcons(cfg.monoIcons());
connect(_theme, SIGNAL(systrayUseMonoIconsChanged(bool)), SLOT(slotUseMonoIconsChanged(bool))); connect(_theme, &Theme::systrayUseMonoIconsChanged, this, &Application::slotUseMonoIconsChanged);
FolderMan::instance()->setupFolders(); FolderMan::instance()->setupFolders();
_proxy.setupQtProxyFromConfig(); // folders have to be defined first, than we set up the Qt proxy. _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) // Enable word wrapping of QInputDialog (#4197)
setStyleSheet("QInputDialog QLabel { qproperty-wordWrap:1; }"); setStyleSheet("QInputDialog QLabel { qproperty-wordWrap:1; }");
connect(AccountManager::instance(), SIGNAL(accountAdded(AccountState *)), connect(AccountManager::instance(), &AccountManager::accountAdded,
SLOT(slotAccountStateAdded(AccountState *))); this, &Application::slotAccountStateAdded);
connect(AccountManager::instance(), SIGNAL(accountRemoved(AccountState *)), connect(AccountManager::instance(), &AccountManager::accountRemoved,
SLOT(slotAccountStateRemoved(AccountState *))); this, &Application::slotAccountStateRemoved);
foreach (auto ai, AccountManager::instance()->accounts()) { foreach (auto ai, AccountManager::instance()->accounts()) {
slotAccountStateAdded(ai.data()); slotAccountStateAdded(ai.data());
} }
connect(FolderMan::instance()->socketApi(), SIGNAL(shareCommandReceived(QString, QString)), connect(FolderMan::instance()->socketApi(), &SocketApi::shareCommandReceived,
_gui, SLOT(slotShowShareDialog(QString, QString))); _gui.data(), &ownCloudGui::slotShowShareDialog);
// startup procedure. // 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.setInterval(ConnectionValidator::DefaultCallingIntervalMsec); // check for connection every 32 seconds.
_checkConnectionTimer.start(); _checkConnectionTimer.start();
// Also check immediately // 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 // Can't use onlineStateChanged because it is always true on modern systems because of many interfaces
connect(&_networkConfigurationManager, SIGNAL(configurationChanged(QNetworkConfiguration)), connect(&_networkConfigurationManager, SIGNAL(configurationChanged(QNetworkConfiguration)),
@ -213,13 +213,13 @@ Application::Application(int &argc, char **argv)
// Update checks // Update checks
UpdaterScheduler *updaterScheduler = new UpdaterScheduler(this); UpdaterScheduler *updaterScheduler = new UpdaterScheduler(this);
connect(updaterScheduler, SIGNAL(updaterAnnouncement(QString, QString)), connect(updaterScheduler, &UpdaterScheduler::updaterAnnouncement,
_gui, SLOT(slotShowTrayMessage(QString, QString))); _gui.data(), &ownCloudGui::slotShowTrayMessage);
connect(updaterScheduler, SIGNAL(requestRestart()), connect(updaterScheduler, &UpdaterScheduler::requestRestart,
_folderManager.data(), SLOT(slotScheduleAppRestart())); _folderManager.data(), &FolderMan::slotScheduleAppRestart);
// Cleanup at Quit. // Cleanup at Quit.
connect(this, SIGNAL(aboutToQuit()), SLOT(slotCleanup())); connect(this, &QCoreApplication::aboutToQuit, this, &Application::slotCleanup);
} }
Application::~Application() Application::~Application()
@ -237,16 +237,16 @@ Application::~Application()
void Application::slotAccountStateRemoved(AccountState *accountState) void Application::slotAccountStateRemoved(AccountState *accountState)
{ {
if (_gui) { if (_gui) {
disconnect(accountState, SIGNAL(stateChanged(int)), disconnect(accountState, &AccountState::stateChanged,
_gui, SLOT(slotAccountStateChanged())); _gui.data(), &ownCloudGui::slotAccountStateChanged);
disconnect(accountState->account().data(), SIGNAL(serverVersionChanged(Account *, QString, QString)), disconnect(accountState->account().data(), &Account::serverVersionChanged,
_gui, SLOT(slotTrayMessageIfServerUnsupported(Account *))); _gui.data(), &ownCloudGui::slotTrayMessageIfServerUnsupported);
} }
if (_folderManager) { if (_folderManager) {
disconnect(accountState, SIGNAL(stateChanged(int)), disconnect(accountState, &AccountState::stateChanged,
_folderManager.data(), SLOT(slotAccountStateChanged())); _folderManager.data(), &FolderMan::slotAccountStateChanged);
disconnect(accountState->account().data(), SIGNAL(serverVersionChanged(Account *, QString, QString)), disconnect(accountState->account().data(), &Account::serverVersionChanged,
_folderManager.data(), SLOT(slotServerVersionChanged(Account *))); _folderManager.data(), &FolderMan::slotServerVersionChanged);
} }
// if there is no more account, show the wizard. // if there is no more account, show the wizard.
@ -259,14 +259,14 @@ void Application::slotAccountStateRemoved(AccountState *accountState)
void Application::slotAccountStateAdded(AccountState *accountState) void Application::slotAccountStateAdded(AccountState *accountState)
{ {
connect(accountState, SIGNAL(stateChanged(int)), connect(accountState, &AccountState::stateChanged,
_gui, SLOT(slotAccountStateChanged())); _gui.data(), &ownCloudGui::slotAccountStateChanged);
connect(accountState->account().data(), SIGNAL(serverVersionChanged(Account *, QString, QString)), connect(accountState->account().data(), &Account::serverVersionChanged,
_gui, SLOT(slotTrayMessageIfServerUnsupported(Account *))); _gui.data(), &ownCloudGui::slotTrayMessageIfServerUnsupported);
connect(accountState, SIGNAL(stateChanged(int)), connect(accountState, &AccountState::stateChanged,
_folderManager.data(), SLOT(slotAccountStateChanged())); _folderManager.data(), &FolderMan::slotAccountStateChanged);
connect(accountState->account().data(), SIGNAL(serverVersionChanged(Account *, QString, QString)), connect(accountState->account().data(), &Account::serverVersionChanged,
_folderManager.data(), SLOT(slotServerVersionChanged(Account *))); _folderManager.data(), &FolderMan::slotServerVersionChanged);
_gui->slotTrayMessageIfServerUnsupported(accountState->account().data()); _gui->slotTrayMessageIfServerUnsupported(accountState->account().data());
} }

View file

@ -40,8 +40,8 @@ AuthenticationDialog::AuthenticationDialog(const QString &realm, const QString &
_password->setEchoMode(QLineEdit::Password); _password->setEchoMode(QLineEdit::Password);
QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal); QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
connect(box, SIGNAL(accepted()), this, SLOT(accept())); connect(box, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(box, SIGNAL(rejected()), this, SLOT(reject())); connect(box, &QDialogButtonBox::rejected, this, &QDialog::reject);
lay->addWidget(box); lay->addWidget(box);
} }

View file

@ -27,7 +27,7 @@ ShibbolethUserJob::ShibbolethUserJob(AccountPtr account, QObject *parent)
: JsonApiJob(account, QLatin1String("ocs/v1.php/cloud/user"), parent) : JsonApiJob(account, QLatin1String("ocs/v1.php/cloud/user"), parent)
{ {
setIgnoreCredentialFailure(true); 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) void ShibbolethUserJob::slotJsonReceived(const QJsonDocument &json, int statusCode)

View file

@ -63,10 +63,10 @@ ShibbolethWebView::ShibbolethWebView(AccountPtr account, QWidget *parent)
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
QWebPage *page = new UserAgentWebPage(this); QWebPage *page = new UserAgentWebPage(this);
connect(page, SIGNAL(loadStarted()), connect(page, &QWebPage::loadStarted,
this, SLOT(slotLoadStarted())); this, &ShibbolethWebView::slotLoadStarted);
connect(page, SIGNAL(loadFinished(bool)), connect(page, &QWebPage::loadFinished,
this, SLOT(slotLoadFinished(bool))); this, &ShibbolethWebView::slotLoadFinished);
// Make sure to accept the same SSL certificate issues as the regular QNAM we use for syncing // 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>)), QObject::connect(page->networkAccessManager(), SIGNAL(sslErrors(QNetworkReply *, QList<QSslError>)),

View file

@ -79,7 +79,7 @@ void ShibbolethCredentials::setAccount(Account *account)
// When constructed with a cookie (by the wizard), we usually don't know the // When constructed with a cookie (by the wizard), we usually don't know the
// user name yet. Request it now from the server. // user name yet. Request it now from the server.
if (_ready && _user.isEmpty()) { 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 *ShibbolethCredentials::createQNAM() const
{ {
QNetworkAccessManager *qnam(new AccessManager); QNetworkAccessManager *qnam(new AccessManager);
connect(qnam, SIGNAL(finished(QNetworkReply *)), connect(qnam, &QNetworkAccessManager::finished,
this, SLOT(slotReplyFinished(QNetworkReply *))); this, &ShibbolethCredentials::slotReplyFinished);
return qnam; return qnam;
} }
@ -145,7 +145,7 @@ void ShibbolethCredentials::fetchFromKeychainHelper()
job->setInsecureFallback(false); job->setInsecureFallback(false);
job->setKey(keychainKey(_url.toString(), user(), job->setKey(keychainKey(_url.toString(), user(),
_keychainMigration ? QString() : _account->id())); _keychainMigration ? QString() : _account->id()));
connect(job, SIGNAL(finished(QKeychain::Job *)), SLOT(slotReadJobDone(QKeychain::Job *))); connect(job, &Job::finished, this, &ShibbolethCredentials::slotReadJobDone);
job->start(); job->start();
} }
@ -210,7 +210,7 @@ void ShibbolethCredentials::slotFetchUser()
// We must first do a request to webdav so the session is enabled. // 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?) // (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); 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->setIgnoreCredentialFailure(true);
job->start(); job->start();
} }
@ -218,7 +218,7 @@ void ShibbolethCredentials::slotFetchUser()
void ShibbolethCredentials::slotFetchUserHelper() void ShibbolethCredentials::slotFetchUserHelper()
{ {
ShibbolethUserJob *job = new ShibbolethUserJob(_account->sharedFromThis(), this); 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(); job->start();
} }
@ -308,9 +308,9 @@ void ShibbolethCredentials::showLoginWindow()
jar->clearSessionCookies(); jar->clearSessionCookies();
_browser = new ShibbolethWebView(_account->sharedFromThis()); _browser = new ShibbolethWebView(_account->sharedFromThis());
connect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie)), connect(_browser.data(), &ShibbolethWebView::shibbolethCookieReceived,
this, SLOT(onShibbolethCookieReceived(QNetworkCookie)), Qt::QueuedConnection); this, &ShibbolethCredentials::onShibbolethCookieReceived, Qt::QueuedConnection);
connect(_browser, SIGNAL(rejected()), this, SLOT(slotBrowserRejected())); connect(_browser.data(), &ShibbolethWebView::rejected, this, &ShibbolethCredentials::slotBrowserRejected);
ownCloudGui::raiseDialog(_browser); ownCloudGui::raiseDialog(_browser);
} }

View file

@ -82,32 +82,32 @@ Folder::Folder(const FolderDefinition &definition,
if (!setIgnoredFiles()) if (!setIgnoredFiles())
qCWarning(lcFolder, "Could not read system exclude file"); qCWarning(lcFolder, "Could not read system exclude file");
connect(_accountState.data(), SIGNAL(isConnectedChanged()), this, SIGNAL(canSyncChanged())); connect(_accountState.data(), &AccountState::isConnectedChanged, this, &Folder::canSyncChanged);
connect(_engine.data(), SIGNAL(rootEtag(QString)), this, SLOT(etagRetreivedFromSyncEngine(QString))); connect(_engine.data(), &SyncEngine::rootEtag, this, &Folder::etagRetreivedFromSyncEngine);
connect(_engine.data(), SIGNAL(started()), SLOT(slotSyncStarted()), Qt::QueuedConnection); connect(_engine.data(), &SyncEngine::started, this, &Folder::slotSyncStarted, Qt::QueuedConnection);
connect(_engine.data(), SIGNAL(finished(bool)), SLOT(slotSyncFinished(bool)), Qt::QueuedConnection); connect(_engine.data(), &SyncEngine::finished, this, &Folder::slotSyncFinished, Qt::QueuedConnection);
connect(_engine.data(), SIGNAL(csyncUnavailable()), SLOT(slotCsyncUnavailable()), Qt::QueuedConnection); connect(_engine.data(), &SyncEngine::csyncUnavailable, this, &Folder::slotCsyncUnavailable, Qt::QueuedConnection);
//direct connection so the message box is blocking the sync. //direct connection so the message box is blocking the sync.
connect(_engine.data(), SIGNAL(aboutToRemoveAllFiles(SyncFileItem::Direction, bool *)), connect(_engine.data(), &SyncEngine::aboutToRemoveAllFiles,
SLOT(slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool *))); this, &Folder::slotAboutToRemoveAllFiles);
connect(_engine.data(), SIGNAL(aboutToRestoreBackup(bool *)), connect(_engine.data(), &SyncEngine::aboutToRestoreBackup,
SLOT(slotAboutToRestoreBackup(bool *))); this, &Folder::slotAboutToRestoreBackup);
connect(_engine.data(), SIGNAL(transmissionProgress(ProgressInfo)), this, SLOT(slotTransmissionProgress(ProgressInfo))); connect(_engine.data(), &SyncEngine::transmissionProgress, this, &Folder::slotTransmissionProgress);
connect(_engine.data(), SIGNAL(itemCompleted(const SyncFileItemPtr &)), connect(_engine.data(), &SyncEngine::itemCompleted,
this, SLOT(slotItemCompleted(const SyncFileItemPtr &))); this, &Folder::slotItemCompleted);
connect(_engine.data(), SIGNAL(newBigFolder(QString, bool)), connect(_engine.data(), &SyncEngine::newBigFolder,
this, SLOT(slotNewBigFolderDiscovered(QString, bool))); this, &Folder::slotNewBigFolderDiscovered);
connect(_engine.data(), SIGNAL(seenLockedFile(QString)), FolderMan::instance(), SLOT(slotSyncOnceFileUnlocks(QString))); connect(_engine.data(), &SyncEngine::seenLockedFile, FolderMan::instance(), &FolderMan::slotSyncOnceFileUnlocks);
connect(_engine.data(), SIGNAL(aboutToPropagate(SyncFileItemVector &)), connect(_engine.data(), &SyncEngine::aboutToPropagate,
SLOT(slotLogPropagationStart())); this, &Folder::slotLogPropagationStart);
connect(_engine.data(), &SyncEngine::syncError, this, &Folder::slotSyncError); connect(_engine.data(), &SyncEngine::syncError, this, &Folder::slotSyncError);
_scheduleSelfTimer.setSingleShot(true); _scheduleSelfTimer.setSingleShot(true);
_scheduleSelfTimer.setInterval(SyncEngine::minimumFileAgeForUpload); _scheduleSelfTimer.setInterval(SyncEngine::minimumFileAgeForUpload);
connect(&_scheduleSelfTimer, SIGNAL(timeout()), connect(&_scheduleSelfTimer, &QTimer::timeout,
SLOT(slotScheduleThisFolder())); this, &Folder::slotScheduleThisFolder);
} }
Folder::~Folder() Folder::~Folder()
@ -288,7 +288,7 @@ void Folder::slotRunEtagJob()
_requestEtagJob = new RequestEtagJob(account, remotePath(), this); _requestEtagJob = new RequestEtagJob(account, remotePath(), this);
_requestEtagJob->setTimeout(60 * 1000); _requestEtagJob->setTimeout(60 * 1000);
// check if the etag is different when retrieved // 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); FolderMan::instance()->slotScheduleETagJob(alias(), _requestEtagJob);
// The _requestEtagJob is auto deleting itself on finish. Our guard pointer _requestEtagJob will then be null. // 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 // file system change notifications are ignored for that folder. And it takes
// some time under certain conditions to make the file system notifications // some time under certain conditions to make the file system notifications
// all come in. // all come in.
QTimer::singleShot(200, this, SLOT(slotEmitFinishedDelayed())); QTimer::singleShot(200, this, &Folder::slotEmitFinishedDelayed);
_lastSyncDuration = _timeSinceLastSyncStart.elapsed(); _lastSyncDuration = _timeSinceLastSyncStart.elapsed();
_timeSinceLastSyncDone.start(); _timeSinceLastSyncDone.start();

View file

@ -60,24 +60,24 @@ FolderMan::FolderMan(QObject *parent)
int polltime = cfg.remotePollInterval(); int polltime = cfg.remotePollInterval();
qCInfo(lcFolderMan) << "setting remote poll timer interval to" << polltime << "msec"; qCInfo(lcFolderMan) << "setting remote poll timer interval to" << polltime << "msec";
_etagPollTimer.setInterval(polltime); _etagPollTimer.setInterval(polltime);
QObject::connect(&_etagPollTimer, SIGNAL(timeout()), this, SLOT(slotEtagPollTimerTimeout())); QObject::connect(&_etagPollTimer, &QTimer::timeout, this, &FolderMan::slotEtagPollTimerTimeout);
_etagPollTimer.start(); _etagPollTimer.start();
_startScheduledSyncTimer.setSingleShot(true); _startScheduledSyncTimer.setSingleShot(true);
connect(&_startScheduledSyncTimer, SIGNAL(timeout()), connect(&_startScheduledSyncTimer, &QTimer::timeout,
SLOT(slotStartScheduledFolderSync())); this, &FolderMan::slotStartScheduledFolderSync);
_timeScheduler.setInterval(5000); _timeScheduler.setInterval(5000);
_timeScheduler.setSingleShot(false); _timeScheduler.setSingleShot(false);
connect(&_timeScheduler, SIGNAL(timeout()), connect(&_timeScheduler, &QTimer::timeout,
SLOT(slotScheduleFolderByTime())); this, &FolderMan::slotScheduleFolderByTime);
_timeScheduler.start(); _timeScheduler.start();
connect(AccountManager::instance(), SIGNAL(accountRemoved(AccountState *)), connect(AccountManager::instance(), &AccountManager::accountRemoved,
SLOT(slotRemoveFoldersForAccount(AccountState *))); this, &FolderMan::slotRemoveFoldersForAccount);
connect(_lockWatcher.data(), SIGNAL(fileUnlocked(QString)), connect(_lockWatcher.data(), &LockWatcher::fileUnlocked,
SLOT(slotWatchedFileUnlocked(QString))); this, &FolderMan::slotWatchedFileUnlocked);
} }
FolderMan *FolderMan::instance() FolderMan *FolderMan::instance()
@ -109,18 +109,18 @@ void FolderMan::unloadFolder(Folder *f)
} }
_folderMap.remove(f->alias()); _folderMap.remove(f->alias());
disconnect(f, SIGNAL(syncStarted()), disconnect(f, &Folder::syncStarted,
this, SLOT(slotFolderSyncStarted())); this, &FolderMan::slotFolderSyncStarted);
disconnect(f, SIGNAL(syncFinished(SyncResult)), disconnect(f, &Folder::syncFinished,
this, SLOT(slotFolderSyncFinished(SyncResult))); this, &FolderMan::slotFolderSyncFinished);
disconnect(f, SIGNAL(syncStateChange()), disconnect(f, &Folder::syncStateChange,
this, SLOT(slotForwardFolderSyncStateChange())); this, &FolderMan::slotForwardFolderSyncStateChange);
disconnect(f, SIGNAL(syncPausedChanged(Folder *, bool)), disconnect(f, &Folder::syncPausedChanged,
this, SLOT(slotFolderSyncPaused(Folder *, bool))); this, &FolderMan::slotFolderSyncPaused);
disconnect(&f->syncEngine().syncFileStatusTracker(), SIGNAL(fileStatusChanged(const QString &, SyncFileStatus)), disconnect(&f->syncEngine().syncFileStatusTracker(), SIGNAL(fileStatusChanged(const QString &, SyncFileStatus)),
_socketApi.data(), SLOT(broadcastStatusPushMessage(const QString &, SyncFileStatus))); _socketApi.data(), SLOT(broadcastStatusPushMessage(const QString &, SyncFileStatus)));
disconnect(f, SIGNAL(watchedFileChangedExternally(QString)), disconnect(f, &Folder::watchedFileChangedExternally,
&f->syncEngine().syncFileStatusTracker(), SLOT(slotPathTouched(QString))); &f->syncEngine().syncFileStatusTracker(), &SyncFileStatusTracker::slotPathTouched);
} }
int FolderMan::unloadAndDeleteAllFolders() int FolderMan::unloadAndDeleteAllFolders()
@ -163,7 +163,7 @@ void FolderMan::registerFolderMonitor(Folder *folder)
// Connect the pathChanged signal, which comes with the changed path, // Connect the pathChanged signal, which comes with the changed path,
// to the signal mapper which maps to the folder alias. 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. // 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); _folderWatchers.insert(folder->alias(), fw);
} }
@ -584,7 +584,7 @@ void FolderMan::scheduleFolderNext(Folder *f)
void FolderMan::slotScheduleETagJob(const QString & /*alias*/, RequestEtagJob *job) 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); QMetaObject::invokeMethod(this, "slotRunOneEtagJob", Qt::QueuedConnection);
// maybe: add to queue // maybe: add to queue
} }
@ -954,15 +954,15 @@ Folder *FolderMan::addFolderInternal(FolderDefinition folderDefinition,
} }
// See matching disconnects in unloadFolder(). // See matching disconnects in unloadFolder().
connect(folder, SIGNAL(syncStarted()), SLOT(slotFolderSyncStarted())); connect(folder, &Folder::syncStarted, this, &FolderMan::slotFolderSyncStarted);
connect(folder, SIGNAL(syncFinished(SyncResult)), SLOT(slotFolderSyncFinished(SyncResult))); connect(folder, &Folder::syncFinished, this, &FolderMan::slotFolderSyncFinished);
connect(folder, SIGNAL(syncStateChange()), SLOT(slotForwardFolderSyncStateChange())); connect(folder, &Folder::syncStateChange, this, &FolderMan::slotForwardFolderSyncStateChange);
connect(folder, SIGNAL(syncPausedChanged(Folder *, bool)), SLOT(slotFolderSyncPaused(Folder *, bool))); connect(folder, &Folder::syncPausedChanged, this, &FolderMan::slotFolderSyncPaused);
connect(folder, SIGNAL(canSyncChanged()), SLOT(slotFolderCanSyncChanged())); connect(folder, &Folder::canSyncChanged, this, &FolderMan::slotFolderCanSyncChanged);
connect(&folder->syncEngine().syncFileStatusTracker(), SIGNAL(fileStatusChanged(const QString &, SyncFileStatus)), connect(&folder->syncEngine().syncFileStatusTracker(), SIGNAL(fileStatusChanged(const QString &, SyncFileStatus)),
_socketApi.data(), SLOT(broadcastStatusPushMessage(const QString &, SyncFileStatus))); _socketApi.data(), SLOT(broadcastStatusPushMessage(const QString &, SyncFileStatus)));
connect(folder, SIGNAL(watchedFileChangedExternally(QString)), connect(folder, &Folder::watchedFileChangedExternally,
&folder->syncEngine().syncFileStatusTracker(), SLOT(slotPathTouched(QString))); &folder->syncEngine().syncFileStatusTracker(), &SyncFileStatusTracker::slotPathTouched);
registerFolderMonitor(folder); registerFolderMonitor(folder);
return folder; return folder;
@ -1032,10 +1032,10 @@ void FolderMan::removeFolder(Folder *f)
unloadFolder(f); unloadFolder(f);
if (currentlyRunning) { if (currentlyRunning) {
// We want to schedule the next folder once this is done // We want to schedule the next folder once this is done
connect(f, SIGNAL(syncFinished(SyncResult)), connect(f, &Folder::syncFinished,
SLOT(slotFolderSyncFinished(SyncResult))); this, &FolderMan::slotFolderSyncFinished);
// Let the folder delete itself when done. // Let the folder delete itself when done.
connect(f, SIGNAL(syncFinished(SyncResult)), f, SLOT(deleteLater())); connect(f, &Folder::syncFinished, f, &QObject::deleteLater);
} else { } else {
delete f; delete f;
} }

View file

@ -67,10 +67,10 @@ void FolderStatusModel::setAccountState(const AccountState *accountState)
_folders.clear(); _folders.clear();
_accountState = accountState; _accountState = accountState;
connect(FolderMan::instance(), SIGNAL(folderSyncStateChange(Folder *)), connect(FolderMan::instance(), &FolderMan::folderSyncStateChange,
SLOT(slotFolderSyncStateChange(Folder *)), Qt::UniqueConnection); this, &FolderStatusModel::slotFolderSyncStateChange, Qt::UniqueConnection);
connect(FolderMan::instance(), SIGNAL(scheduleQueueChanged()), connect(FolderMan::instance(), &FolderMan::scheduleQueueChanged,
SLOT(slotFolderScheduleQueueChanged()), Qt::UniqueConnection); this, &FolderStatusModel::slotFolderScheduleQueueChanged, Qt::UniqueConnection);
auto folders = FolderMan::instance()->map(); auto folders = FolderMan::instance()->map();
foreach (auto f, folders) { foreach (auto f, folders) {
@ -85,8 +85,8 @@ void FolderStatusModel::setAccountState(const AccountState *accountState)
info._checked = Qt::PartiallyChecked; info._checked = Qt::PartiallyChecked;
_folders << info; _folders << info;
connect(f, SIGNAL(progressInfo(ProgressInfo)), this, SLOT(slotSetProgress(ProgressInfo)), Qt::UniqueConnection); connect(f, &Folder::progressInfo, this, &FolderStatusModel::slotSetProgress, Qt::UniqueConnection);
connect(f, SIGNAL(newBigFolderDiscovered(QString)), this, SLOT(slotNewBigFolder()), Qt::UniqueConnection); connect(f, &Folder::newBigFolderDiscovered, this, &FolderStatusModel::slotNewBigFolder, Qt::UniqueConnection);
} }
// Sort by header text // Sort by header text
@ -556,12 +556,12 @@ void FolderStatusModel::fetchMore(const QModelIndex &parent)
<< "http://owncloud.org/ns:size" << "http://owncloud.org/ns:size"
<< "http://owncloud.org/ns:permissions"); << "http://owncloud.org/ns:permissions");
job->setTimeout(60 * 1000); job->setTimeout(60 * 1000);
connect(job, SIGNAL(directoryListingSubfolders(QStringList)), connect(job, &LsColJob::directoryListingSubfolders,
SLOT(slotUpdateDirectories(QStringList))); this, &FolderStatusModel::slotUpdateDirectories);
connect(job, SIGNAL(finishedWithError(QNetworkReply *)), connect(job, &LsColJob::finishedWithError,
this, SLOT(slotLscolFinishedWithError(QNetworkReply *))); this, &FolderStatusModel::slotLscolFinishedWithError);
connect(job, SIGNAL(directoryListingIterated(const QString &, const QMap<QString, QString> &)), connect(job, &LsColJob::directoryListingIterated,
this, SLOT(slotGatherPermissions(const QString &, const QMap<QString, QString> &))); this, &FolderStatusModel::slotGatherPermissions);
job->start(); job->start();
@ -570,7 +570,7 @@ void FolderStatusModel::fetchMore(const QModelIndex &parent)
// Show 'fetching data...' hint after a while. // Show 'fetching data...' hint after a while.
_fetchingItems[persistentIndex].start(); _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) void FolderStatusModel::slotGatherPermissions(const QString &href, const QMap<QString, QString> &map)

View file

@ -34,7 +34,7 @@ FolderWatcherPrivate::FolderWatcherPrivate(FolderWatcher *p, const QString &path
_fd = inotify_init(); _fd = inotify_init();
if (_fd != -1) { if (_fd != -1) {
_socket.reset(new QSocketNotifier(_fd, QSocketNotifier::Read)); _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 { } else {
qCWarning(lcFolderWatcher) << "notify_init() failed: " << strerror(errno); qCWarning(lcFolderWatcher) << "notify_init() failed: " << strerror(errno);
} }

View file

@ -62,7 +62,7 @@ FolderWizardLocalPath::FolderWizardLocalPath(const AccountPtr &account)
{ {
_ui.setupUi(this); _ui.setupUi(this);
registerField(QLatin1String("sourceFolder*"), _ui.localFolderLineEdit); 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.")); _ui.localFolderChooseBtn->setToolTip(tr("Click to select a local folder to sync."));
QString defaultPath = QDir::homePath() + QLatin1Char('/') + Theme::instance()->appName(); QString defaultPath = QDir::homePath() + QLatin1Char('/') + Theme::instance()->appName();
@ -151,15 +151,15 @@ FolderWizardRemotePath::FolderWizardRemotePath(const AccountPtr &account)
_ui.folderTreeWidget->setSortingEnabled(true); _ui.folderTreeWidget->setSortingEnabled(true);
_ui.folderTreeWidget->sortByColumn(0, Qt::AscendingOrder); _ui.folderTreeWidget->sortByColumn(0, Qt::AscendingOrder);
connect(_ui.addFolderButton, SIGNAL(clicked()), SLOT(slotAddRemoteFolder())); connect(_ui.addFolderButton, &QAbstractButton::clicked, this, &FolderWizardRemotePath::slotAddRemoteFolder);
connect(_ui.refreshButton, SIGNAL(clicked()), SLOT(slotRefreshFolders())); connect(_ui.refreshButton, &QAbstractButton::clicked, this, &FolderWizardRemotePath::slotRefreshFolders);
connect(_ui.folderTreeWidget, SIGNAL(itemExpanded(QTreeWidgetItem *)), SLOT(slotItemExpanded(QTreeWidgetItem *))); connect(_ui.folderTreeWidget, &QTreeWidget::itemExpanded, this, &FolderWizardRemotePath::slotItemExpanded);
connect(_ui.folderTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), SLOT(slotCurrentItemChanged(QTreeWidgetItem *))); connect(_ui.folderTreeWidget, &QTreeWidget::currentItemChanged, this, &FolderWizardRemotePath::slotCurrentItemChanged);
connect(_ui.folderEntry, SIGNAL(textEdited(QString)), SLOT(slotFolderEntryEdited(QString))); connect(_ui.folderEntry, &QLineEdit::textEdited, this, &FolderWizardRemotePath::slotFolderEntryEdited);
_lscolTimer.setInterval(500); _lscolTimer.setInterval(500);
_lscolTimer.setSingleShot(true); _lscolTimer.setSingleShot(true);
connect(&_lscolTimer, SIGNAL(timeout()), SLOT(slotLsColFolderEntry())); connect(&_lscolTimer, &QTimer::timeout, this, &FolderWizardRemotePath::slotLsColFolderEntry);
_ui.folderTreeWidget->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); _ui.folderTreeWidget->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
// Make sure that there will be a scrollbar when the contents is too wide // 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 */ /* check the owncloud configuration file and query the ownCloud */
connect(job, SIGNAL(finished(QNetworkReply::NetworkError)), connect(job, SIGNAL(finished(QNetworkReply::NetworkError)),
SLOT(slotCreateRemoteFolderFinished(QNetworkReply::NetworkError))); SLOT(slotCreateRemoteFolderFinished(QNetworkReply::NetworkError)));
connect(job, SIGNAL(networkError(QNetworkReply *)), SLOT(slotHandleMkdirNetworkError(QNetworkReply *))); connect(job, &AbstractNetworkJob::networkError, this, &FolderWizardRemotePath::slotHandleMkdirNetworkError);
job->start(); job->start();
} }
@ -373,10 +373,10 @@ void FolderWizardRemotePath::slotLsColFolderEntry()
// No error handling, no updating, we do this manually // No error handling, no updating, we do this manually
// because of extra logic in the typed-path case. // because of extra logic in the typed-path case.
disconnect(job, 0, this, 0); disconnect(job, 0, this, 0);
connect(job, SIGNAL(finishedWithError(QNetworkReply *)), connect(job, &LsColJob::finishedWithError,
SLOT(slotTypedPathError(QNetworkReply *))); this, &FolderWizardRemotePath::slotTypedPathError);
connect(job, SIGNAL(directoryListingSubfolders(QStringList)), connect(job, &LsColJob::directoryListingSubfolders,
SLOT(slotTypedPathFound(QStringList))); this, &FolderWizardRemotePath::slotTypedPathFound);
} }
void FolderWizardRemotePath::slotTypedPathFound(const QStringList &subpaths) void FolderWizardRemotePath::slotTypedPathFound(const QStringList &subpaths)
@ -404,10 +404,10 @@ LsColJob *FolderWizardRemotePath::runLsColJob(const QString &path)
{ {
LsColJob *job = new LsColJob(_account, path, this); LsColJob *job = new LsColJob(_account, path, this);
job->setProperties(QList<QByteArray>() << "resourcetype"); job->setProperties(QList<QByteArray>() << "resourcetype");
connect(job, SIGNAL(directoryListingSubfolders(QStringList)), connect(job, &LsColJob::directoryListingSubfolders,
SLOT(slotUpdateDirectories(QStringList))); this, &FolderWizardRemotePath::slotUpdateDirectories);
connect(job, SIGNAL(finishedWithError(QNetworkReply *)), connect(job, &LsColJob::finishedWithError,
SLOT(slotHandleLsColNetworkError(QNetworkReply *))); this, &FolderWizardRemotePath::slotHandleLsColNetworkError);
job->start(); job->start();
return job; return job;

View file

@ -42,11 +42,11 @@ GeneralSettings::GeneralSettings(QWidget *parent)
{ {
_ui->setupUi(this); _ui->setupUi(this);
connect(_ui->desktopNotificationsCheckBox, SIGNAL(toggled(bool)), connect(_ui->desktopNotificationsCheckBox, &QAbstractButton::toggled,
SLOT(slotToggleOptionalDesktopNotifications(bool))); this, &GeneralSettings::slotToggleOptionalDesktopNotifications);
_ui->autostartCheckBox->setChecked(Utility::hasLaunchOnStartup(Theme::instance()->appName())); _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 // setup about section
QString about = Theme::instance()->about(); QString about = Theme::instance()->about();
@ -63,11 +63,11 @@ GeneralSettings::GeneralSettings(QWidget *parent)
slotUpdateInfo(); slotUpdateInfo();
// misc // misc
connect(_ui->monoIconsCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings())); connect(_ui->monoIconsCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
connect(_ui->crashreporterCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings())); connect(_ui->crashreporterCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
connect(_ui->newFolderLimitCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings())); connect(_ui->newFolderLimitCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
connect(_ui->newFolderLimitSpinBox, SIGNAL(valueChanged(int)), SLOT(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 #ifndef WITH_CRASHREPORTER
_ui->crashreporterCheckBox->setVisible(false); _ui->crashreporterCheckBox->setVisible(false);
@ -84,10 +84,10 @@ GeneralSettings::GeneralSettings(QWidget *parent)
// is no point in offering an option // is no point in offering an option
_ui->monoIconsCheckBox->setVisible(Theme::instance()->monoIconsAvailable()); _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. // 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() GeneralSettings::~GeneralSettings()
@ -124,8 +124,8 @@ void GeneralSettings::slotUpdateInfo()
} }
if (updater) { if (updater) {
connect(updater, SIGNAL(downloadStateChanged()), SLOT(slotUpdateInfo()), Qt::UniqueConnection); connect(updater, &OCUpdater::downloadStateChanged, this, &GeneralSettings::slotUpdateInfo, Qt::UniqueConnection);
connect(_ui->restartButton, SIGNAL(clicked()), updater, SLOT(slotStartInstaller()), Qt::UniqueConnection); connect(_ui->restartButton, &QAbstractButton::clicked, updater, &OCUpdater::slotStartInstaller, Qt::UniqueConnection);
connect(_ui->restartButton, SIGNAL(clicked()), qApp, SLOT(quit()), Qt::UniqueConnection); connect(_ui->restartButton, SIGNAL(clicked()), qApp, SLOT(quit()), Qt::UniqueConnection);
_ui->updateStateLabel->setText(updater->statusString()); _ui->updateStateLabel->setText(updater->statusString());
_ui->restartButton->setVisible(updater->downloadState() == OCUpdater::DownloadComplete); _ui->restartButton->setVisible(updater->downloadState() == OCUpdater::DownloadComplete);

View file

@ -54,11 +54,11 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent)
readIgnoreFile(cfgFile.excludeFile(ConfigFile::SystemScope), true); readIgnoreFile(cfgFile.excludeFile(ConfigFile::SystemScope), true);
readIgnoreFile(cfgFile.excludeFile(ConfigFile::UserScope), false); readIgnoreFile(cfgFile.excludeFile(ConfigFile::UserScope), false);
connect(this, SIGNAL(accepted()), SLOT(slotUpdateLocalIgnoreList())); connect(this, &QDialog::accepted, this, &IgnoreListEditor::slotUpdateLocalIgnoreList);
ui->removePushButton->setEnabled(false); ui->removePushButton->setEnabled(false);
connect(ui->tableWidget, SIGNAL(itemSelectionChanged()), SLOT(slotItemSelectionChanged())); connect(ui->tableWidget, &QTableWidget::itemSelectionChanged, this, &IgnoreListEditor::slotItemSelectionChanged);
connect(ui->removePushButton, SIGNAL(clicked()), SLOT(slotRemoveCurrentItem())); connect(ui->removePushButton, &QAbstractButton::clicked, this, &IgnoreListEditor::slotRemoveCurrentItem);
connect(ui->addPushButton, SIGNAL(clicked()), SLOT(slotAddPattern())); connect(ui->addPushButton, &QAbstractButton::clicked, this, &IgnoreListEditor::slotAddPattern);
ui->tableWidget->resizeColumnsToContents(); ui->tableWidget->resizeColumnsToContents();
ui->tableWidget->horizontalHeader()->setResizeMode(patternCol, QHeaderView::Stretch); ui->tableWidget->horizontalHeader()->setResizeMode(patternCol, QHeaderView::Stretch);

View file

@ -44,30 +44,30 @@ IssuesWidget::IssuesWidget(QWidget *parent)
{ {
_ui->setupUi(this); _ui->setupUi(this);
connect(ProgressDispatcher::instance(), SIGNAL(progressInfo(QString, ProgressInfo)), connect(ProgressDispatcher::instance(), &ProgressDispatcher::progressInfo,
this, SLOT(slotProgressInfo(QString, ProgressInfo))); this, &IssuesWidget::slotProgressInfo);
connect(ProgressDispatcher::instance(), SIGNAL(itemCompleted(QString, SyncFileItemPtr)), connect(ProgressDispatcher::instance(), &ProgressDispatcher::itemCompleted,
this, SLOT(slotItemCompleted(QString, SyncFileItemPtr))); this, &IssuesWidget::slotItemCompleted);
connect(ProgressDispatcher::instance(), &ProgressDispatcher::syncError, connect(ProgressDispatcher::instance(), &ProgressDispatcher::syncError,
this, &IssuesWidget::addError); this, &IssuesWidget::addError);
connect(_ui->_treeWidget, SIGNAL(itemActivated(QTreeWidgetItem *, int)), SLOT(slotOpenFile(QTreeWidgetItem *, int))); connect(_ui->_treeWidget, &QTreeWidget::itemActivated, this, &IssuesWidget::slotOpenFile);
connect(_ui->copyIssuesButton, SIGNAL(clicked()), SIGNAL(copyToClipboard())); connect(_ui->copyIssuesButton, &QAbstractButton::clicked, this, &IssuesWidget::copyToClipboard);
connect(_ui->showIgnores, SIGNAL(toggled(bool)), SLOT(slotRefreshIssues())); connect(_ui->showIgnores, &QAbstractButton::toggled, this, &IssuesWidget::slotRefreshIssues);
connect(_ui->showWarnings, SIGNAL(toggled(bool)), SLOT(slotRefreshIssues())); connect(_ui->showWarnings, &QAbstractButton::toggled, this, &IssuesWidget::slotRefreshIssues);
connect(_ui->filterAccount, SIGNAL(currentIndexChanged(int)), SLOT(slotRefreshIssues())); connect(_ui->filterAccount, SIGNAL(currentIndexChanged(int)), SLOT(slotRefreshIssues()));
connect(_ui->filterAccount, SIGNAL(currentIndexChanged(int)), SLOT(slotUpdateFolderFilters())); connect(_ui->filterAccount, SIGNAL(currentIndexChanged(int)), SLOT(slotUpdateFolderFilters()));
connect(_ui->filterFolder, SIGNAL(currentIndexChanged(int)), SLOT(slotRefreshIssues())); connect(_ui->filterFolder, SIGNAL(currentIndexChanged(int)), SLOT(slotRefreshIssues()));
for (auto account : AccountManager::instance()->accounts()) { for (auto account : AccountManager::instance()->accounts()) {
slotAccountAdded(account.data()); slotAccountAdded(account.data());
} }
connect(AccountManager::instance(), SIGNAL(accountAdded(AccountState *)), connect(AccountManager::instance(), &AccountManager::accountAdded,
SLOT(slotAccountAdded(AccountState *))); this, &IssuesWidget::slotAccountAdded);
connect(AccountManager::instance(), SIGNAL(accountRemoved(AccountState *)), connect(AccountManager::instance(), &AccountManager::accountRemoved,
SLOT(slotAccountRemoved(AccountState *))); this, &IssuesWidget::slotAccountRemoved);
connect(FolderMan::instance(), SIGNAL(folderListChanged(Folder::Map)), connect(FolderMan::instance(), &FolderMan::folderListChanged,
SLOT(slotUpdateFolderFilters())); this, &IssuesWidget::slotUpdateFolderFilters);
// Adjust copyToClipboard() when making changes here! // Adjust copyToClipboard() when making changes here!

View file

@ -27,8 +27,8 @@ static const int check_frequency = 20 * 1000; // ms
LockWatcher::LockWatcher(QObject *parent) LockWatcher::LockWatcher(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
connect(&_timer, SIGNAL(timeout()), connect(&_timer, &QTimer::timeout,
SLOT(checkFiles())); this, &LockWatcher::checkFiles);
_timer.start(check_frequency); _timer.start(check_frequency);
} }

View file

@ -76,7 +76,7 @@ LogBrowser::LogBrowser(QWidget *parent)
// find button // find button
QPushButton *findBtn = new QPushButton; QPushButton *findBtn = new QPushButton;
findBtn->setText(tr("&Find")); findBtn->setText(tr("&Find"));
connect(findBtn, SIGNAL(clicked()), this, SLOT(slotFind())); connect(findBtn, &QAbstractButton::clicked, this, &LogBrowser::slotFind);
toolLayout->addWidget(findBtn); toolLayout->addWidget(findBtn);
// stretch // stretch
@ -87,12 +87,12 @@ LogBrowser::LogBrowser(QWidget *parent)
// Debug logging // Debug logging
_logDebugCheckBox = new QCheckBox(tr("&Capture debug messages") + " "); _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); toolLayout->addWidget(_logDebugCheckBox);
QDialogButtonBox *btnbox = new QDialogButtonBox; QDialogButtonBox *btnbox = new QDialogButtonBox;
QPushButton *closeBtn = btnbox->addButton(QDialogButtonBox::Close); QPushButton *closeBtn = btnbox->addButton(QDialogButtonBox::Close);
connect(closeBtn, SIGNAL(clicked()), this, SLOT(close())); connect(closeBtn, &QAbstractButton::clicked, this, &QWidget::close);
mainLayout->addWidget(btnbox); mainLayout->addWidget(btnbox);
@ -101,14 +101,14 @@ LogBrowser::LogBrowser(QWidget *parent)
_clearBtn->setText(tr("Clear")); _clearBtn->setText(tr("Clear"));
_clearBtn->setToolTip(tr("Clear the log display.")); _clearBtn->setToolTip(tr("Clear the log display."));
btnbox->addButton(_clearBtn, QDialogButtonBox::ActionRole); btnbox->addButton(_clearBtn, QDialogButtonBox::ActionRole);
connect(_clearBtn, SIGNAL(clicked()), this, SLOT(slotClearLog())); connect(_clearBtn, &QAbstractButton::clicked, this, &LogBrowser::slotClearLog);
// save Button // save Button
_saveBtn = new QPushButton; _saveBtn = new QPushButton;
_saveBtn->setText(tr("S&ave")); _saveBtn->setText(tr("S&ave"));
_saveBtn->setToolTip(tr("Save the log file to a file on disk for debugging.")); _saveBtn->setToolTip(tr("Save the log file to a file on disk for debugging."));
btnbox->addButton(_saveBtn, QDialogButtonBox::ActionRole); btnbox->addButton(_saveBtn, QDialogButtonBox::ActionRole);
connect(_saveBtn, SIGNAL(clicked()), this, SLOT(slotSave())); connect(_saveBtn, &QAbstractButton::clicked, this, &LogBrowser::slotSave);
setLayout(mainLayout); setLayout(mainLayout);
@ -116,11 +116,11 @@ LogBrowser::LogBrowser(QWidget *parent)
Logger::instance()->setLogWindowActivated(true); Logger::instance()->setLogWindowActivated(true);
// Direct connection for log coming from this thread, and queued for the one in a different thread // 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); QAction *showLogWindow = new QAction(this);
showLogWindow->setShortcut(QKeySequence("F12")); showLogWindow->setShortcut(QKeySequence("F12"));
connect(showLogWindow, SIGNAL(triggered()), SLOT(close())); connect(showLogWindow, &QAction::triggered, this, &QWidget::close);
addAction(showLogWindow); addAction(showLogWindow);
ConfigFile cfg; ConfigFile cfg;

View file

@ -45,13 +45,13 @@ NetworkSettings::NetworkSettings(QWidget *parent)
_ui->userLineEdit->setEnabled(true); _ui->userLineEdit->setEnabled(true);
_ui->passwordLineEdit->setEnabled(true); _ui->passwordLineEdit->setEnabled(true);
_ui->authWidgets->setEnabled(_ui->authRequiredcheckBox->isChecked()); _ui->authWidgets->setEnabled(_ui->authRequiredcheckBox->isChecked());
connect(_ui->authRequiredcheckBox, SIGNAL(toggled(bool)), connect(_ui->authRequiredcheckBox, &QAbstractButton::toggled,
_ui->authWidgets, SLOT(setEnabled(bool))); _ui->authWidgets, &QWidget::setEnabled);
connect(_ui->manualProxyRadioButton, SIGNAL(toggled(bool)), connect(_ui->manualProxyRadioButton, &QAbstractButton::toggled,
_ui->manualSettings, SLOT(setEnabled(bool))); _ui->manualSettings, &QWidget::setEnabled);
connect(_ui->manualProxyRadioButton, SIGNAL(toggled(bool)), connect(_ui->manualProxyRadioButton, &QAbstractButton::toggled,
_ui->typeComboBox, SLOT(setEnabled(bool))); _ui->typeComboBox, &QWidget::setEnabled);
loadProxySettings(); loadProxySettings();
loadBWLimitSettings(); loadBWLimitSettings();
@ -59,18 +59,18 @@ NetworkSettings::NetworkSettings(QWidget *parent)
// proxy // proxy
connect(_ui->typeComboBox, SIGNAL(currentIndexChanged(int)), SLOT(saveProxySettings())); connect(_ui->typeComboBox, SIGNAL(currentIndexChanged(int)), SLOT(saveProxySettings()));
connect(_ui->proxyButtonGroup, SIGNAL(buttonClicked(int)), SLOT(saveProxySettings())); connect(_ui->proxyButtonGroup, SIGNAL(buttonClicked(int)), SLOT(saveProxySettings()));
connect(_ui->hostLineEdit, SIGNAL(editingFinished()), SLOT(saveProxySettings())); connect(_ui->hostLineEdit, &QLineEdit::editingFinished, this, &NetworkSettings::saveProxySettings);
connect(_ui->userLineEdit, SIGNAL(editingFinished()), SLOT(saveProxySettings())); connect(_ui->userLineEdit, &QLineEdit::editingFinished, this, &NetworkSettings::saveProxySettings);
connect(_ui->passwordLineEdit, SIGNAL(editingFinished()), SLOT(saveProxySettings())); connect(_ui->passwordLineEdit, &QLineEdit::editingFinished, this, &NetworkSettings::saveProxySettings);
connect(_ui->portSpinBox, SIGNAL(editingFinished()), SLOT(saveProxySettings())); connect(_ui->portSpinBox, &QAbstractSpinBox::editingFinished, this, &NetworkSettings::saveProxySettings);
connect(_ui->authRequiredcheckBox, SIGNAL(toggled(bool)), SLOT(saveProxySettings())); connect(_ui->authRequiredcheckBox, &QAbstractButton::toggled, this, &NetworkSettings::saveProxySettings);
connect(_ui->uploadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings())); connect(_ui->uploadLimitRadioButton, &QAbstractButton::clicked, this, &NetworkSettings::saveBWLimitSettings);
connect(_ui->noUploadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings())); connect(_ui->noUploadLimitRadioButton, &QAbstractButton::clicked, this, &NetworkSettings::saveBWLimitSettings);
connect(_ui->autoUploadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings())); connect(_ui->autoUploadLimitRadioButton, &QAbstractButton::clicked, this, &NetworkSettings::saveBWLimitSettings);
connect(_ui->downloadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings())); connect(_ui->downloadLimitRadioButton, &QAbstractButton::clicked, this, &NetworkSettings::saveBWLimitSettings);
connect(_ui->noDownloadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings())); connect(_ui->noDownloadLimitRadioButton, &QAbstractButton::clicked, this, &NetworkSettings::saveBWLimitSettings);
connect(_ui->autoDownloadLimitRadioButton, SIGNAL(clicked()), SLOT(saveBWLimitSettings())); connect(_ui->autoDownloadLimitRadioButton, &QAbstractButton::clicked, this, &NetworkSettings::saveBWLimitSettings);
connect(_ui->downloadSpinBox, SIGNAL(valueChanged(int)), SLOT(saveBWLimitSettings())); connect(_ui->downloadSpinBox, SIGNAL(valueChanged(int)), SLOT(saveBWLimitSettings()));
connect(_ui->uploadSpinBox, SIGNAL(valueChanged(int)), SLOT(saveBWLimitSettings())); connect(_ui->uploadSpinBox, SIGNAL(valueChanged(int)), SLOT(saveBWLimitSettings()));
} }

View file

@ -66,13 +66,13 @@ void NotificationWidget::setActivity(const Activity &activity)
// in case there is no action defined, do a close button. // in case there is no action defined, do a close button.
QPushButton *b = _ui._buttonBox->addButton(QDialogButtonBox::Close); QPushButton *b = _ui._buttonBox->addButton(QDialogButtonBox::Close);
b->setDefault(true); b->setDefault(true);
connect(b, SIGNAL(clicked()), this, SLOT(slotButtonClicked())); connect(b, &QAbstractButton::clicked, this, &NotificationWidget::slotButtonClicked);
_buttons.append(b); _buttons.append(b);
} else { } else {
foreach (auto link, activity._links) { foreach (auto link, activity._links) {
QPushButton *b = _ui._buttonBox->addButton(link._label, QDialogButtonBox::AcceptRole); QPushButton *b = _ui._buttonBox->addButton(link._label, QDialogButtonBox::AcceptRole);
b->setDefault(link._isPrimary); b->setDefault(link._isPrimary);
connect(b, SIGNAL(clicked()), this, SLOT(slotButtonClicked())); connect(b, &QAbstractButton::clicked, this, &NotificationWidget::slotButtonClicked);
_buttons.append(b); _buttons.append(b);
} }
} }

View file

@ -20,7 +20,7 @@ OcsShareeJob::OcsShareeJob(AccountPtr account)
: OcsJob(account) : OcsJob(account)
{ {
setPath("ocs/v1.php/apps/files_sharing/api/v1/sharees"); 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, void OcsShareeJob::getSharees(const QString &search,

View file

@ -25,7 +25,7 @@ OcsShareJob::OcsShareJob(AccountPtr account)
: OcsJob(account) : OcsJob(account)
{ {
setPath("ocs/v1.php/apps/files_sharing/api/v1/shares"); 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) void OcsShareJob::getShares(const QString &path)

View file

@ -70,8 +70,8 @@ ownCloudGui::ownCloudGui(Application *parent)
// for the beginning, set the offline icon until the account was verified // for the beginning, set the offline icon until the account was verified
_tray->setIcon(Theme::instance()->folderOfflineIcon(/*systray?*/ true, /*currently visible?*/ false)); _tray->setIcon(Theme::instance()->folderOfflineIcon(/*systray?*/ true, /*currently visible?*/ false));
connect(_tray.data(), SIGNAL(activated(QSystemTrayIcon::ActivationReason)), connect(_tray.data(), &QSystemTrayIcon::activated,
SLOT(slotTrayClicked(QSystemTrayIcon::ActivationReason))); this, &ownCloudGui::slotTrayClicked);
setupActions(); setupActions();
setupContextMenu(); setupContextMenu();
@ -79,24 +79,24 @@ ownCloudGui::ownCloudGui(Application *parent)
_tray->show(); _tray->show();
ProgressDispatcher *pd = ProgressDispatcher::instance(); ProgressDispatcher *pd = ProgressDispatcher::instance();
connect(pd, SIGNAL(progressInfo(QString, ProgressInfo)), this, connect(pd, &ProgressDispatcher::progressInfo, this,
SLOT(slotUpdateProgress(QString, ProgressInfo))); &ownCloudGui::slotUpdateProgress);
FolderMan *folderMan = FolderMan::instance(); FolderMan *folderMan = FolderMan::instance();
connect(folderMan, SIGNAL(folderSyncStateChange(Folder *)), connect(folderMan, &FolderMan::folderSyncStateChange,
this, SLOT(slotSyncStateChange(Folder *))); this, &ownCloudGui::slotSyncStateChange);
connect(AccountManager::instance(), SIGNAL(accountAdded(AccountState *)), connect(AccountManager::instance(), &AccountManager::accountAdded,
SLOT(updateContextMenuNeeded())); this, &ownCloudGui::updateContextMenuNeeded);
connect(AccountManager::instance(), SIGNAL(accountRemoved(AccountState *)), connect(AccountManager::instance(), &AccountManager::accountRemoved,
SLOT(updateContextMenuNeeded())); this, &ownCloudGui::updateContextMenuNeeded);
connect(Logger::instance(), SIGNAL(guiLog(QString, QString)), connect(Logger::instance(), &Logger::guiLog,
SLOT(slotShowTrayMessage(QString, QString))); this, &ownCloudGui::slotShowTrayMessage);
connect(Logger::instance(), SIGNAL(optionalGuiLog(QString, QString)), connect(Logger::instance(), &Logger::optionalGuiLog,
SLOT(slotShowOptionalTrayMessage(QString, QString))); this, &ownCloudGui::slotShowOptionalTrayMessage);
connect(Logger::instance(), SIGNAL(guiMessage(QString, QString)), connect(Logger::instance(), &Logger::guiMessage,
SLOT(slotShowGuiMessage(QString, QString))); this, &ownCloudGui::slotShowGuiMessage);
} }
// This should rather be in application.... or rather in ConfigFile? // 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); auto actionOpenoC = menu->addAction(browserOpen);
actionOpenoC->setProperty(propertyAccountC, QVariant::fromValue(accountState->account())); 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(); FolderMan *folderMan = FolderMan::instance();
bool firstFolder = true; bool firstFolder = true;
@ -336,22 +336,22 @@ void ownCloudGui::addAccountContextMenu(AccountStatePtr accountState, QMenu *men
if (onePaused) { if (onePaused) {
QAction *enable = menu->addAction(tr("Unpause all folders")); QAction *enable = menu->addAction(tr("Unpause all folders"));
enable->setProperty(propertyAccountC, QVariant::fromValue(accountState)); enable->setProperty(propertyAccountC, QVariant::fromValue(accountState));
connect(enable, SIGNAL(triggered(bool)), SLOT(slotUnpauseAllFolders())); connect(enable, &QAction::triggered, this, &ownCloudGui::slotUnpauseAllFolders);
} }
if (!allPaused) { if (!allPaused) {
QAction *enable = menu->addAction(tr("Pause all folders")); QAction *enable = menu->addAction(tr("Pause all folders"));
enable->setProperty(propertyAccountC, QVariant::fromValue(accountState)); enable->setProperty(propertyAccountC, QVariant::fromValue(accountState));
connect(enable, SIGNAL(triggered(bool)), SLOT(slotPauseAllFolders())); connect(enable, &QAction::triggered, this, &ownCloudGui::slotPauseAllFolders);
} }
if (accountState->isSignedOut()) { if (accountState->isSignedOut()) {
QAction *signin = menu->addAction(tr("Log in...")); QAction *signin = menu->addAction(tr("Log in..."));
signin->setProperty(propertyAccountC, QVariant::fromValue(accountState)); signin->setProperty(propertyAccountC, QVariant::fromValue(accountState));
connect(signin, SIGNAL(triggered()), this, SLOT(slotLogin())); connect(signin, &QAction::triggered, this, &ownCloudGui::slotLogin);
} else { } else {
QAction *signout = menu->addAction(tr("Log out")); QAction *signout = menu->addAction(tr("Log out"));
signout->setProperty(propertyAccountC, QVariant::fromValue(accountState)); 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 // When the qdbusmenuWorkaround is necessary, we can't do on-demand updates
// because the workaround is to hide and show the tray icon. // because the workaround is to hide and show the tray icon.
if (_qdbusmenuWorkaround) { if (_qdbusmenuWorkaround) {
connect(&_workaroundBatchTrayUpdate, SIGNAL(timeout()), SLOT(updateContextMenu())); connect(&_workaroundBatchTrayUpdate, &QTimer::timeout, this, &ownCloudGui::updateContextMenu);
_workaroundBatchTrayUpdate.setInterval(30 * 1000); _workaroundBatchTrayUpdate.setInterval(30 * 1000);
_workaroundBatchTrayUpdate.setSingleShot(true); _workaroundBatchTrayUpdate.setSingleShot(true);
} else { } else {
@ -473,7 +473,7 @@ void ownCloudGui::setupContextMenu()
connect(_contextMenu.data(), SIGNAL(aboutToShow()), SLOT(slotContextMenuAboutToShow())); connect(_contextMenu.data(), SIGNAL(aboutToShow()), SLOT(slotContextMenuAboutToShow()));
connect(_contextMenu.data(), SIGNAL(aboutToHide()), SLOT(slotContextMenuAboutToHide())); connect(_contextMenu.data(), SIGNAL(aboutToHide()), SLOT(slotContextMenuAboutToHide()));
#else #else
connect(_contextMenu.data(), SIGNAL(aboutToShow()), SLOT(updateContextMenu())); connect(_contextMenu.data(), &QMenu::aboutToShow, this, &ownCloudGui::updateContextMenu);
#endif #endif
} }
@ -576,7 +576,7 @@ void ownCloudGui::updateContextMenu()
text = tr("Unpause synchronization"); text = tr("Unpause synchronization");
} }
QAction *action = _contextMenu->addAction(text); QAction *action = _contextMenu->addAction(text);
connect(action, SIGNAL(triggered(bool)), SLOT(slotUnpauseAllFolders())); connect(action, &QAction::triggered, this, &ownCloudGui::slotUnpauseAllFolders);
} }
if (atLeastOneNotPaused) { if (atLeastOneNotPaused) {
QString text; QString text;
@ -586,7 +586,7 @@ void ownCloudGui::updateContextMenu()
text = tr("Pause synchronization"); text = tr("Pause synchronization");
} }
QAction *action = _contextMenu->addAction(text); QAction *action = _contextMenu->addAction(text);
connect(action, SIGNAL(triggered(bool)), SLOT(slotPauseAllFolders())); connect(action, &QAction::triggered, this, &ownCloudGui::slotPauseAllFolders);
} }
if (atLeastOneSignedIn) { if (atLeastOneSignedIn) {
if (accountList.count() > 1) { if (accountList.count() > 1) {
@ -686,18 +686,18 @@ void ownCloudGui::setupActions()
_actionRecent = new QAction(tr("Details..."), this); _actionRecent = new QAction(tr("Details..."), this);
_actionRecent->setEnabled(true); _actionRecent->setEnabled(true);
QObject::connect(_actionRecent, SIGNAL(triggered(bool)), SLOT(slotShowSyncProtocol())); QObject::connect(_actionRecent, &QAction::triggered, this, &ownCloudGui::slotShowSyncProtocol);
QObject::connect(_actionSettings, SIGNAL(triggered(bool)), SLOT(slotShowSettings())); QObject::connect(_actionSettings, &QAction::triggered, this, &ownCloudGui::slotShowSettings);
QObject::connect(_actionNewAccountWizard, SIGNAL(triggered(bool)), SLOT(slotNewAccountWizard())); QObject::connect(_actionNewAccountWizard, &QAction::triggered, this, &ownCloudGui::slotNewAccountWizard);
_actionHelp = new QAction(tr("Help"), this); _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); _actionQuit = new QAction(tr("Quit %1").arg(Theme::instance()->appNameGUI()), this);
QObject::connect(_actionQuit, SIGNAL(triggered(bool)), _app, SLOT(quit())); QObject::connect(_actionQuit, SIGNAL(triggered(bool)), _app, SLOT(quit()));
_actionLogin = new QAction(tr("Log in..."), this); _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); _actionLogout = new QAction(tr("Log out"), this);
connect(_actionLogout, SIGNAL(triggered()), this, SLOT(slotLogout())); connect(_actionLogout, &QAction::triggered, this, &ownCloudGui::slotLogout);
if (_app->debugMode()) { if (_app->debugMode()) {
_actionCrash = new QAction(tr("Crash now", "Only shows in debug mode to allow testing the crash handler"), this); _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)); .arg(progress._currentDiscoveredFolder));
} }
} else if (progress.status() == ProgressInfo::Done) { } else if (progress.status() == ProgressInfo::Done) {
QTimer::singleShot(2000, this, SLOT(slotDisplayIdle())); QTimer::singleShot(2000, this, &ownCloudGui::slotDisplayIdle);
} }
if (progress.status() != ProgressInfo::Propagation) { if (progress.status() != ProgressInfo::Propagation) {
return; return;
@ -1036,7 +1036,7 @@ void ownCloudGui::slotShowShareDialog(const QString &sharePath, const QString &l
w->setAttribute(Qt::WA_DeleteOnClose, true); w->setAttribute(Qt::WA_DeleteOnClose, true);
_shareDialogs[localPath] = w; _shareDialogs[localPath] = w;
connect(w, SIGNAL(destroyed(QObject *)), SLOT(slotRemoveDestroyedShareDialogs())); connect(w, &QObject::destroyed, this, &ownCloudGui::slotRemoveDestroyedShareDialogs);
} }
raiseDialog(w); raiseDialog(w);
} }

View file

@ -44,19 +44,19 @@ OwncloudSetupWizard::OwncloudSetupWizard(QObject *parent)
, _ocWizard(new OwncloudWizard) , _ocWizard(new OwncloudWizard)
, _remoteFolder() , _remoteFolder()
{ {
connect(_ocWizard, SIGNAL(determineAuthType(const QString &)), connect(_ocWizard, &OwncloudWizard::determineAuthType,
this, SLOT(slotDetermineAuthType(const QString &))); this, &OwncloudSetupWizard::slotDetermineAuthType);
connect(_ocWizard, SIGNAL(connectToOCUrl(const QString &)), connect(_ocWizard, &OwncloudWizard::connectToOCUrl,
this, SLOT(slotConnectToOCUrl(const QString &))); this, &OwncloudSetupWizard::slotConnectToOCUrl);
connect(_ocWizard, SIGNAL(createLocalAndRemoteFolders(QString, QString)), connect(_ocWizard, &OwncloudWizard::createLocalAndRemoteFolders,
this, SLOT(slotCreateLocalAndRemoteFolders(QString, QString))); this, &OwncloudSetupWizard::slotCreateLocalAndRemoteFolders);
/* basicSetupFinished might be called from a reply from the network. /* basicSetupFinished might be called from a reply from the network.
slotAssistantFinished might destroy the temporary QNetworkAccessManager. slotAssistantFinished might destroy the temporary QNetworkAccessManager.
Therefore Qt::QueuedConnection is required */ Therefore Qt::QueuedConnection is required */
connect(_ocWizard, SIGNAL(basicSetupFinished(int)), connect(_ocWizard, &OwncloudWizard::basicSetupFinished,
this, SLOT(slotAssistantFinished(int)), Qt::QueuedConnection); this, &OwncloudSetupWizard::slotAssistantFinished, Qt::QueuedConnection);
connect(_ocWizard, SIGNAL(finished(int)), SLOT(deleteLater())); connect(_ocWizard, &QDialog::finished, this, &QObject::deleteLater);
connect(_ocWizard, SIGNAL(skipFolderConfiguration()), SLOT(slotSkipFolderConfiguration())); connect(_ocWizard, &OwncloudWizard::skipFolderConfiguration, this, &OwncloudSetupWizard::slotSkipFolderConfiguration);
} }
OwncloudSetupWizard::~OwncloudSetupWizard() OwncloudSetupWizard::~OwncloudSetupWizard()
@ -202,9 +202,9 @@ void OwncloudSetupWizard::slotContinueDetermineAuth()
[this, account]() { [this, account]() {
CheckServerJob *job = new CheckServerJob(account, this); CheckServerJob *job = new CheckServerJob(account, this);
job->setIgnoreCredentialFailure(true); job->setIgnoreCredentialFailure(true);
connect(job, SIGNAL(instanceFound(QUrl, QJsonObject)), SLOT(slotOwnCloudFoundAuth(QUrl, QJsonObject))); connect(job, &CheckServerJob::instanceFound, this, &OwncloudSetupWizard::slotOwnCloudFoundAuth);
connect(job, SIGNAL(instanceNotFound(QNetworkReply *)), SLOT(slotNoOwnCloudFoundAuth(QNetworkReply *))); connect(job, &CheckServerJob::instanceNotFound, this, &OwncloudSetupWizard::slotNoOwnCloudFoundAuth);
connect(job, SIGNAL(timeout(const QUrl &)), SLOT(slotNoOwnCloudFoundAuthTimeout(const QUrl &))); connect(job, &CheckServerJob::timeout, this, &OwncloudSetupWizard::slotNoOwnCloudFoundAuthTimeout);
job->setTimeout((account->url().scheme() == "https") ? 30 * 1000 : 10 * 1000); job->setTimeout((account->url().scheme() == "https") ? 30 * 1000 : 10 * 1000);
job->start(); job->start();
}); });
@ -310,8 +310,8 @@ void OwncloudSetupWizard::testOwnCloudConnect()
// so don't automatically follow redirects. // so don't automatically follow redirects.
job->setFollowRedirects(false); job->setFollowRedirects(false);
job->setProperties(QList<QByteArray>() << "getlastmodified"); job->setProperties(QList<QByteArray>() << "getlastmodified");
connect(job, SIGNAL(result(QVariantMap)), _ocWizard, SLOT(successfulStep())); connect(job, &PropfindJob::result, _ocWizard, &OwncloudWizard::successfulStep);
connect(job, SIGNAL(finishedWithError()), this, SLOT(slotAuthError())); connect(job, &PropfindJob::finishedWithError, this, &OwncloudSetupWizard::slotAuthError);
job->start(); job->start();
} }
@ -429,7 +429,7 @@ void OwncloudSetupWizard::slotCreateLocalAndRemoteFolders(const QString &localFo
} }
if (nextStep) { if (nextStep) {
EntityExistsJob *job = new EntityExistsJob(_ocWizard->account(), _ocWizard->account()->davPath() + remoteFolder, this); 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(); job->start();
} else { } else {
finalizeSetup(false); finalizeSetup(false);
@ -602,8 +602,8 @@ void OwncloudSetupWizard::slotSkipFolderConfiguration()
{ {
applyAccountChanges(); applyAccountChanges();
disconnect(_ocWizard, SIGNAL(basicSetupFinished(int)), disconnect(_ocWizard, &OwncloudWizard::basicSetupFinished,
this, SLOT(slotAssistantFinished(int))); this, &OwncloudSetupWizard::slotAssistantFinished);
_ocWizard->close(); _ocWizard->close();
emit ownCloudWizardDone(QDialog::Accepted); emit ownCloudWizardDone(QDialog::Accepted);
} }

View file

@ -38,10 +38,10 @@ ProtocolWidget::ProtocolWidget(QWidget *parent)
{ {
_ui->setupUi(this); _ui->setupUi(this);
connect(ProgressDispatcher::instance(), SIGNAL(itemCompleted(QString, SyncFileItemPtr)), connect(ProgressDispatcher::instance(), &ProgressDispatcher::itemCompleted,
this, SLOT(slotItemCompleted(QString, SyncFileItemPtr))); 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! // Adjust copyToClipboard() when making changes here!
QStringList header; QStringList header;
@ -74,7 +74,7 @@ ProtocolWidget::ProtocolWidget(QWidget *parent)
QPushButton *copyBtn = _ui->_dialogButtonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole); QPushButton *copyBtn = _ui->_dialogButtonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
copyBtn->setToolTip(tr("Copy the activity list to the clipboard.")); copyBtn->setToolTip(tr("Copy the activity list to the clipboard."));
copyBtn->setEnabled(true); copyBtn->setEnabled(true);
connect(copyBtn, SIGNAL(clicked()), SIGNAL(copyToClipboard())); connect(copyBtn, &QAbstractButton::clicked, this, &ProtocolWidget::copyToClipboard);
} }
ProtocolWidget::~ProtocolWidget() ProtocolWidget::~ProtocolWidget()

View file

@ -131,8 +131,8 @@ void ProxyAuthHandler::handleProxyAuthenticationRequired(
sending_qnam = qnam_alive.data(); sending_qnam = qnam_alive.data();
if (sending_qnam) { if (sending_qnam) {
_gaveCredentialsTo.insert(sending_qnam); _gaveCredentialsTo.insert(sending_qnam);
connect(sending_qnam, SIGNAL(destroyed(QObject *)), connect(sending_qnam, &QObject::destroyed,
SLOT(slotSenderDestroyed(QObject *))); this, &ProxyAuthHandler::slotSenderDestroyed);
} }
} }
@ -194,8 +194,8 @@ bool ProxyAuthHandler::getCredsFromKeychain()
_readPasswordJob->setInsecureFallback(false); _readPasswordJob->setInsecureFallback(false);
_readPasswordJob->setKey(keychainPasswordKey()); _readPasswordJob->setKey(keychainPasswordKey());
_readPasswordJob->setAutoDelete(false); _readPasswordJob->setAutoDelete(false);
connect(_readPasswordJob.data(), SIGNAL(finished(QKeychain::Job *)), connect(_readPasswordJob.data(), &QKeychain::Job::finished,
SLOT(slotKeychainJobDone())); this, &ProxyAuthHandler::slotKeychainJobDone);
_keychainJobRunning = true; _keychainJobRunning = true;
_readPasswordJob->start(); _readPasswordJob->start();
} }
@ -242,7 +242,7 @@ void ProxyAuthHandler::storeCredsInKeychain()
job->setKey(keychainPasswordKey()); job->setKey(keychainPasswordKey());
job->setTextData(_password); job->setTextData(_password);
job->setAutoDelete(false); job->setAutoDelete(false);
connect(job, SIGNAL(finished(QKeychain::Job *)), SLOT(slotKeychainJobDone())); connect(job, &QKeychain::Job::finished, this, &ProxyAuthHandler::slotKeychainJobDone);
_keychainJobRunning = true; _keychainJobRunning = true;
job->start(); job->start();

View file

@ -36,9 +36,9 @@ QuotaInfo::QuotaInfo(AccountState *accountState, QObject *parent)
, _lastQuotaUsedBytes(0) , _lastQuotaUsedBytes(0)
, _active(false) , _active(false)
{ {
connect(accountState, SIGNAL(stateChanged(int)), connect(accountState, &AccountState::stateChanged,
SLOT(slotAccountStateChanged())); this, &QuotaInfo::slotAccountStateChanged);
connect(&_jobRestartTimer, SIGNAL(timeout()), SLOT(slotCheckQuota())); connect(&_jobRestartTimer, &QTimer::timeout, this, &QuotaInfo::slotCheckQuota);
_jobRestartTimer.setSingleShot(true); _jobRestartTimer.setSingleShot(true);
} }
@ -101,8 +101,8 @@ void QuotaInfo::slotCheckQuota()
_job = new PropfindJob(account, quotaBaseFolder(), this); _job = new PropfindJob(account, quotaBaseFolder(), this);
_job->setProperties(QList<QByteArray>() << "quota-available-bytes" _job->setProperties(QList<QByteArray>() << "quota-available-bytes"
<< "quota-used-bytes"); << "quota-used-bytes");
connect(_job, SIGNAL(result(QVariantMap)), SLOT(slotUpdateLastQuota(QVariantMap))); connect(_job.data(), &PropfindJob::result, this, &QuotaInfo::slotUpdateLastQuota);
connect(_job, SIGNAL(networkError(QNetworkReply *)), SLOT(slotRequestFailed())); connect(_job.data(), &AbstractNetworkJob::networkError, this, &QuotaInfo::slotRequestFailed);
_job->start(); _job->start();
} }

View file

@ -83,10 +83,10 @@ SelectiveSyncWidget::SelectiveSyncWidget(AccountPtr account, QWidget *parent)
layout->addWidget(_folderTree); layout->addWidget(_folderTree);
connect(_folderTree, SIGNAL(itemExpanded(QTreeWidgetItem *)), connect(_folderTree, &QTreeWidget::itemExpanded,
SLOT(slotItemExpanded(QTreeWidgetItem *))); this, &SelectiveSyncWidget::slotItemExpanded);
connect(_folderTree, SIGNAL(itemChanged(QTreeWidgetItem *, int)), connect(_folderTree, &QTreeWidget::itemChanged,
SLOT(slotItemChanged(QTreeWidgetItem *, int))); this, &SelectiveSyncWidget::slotItemChanged);
_folderTree->setSortingEnabled(true); _folderTree->setSortingEnabled(true);
_folderTree->sortByColumn(0, Qt::AscendingOrder); _folderTree->sortByColumn(0, Qt::AscendingOrder);
_folderTree->setColumnCount(2); _folderTree->setColumnCount(2);
@ -107,10 +107,10 @@ void SelectiveSyncWidget::refreshFolders()
LsColJob *job = new LsColJob(_account, _folderPath, this); LsColJob *job = new LsColJob(_account, _folderPath, this);
job->setProperties(QList<QByteArray>() << "resourcetype" job->setProperties(QList<QByteArray>() << "resourcetype"
<< "http://owncloud.org/ns:size"); << "http://owncloud.org/ns:size");
connect(job, SIGNAL(directoryListingSubfolders(QStringList)), connect(job, &LsColJob::directoryListingSubfolders,
this, SLOT(slotUpdateDirectories(QStringList))); this, &SelectiveSyncWidget::slotUpdateDirectories);
connect(job, SIGNAL(finishedWithError(QNetworkReply *)), connect(job, &LsColJob::finishedWithError,
this, SLOT(slotLscolFinishedWithError(QNetworkReply *))); this, &SelectiveSyncWidget::slotLscolFinishedWithError);
job->start(); job->start();
_folderTree->clear(); _folderTree->clear();
_loading->show(); _loading->show();
@ -291,8 +291,8 @@ void SelectiveSyncWidget::slotItemExpanded(QTreeWidgetItem *item)
LsColJob *job = new LsColJob(_account, prefix + dir, this); LsColJob *job = new LsColJob(_account, prefix + dir, this);
job->setProperties(QList<QByteArray>() << "resourcetype" job->setProperties(QList<QByteArray>() << "resourcetype"
<< "http://owncloud.org/ns:size"); << "http://owncloud.org/ns:size");
connect(job, SIGNAL(directoryListingSubfolders(QStringList)), connect(job, &LsColJob::directoryListingSubfolders,
SLOT(slotUpdateDirectories(QStringList))); this, &SelectiveSyncWidget::slotUpdateDirectories);
job->start(); job->start();
} }
@ -440,7 +440,7 @@ SelectiveSyncDialog::SelectiveSyncDialog(AccountPtr account, Folder *folder, QWi
_okButton->setEnabled(false); _okButton->setEnabled(false);
} }
// Make sure we don't get crashes if the folder is destroyed while we are still open // 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, SelectiveSyncDialog::SelectiveSyncDialog(AccountPtr account, const QString &folder,
@ -463,7 +463,7 @@ void SelectiveSyncDialog::init(const AccountPtr &account)
connect(_okButton, SIGNAL(clicked()), this, SLOT(accept())); connect(_okButton, SIGNAL(clicked()), this, SLOT(accept()));
QPushButton *button; QPushButton *button;
button = buttonBox->addButton(QDialogButtonBox::Cancel); button = buttonBox->addButton(QDialogButtonBox::Cancel);
connect(button, SIGNAL(clicked()), this, SLOT(reject())); connect(button, &QAbstractButton::clicked, this, &QDialog::reject);
layout->addWidget(buttonBox); layout->addWidget(buttonBox);
} }

View file

@ -48,8 +48,8 @@ void ServerNotificationHandler::slotFetchNotifications(AccountState *ptr)
// if the previous notification job has finished, start next. // if the previous notification job has finished, start next.
_notificationJob = new JsonApiJob(ptr->account(), QLatin1String("ocs/v2.php/apps/notifications/api/v1/notifications"), this); _notificationJob = new JsonApiJob(ptr->account(), QLatin1String("ocs/v2.php/apps/notifications/api/v1/notifications"), this);
QObject::connect(_notificationJob.data(), SIGNAL(jsonReceived(QJsonDocument, int)), QObject::connect(_notificationJob.data(), &JsonApiJob::jsonReceived,
this, SLOT(slotNotificationsReceived(QJsonDocument, int))); this, &ServerNotificationHandler::slotNotificationsReceived);
_notificationJob->setProperty("AccountStatePtr", QVariant::fromValue<AccountState *>(ptr)); _notificationJob->setProperty("AccountStatePtr", QVariant::fromValue<AccountState *>(ptr));
_notificationJob->start(); _notificationJob->start();

View file

@ -109,8 +109,8 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
_toolBar->addAction(_activityAction); _toolBar->addAction(_activityAction);
_activitySettings = new ActivitySettings; _activitySettings = new ActivitySettings;
_ui->stack->addWidget(_activitySettings); _ui->stack->addWidget(_activitySettings);
connect(_activitySettings, SIGNAL(guiLog(QString, QString)), _gui, connect(_activitySettings, &ActivitySettings::guiLog, _gui,
SLOT(slotShowOptionalTrayMessage(QString, QString))); &ownCloudGui::slotShowOptionalTrayMessage);
_activitySettings->setNotificationRefreshInterval(cfg.notificationRefreshInterval()); _activitySettings->setNotificationRefreshInterval(cfg.notificationRefreshInterval());
QAction *generalAction = createColorAwareAction(QLatin1String(":/client/resources/settings.png"), tr("General")); 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(generalAction, generalSettings);
_actionGroupWidgets.insert(networkAction, networkSettings); _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 *)), connect(AccountManager::instance(), &AccountManager::accountAdded,
this, SLOT(accountAdded(AccountState *))); this, &SettingsDialog::accountAdded);
connect(AccountManager::instance(), SIGNAL(accountRemoved(AccountState *)), connect(AccountManager::instance(), &AccountManager::accountRemoved,
this, SLOT(accountRemoved(AccountState *))); this, &SettingsDialog::accountRemoved);
foreach (auto ai, AccountManager::instance()->accounts()) { foreach (auto ai, AccountManager::instance()->accounts()) {
accountAdded(ai.data()); accountAdded(ai.data());
} }
QTimer::singleShot(1, this, SLOT(showFirstPage())); QTimer::singleShot(1, this, &SettingsDialog::showFirstPage);
QPushButton *closeButton = _ui->buttonBox->button(QDialogButtonBox::Close); QPushButton *closeButton = _ui->buttonBox->button(QDialogButtonBox::Close);
connect(closeButton, SIGNAL(clicked()), SLOT(accept())); connect(closeButton, SIGNAL(clicked()), SLOT(accept()));
QAction *showLogWindow = new QAction(this); QAction *showLogWindow = new QAction(this);
showLogWindow->setShortcut(QKeySequence("F12")); showLogWindow->setShortcut(QKeySequence("F12"));
connect(showLogWindow, SIGNAL(triggered()), gui, SLOT(slotToggleLogBrowser())); connect(showLogWindow, &QAction::triggered, gui, &ownCloudGui::slotToggleLogBrowser);
addAction(showLogWindow); addAction(showLogWindow);
customizeStyle(); customizeStyle();
@ -245,11 +245,11 @@ void SettingsDialog::accountAdded(AccountState *s)
_actionGroupWidgets.insert(accountAction, accountSettings); _actionGroupWidgets.insert(accountAction, accountSettings);
_actionForAccount.insert(s->account().data(), accountAction); _actionForAccount.insert(s->account().data(), accountAction);
connect(accountSettings, SIGNAL(folderChanged()), _gui, SLOT(slotFoldersChanged())); connect(accountSettings, &AccountSettings::folderChanged, _gui, &ownCloudGui::slotFoldersChanged);
connect(accountSettings, SIGNAL(openFolderAlias(const QString &)), connect(accountSettings, &AccountSettings::openFolderAlias,
_gui, SLOT(slotFolderOpenAction(QString))); _gui, &ownCloudGui::slotFolderOpenAction);
connect(accountSettings, SIGNAL(showIssuesList(QString)), SLOT(showIssuesList(QString))); connect(accountSettings, &AccountSettings::showIssuesList, this, &SettingsDialog::showIssuesList);
connect(s->account().data(), SIGNAL(accountChangedAvatar()), SLOT(slotAccountAvatarChanged())); connect(s->account().data(), &Account::accountChangedAvatar, this, &SettingsDialog::slotAccountAvatarChanged);
slotRefreshActivity(s); slotRefreshActivity(s);
} }

View file

@ -58,10 +58,10 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState,
_ui->setupUi(this); _ui->setupUi(this);
QPushButton *closeButton = _ui->buttonBox->button(QDialogButtonBox::Close); 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 // 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 // Because people press enter in the dialog and we don't want to close for that
closeButton->setDefault(false); closeButton->setDefault(false);
@ -118,7 +118,7 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState,
if (QFileInfo(_localPath).isFile()) { if (QFileInfo(_localPath).isFile()) {
ThumbnailJob *job = new ThumbnailJob(_sharePath, _accountState->account(), this); 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(); job->start();
} }
@ -135,8 +135,8 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState,
<< "http://open-collaboration-services.org/ns:share-permissions" << "http://open-collaboration-services.org/ns:share-permissions"
<< "http://owncloud.org/ns:privatelink"); << "http://owncloud.org/ns:privatelink");
job->setTimeout(10 * 1000); job->setTimeout(10 * 1000);
connect(job, SIGNAL(result(QVariantMap)), SLOT(slotPropfindReceived(QVariantMap))); connect(job, &PropfindJob::result, this, &ShareDialog::slotPropfindReceived);
connect(job, SIGNAL(finishedWithError(QNetworkReply *)), SLOT(slotPropfindError())); connect(job, &PropfindJob::finishedWithError, this, &ShareDialog::slotPropfindError);
job->start(); job->start();
} }

View file

@ -72,8 +72,8 @@ void ShareeModel::fetch(const QString &search, const ShareeSet &blacklist)
_search = search; _search = search;
_shareeBlacklist = blacklist; _shareeBlacklist = blacklist;
OcsShareeJob *job = new OcsShareeJob(_account); OcsShareeJob *job = new OcsShareeJob(_account);
connect(job, SIGNAL(shareeJobFinished(QJsonDocument)), SLOT(shareesFetched(QJsonDocument))); connect(job, &OcsShareeJob::shareeJobFinished, this, &ShareeModel::shareesFetched);
connect(job, SIGNAL(ocsError(int, QString)), SIGNAL(displayErrorMessage(int, QString))); connect(job, &OcsJob::ocsError, this, &ShareeModel::displayErrorMessage);
job->getSharees(_search, _type, 1, 50); job->getSharees(_search, _type, 1, 50);
} }

View file

@ -71,18 +71,18 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
_ui->layout_editing->addWidget(_pi_editing, 0, 2); _ui->layout_editing->addWidget(_pi_editing, 0, 2);
_ui->horizontalLayout_expire->insertWidget(_ui->horizontalLayout_expire->count() - 1, _pi_date); _ui->horizontalLayout_expire->insertWidget(_ui->horizontalLayout_expire->count() - 1, _pi_date);
connect(_ui->nameLineEdit, SIGNAL(returnPressed()), SLOT(slotShareNameEntered())); connect(_ui->nameLineEdit, &QLineEdit::returnPressed, this, &ShareLinkWidget::slotShareNameEntered);
connect(_ui->createShareButton, SIGNAL(clicked(bool)), SLOT(slotShareNameEntered())); connect(_ui->createShareButton, &QAbstractButton::clicked, this, &ShareLinkWidget::slotShareNameEntered);
connect(_ui->linkShares, SIGNAL(itemSelectionChanged()), SLOT(slotShareSelectionChanged())); connect(_ui->linkShares, &QTableWidget::itemSelectionChanged, this, &ShareLinkWidget::slotShareSelectionChanged);
connect(_ui->linkShares, SIGNAL(itemChanged(QTableWidgetItem *)), SLOT(slotNameEdited(QTableWidgetItem *))); connect(_ui->linkShares, &QTableWidget::itemChanged, this, &ShareLinkWidget::slotNameEdited);
connect(_ui->checkBox_password, SIGNAL(clicked()), this, SLOT(slotCheckBoxPasswordClicked())); connect(_ui->checkBox_password, &QAbstractButton::clicked, this, &ShareLinkWidget::slotCheckBoxPasswordClicked);
connect(_ui->lineEdit_password, SIGNAL(returnPressed()), this, SLOT(slotPasswordReturnPressed())); connect(_ui->lineEdit_password, &QLineEdit::returnPressed, this, &ShareLinkWidget::slotPasswordReturnPressed);
connect(_ui->lineEdit_password, SIGNAL(textChanged(QString)), this, SLOT(slotPasswordChanged(QString))); connect(_ui->lineEdit_password, &QLineEdit::textChanged, this, &ShareLinkWidget::slotPasswordChanged);
connect(_ui->pushButton_setPassword, SIGNAL(clicked(bool)), SLOT(slotPasswordReturnPressed())); connect(_ui->pushButton_setPassword, &QAbstractButton::clicked, this, &ShareLinkWidget::slotPasswordReturnPressed);
connect(_ui->checkBox_expire, SIGNAL(clicked()), this, SLOT(slotCheckBoxExpireClicked())); connect(_ui->checkBox_expire, &QAbstractButton::clicked, this, &ShareLinkWidget::slotCheckBoxExpireClicked);
connect(_ui->calendar, SIGNAL(dateChanged(QDate)), SLOT(slotExpireDateChanged(QDate))); connect(_ui->calendar, &QDateTimeEdit::dateChanged, this, &ShareLinkWidget::slotExpireDateChanged);
connect(_ui->checkBox_editing, SIGNAL(clicked()), this, SLOT(slotPermissionsCheckboxClicked())); connect(_ui->checkBox_editing, &QAbstractButton::clicked, this, &ShareLinkWidget::slotPermissionsCheckboxClicked);
connect(_ui->checkBox_fileListing, SIGNAL(clicked(bool)), this, SLOT(slotPermissionsCheckboxClicked())); connect(_ui->checkBox_fileListing, &QAbstractButton::clicked, this, &ShareLinkWidget::slotPermissionsCheckboxClicked);
_ui->errorLabel->hide(); _ui->errorLabel->hide();
@ -156,8 +156,8 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
// Prepare sharing menu // Prepare sharing menu
_shareLinkMenu = new QMenu(this); _shareLinkMenu = new QMenu(this);
connect(_shareLinkMenu, SIGNAL(triggered(QAction *)), connect(_shareLinkMenu, &QMenu::triggered,
SLOT(slotShareLinkActionTriggered(QAction *))); this, &ShareLinkWidget::slotShareLinkActionTriggered);
_openLinkAction = _shareLinkMenu->addAction(tr("Open link in browser")); _openLinkAction = _shareLinkMenu->addAction(tr("Open link in browser"));
_copyLinkAction = _shareLinkMenu->addAction(tr("Copy link to clipboard")); _copyLinkAction = _shareLinkMenu->addAction(tr("Copy link to clipboard"));
_copyDirectLinkAction = _shareLinkMenu->addAction(tr("Copy link to clipboard (direct download)")); _copyDirectLinkAction = _shareLinkMenu->addAction(tr("Copy link to clipboard (direct download)"));
@ -169,10 +169,10 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
*/ */
if (sharingPossible) { if (sharingPossible) {
_manager = new ShareManager(_account, this); _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(linkShareCreated(QSharedPointer<LinkShare>)), SLOT(slotCreateShareFetched(const QSharedPointer<LinkShare>)));
connect(_manager, SIGNAL(linkShareRequiresPassword(QString)), SLOT(slotCreateShareRequiresPassword(QString))); connect(_manager, &ShareManager::linkShareRequiresPassword, this, &ShareLinkWidget::slotCreateShareRequiresPassword);
connect(_manager, SIGNAL(serverError(int, QString)), SLOT(slotServerError(int, QString))); connect(_manager, &ShareManager::serverError, this, &ShareLinkWidget::slotServerError);
} }
} }
@ -218,13 +218,13 @@ void ShareLinkWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shar
auto linkShare = qSharedPointerDynamicCast<LinkShare>(share); auto linkShare = qSharedPointerDynamicCast<LinkShare>(share);
// Connect all shares signals to gui slots // Connect all shares signals to gui slots
connect(share.data(), SIGNAL(serverError(int, QString)), SLOT(slotServerError(int, QString))); connect(share.data(), &Share::serverError, this, &ShareLinkWidget::slotServerError);
connect(share.data(), SIGNAL(shareDeleted()), SLOT(slotDeleteShareFetched())); connect(share.data(), &Share::shareDeleted, this, &ShareLinkWidget::slotDeleteShareFetched);
connect(share.data(), SIGNAL(expireDateSet()), SLOT(slotExpireSet())); connect(share.data(), SIGNAL(expireDateSet()), SLOT(slotExpireSet()));
connect(share.data(), SIGNAL(publicUploadSet()), SLOT(slotPermissionsSet())); connect(share.data(), SIGNAL(publicUploadSet()), SLOT(slotPermissionsSet()));
connect(share.data(), SIGNAL(passwordSet()), SLOT(slotPasswordSet())); connect(share.data(), SIGNAL(passwordSet()), SLOT(slotPasswordSet()));
connect(share.data(), SIGNAL(passwordSetError(int, QString)), SLOT(slotPasswordSetError(int, QString))); 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 // Build the table row
auto row = table->rowCount(); auto row = table->rowCount();
@ -247,13 +247,13 @@ void ShareLinkWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shar
auto shareButton = new QToolButton; auto shareButton = new QToolButton;
shareButton->setText("..."); shareButton->setText("...");
shareButton->setProperty(propertyShareC, QVariant::fromValue(linkShare)); 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); table->setCellWidget(row, 1, shareButton);
auto deleteButton = new QToolButton; auto deleteButton = new QToolButton;
deleteButton->setIcon(deleteIcon); deleteButton->setIcon(deleteIcon);
deleteButton->setProperty(propertyShareC, QVariant::fromValue(linkShare)); 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); table->setCellWidget(row, 2, deleteButton);
// Reestablish the previous selection // Reestablish the previous selection

View file

@ -72,8 +72,8 @@ QSharedPointer<Sharee> Share::getShareWith() const
void Share::setPermissions(Permissions permissions) void Share::setPermissions(Permissions permissions)
{ {
OcsShareJob *job = new OcsShareJob(_account); OcsShareJob *job = new OcsShareJob(_account);
connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotPermissionsSet(QJsonDocument, QVariant))); connect(job, &OcsShareJob::shareJobFinished, this, &Share::slotPermissionsSet);
connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString))); connect(job, &OcsJob::ocsError, this, &Share::slotOcsError);
job->setPermissions(getId(), permissions); job->setPermissions(getId(), permissions);
} }
@ -91,8 +91,8 @@ Share::Permissions Share::getPermissions() const
void Share::deleteShare() void Share::deleteShare()
{ {
OcsShareJob *job = new OcsShareJob(_account); OcsShareJob *job = new OcsShareJob(_account);
connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotDeleted())); connect(job, &OcsShareJob::shareJobFinished, this, &Share::slotDeleted);
connect(job, SIGNAL(ocsError(int, const QString &)), SLOT(slotOcsError(int, const QString &))); connect(job, &OcsJob::ocsError, this, &Share::slotOcsError);
job->deleteShare(getId()); job->deleteShare(getId());
} }
@ -164,8 +164,8 @@ QString LinkShare::getName() const
void LinkShare::setName(const QString &name) void LinkShare::setName(const QString &name)
{ {
OcsShareJob *job = new OcsShareJob(_account); OcsShareJob *job = new OcsShareJob(_account);
connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotNameSet(QJsonDocument, QVariant))); connect(job, &OcsShareJob::shareJobFinished, this, &LinkShare::slotNameSet);
connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString))); connect(job, &OcsJob::ocsError, this, &LinkShare::slotOcsError);
job->setName(getId(), name); job->setName(getId(), name);
} }
@ -177,8 +177,8 @@ QString LinkShare::getToken() const
void LinkShare::setPassword(const QString &password) void LinkShare::setPassword(const QString &password)
{ {
OcsShareJob *job = new OcsShareJob(_account); OcsShareJob *job = new OcsShareJob(_account);
connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotPasswordSet(QJsonDocument, QVariant))); connect(job, &OcsShareJob::shareJobFinished, this, &LinkShare::slotPasswordSet);
connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotSetPasswordError(int, QString))); connect(job, &OcsJob::ocsError, this, &LinkShare::slotSetPasswordError);
job->setPassword(getId(), password); job->setPassword(getId(), password);
} }
@ -191,8 +191,8 @@ void LinkShare::slotPasswordSet(const QJsonDocument &, const QVariant &value)
void LinkShare::setExpireDate(const QDate &date) void LinkShare::setExpireDate(const QDate &date)
{ {
OcsShareJob *job = new OcsShareJob(_account); OcsShareJob *job = new OcsShareJob(_account);
connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotExpireDateSet(QJsonDocument, QVariant))); connect(job, &OcsShareJob::shareJobFinished, this, &LinkShare::slotExpireDateSet);
connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString))); connect(job, &OcsJob::ocsError, this, &LinkShare::slotOcsError);
job->setExpireDate(getId(), date); job->setExpireDate(getId(), date);
} }
@ -234,8 +234,8 @@ void ShareManager::createLinkShare(const QString &path,
const QString &password) const QString &password)
{ {
OcsShareJob *job = new OcsShareJob(_account); OcsShareJob *job = new OcsShareJob(_account);
connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotLinkShareCreated(QJsonDocument))); connect(job, &OcsShareJob::shareJobFinished, this, &ShareManager::slotLinkShareCreated);
connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString))); connect(job, &OcsJob::ocsError, this, &ShareManager::slotOcsError);
job->createLinkShare(path, name, password); job->createLinkShare(path, name, password);
} }
@ -276,8 +276,8 @@ void ShareManager::createShare(const QString &path,
continuation.permissions = permissions; continuation.permissions = permissions;
_jobContinuation[job] = QVariant::fromValue(continuation); _jobContinuation[job] = QVariant::fromValue(continuation);
connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotCreateShare(QJsonDocument))); connect(job, &OcsShareJob::shareJobFinished, this, &ShareManager::slotCreateShare);
connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString))); connect(job, &OcsJob::ocsError, this, &ShareManager::slotOcsError);
job->getSharedWithMe(); job->getSharedWithMe();
} }
@ -308,8 +308,8 @@ void ShareManager::slotCreateShare(const QJsonDocument &reply)
} }
OcsShareJob *job = new OcsShareJob(_account); OcsShareJob *job = new OcsShareJob(_account);
connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotShareCreated(QJsonDocument))); connect(job, &OcsShareJob::shareJobFinished, this, &ShareManager::slotShareCreated);
connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString))); connect(job, &OcsJob::ocsError, this, &ShareManager::slotOcsError);
job->createShare(cont.path, cont.shareType, cont.shareWith, cont.permissions); 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) void ShareManager::fetchShares(const QString &path)
{ {
OcsShareJob *job = new OcsShareJob(_account); OcsShareJob *job = new OcsShareJob(_account);
connect(job, SIGNAL(shareJobFinished(QJsonDocument, QVariant)), SLOT(slotSharesFetched(QJsonDocument))); connect(job, &OcsShareJob::shareJobFinished, this, &ShareManager::slotSharesFetched);
connect(job, SIGNAL(ocsError(int, QString)), SLOT(slotOcsError(int, QString))); connect(job, &OcsJob::ocsError, this, &ShareManager::slotOcsError);
job->getShares(path); job->getShares(path);
} }

View file

@ -71,8 +71,8 @@ ShareUserGroupWidget::ShareUserGroupWidget(AccountPtr account,
_completerModel = new ShareeModel(_account, _completerModel = new ShareeModel(_account,
_isFile ? QLatin1String("file") : QLatin1String("folder"), _isFile ? QLatin1String("file") : QLatin1String("folder"),
_completer); _completer);
connect(_completerModel, SIGNAL(shareesReady()), this, SLOT(slotShareesReady())); connect(_completerModel, &ShareeModel::shareesReady, this, &ShareUserGroupWidget::slotShareesReady);
connect(_completerModel, SIGNAL(displayErrorMessage(int, QString)), this, SLOT(displayError(int, QString))); connect(_completerModel, &ShareeModel::displayErrorMessage, this, &ShareUserGroupWidget::displayError);
_completer->setModel(_completerModel); _completer->setModel(_completerModel);
_completer->setCaseSensitivity(Qt::CaseInsensitive); _completer->setCaseSensitivity(Qt::CaseInsensitive);
@ -80,11 +80,11 @@ ShareUserGroupWidget::ShareUserGroupWidget(AccountPtr account,
_ui->shareeLineEdit->setCompleter(_completer); _ui->shareeLineEdit->setCompleter(_completer);
_manager = new ShareManager(_account, this); _manager = new ShareManager(_account, this);
connect(_manager, SIGNAL(sharesFetched(QList<QSharedPointer<Share>>)), SLOT(slotSharesFetched(QList<QSharedPointer<Share>>))); connect(_manager, &ShareManager::sharesFetched, this, &ShareUserGroupWidget::slotSharesFetched);
connect(_manager, SIGNAL(shareCreated(QSharedPointer<Share>)), SLOT(getShares())); connect(_manager, &ShareManager::shareCreated, this, &ShareUserGroupWidget::getShares);
connect(_manager, SIGNAL(serverError(int, QString)), this, SLOT(displayError(int, QString))); connect(_manager, &ShareManager::serverError, this, &ShareUserGroupWidget::displayError);
connect(_ui->shareeLineEdit, SIGNAL(returnPressed()), SLOT(slotLineEditReturn())); connect(_ui->shareeLineEdit, &QLineEdit::returnPressed, this, &ShareUserGroupWidget::slotLineEditReturn);
connect(_ui->privateLinkText, SIGNAL(linkActivated(QString)), SLOT(slotPrivateLinkShare())); connect(_ui->privateLinkText, &QLabel::linkActivated, this, &ShareUserGroupWidget::slotPrivateLinkShare);
// By making the next two QueuedConnections we can override // By making the next two QueuedConnections we can override
// the strings the completer sets on the line edit. // the strings the completer sets on the line edit.
@ -94,9 +94,9 @@ ShareUserGroupWidget::ShareUserGroupWidget(AccountPtr account,
Qt::QueuedConnection); Qt::QueuedConnection);
// Queued connection so this signal is recieved after textChanged // Queued connection so this signal is recieved after textChanged
connect(_ui->shareeLineEdit, SIGNAL(textEdited(QString)), connect(_ui->shareeLineEdit, &QLineEdit::textEdited,
this, SLOT(slotLineEditTextEdited(QString)), Qt::QueuedConnection); this, &ShareUserGroupWidget::slotLineEditTextEdited, Qt::QueuedConnection);
connect(&_completionTimer, SIGNAL(timeout()), this, SLOT(searchForSharees())); connect(&_completionTimer, &QTimer::timeout, this, &ShareUserGroupWidget::searchForSharees);
_completionTimer.setSingleShot(true); _completionTimer.setSingleShot(true);
_completionTimer.setInterval(600); _completionTimer.setInterval(600);
@ -192,8 +192,8 @@ void ShareUserGroupWidget::slotSharesFetched(const QList<QSharedPointer<Share>>
} }
ShareUserLine *s = new ShareUserLine(share, _maxSharingPermissions, _isFile, _ui->scrollArea); ShareUserLine *s = new ShareUserLine(share, _maxSharingPermissions, _isFile, _ui->scrollArea);
connect(s, SIGNAL(resizeRequested()), this, SLOT(slotAdjustScrollWidgetSize())); connect(s, &ShareUserLine::resizeRequested, this, &ShareUserGroupWidget::slotAdjustScrollWidgetSize);
connect(s, SIGNAL(visualDeletionDone()), this, SLOT(getShares())); connect(s, &ShareUserLine::visualDeletionDone, this, &ShareUserGroupWidget::getShares);
layout->addWidget(s); layout->addWidget(s);
x++; x++;
@ -390,11 +390,11 @@ ShareUserLine::ShareUserLine(QSharedPointer<Share> share,
_ui->permissionsEdit->setEnabled(maxSharingPermissions _ui->permissionsEdit->setEnabled(maxSharingPermissions
& (SharePermissionCreate | SharePermissionUpdate | SharePermissionDelete)); & (SharePermissionCreate | SharePermissionUpdate | SharePermissionDelete));
connect(_permissionUpdate, SIGNAL(triggered(bool)), SLOT(slotPermissionsChanged())); connect(_permissionUpdate, &QAction::triggered, this, &ShareUserLine::slotPermissionsChanged);
connect(_permissionCreate, SIGNAL(triggered(bool)), SLOT(slotPermissionsChanged())); connect(_permissionCreate, &QAction::triggered, this, &ShareUserLine::slotPermissionsChanged);
connect(_permissionDelete, SIGNAL(triggered(bool)), SLOT(slotPermissionsChanged())); connect(_permissionDelete, &QAction::triggered, this, &ShareUserLine::slotPermissionsChanged);
connect(_ui->permissionShare, SIGNAL(clicked(bool)), SLOT(slotPermissionsChanged())); connect(_ui->permissionShare, &QAbstractButton::clicked, this, &ShareUserLine::slotPermissionsChanged);
connect(_ui->permissionsEdit, SIGNAL(clicked(bool)), SLOT(slotEditPermissionsChanged())); connect(_ui->permissionsEdit, &QAbstractButton::clicked, this, &ShareUserLine::slotEditPermissionsChanged);
/* /*
* We don't show permssion share for federated shares with server <9.1 * 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); _ui->permissionToolButton->setVisible(false);
} }
connect(share.data(), SIGNAL(permissionsSet()), SLOT(slotPermissionsSet())); connect(share.data(), &Share::permissionsSet, this, &ShareUserLine::slotPermissionsSet);
connect(share.data(), SIGNAL(shareDeleted()), SLOT(slotShareDeleted())); connect(share.data(), &Share::shareDeleted, this, &ShareUserLine::slotShareDeleted);
_ui->deleteShareButton->setIcon(QIcon::fromTheme(QLatin1String("user-trash"), _ui->deleteShareButton->setIcon(QIcon::fromTheme(QLatin1String("user-trash"),
QIcon(QLatin1String(":/client/resources/delete.png")))); QIcon(QLatin1String(":/client/resources/delete.png"))));
@ -509,8 +509,8 @@ void ShareUserLine::slotShareDeleted()
animation->setStartValue(height()); animation->setStartValue(height());
animation->setEndValue(0); animation->setEndValue(0);
connect(animation, SIGNAL(finished()), SLOT(slotDeleteAnimationFinished())); connect(animation, &QAbstractAnimation::finished, this, &ShareUserLine::slotDeleteAnimationFinished);
connect(animation, SIGNAL(valueChanged(QVariant)), this, SIGNAL(resizeRequested())); connect(animation, &QVariantAnimation::valueChanged, this, &ShareUserLine::resizeRequested);
animation->start(); animation->start();
} }

View file

@ -207,10 +207,10 @@ SocketApi::SocketApi(QObject *parent)
qCInfo(lcSocketApi) << "server started, listening at " << socketPath; qCInfo(lcSocketApi) << "server started, listening at " << socketPath;
} }
connect(&_localServer, SIGNAL(newConnection()), this, SLOT(slotNewConnection())); connect(&_localServer, &QLocalServer::newConnection, this, &SocketApi::slotNewConnection);
// folder watcher // folder watcher
connect(FolderMan::instance(), SIGNAL(folderSyncStateChange(Folder *)), this, SLOT(slotUpdateFolderView(Folder *))); connect(FolderMan::instance(), &FolderMan::folderSyncStateChange, this, &SocketApi::slotUpdateFolderView);
} }
SocketApi::~SocketApi() SocketApi::~SocketApi()
@ -230,9 +230,9 @@ void SocketApi::slotNewConnection()
return; return;
} }
qCInfo(lcSocketApi) << "New connection" << socket; 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(disconnected()), this, SLOT(onLostConnection()));
connect(socket, SIGNAL(destroyed(QObject *)), this, SLOT(slotSocketDestroyed(QObject *))); connect(socket, &QObject::destroyed, this, &SocketApi::slotSocketDestroyed);
ASSERT(socket->readAll().isEmpty()); ASSERT(socket->readAll().isEmpty());
_listeners.append(SocketListener(socket)); _listeners.append(SocketListener(socket));

View file

@ -35,8 +35,8 @@ SslButton::SslButton(QWidget *parent)
setAutoRaise(true); setAutoRaise(true);
_menu = new QMenu(this); _menu = new QMenu(this);
QObject::connect(_menu, SIGNAL(aboutToShow()), QObject::connect(_menu, &QMenu::aboutToShow,
this, SLOT(slotUpdateMenu())); this, &SslButton::slotUpdateMenu);
} }
QString SslButton::protoToString(QSsl::SslProtocol proto) QString SslButton::protoToString(QSsl::SslProtocol proto)

View file

@ -68,13 +68,13 @@ SslErrorDialog::SslErrorDialog(AccountPtr account, QWidget *parent)
QPushButton *cancelButton = QPushButton *cancelButton =
_ui->_dialogButtonBox->button(QDialogButtonBox::Cancel); _ui->_dialogButtonBox->button(QDialogButtonBox::Cancel);
okButton->setEnabled(false); okButton->setEnabled(false);
connect(_ui->_cbTrustConnect, SIGNAL(clicked(bool)), connect(_ui->_cbTrustConnect, &QAbstractButton::clicked,
okButton, SLOT(setEnabled(bool))); okButton, &QWidget::setEnabled);
if (okButton) { if (okButton) {
okButton->setDefault(true); okButton->setDefault(true);
connect(okButton, SIGNAL(clicked()), SLOT(accept())); connect(okButton, &QAbstractButton::clicked, this, &QDialog::accept);
connect(cancelButton, SIGNAL(clicked()), SLOT(reject())); connect(cancelButton, &QAbstractButton::clicked, this, &QDialog::reject);
} }
} }

View file

@ -41,7 +41,7 @@ SyncLogDialog::SyncLogDialog(QWidget *parent, ProtocolWidget *protoWidget)
QPushButton *closeButton = _ui->buttonBox->button(QDialogButtonBox::Close); QPushButton *closeButton = _ui->buttonBox->button(QDialogButtonBox::Close);
if (closeButton) { if (closeButton) {
connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); connect(closeButton, &QAbstractButton::clicked, this, &QWidget::close);
} }
} }

View file

@ -24,8 +24,8 @@ ToolTipUpdater::ToolTipUpdater(QTreeView *treeView)
: QObject(treeView) : QObject(treeView)
, _treeView(treeView) , _treeView(treeView)
{ {
connect(_treeView->model(), SIGNAL(dataChanged(QModelIndex, QModelIndex, QVector<int>)), connect(_treeView->model(), &QAbstractItemModel::dataChanged,
SLOT(dataChanged(QModelIndex, QModelIndex, QVector<int>))); this, &ToolTipUpdater::dataChanged);
_treeView->viewport()->installEventFilter(this); _treeView->viewport()->installEventFilter(this);
} }

View file

@ -39,18 +39,18 @@ static const char autoUpdateAttemptedC[] = "Updater/autoUpdateAttempted";
UpdaterScheduler::UpdaterScheduler(QObject *parent) UpdaterScheduler::UpdaterScheduler(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
connect(&_updateCheckTimer, SIGNAL(timeout()), connect(&_updateCheckTimer, &QTimer::timeout,
this, SLOT(slotTimerFired())); this, &UpdaterScheduler::slotTimerFired);
// Note: the sparkle-updater is not an OCUpdater // Note: the sparkle-updater is not an OCUpdater
if (OCUpdater *updater = qobject_cast<OCUpdater *>(Updater::instance())) { if (OCUpdater *updater = qobject_cast<OCUpdater *>(Updater::instance())) {
connect(updater, SIGNAL(newUpdateAvailable(QString, QString)), connect(updater, &OCUpdater::newUpdateAvailable,
this, SIGNAL(updaterAnnouncement(QString, QString))); this, &UpdaterScheduler::updaterAnnouncement);
connect(updater, SIGNAL(requestRestart()), SIGNAL(requestRestart())); connect(updater, &OCUpdater::requestRestart, this, &UpdaterScheduler::requestRestart);
} }
// at startup, do a check in any case. // at startup, do a check in any case.
QTimer::singleShot(3000, this, SLOT(slotTimerFired())); QTimer::singleShot(3000, this, &UpdaterScheduler::slotTimerFired);
ConfigFile cfg; ConfigFile cfg;
auto checkInterval = cfg.updateCheckInterval(); auto checkInterval = cfg.updateCheckInterval();
@ -194,9 +194,9 @@ void OCUpdater::slotStartInstaller()
void OCUpdater::checkForUpdate() void OCUpdater::checkForUpdate()
{ {
QNetworkReply *reply = _accessManager->get(QNetworkRequest(_updateUrl)); QNetworkReply *reply = _accessManager->get(QNetworkRequest(_updateUrl));
connect(_timeoutWatchdog, SIGNAL(timeout()), this, SLOT(slotTimedOut())); connect(_timeoutWatchdog, &QTimer::timeout, this, &OCUpdater::slotTimedOut);
_timeoutWatchdog->start(30 * 1000); _timeoutWatchdog->start(30 * 1000);
connect(reply, SIGNAL(finished()), this, SLOT(slotVersionInfoArrived())); connect(reply, &QNetworkReply::finished, this, &OCUpdater::slotVersionInfoArrived);
setDownloadState(CheckingServer); setDownloadState(CheckingServer);
} }
@ -303,8 +303,8 @@ void NSISUpdater::versionInfoArrived(const UpdateInfo &info)
setDownloadState(DownloadComplete); setDownloadState(DownloadComplete);
} else { } else {
QNetworkReply *reply = qnam()->get(QNetworkRequest(QUrl(url))); QNetworkReply *reply = qnam()->get(QNetworkRequest(QUrl(url)));
connect(reply, SIGNAL(readyRead()), SLOT(slotWriteFile())); connect(reply, &QIODevice::readyRead, this, &NSISUpdater::slotWriteFile);
connect(reply, SIGNAL(finished()), SLOT(slotDownloadFinished())); connect(reply, &QNetworkReply::finished, this, &NSISUpdater::slotDownloadFinished);
setDownloadState(Downloading); setDownloadState(Downloading);
_file.reset(new QTemporaryFile); _file.reset(new QTemporaryFile);
_file->setAutoRemove(true); _file->setAutoRemove(true);
@ -353,11 +353,11 @@ void NSISUpdater::showDialog(const UpdateInfo &info)
QPushButton *reject = bb->addButton(tr("Skip this time"), QDialogButtonBox::AcceptRole); QPushButton *reject = bb->addButton(tr("Skip this time"), QDialogButtonBox::AcceptRole);
QPushButton *getupdate = bb->addButton(tr("Get update"), QDialogButtonBox::AcceptRole); QPushButton *getupdate = bb->addButton(tr("Get update"), QDialogButtonBox::AcceptRole);
connect(skip, SIGNAL(clicked()), msgBox, SLOT(reject())); connect(skip, &QAbstractButton::clicked, msgBox, &QDialog::reject);
connect(reject, SIGNAL(clicked()), msgBox, SLOT(reject())); connect(reject, &QAbstractButton::clicked, msgBox, &QDialog::reject);
connect(getupdate, SIGNAL(clicked()), msgBox, SLOT(accept())); 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())); connect(getupdate, SIGNAL(clicked()), SLOT(slotOpenUpdateUrl()));
layout->addWidget(bb); layout->addWidget(bb);

View file

@ -54,12 +54,12 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
stopSpinner(); stopSpinner();
setupCustomization(); setupCustomization();
connect(_ui.pbSelectLocalFolder, SIGNAL(clicked()), SLOT(slotSelectFolder())); connect(_ui.pbSelectLocalFolder, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectFolder);
setButtonText(QWizard::NextButton, tr("Connect...")); setButtonText(QWizard::NextButton, tr("Connect..."));
connect(_ui.rSyncEverything, SIGNAL(clicked()), SLOT(slotSyncEverythingClicked())); connect(_ui.rSyncEverything, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSyncEverythingClicked);
connect(_ui.rSelectiveSync, SIGNAL(clicked()), SLOT(slotSelectiveSyncClicked())); connect(_ui.rSelectiveSync, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
connect(_ui.bSelectiveSync, SIGNAL(clicked()), SLOT(slotSelectiveSyncClicked())); connect(_ui.bSelectiveSync, &QAbstractButton::clicked, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
QIcon appIcon = theme->applicationIcon(); QIcon appIcon = theme->applicationIcon();
_ui.lServerIcon->setText(QString()); _ui.lServerIcon->setText(QString());
@ -120,13 +120,13 @@ void OwncloudAdvancedSetupPage::initializePage()
auto quotaJob = new PropfindJob(acc, _remoteFolder, this); auto quotaJob = new PropfindJob(acc, _remoteFolder, this);
quotaJob->setProperties(QList<QByteArray>() << "http://owncloud.org/ns:size"); 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(); quotaJob->start();
if (Theme::instance()->wizardSelectiveSyncDefaultNothing()) { if (Theme::instance()->wizardSelectiveSyncDefaultNothing()) {
_selectiveSyncBlacklist = QStringList("/"); _selectiveSyncBlacklist = QStringList("/");
QTimer::singleShot(0, this, SLOT(slotSelectiveSyncClicked())); QTimer::singleShot(0, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
} }
ConfigFile cfgFile; ConfigFile cfgFile;

View file

@ -24,9 +24,9 @@ OwncloudConnectionMethodDialog::OwncloudConnectionMethodDialog(QWidget *parent)
{ {
ui->setupUi(this); ui->setupUi(this);
connect(ui->btnNoTLS, SIGNAL(clicked(bool)), this, SLOT(returnNoTLS())); connect(ui->btnNoTLS, &QAbstractButton::clicked, this, &OwncloudConnectionMethodDialog::returnNoTLS);
connect(ui->btnClientSideTLS, SIGNAL(clicked(bool)), this, SLOT(returnClientSideTLS())); connect(ui->btnClientSideTLS, &QAbstractButton::clicked, this, &OwncloudConnectionMethodDialog::returnClientSideTLS);
connect(ui->btnBack, SIGNAL(clicked(bool)), this, SLOT(returnBack())); connect(ui->btnBack, &QAbstractButton::clicked, this, &OwncloudConnectionMethodDialog::returnBack);
} }
void OwncloudConnectionMethodDialog::setUrl(const QUrl &url) void OwncloudConnectionMethodDialog::setUrl(const QUrl &url)

View file

@ -66,8 +66,8 @@ OwncloudSetupPage::OwncloudSetupPage(QWidget *parent)
setupCustomization(); setupCustomization();
slotUrlChanged(QLatin1String("")); // don't jitter UI slotUrlChanged(QLatin1String("")); // don't jitter UI
connect(_ui.leUrl, SIGNAL(textChanged(QString)), SLOT(slotUrlChanged(QString))); connect(_ui.leUrl, &QLineEdit::textChanged, this, &OwncloudSetupPage::slotUrlChanged);
connect(_ui.leUrl, SIGNAL(editingFinished()), SLOT(slotUrlEditFinished())); connect(_ui.leUrl, &QLineEdit::editingFinished, this, &OwncloudSetupPage::slotUrlEditFinished);
addCertDial = new AddCertificateDialog(this); addCertDial = new AddCertificateDialog(this);
} }
@ -268,7 +268,7 @@ void OwncloudSetupPage::setErrorString(const QString &err, bool retryHTTPonly)
} break; } break;
case OwncloudConnectionMethodDialog::Client_Side_TLS: case OwncloudConnectionMethodDialog::Client_Side_TLS:
addCertDial->show(); addCertDial->show();
connect(addCertDial, SIGNAL(accepted()), this, SLOT(slotCertificateAccepted())); connect(addCertDial, &QDialog::accepted, this, &OwncloudSetupPage::slotCertificateAccepted);
break; break;
case OwncloudConnectionMethodDialog::Closed: case OwncloudConnectionMethodDialog::Closed:
case OwncloudConnectionMethodDialog::Back: case OwncloudConnectionMethodDialog::Back:

View file

@ -49,10 +49,10 @@ void OwncloudShibbolethCredsPage::setupBrowser()
qnam->setCookieJar(jar); qnam->setCookieJar(jar);
_browser = new ShibbolethWebView(account); _browser = new ShibbolethWebView(account);
connect(_browser, SIGNAL(shibbolethCookieReceived(const QNetworkCookie &)), connect(_browser.data(), &ShibbolethWebView::shibbolethCookieReceived,
this, SLOT(slotShibbolethCookieReceived(const QNetworkCookie &)), Qt::QueuedConnection); this, &OwncloudShibbolethCredsPage::slotShibbolethCookieReceived, Qt::QueuedConnection);
connect(_browser, SIGNAL(rejected()), connect(_browser.data(), &ShibbolethWebView::rejected,
this, SLOT(slotBrowserRejected())); this, &OwncloudShibbolethCredsPage::slotBrowserRejected);
_browser->move(ocWizard->x(), ocWizard->y()); _browser->move(ocWizard->x(), ocWizard->y());
_browser->show(); _browser->show();

View file

@ -62,22 +62,22 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
setPage(WizardCommon::Page_AdvancedSetup, _advancedSetupPage); setPage(WizardCommon::Page_AdvancedSetup, _advancedSetupPage);
setPage(WizardCommon::Page_Result, _resultPage); 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 // note: start Id is set by the calling class depending on if the
// welcome text is to be shown or not. // welcome text is to be shown or not.
setWizardStyle(QWizard::ModernStyle); setWizardStyle(QWizard::ModernStyle);
connect(this, SIGNAL(currentIdChanged(int)), SLOT(slotCurrentPageChanged(int))); connect(this, &QWizard::currentIdChanged, this, &OwncloudWizard::slotCurrentPageChanged);
connect(_setupPage, SIGNAL(determineAuthType(QString)), SIGNAL(determineAuthType(QString))); connect(_setupPage, &OwncloudSetupPage::determineAuthType, this, &OwncloudWizard::determineAuthType);
connect(_httpCredsPage, SIGNAL(connectToOCUrl(QString)), SIGNAL(connectToOCUrl(QString))); connect(_httpCredsPage, &OwncloudHttpCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
connect(_browserCredsPage, SIGNAL(connectToOCUrl(QString)), SIGNAL(connectToOCUrl(QString))); connect(_browserCredsPage, &OwncloudOAuthCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
#ifndef NO_SHIBBOLETH #ifndef NO_SHIBBOLETH
connect(_shibbolethCredsPage, SIGNAL(connectToOCUrl(QString)), SIGNAL(connectToOCUrl(QString))); connect(_shibbolethCredsPage, &OwncloudShibbolethCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
#endif #endif
connect(_advancedSetupPage, SIGNAL(createLocalAndRemoteFolders(QString, QString)), connect(_advancedSetupPage, &OwncloudAdvancedSetupPage::createLocalAndRemoteFolders,
SIGNAL(createLocalAndRemoteFolders(QString, QString))); this, &OwncloudWizard::createLocalAndRemoteFolders);
connect(this, SIGNAL(customButtonClicked(int)), this, SIGNAL(skipFolderConfiguration())); connect(this, &QWizard::customButtonClicked, this, &OwncloudWizard::skipFolderConfiguration);
Theme *theme = Theme::instance(); Theme *theme = Theme::instance();
@ -193,7 +193,7 @@ void OwncloudWizard::slotCurrentPageChanged(int id)
} }
if (id == WizardCommon::Page_Result) { 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); emit basicSetupFinished(QDialog::Accepted);
appendToConfigurationLog(QString::null); appendToConfigurationLog(QString::null);
// Immediately close on show, we currently don't want this page anymore // Immediately close on show, we currently don't want this page anymore

View file

@ -41,7 +41,7 @@ OwncloudWizardResultPage::OwncloudWizardResultPage()
_ui.pbOpenLocal->setIcon(QIcon(QLatin1String(":/client/resources/folder-sync.png"))); _ui.pbOpenLocal->setIcon(QIcon(QLatin1String(":/client/resources/folder-sync.png")));
_ui.pbOpenLocal->setIconSize(QSize(48, 48)); _ui.pbOpenLocal->setIconSize(QSize(48, 48));
_ui.pbOpenLocal->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); _ui.pbOpenLocal->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
connect(_ui.pbOpenLocal, SIGNAL(clicked()), SLOT(slotOpenLocal())); connect(_ui.pbOpenLocal, &QAbstractButton::clicked, this, &OwncloudWizardResultPage::slotOpenLocal);
Theme *theme = Theme::instance(); Theme *theme = Theme::instance();
QIcon appIcon = theme->applicationIcon(); QIcon appIcon = theme->applicationIcon();
@ -49,7 +49,7 @@ OwncloudWizardResultPage::OwncloudWizardResultPage()
_ui.pbOpenServer->setIcon(appIcon.pixmap(48)); _ui.pbOpenServer->setIcon(appIcon.pixmap(48));
_ui.pbOpenServer->setIconSize(QSize(48, 48)); _ui.pbOpenServer->setIconSize(QSize(48, 48));
_ui.pbOpenServer->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); _ui.pbOpenServer->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
connect(_ui.pbOpenServer, SIGNAL(clicked()), SLOT(slotOpenServer())); connect(_ui.pbOpenServer, &QAbstractButton::clicked, this, &OwncloudWizardResultPage::slotOpenServer);
setupCustomization(); setupCustomization();
} }

View file

@ -52,15 +52,15 @@ AbstractNetworkJob::AbstractNetworkJob(AccountPtr account, const QString &path,
{ {
_timer.setSingleShot(true); _timer.setSingleShot(true);
_timer.setInterval(OwncloudPropagator::httpTimeout() * 1000); // default to 5 minutes. _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. // Network activity on the propagator jobs (GET/PUT) keeps all requests alive.
// This is a workaround for OC instances which only support one // This is a workaround for OC instances which only support one
// parallel up and download // parallel up and download
if (_account) { 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) void AbstractNetworkJob::setupConnections(QNetworkReply *reply)
{ {
connect(reply, SIGNAL(finished()), SLOT(slotFinished())); connect(reply, &QNetworkReply::finished, this, &AbstractNetworkJob::slotFinished);
connect(reply, SIGNAL(encrypted()), SIGNAL(networkActivity())); connect(reply, &QNetworkReply::encrypted, this, &AbstractNetworkJob::networkActivity);
connect(reply->manager(), SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)), SIGNAL(networkActivity())); connect(reply->manager(), &QNetworkAccessManager::proxyAuthenticationRequired, this, &AbstractNetworkJob::networkActivity);
connect(reply, SIGNAL(sslErrors(QList<QSslError>)), SIGNAL(networkActivity())); connect(reply, &QNetworkReply::sslErrors, this, &AbstractNetworkJob::networkActivity);
connect(reply, SIGNAL(metaDataChanged()), SIGNAL(networkActivity())); connect(reply, &QNetworkReply::metaDataChanged, this, &AbstractNetworkJob::networkActivity);
connect(reply, SIGNAL(downloadProgress(qint64, qint64)), SIGNAL(networkActivity())); connect(reply, &QNetworkReply::downloadProgress, this, &AbstractNetworkJob::networkActivity);
connect(reply, SIGNAL(uploadProgress(qint64, qint64)), SIGNAL(networkActivity())); connect(reply, &QNetworkReply::uploadProgress, this, &AbstractNetworkJob::networkActivity);
} }
QNetworkReply *AbstractNetworkJob::addTimer(QNetworkReply *reply) QNetworkReply *AbstractNetworkJob::addTimer(QNetworkReply *reply)

View file

@ -150,12 +150,12 @@ void Account::setCredentials(AbstractCredentials *cred)
} }
connect(_am.data(), SIGNAL(sslErrors(QNetworkReply *, QList<QSslError>)), connect(_am.data(), SIGNAL(sslErrors(QNetworkReply *, QList<QSslError>)),
SLOT(slotHandleSslErrors(QNetworkReply *, QList<QSslError>))); SLOT(slotHandleSslErrors(QNetworkReply *, QList<QSslError>)));
connect(_am.data(), SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)), connect(_am.data(), &QNetworkAccessManager::proxyAuthenticationRequired,
SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *))); this, &Account::proxyAuthenticationRequired);
connect(_credentials.data(), SIGNAL(fetched()), connect(_credentials.data(), &AbstractCredentials::fetched,
SLOT(slotCredentialsFetched())); this, &Account::slotCredentialsFetched);
connect(_credentials.data(), SIGNAL(asked()), connect(_credentials.data(), &AbstractCredentials::asked,
SLOT(slotCredentialsAsked())); this, &Account::slotCredentialsAsked);
} }
QUrl Account::davUrl() const QUrl Account::davUrl() const
@ -213,8 +213,8 @@ void Account::resetNetworkAccessManager()
_am->setCookieJar(jar); // takes ownership of the old cookie jar _am->setCookieJar(jar); // takes ownership of the old cookie jar
connect(_am.data(), SIGNAL(sslErrors(QNetworkReply *, QList<QSslError>)), connect(_am.data(), SIGNAL(sslErrors(QNetworkReply *, QList<QSslError>)),
SLOT(slotHandleSslErrors(QNetworkReply *, QList<QSslError>))); SLOT(slotHandleSslErrors(QNetworkReply *, QList<QSslError>)));
connect(_am.data(), SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)), connect(_am.data(), &QNetworkAccessManager::proxyAuthenticationRequired,
SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *))); this, &Account::proxyAuthenticationRequired);
} }
QNetworkAccessManager *Account::networkAccessManager() QNetworkAccessManager *Account::networkAccessManager()

View file

@ -56,34 +56,34 @@ BandwidthManager::BandwidthManager(OwncloudPropagator *p)
_currentUploadLimit = _propagator->_uploadLimit.fetchAndAddAcquire(0); _currentUploadLimit = _propagator->_uploadLimit.fetchAndAddAcquire(0);
_currentDownloadLimit = _propagator->_downloadLimit.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.setInterval(10 * 1000);
_switchingTimer.start(); _switchingTimer.start();
QMetaObject::invokeMethod(this, "switchingTimerExpired", Qt::QueuedConnection); QMetaObject::invokeMethod(this, "switchingTimerExpired", Qt::QueuedConnection);
// absolute uploads/downloads // absolute uploads/downloads
QObject::connect(&_absoluteLimitTimer, SIGNAL(timeout()), this, SLOT(absoluteLimitTimerExpired())); QObject::connect(&_absoluteLimitTimer, &QTimer::timeout, this, &BandwidthManager::absoluteLimitTimerExpired);
_absoluteLimitTimer.setInterval(1000); _absoluteLimitTimer.setInterval(1000);
_absoluteLimitTimer.start(); _absoluteLimitTimer.start();
// Relative uploads // Relative uploads
QObject::connect(&_relativeUploadMeasuringTimer, SIGNAL(timeout()), QObject::connect(&_relativeUploadMeasuringTimer, &QTimer::timeout,
this, SLOT(relativeUploadMeasuringTimerExpired())); this, &BandwidthManager::relativeUploadMeasuringTimerExpired);
_relativeUploadMeasuringTimer.setInterval(relativeLimitMeasuringTimerIntervalMsec); _relativeUploadMeasuringTimer.setInterval(relativeLimitMeasuringTimerIntervalMsec);
_relativeUploadMeasuringTimer.start(); _relativeUploadMeasuringTimer.start();
_relativeUploadMeasuringTimer.setSingleShot(true); // will be restarted from the delay timer _relativeUploadMeasuringTimer.setSingleShot(true); // will be restarted from the delay timer
QObject::connect(&_relativeUploadDelayTimer, SIGNAL(timeout()), QObject::connect(&_relativeUploadDelayTimer, &QTimer::timeout,
this, SLOT(relativeUploadDelayTimerExpired())); this, &BandwidthManager::relativeUploadDelayTimerExpired);
_relativeUploadDelayTimer.setSingleShot(true); // will be restarted from the measuring timer _relativeUploadDelayTimer.setSingleShot(true); // will be restarted from the measuring timer
// Relative downloads // Relative downloads
QObject::connect(&_relativeDownloadMeasuringTimer, SIGNAL(timeout()), QObject::connect(&_relativeDownloadMeasuringTimer, &QTimer::timeout,
this, SLOT(relativeDownloadMeasuringTimerExpired())); this, &BandwidthManager::relativeDownloadMeasuringTimerExpired);
_relativeDownloadMeasuringTimer.setInterval(relativeLimitMeasuringTimerIntervalMsec); _relativeDownloadMeasuringTimer.setInterval(relativeLimitMeasuringTimerIntervalMsec);
_relativeDownloadMeasuringTimer.start(); _relativeDownloadMeasuringTimer.start();
_relativeDownloadMeasuringTimer.setSingleShot(true); // will be restarted from the delay timer _relativeDownloadMeasuringTimer.setSingleShot(true); // will be restarted from the delay timer
QObject::connect(&_relativeDownloadDelayTimer, SIGNAL(timeout()), QObject::connect(&_relativeDownloadDelayTimer, &QTimer::timeout,
this, SLOT(relativeDownloadDelayTimerExpired())); this, &BandwidthManager::relativeDownloadDelayTimerExpired);
_relativeDownloadDelayTimer.setSingleShot(true); // will be restarted from the measuring timer _relativeDownloadDelayTimer.setSingleShot(true); // will be restarted from the measuring timer
} }

View file

@ -116,9 +116,9 @@ void ConnectionValidator::slotCheckServerAndAuth()
CheckServerJob *checkJob = new CheckServerJob(_account, this); CheckServerJob *checkJob = new CheckServerJob(_account, this);
checkJob->setTimeout(timeoutToUseMsec); checkJob->setTimeout(timeoutToUseMsec);
checkJob->setIgnoreCredentialFailure(true); checkJob->setIgnoreCredentialFailure(true);
connect(checkJob, SIGNAL(instanceFound(QUrl, QJsonObject)), SLOT(slotStatusFound(QUrl, QJsonObject))); connect(checkJob, &CheckServerJob::instanceFound, this, &ConnectionValidator::slotStatusFound);
connect(checkJob, SIGNAL(instanceNotFound(QNetworkReply *)), SLOT(slotNoStatusFound(QNetworkReply *))); connect(checkJob, &CheckServerJob::instanceNotFound, this, &ConnectionValidator::slotNoStatusFound);
connect(checkJob, SIGNAL(timeout(QUrl)), SLOT(slotJobTimeout(QUrl))); connect(checkJob, &CheckServerJob::timeout, this, &ConnectionValidator::slotJobTimeout);
checkJob->start(); checkJob->start();
} }
@ -154,7 +154,7 @@ void ConnectionValidator::slotStatusFound(const QUrl &url, const QJsonObject &in
} }
// now check the authentication // 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!). // status.php could not be loaded (network or server issue!).
@ -201,8 +201,8 @@ void ConnectionValidator::checkAuthentication()
PropfindJob *job = new PropfindJob(_account, "/", this); PropfindJob *job = new PropfindJob(_account, "/", this);
job->setTimeout(timeoutToUseMsec); job->setTimeout(timeoutToUseMsec);
job->setProperties(QList<QByteArray>() << "getlastmodified"); job->setProperties(QList<QByteArray>() << "getlastmodified");
connect(job, SIGNAL(result(QVariantMap)), SLOT(slotAuthSuccess())); connect(job, &PropfindJob::result, this, &ConnectionValidator::slotAuthSuccess);
connect(job, SIGNAL(finishedWithError(QNetworkReply *)), SLOT(slotAuthFailed(QNetworkReply *))); connect(job, &PropfindJob::finishedWithError, this, &ConnectionValidator::slotAuthFailed);
job->start(); job->start();
} }
@ -249,7 +249,7 @@ void ConnectionValidator::checkServerCapabilities()
{ {
JsonApiJob *job = new JsonApiJob(_account, QLatin1String("ocs/v1.php/cloud/capabilities"), this); JsonApiJob *job = new JsonApiJob(_account, QLatin1String("ocs/v1.php/cloud/capabilities"), this);
job->setTimeout(timeoutToUseMsec); job->setTimeout(timeoutToUseMsec);
QObject::connect(job, SIGNAL(jsonReceived(QJsonDocument, int)), this, SLOT(slotCapabilitiesRecieved(QJsonDocument))); QObject::connect(job, &JsonApiJob::jsonReceived, this, &ConnectionValidator::slotCapabilitiesRecieved);
job->start(); job->start();
} }
@ -272,7 +272,7 @@ void ConnectionValidator::fetchUser()
{ {
JsonApiJob *job = new JsonApiJob(_account, QLatin1String("ocs/v1.php/cloud/user"), this); JsonApiJob *job = new JsonApiJob(_account, QLatin1String("ocs/v1.php/cloud/user"), this);
job->setTimeout(timeoutToUseMsec); job->setTimeout(timeoutToUseMsec);
QObject::connect(job, SIGNAL(jsonReceived(QJsonDocument, int)), this, SLOT(slotUserFetched(QJsonDocument))); QObject::connect(job, &JsonApiJob::jsonReceived, this, &ConnectionValidator::slotUserFetched);
job->start(); job->start();
} }
@ -312,7 +312,7 @@ void ConnectionValidator::slotUserFetched(const QJsonDocument &json)
AvatarJob *job = new AvatarJob(_account, this); AvatarJob *job = new AvatarJob(_account, this);
job->setTimeout(20 * 1000); job->setTimeout(20 * 1000);
QObject::connect(job, SIGNAL(avatarPixmap(QImage)), this, SLOT(slotAvatarImage(QImage))); QObject::connect(job, &AvatarJob::avatarPixmap, this, &ConnectionValidator::slotAvatarImage);
job->start(); job->start();
} }

View file

@ -147,8 +147,8 @@ QNetworkAccessManager *HttpCredentials::createQNAM() const
{ {
AccessManager *qnam = new HttpCredentialsAccessManager(this); AccessManager *qnam = new HttpCredentialsAccessManager(this);
connect(qnam, SIGNAL(authenticationRequired(QNetworkReply *, QAuthenticator *)), connect(qnam, &QNetworkAccessManager::authenticationRequired,
this, SLOT(slotAuthentication(QNetworkReply *, QAuthenticator *))); this, &HttpCredentials::slotAuthentication);
return qnam; return qnam;
} }
@ -198,7 +198,7 @@ void HttpCredentials::fetchFromKeychainHelper()
addSettingsToJob(_account, job); addSettingsToJob(_account, job);
job->setInsecureFallback(false); job->setInsecureFallback(false);
job->setKey(kck); job->setKey(kck);
connect(job, SIGNAL(finished(QKeychain::Job *)), SLOT(slotReadClientCertPEMJobDone(QKeychain::Job *))); connect(job, &Job::finished, this, &HttpCredentials::slotReadClientCertPEMJobDone);
job->start(); job->start();
} }
@ -238,7 +238,7 @@ void HttpCredentials::slotReadClientCertPEMJobDone(QKeychain::Job *incoming)
addSettingsToJob(_account, job); addSettingsToJob(_account, job);
job->setInsecureFallback(false); job->setInsecureFallback(false);
job->setKey(kck); job->setKey(kck);
connect(job, SIGNAL(finished(QKeychain::Job *)), SLOT(slotReadClientKeyPEMJobDone(QKeychain::Job *))); connect(job, &Job::finished, this, &HttpCredentials::slotReadClientKeyPEMJobDone);
job->start(); job->start();
} }
@ -273,7 +273,7 @@ void HttpCredentials::slotReadClientKeyPEMJobDone(QKeychain::Job *incoming)
addSettingsToJob(_account, job); addSettingsToJob(_account, job);
job->setInsecureFallback(false); job->setInsecureFallback(false);
job->setKey(kck); job->setKey(kck);
connect(job, SIGNAL(finished(QKeychain::Job *)), SLOT(slotReadJobDone(QKeychain::Job *))); connect(job, &Job::finished, this, &HttpCredentials::slotReadJobDone);
job->start(); job->start();
} }
@ -419,7 +419,7 @@ void HttpCredentials::invalidateToken()
// indirectly) from QNetworkAccessManagerPrivate::authenticationRequired, which itself // indirectly) from QNetworkAccessManagerPrivate::authenticationRequired, which itself
// is a called from a BlockingQueuedConnection from the Qt HTTP thread. And clearing the // is a called from a BlockingQueuedConnection from the Qt HTTP thread. And clearing the
// cache needs to synchronize again with the HTTP thread. // cache needs to synchronize again with the HTTP thread.
QTimer::singleShot(0, _account, SLOT(clearQNAMCache())); QTimer::singleShot(0, _account, &Account::clearQNAMCache);
} }
void HttpCredentials::forgetSensitiveData() void HttpCredentials::forgetSensitiveData()
@ -446,7 +446,7 @@ void HttpCredentials::persist()
WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName()); WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
addSettingsToJob(_account, job); addSettingsToJob(_account, job);
job->setInsecureFallback(false); 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->setKey(keychainKey(_account->url().toString(), _user + clientCertificatePEMC, _account->id()));
job->setBinaryData(_clientSslCertificate.toPem()); job->setBinaryData(_clientSslCertificate.toPem());
job->start(); job->start();
@ -459,7 +459,7 @@ void HttpCredentials::slotWriteClientCertPEMJobDone(Job *incomingJob)
WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName()); WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
addSettingsToJob(_account, job); addSettingsToJob(_account, job);
job->setInsecureFallback(false); 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->setKey(keychainKey(_account->url().toString(), _user + clientKeyPEMC, _account->id()));
job->setBinaryData(_clientSslKey.toPem()); job->setBinaryData(_clientSslKey.toPem());
job->start(); job->start();
@ -471,7 +471,7 @@ void HttpCredentials::slotWriteClientKeyPEMJobDone(Job *incomingJob)
WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName()); WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
addSettingsToJob(_account, job); addSettingsToJob(_account, job);
job->setInsecureFallback(false); 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->setKey(keychainKey(_account->url().toString(), _user, _account->id()));
job->setTextData(isUsingOAuth() ? _refreshToken : _password); job->setTextData(isUsingOAuth() ? _refreshToken : _password);
job->start(); job->start();

View file

@ -282,10 +282,10 @@ void DiscoverySingleDirectoryJob::start()
lsColJob->setProperties(props); lsColJob->setProperties(props);
QObject::connect(lsColJob, SIGNAL(directoryListingIterated(QString, QMap<QString, QString>)), QObject::connect(lsColJob, &LsColJob::directoryListingIterated,
this, SLOT(directoryListingIteratedSlot(QString, QMap<QString, QString>))); this, &DiscoverySingleDirectoryJob::directoryListingIteratedSlot);
QObject::connect(lsColJob, SIGNAL(finishedWithError(QNetworkReply *)), this, SLOT(lsJobFinishedWithErrorSlot(QNetworkReply *))); QObject::connect(lsColJob, &LsColJob::finishedWithError, this, &DiscoverySingleDirectoryJob::lsJobFinishedWithErrorSlot);
QObject::connect(lsColJob, SIGNAL(finishedWithoutError()), this, SLOT(lsJobFinishedWithoutErrorSlot())); QObject::connect(lsColJob, &LsColJob::finishedWithoutError, this, &DiscoverySingleDirectoryJob::lsJobFinishedWithoutErrorSlot);
lsColJob->start(); lsColJob->start();
_lsColJob = lsColJob; _lsColJob = lsColJob;
@ -469,11 +469,11 @@ void DiscoveryMainThread::setupHooks(DiscoveryJob *discoveryJob, const QString &
_discoveryJob = discoveryJob; _discoveryJob = discoveryJob;
_pathPrefix = pathPrefix; _pathPrefix = pathPrefix;
connect(discoveryJob, SIGNAL(doOpendirSignal(QString, DiscoveryDirectoryResult *)), connect(discoveryJob, &DiscoveryJob::doOpendirSignal,
this, SLOT(doOpendirSlot(QString, DiscoveryDirectoryResult *)), this, &DiscoveryMainThread::doOpendirSlot,
Qt::QueuedConnection); Qt::QueuedConnection);
connect(discoveryJob, SIGNAL(doGetSizeSignal(QString, qint64 *)), connect(discoveryJob, &DiscoveryJob::doGetSizeSignal,
this, SLOT(doGetSizeSlot(QString, qint64 *)), this, &DiscoveryMainThread::doGetSizeSlot,
Qt::QueuedConnection); Qt::QueuedConnection);
} }
@ -499,16 +499,16 @@ void DiscoveryMainThread::doOpendirSlot(const QString &subPath, DiscoveryDirecto
// Schedule the DiscoverySingleDirectoryJob // Schedule the DiscoverySingleDirectoryJob
_singleDirJob = new DiscoverySingleDirectoryJob(_account, fullPath, this); _singleDirJob = new DiscoverySingleDirectoryJob(_account, fullPath, this);
QObject::connect(_singleDirJob, SIGNAL(finishedWithResult()), QObject::connect(_singleDirJob.data(), &DiscoverySingleDirectoryJob::finishedWithResult,
this, SLOT(singleDirectoryJobResultSlot())); this, &DiscoveryMainThread::singleDirectoryJobResultSlot);
QObject::connect(_singleDirJob, SIGNAL(finishedWithError(int, QString)), QObject::connect(_singleDirJob.data(), &DiscoverySingleDirectoryJob::finishedWithError,
this, SLOT(singleDirectoryJobFinishedWithErrorSlot(int, QString))); this, &DiscoveryMainThread::singleDirectoryJobFinishedWithErrorSlot);
QObject::connect(_singleDirJob, SIGNAL(firstDirectoryPermissions(QString)), QObject::connect(_singleDirJob.data(), &DiscoverySingleDirectoryJob::firstDirectoryPermissions,
this, SLOT(singleDirectoryJobFirstDirectoryPermissionsSlot(QString))); this, &DiscoveryMainThread::singleDirectoryJobFirstDirectoryPermissionsSlot);
QObject::connect(_singleDirJob, SIGNAL(etagConcatenation(QString)), QObject::connect(_singleDirJob.data(), &DiscoverySingleDirectoryJob::etagConcatenation,
this, SIGNAL(etagConcatenation(QString))); this, &DiscoveryMainThread::etagConcatenation);
QObject::connect(_singleDirJob, SIGNAL(etag(QString)), QObject::connect(_singleDirJob.data(), &DiscoverySingleDirectoryJob::etag,
this, SIGNAL(etag(QString))); this, &DiscoveryMainThread::etag);
if (!_firstFolderProcessed) { if (!_firstFolderProcessed) {
_singleDirJob->setIsRootPath(); _singleDirJob->setIsRootPath();
@ -584,10 +584,10 @@ void DiscoveryMainThread::doGetSizeSlot(const QString &path, qint64 *result)
auto propfindJob = new PropfindJob(_account, fullPath, this); auto propfindJob = new PropfindJob(_account, fullPath, this);
propfindJob->setProperties(QList<QByteArray>() << "resourcetype" propfindJob->setProperties(QList<QByteArray>() << "resourcetype"
<< "http://owncloud.org/ns:size"); << "http://owncloud.org/ns:size");
QObject::connect(propfindJob, SIGNAL(finishedWithError()), QObject::connect(propfindJob, &PropfindJob::finishedWithError,
this, SLOT(slotGetSizeFinishedWithError())); this, &DiscoveryMainThread::slotGetSizeFinishedWithError);
QObject::connect(propfindJob, SIGNAL(result(QVariantMap)), QObject::connect(propfindJob, &PropfindJob::result,
this, SLOT(slotGetSizeResult(QVariantMap))); this, &DiscoveryMainThread::slotGetSizeResult);
propfindJob->start(); propfindJob->start();
} }

View file

@ -362,14 +362,14 @@ bool LsColJob::finished()
int httpCode = reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); int httpCode = reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if (httpCode == 207 && contentType.contains("application/xml; charset=utf-8")) { if (httpCode == 207 && contentType.contains("application/xml; charset=utf-8")) {
LsColXMLParser parser; LsColXMLParser parser;
connect(&parser, SIGNAL(directoryListingSubfolders(const QStringList &)), connect(&parser, &LsColXMLParser::directoryListingSubfolders,
this, SIGNAL(directoryListingSubfolders(const QStringList &))); this, &LsColJob::directoryListingSubfolders);
connect(&parser, SIGNAL(directoryListingIterated(const QString &, const QMap<QString, QString> &)), connect(&parser, &LsColXMLParser::directoryListingIterated,
this, SIGNAL(directoryListingIterated(const QString &, const QMap<QString, QString> &))); this, &LsColJob::directoryListingIterated);
connect(&parser, SIGNAL(finishedWithError(QNetworkReply *)), connect(&parser, &LsColXMLParser::finishedWithError,
this, SIGNAL(finishedWithError(QNetworkReply *))); this, &LsColJob::finishedWithError);
connect(&parser, SIGNAL(finishedWithoutError()), connect(&parser, &LsColXMLParser::finishedWithoutError,
this, SIGNAL(finishedWithoutError())); this, &LsColJob::finishedWithoutError);
QString expectedPath = reply()->request().url().path(); // something like "/owncloud/remote.php/webdav/folder" QString expectedPath = reply()->request().url().path(); // something like "/owncloud/remote.php/webdav/folder"
if (!parser.parse(reply()->readAll(), &_sizes, expectedPath)) { if (!parser.parse(reply()->readAll(), &_sizes, expectedPath)) {
@ -400,16 +400,16 @@ CheckServerJob::CheckServerJob(AccountPtr account, QObject *parent)
, _permanentRedirects(0) , _permanentRedirects(0)
{ {
setIgnoreCredentialFailure(true); setIgnoreCredentialFailure(true);
connect(this, SIGNAL(redirected(QNetworkReply *, QUrl, int)), connect(this, &AbstractNetworkJob::redirected,
SLOT(slotRedirected(QNetworkReply *, QUrl, int))); this, &CheckServerJob::slotRedirected);
} }
void CheckServerJob::start() void CheckServerJob::start()
{ {
_serverUrl = account()->url(); _serverUrl = account()->url();
sendRequest("GET", Utility::concatUrlPath(_serverUrl, path())); sendRequest("GET", Utility::concatUrlPath(_serverUrl, path()));
connect(reply(), SIGNAL(metaDataChanged()), this, SLOT(metaDataChangedSlot())); connect(reply(), &QNetworkReply::metaDataChanged, this, &CheckServerJob::metaDataChangedSlot);
connect(reply(), SIGNAL(encrypted()), this, SLOT(encryptedSlot())); connect(reply(), &QNetworkReply::encrypted, this, &CheckServerJob::encryptedSlot);
AbstractNetworkJob::start(); AbstractNetworkJob::start();
} }

View file

@ -331,8 +331,8 @@ bool PropagateItemJob::checkForProblemsWithShared(int httpStatusCode, const QStr
if (newJob) { if (newJob) {
newJob->setRestoreJobMsg(msg); newJob->setRestoreJobMsg(msg);
_restoreJob.reset(newJob); _restoreJob.reset(newJob);
connect(_restoreJob.data(), SIGNAL(finished(SyncFileItem::Status)), connect(_restoreJob.data(), &PropagatorJob::finished,
this, SLOT(slotRestoreJobFinished(SyncFileItem::Status))); this, &PropagateItemJob::slotRestoreJobFinished);
QMetaObject::invokeMethod(newJob, "start"); QMetaObject::invokeMethod(newJob, "start");
} }
return true; return true;
@ -521,7 +521,7 @@ void OwncloudPropagator::start(const SyncFileItemVector &items)
_rootJob->appendJob(it); _rootJob->appendJob(it);
} }
connect(_rootJob.data(), SIGNAL(finished(SyncFileItem::Status)), this, SLOT(emitFinished(SyncFileItem::Status))); connect(_rootJob.data(), &PropagatorJob::finished, this, &OwncloudPropagator::emitFinished);
scheduleNextJob(); scheduleNextJob();
} }
@ -654,7 +654,7 @@ QString OwncloudPropagator::getFilePath(const QString &tmp_file_name) const
void OwncloudPropagator::scheduleNextJob() void OwncloudPropagator::scheduleNextJob()
{ {
QTimer::singleShot(0, this, SLOT(scheduleNextJobImpl())); QTimer::singleShot(0, this, &OwncloudPropagator::scheduleNextJobImpl);
} }
void OwncloudPropagator::scheduleNextJobImpl() void OwncloudPropagator::scheduleNextJobImpl()
@ -854,9 +854,9 @@ PropagateDirectory::PropagateDirectory(OwncloudPropagator *propagator, const Syn
, _subJobs(propagator) , _subJobs(propagator)
{ {
if (_firstJob) { 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() PropagatorJob::JobParallelism PropagateDirectory::parallelism()
@ -968,7 +968,7 @@ void CleanupPollsJob::start()
if (record.isValid()) { if (record.isValid()) {
SyncFileItemPtr item = SyncFileItem::fromSyncJournalFileRecord(record); SyncFileItemPtr item = SyncFileItem::fromSyncJournalFileRecord(record);
PollJob *job = new PollJob(_account, info._url, item, _journal, _localPath, this); 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(); job->start();
} }
} }

View file

@ -221,7 +221,7 @@ private slots:
bool possiblyRunNextJob(PropagatorJob *next) bool possiblyRunNextJob(PropagatorJob *next)
{ {
if (next->_state == NotYetStarted) { 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(); return next->scheduleSelfOrChild();
} }

View file

@ -130,7 +130,7 @@ void ProgressDispatcher::setProgressInfo(const QString &folder, const ProgressIn
ProgressInfo::ProgressInfo() ProgressInfo::ProgressInfo()
{ {
connect(&_updateEstimatesTimer, SIGNAL(timeout()), SLOT(updateEstimates())); connect(&_updateEstimatesTimer, &QTimer::timeout, this, &ProgressInfo::updateEstimates);
reset(); reset();
} }

View file

@ -137,10 +137,10 @@ void GETFileJob::start()
qCWarning(lcGetJob) << " Network error: " << errorString(); qCWarning(lcGetJob) << " Network error: " << errorString();
} }
connect(reply(), SIGNAL(metaDataChanged()), this, SLOT(slotMetaDataChanged())); connect(reply(), &QNetworkReply::metaDataChanged, this, &GETFileJob::slotMetaDataChanged);
connect(reply(), SIGNAL(readyRead()), this, SLOT(slotReadyRead())); connect(reply(), &QIODevice::readyRead, this, &GETFileJob::slotReadyRead);
connect(reply(), SIGNAL(downloadProgress(qint64, qint64)), this, SIGNAL(downloadProgress(qint64, qint64))); connect(reply(), &QNetworkReply::downloadProgress, this, &GETFileJob::downloadProgress);
connect(this, SIGNAL(networkActivity()), account().data(), SIGNAL(propagatorNetworkActivity())); connect(this, &AbstractNetworkJob::networkActivity, account().data(), &Account::propagatorNetworkActivity);
AbstractNetworkJob::start(); AbstractNetworkJob::start();
} }
@ -356,8 +356,8 @@ void PropagateDownloadFile::start()
qCDebug(lcPropagateDownload) << _item->_file << "may not need download, computing checksum"; qCDebug(lcPropagateDownload) << _item->_file << "may not need download, computing checksum";
auto computeChecksum = new ComputeChecksum(this); auto computeChecksum = new ComputeChecksum(this);
computeChecksum->setChecksumType(parseChecksumHeaderType(_item->_checksumHeader)); computeChecksum->setChecksumType(parseChecksumHeaderType(_item->_checksumHeader));
connect(computeChecksum, SIGNAL(done(QByteArray, QByteArray)), connect(computeChecksum, &ComputeChecksum::done,
SLOT(conflictChecksumComputed(QByteArray, QByteArray))); this, &PropagateDownloadFile::conflictChecksumComputed);
computeChecksum->start(propagator()->getFilePath(_item->_file)); computeChecksum->start(propagator()->getFilePath(_item->_file));
return; return;
} }
@ -478,8 +478,8 @@ void PropagateDownloadFile::startDownload()
&_tmpFile, headers, expectedEtagForResume, _resumeStart, this); &_tmpFile, headers, expectedEtagForResume, _resumeStart, this);
} }
_job->setBandwidthManager(&propagator()->_bandwidthManager); _job->setBandwidthManager(&propagator()->_bandwidthManager);
connect(_job, SIGNAL(finishedSignal()), this, SLOT(slotGetFinished())); connect(_job.data(), &GETFileJob::finishedSignal, this, &PropagateDownloadFile::slotGetFinished);
connect(_job, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(slotDownloadProgress(qint64, qint64))); connect(_job.data(), &GETFileJob::downloadProgress, this, &PropagateDownloadFile::slotDownloadProgress);
propagator()->_activeJobList.append(this); propagator()->_activeJobList.append(this);
_job->start(); _job->start();
} }
@ -620,10 +620,10 @@ void PropagateDownloadFile::slotGetFinished()
// will also emit the validated() signal to continue the flow in slot transmissionChecksumValidated() // will also emit the validated() signal to continue the flow in slot transmissionChecksumValidated()
// as this is (still) also correct. // as this is (still) also correct.
ValidateChecksumHeader *validator = new ValidateChecksumHeader(this); ValidateChecksumHeader *validator = new ValidateChecksumHeader(this);
connect(validator, SIGNAL(validated(QByteArray, QByteArray)), connect(validator, &ValidateChecksumHeader::validated,
SLOT(transmissionChecksumValidated(QByteArray, QByteArray))); this, &PropagateDownloadFile::transmissionChecksumValidated);
connect(validator, SIGNAL(validationFailed(QString)), connect(validator, &ValidateChecksumHeader::validationFailed,
SLOT(slotChecksumFail(QString))); this, &PropagateDownloadFile::slotChecksumFail);
auto checksumHeader = job->reply()->rawHeader(checkSumHeaderC); auto checksumHeader = job->reply()->rawHeader(checkSumHeaderC);
validator->start(_tmpFile.fileName(), checksumHeader); validator->start(_tmpFile.fileName(), checksumHeader);
} }
@ -750,8 +750,8 @@ void PropagateDownloadFile::transmissionChecksumValidated(const QByteArray &chec
auto computeChecksum = new ComputeChecksum(this); auto computeChecksum = new ComputeChecksum(this);
computeChecksum->setChecksumType(theContentChecksumType); computeChecksum->setChecksumType(theContentChecksumType);
connect(computeChecksum, SIGNAL(done(QByteArray, QByteArray)), connect(computeChecksum, &ComputeChecksum::done,
SLOT(contentChecksumComputed(QByteArray, QByteArray))); this, &PropagateDownloadFile::contentChecksumComputed);
computeChecksum->start(_tmpFile.fileName()); computeChecksum->start(_tmpFile.fileName());
} }

View file

@ -70,7 +70,7 @@ void PropagateRemoteDelete::start()
_job = new DeleteJob(propagator()->account(), _job = new DeleteJob(propagator()->account(),
propagator()->_remoteFolder + _item->_file, propagator()->_remoteFolder + _item->_file,
this); this);
connect(_job, SIGNAL(finishedSignal()), this, SLOT(slotDeleteJobFinished())); connect(_job.data(), &DeleteJob::finishedSignal, this, &PropagateRemoteDelete::slotDeleteJobFinished);
propagator()->_activeJobList.append(this); propagator()->_activeJobList.append(this);
_job->start(); _job->start();
} }

View file

@ -111,8 +111,8 @@ void PropagateRemoteMkdir::slotMkcolJobFinished()
auto propfindJob = new PropfindJob(_job->account(), _job->path(), this); auto propfindJob = new PropfindJob(_job->account(), _job->path(), this);
propfindJob->setProperties(QList<QByteArray>() << "getetag" propfindJob->setProperties(QList<QByteArray>() << "getetag"
<< "http://owncloud.org/ns:id"); << "http://owncloud.org/ns:id");
QObject::connect(propfindJob, SIGNAL(result(QVariantMap)), this, SLOT(propfindResult(QVariantMap))); QObject::connect(propfindJob, &PropfindJob::result, this, &PropagateRemoteMkdir::propfindResult);
QObject::connect(propfindJob, SIGNAL(finishedWithError()), this, SLOT(propfindError())); QObject::connect(propfindJob, &PropfindJob::finishedWithError, this, &PropagateRemoteMkdir::propfindError);
propfindJob->start(); propfindJob->start();
_job = propfindJob; _job = propfindJob;
return; return;

View file

@ -112,7 +112,7 @@ void PropagateRemoteMove::start()
_job = new MoveJob(propagator()->account(), _job = new MoveJob(propagator()->account(),
propagator()->_remoteFolder + _item->_file, propagator()->_remoteFolder + _item->_file,
destination, this); destination, this);
connect(_job, SIGNAL(finishedSignal()), this, SLOT(slotMoveJobFinished())); connect(_job.data(), &MoveJob::finishedSignal, this, &PropagateRemoteMove::slotMoveJobFinished);
propagator()->_activeJobList.append(this); propagator()->_activeJobList.append(this);
_job->start(); _job->start();
} }

View file

@ -85,8 +85,8 @@ void PUTFileJob::start()
qCWarning(lcPutJob) << " Network error: " << reply()->errorString(); qCWarning(lcPutJob) << " Network error: " << reply()->errorString();
} }
connect(reply(), SIGNAL(uploadProgress(qint64, qint64)), this, SIGNAL(uploadProgress(qint64, qint64))); connect(reply(), &QNetworkReply::uploadProgress, this, &PUTFileJob::uploadProgress);
connect(this, SIGNAL(networkActivity()), account().data(), SIGNAL(propagatorNetworkActivity())); connect(this, &AbstractNetworkJob::networkActivity, account().data(), &Account::propagatorNetworkActivity);
_requestTimer.start(); _requestTimer.start();
AbstractNetworkJob::start(); AbstractNetworkJob::start();
} }
@ -98,7 +98,7 @@ void PollJob::start()
QUrl finalUrl = QUrl::fromUserInput(accountUrl.scheme() + QLatin1String("://") + accountUrl.authority() QUrl finalUrl = QUrl::fromUserInput(accountUrl.scheme() + QLatin1String("://") + accountUrl.authority()
+ (path().startsWith('/') ? QLatin1String("") : QLatin1String("/")) + path()); + (path().startsWith('/') ? QLatin1String("") : QLatin1String("/")) + path());
sendRequest("GET", finalUrl); sendRequest("GET", finalUrl);
connect(reply(), SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(resetTimeout())); connect(reply(), &QNetworkReply::downloadProgress, this, &AbstractNetworkJob::resetTimeout);
AbstractNetworkJob::start(); AbstractNetworkJob::start();
} }
@ -197,8 +197,8 @@ void PropagateUploadFileCommon::start()
propagator()->_remoteFolder + _item->_file, propagator()->_remoteFolder + _item->_file,
this); this);
_jobs.append(job); _jobs.append(job);
connect(job, SIGNAL(finishedSignal()), SLOT(slotComputeContentChecksum())); connect(job, &DeleteJob::finishedSignal, this, &PropagateUploadFileCommon::slotComputeContentChecksum);
connect(job, SIGNAL(destroyed(QObject *)), SLOT(slotJobDestroyed(QObject *))); connect(job, &QObject::destroyed, this, &PropagateUploadFileCommon::slotJobDestroyed);
job->start(); job->start();
} }
@ -232,10 +232,10 @@ void PropagateUploadFileCommon::slotComputeContentChecksum()
auto computeChecksum = new ComputeChecksum(this); auto computeChecksum = new ComputeChecksum(this);
computeChecksum->setChecksumType(checksumType); computeChecksum->setChecksumType(checksumType);
connect(computeChecksum, SIGNAL(done(QByteArray, QByteArray)), connect(computeChecksum, &ComputeChecksum::done,
SLOT(slotComputeTransmissionChecksum(QByteArray, QByteArray))); this, &PropagateUploadFileCommon::slotComputeTransmissionChecksum);
connect(computeChecksum, SIGNAL(done(QByteArray, QByteArray)), connect(computeChecksum, &ComputeChecksum::done,
computeChecksum, SLOT(deleteLater())); computeChecksum, &QObject::deleteLater);
computeChecksum->start(filePath); computeChecksum->start(filePath);
} }
@ -264,10 +264,10 @@ void PropagateUploadFileCommon::slotComputeTransmissionChecksum(const QByteArray
computeChecksum->setChecksumType(QByteArray()); computeChecksum->setChecksumType(QByteArray());
} }
connect(computeChecksum, SIGNAL(done(QByteArray, QByteArray)), connect(computeChecksum, &ComputeChecksum::done,
SLOT(slotStartUpload(QByteArray, QByteArray))); this, &PropagateUploadFileCommon::slotStartUpload);
connect(computeChecksum, SIGNAL(done(QByteArray, QByteArray)), connect(computeChecksum, &ComputeChecksum::done,
computeChecksum, SLOT(deleteLater())); computeChecksum, &QObject::deleteLater);
const QString filePath = propagator()->getFilePath(_item->_file); const QString filePath = propagator()->getFilePath(_item->_file);
computeChecksum->start(filePath); computeChecksum->start(filePath);
} }
@ -465,7 +465,7 @@ void PropagateUploadFileCommon::startPollJob(const QString &path)
{ {
PollJob *job = new PollJob(propagator()->account(), path, _item, PollJob *job = new PollJob(propagator()->account(), path, _item,
propagator()->_journal, propagator()->_localDir, this); propagator()->_journal, propagator()->_localDir, this);
connect(job, SIGNAL(finishedSignal()), SLOT(slotPollFinished())); connect(job, &PollJob::finishedSignal, this, &PropagateUploadFileCommon::slotPollFinished);
SyncJournalDb::PollInfo info; SyncJournalDb::PollInfo info;
info._file = _item->_file; info._file = _item->_file;
info._url = path; info._url = path;

View file

@ -90,12 +90,12 @@ void PropagateUploadFileNG::doStartUpload()
_jobs.append(job); _jobs.append(job);
job->setProperties(QList<QByteArray>() << "resourcetype" job->setProperties(QList<QByteArray>() << "resourcetype"
<< "getcontentlength"); << "getcontentlength");
connect(job, SIGNAL(finishedWithoutError()), this, SLOT(slotPropfindFinished())); connect(job, &LsColJob::finishedWithoutError, this, &PropagateUploadFileNG::slotPropfindFinished);
connect(job, SIGNAL(finishedWithError(QNetworkReply *)), connect(job, &LsColJob::finishedWithError,
this, SLOT(slotPropfindFinishedWithError())); this, &PropagateUploadFileNG::slotPropfindFinishedWithError);
connect(job, SIGNAL(destroyed(QObject *)), this, SLOT(slotJobDestroyed(QObject *))); connect(job, &QObject::destroyed, this, &PropagateUploadFileCommon::slotJobDestroyed);
connect(job, SIGNAL(directoryListingIterated(QString, QMap<QString, QString>)), connect(job, &LsColJob::directoryListingIterated,
this, SLOT(slotPropfindIterate(QString, QMap<QString, QString>))); this, &PropagateUploadFileNG::slotPropfindIterate);
job->start(); job->start();
return; return;
} else if (progressInfo._valid) { } 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. // 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) { for (auto it = _serverChunks.begin(); it != _serverChunks.end(); ++it) {
auto job = new DeleteJob(propagator()->account(), Utility::concatUrlPath(chunkUrl(), it->originalName), this); 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); _jobs.append(job);
job->start(); job->start();
} }
@ -238,7 +238,7 @@ void PropagateUploadFileNG::startNewUpload()
connect(job, SIGNAL(finished(QNetworkReply::NetworkError)), connect(job, SIGNAL(finished(QNetworkReply::NetworkError)),
this, SLOT(slotMkColFinished(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(); job->start();
} }
@ -292,8 +292,8 @@ void PropagateUploadFileNG::startNextChunk()
auto job = new MoveJob(propagator()->account(), Utility::concatUrlPath(chunkUrl(), "/.file"), auto job = new MoveJob(propagator()->account(), Utility::concatUrlPath(chunkUrl(), "/.file"),
destination, headers, this); destination, headers, this);
_jobs.append(job); _jobs.append(job);
connect(job, SIGNAL(finishedSignal()), this, SLOT(slotMoveJobFinished())); connect(job, &MoveJob::finishedSignal, this, &PropagateUploadFileNG::slotMoveJobFinished);
connect(job, SIGNAL(destroyed(QObject *)), this, SLOT(slotJobDestroyed(QObject *))); connect(job, &QObject::destroyed, this, &PropagateUploadFileCommon::slotJobDestroyed);
propagator()->_activeJobList.append(this); propagator()->_activeJobList.append(this);
job->start(); job->start();
return; return;
@ -324,12 +324,12 @@ void PropagateUploadFileNG::startNextChunk()
// job takes ownership of device via a QScopedPointer. Job deletes itself when finishing // job takes ownership of device via a QScopedPointer. Job deletes itself when finishing
PUTFileJob *job = new PUTFileJob(propagator()->account(), url, device, headers, _currentChunk, this); PUTFileJob *job = new PUTFileJob(propagator()->account(), url, device, headers, _currentChunk, this);
_jobs.append(job); _jobs.append(job);
connect(job, SIGNAL(finishedSignal()), this, SLOT(slotPutFinished())); connect(job, &PUTFileJob::finishedSignal, this, &PropagateUploadFileNG::slotPutFinished);
connect(job, SIGNAL(uploadProgress(qint64, qint64)), connect(job, &PUTFileJob::uploadProgress,
this, SLOT(slotUploadProgress(qint64, qint64))); this, &PropagateUploadFileNG::slotUploadProgress);
connect(job, SIGNAL(uploadProgress(qint64, qint64)), connect(job, SIGNAL(uploadProgress(qint64, qint64)),
device, SLOT(slotJobUploadProgress(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(); job->start();
propagator()->_activeJobList.append(this); propagator()->_activeJobList.append(this);
_currentChunk++; _currentChunk++;

View file

@ -126,10 +126,10 @@ void PropagateUploadFileV1::startNextChunk()
// job takes ownership of device via a QScopedPointer. Job deletes itself when finishing // 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); PUTFileJob *job = new PUTFileJob(propagator()->account(), propagator()->_remoteFolder + path, device, headers, _currentChunk, this);
_jobs.append(job); _jobs.append(job);
connect(job, SIGNAL(finishedSignal()), this, SLOT(slotPutFinished())); connect(job, &PUTFileJob::finishedSignal, this, &PropagateUploadFileV1::slotPutFinished);
connect(job, SIGNAL(uploadProgress(qint64, qint64)), this, SLOT(slotUploadProgress(qint64, qint64))); connect(job, &PUTFileJob::uploadProgress, this, &PropagateUploadFileV1::slotUploadProgress);
connect(job, SIGNAL(uploadProgress(qint64, qint64)), device, SLOT(slotJobUploadProgress(qint64, qint64))); 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(); job->start();
propagator()->_activeJobList.append(this); propagator()->_activeJobList.append(this);
_currentChunk++; _currentChunk++;

View file

@ -95,7 +95,7 @@ SyncEngine::SyncEngine(AccountPtr account, const QString &localPath,
_clearTouchedFilesTimer.setSingleShot(true); _clearTouchedFilesTimer.setSingleShot(true);
_clearTouchedFilesTimer.setInterval(30 * 1000); _clearTouchedFilesTimer.setInterval(30 * 1000);
connect(&_clearTouchedFilesTimer, SIGNAL(timeout()), SLOT(slotClearTouchedFiles())); connect(&_clearTouchedFilesTimer, &QTimer::timeout, this, &SyncEngine::slotClearTouchedFiles);
_thread.setObjectName("SyncEngine_Thread"); _thread.setObjectName("SyncEngine_Thread");
} }
@ -731,8 +731,8 @@ void SyncEngine::startSync()
qCInfo(lcEngine) << "Finish Poll jobs before starting a sync"; qCInfo(lcEngine) << "Finish Poll jobs before starting a sync";
CleanupPollsJob *job = new CleanupPollsJob(pollInfos, _account, CleanupPollsJob *job = new CleanupPollsJob(pollInfos, _account,
_journal, _localPath, this); _journal, _localPath, this);
connect(job, SIGNAL(finished()), this, SLOT(startSync())); connect(job, &CleanupPollsJob::finished, this, &SyncEngine::startSync);
connect(job, SIGNAL(aborted(QString)), this, SLOT(slotCleanPollsJobAborted(QString))); connect(job, &CleanupPollsJob::aborted, this, &SyncEngine::slotCleanPollsJobAborted);
job->start(); job->start();
return; return;
} }
@ -845,13 +845,13 @@ void SyncEngine::startSync()
_discoveryMainThread = new DiscoveryMainThread(account()); _discoveryMainThread = new DiscoveryMainThread(account());
_discoveryMainThread->setParent(this); _discoveryMainThread->setParent(this);
connect(this, SIGNAL(finished(bool)), _discoveryMainThread, SLOT(deleteLater())); connect(this, &SyncEngine::finished, _discoveryMainThread.data(), &QObject::deleteLater);
qCInfo(lcEngine) << "Server" << account()->serverVersion() qCInfo(lcEngine) << "Server" << account()->serverVersion()
<< (account()->isHttp2Supported() ? "Using HTTP/2" : ""); << (account()->isHttp2Supported() ? "Using HTTP/2" : "");
if (account()->rootEtagChangesNotOnlySubFolderEtags()) { if (account()->rootEtagChangesNotOnlySubFolderEtags()) {
connect(_discoveryMainThread, SIGNAL(etag(QString)), this, SLOT(slotRootEtagReceived(QString))); connect(_discoveryMainThread.data(), &DiscoveryMainThread::etag, this, &SyncEngine::slotRootEtagReceived);
} else { } 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()); DiscoveryJob *discoveryJob = new DiscoveryJob(_csync_ctx.data());
@ -868,12 +868,12 @@ void SyncEngine::startSync()
discoveryJob->_syncOptions = _syncOptions; discoveryJob->_syncOptions = _syncOptions;
discoveryJob->moveToThread(&_thread); discoveryJob->moveToThread(&_thread);
connect(discoveryJob, SIGNAL(finished(int)), this, SLOT(slotDiscoveryJobFinished(int))); connect(discoveryJob, &DiscoveryJob::finished, this, &SyncEngine::slotDiscoveryJobFinished);
connect(discoveryJob, SIGNAL(folderDiscovered(bool, QString)), connect(discoveryJob, &DiscoveryJob::folderDiscovered,
this, SLOT(slotFolderDiscovered(bool, QString))); this, &SyncEngine::slotFolderDiscovered);
connect(discoveryJob, SIGNAL(newBigFolder(QString, bool)), connect(discoveryJob, &DiscoveryJob::newBigFolder,
this, SIGNAL(newBigFolder(QString, bool))); this, &SyncEngine::newBigFolder);
// This is used for the DiscoveryJob to be able to request the main thread/ // 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>( _propagator = QSharedPointer<OwncloudPropagator>(
new OwncloudPropagator(_account, _localPath, _remotePath, _journal)); new OwncloudPropagator(_account, _localPath, _remotePath, _journal));
_propagator->setSyncOptions(_syncOptions); _propagator->setSyncOptions(_syncOptions);
connect(_propagator.data(), SIGNAL(itemCompleted(const SyncFileItemPtr &)), connect(_propagator.data(), &OwncloudPropagator::itemCompleted,
this, SLOT(slotItemCompleted(const SyncFileItemPtr &))); this, &SyncEngine::slotItemCompleted);
connect(_propagator.data(), SIGNAL(progress(const SyncFileItem &, quint64)), connect(_propagator.data(), &OwncloudPropagator::progress,
this, SLOT(slotProgress(const SyncFileItem &, quint64))); this, &SyncEngine::slotProgress);
connect(_propagator.data(), SIGNAL(finished(bool)), this, SLOT(slotFinished(bool)), Qt::QueuedConnection); connect(_propagator.data(), &OwncloudPropagator::finished, this, &SyncEngine::slotFinished, Qt::QueuedConnection);
connect(_propagator.data(), SIGNAL(seenLockedFile(QString)), SIGNAL(seenLockedFile(QString))); connect(_propagator.data(), &OwncloudPropagator::seenLockedFile, this, &SyncEngine::seenLockedFile);
connect(_propagator.data(), SIGNAL(touchedFile(QString)), SLOT(slotAddTouchedFile(QString))); connect(_propagator.data(), &OwncloudPropagator::touchedFile, this, &SyncEngine::slotAddTouchedFile);
connect(_propagator.data(), SIGNAL(insufficientLocalStorage()), SLOT(slotInsufficientLocalStorage())); connect(_propagator.data(), &OwncloudPropagator::insufficientLocalStorage, this, &SyncEngine::slotInsufficientLocalStorage);
connect(_propagator.data(), SIGNAL(insufficientRemoteStorage()), SLOT(slotInsufficientRemoteStorage())); connect(_propagator.data(), &OwncloudPropagator::insufficientRemoteStorage, this, &SyncEngine::slotInsufficientRemoteStorage);
// apply the network limits to the propagator // apply the network limits to the propagator
setNetworkLimits(_uploadLimit, _downloadLimit); setNetworkLimits(_uploadLimit, _downloadLimit);

View file

@ -111,13 +111,13 @@ static inline bool showWarningInSocketApi(const SyncFileItem &item)
SyncFileStatusTracker::SyncFileStatusTracker(SyncEngine *syncEngine) SyncFileStatusTracker::SyncFileStatusTracker(SyncEngine *syncEngine)
: _syncEngine(syncEngine) : _syncEngine(syncEngine)
{ {
connect(syncEngine, SIGNAL(aboutToPropagate(SyncFileItemVector &)), connect(syncEngine, &SyncEngine::aboutToPropagate,
SLOT(slotAboutToPropagate(SyncFileItemVector &))); this, &SyncFileStatusTracker::slotAboutToPropagate);
connect(syncEngine, SIGNAL(itemCompleted(const SyncFileItemPtr &)), connect(syncEngine, &SyncEngine::itemCompleted,
SLOT(slotItemCompleted(const SyncFileItemPtr &))); this, &SyncFileStatusTracker::slotItemCompleted);
connect(syncEngine, SIGNAL(finished(bool)), SLOT(slotSyncFinished())); connect(syncEngine, &SyncEngine::finished, this, &SyncFileStatusTracker::slotSyncFinished);
connect(syncEngine, SIGNAL(started()), SLOT(slotSyncEngineRunningChanged())); connect(syncEngine, &SyncEngine::started, this, &SyncFileStatusTracker::slotSyncEngineRunningChanged);
connect(syncEngine, SIGNAL(finished(bool)), SLOT(slotSyncEngineRunningChanged())); connect(syncEngine, &SyncEngine::finished, this, &SyncFileStatusTracker::slotSyncEngineRunningChanged);
} }
SyncFileStatus SyncFileStatusTracker::fileStatus(const QString &relativePath) SyncFileStatus SyncFileStatusTracker::fileStatus(const QString &relativePath)