From 6ec69a700d5b1eb6eb99b9ee16a85f2e29b50204 Mon Sep 17 00:00:00 2001 From: Michael Schuster Date: Fri, 29 May 2020 20:57:52 +0200 Subject: [PATCH] ShareDialog: Pointer cosmetics Signed-off-by: Michael Schuster --- src/gui/sharedialog.cpp | 11 ++++++----- src/gui/sharedialog.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp index 7a47e0621..7064a8ffd 100644 --- a/src/gui/sharedialog.cpp +++ b/src/gui/sharedialog.cpp @@ -145,7 +145,8 @@ void ShareDialog::addLinkShareWidget(const QSharedPointer &linkShare) connect(linkShare.data(), &Share::serverError, _linkWidgetList.at(index), &ShareLinkWidget::slotServerError); connect(linkShare.data(), &Share::shareDeleted, _linkWidgetList.at(index), &ShareLinkWidget::slotDeleteShareFetched); - if(_manager != nullptr) { + + if(_manager) { connect(_manager, &ShareManager::linkShareRequiresPassword, _linkWidgetList.at(index), &ShareLinkWidget::slotCreateShareRequiresPassword); connect(_manager, &ShareManager::serverError, _linkWidgetList.at(index), &ShareLinkWidget::slotServerError); } @@ -293,7 +294,7 @@ void ShareDialog::showSharingUi() } if (theme->linkSharing()) { - if(_manager != nullptr) { + if(_manager) { _manager->fetchShares(_sharePath); } } @@ -301,7 +302,7 @@ void ShareDialog::showSharingUi() void ShareDialog::slotCreateLinkShare() { - if(_manager != nullptr) { + if(_manager) { _manager->createLinkShare(_sharePath, QString(), QString()); } } @@ -321,7 +322,7 @@ void ShareDialog::slotLinkShareRequiresPassword() return; } - if(_manager != nullptr) { + if(_manager) { // Try to create the link share again with the newly entered password _manager->createLinkShare(_sharePath, QString(), password); } @@ -355,7 +356,7 @@ void ShareDialog::slotAccountStateChanged(int state) bool enabled = (state == AccountState::State::Connected); qCDebug(lcSharing) << "Account connected?" << enabled; - if (_userGroupWidget != nullptr) { + if (_userGroupWidget) { _userGroupWidget->setEnabled(enabled); } diff --git a/src/gui/sharedialog.h b/src/gui/sharedialog.h index 7f03e29be..019f316a7 100644 --- a/src/gui/sharedialog.h +++ b/src/gui/sharedialog.h @@ -90,7 +90,7 @@ private: ShareDialogStartPage _startPage; ShareManager *_manager = nullptr; - QList _linkWidgetList = {}; + QList _linkWidgetList; ShareLinkWidget* _emptyShareLinkWidget = nullptr; ShareUserGroupWidget *_userGroupWidget = nullptr; QProgressIndicator *_progressIndicator = nullptr; -- 2.30.2