Merge pull request #2541 from nicolasfella/work/nullptrflags

Don't use nullptr for QFlags
This commit is contained in:
Kevin Ottens 2020-10-12 15:33:38 +02:00 committed by GitHub
commit e787054d1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -102,7 +102,7 @@ void FolderStatusModel::setAccountState(const AccountState *accountState)
Qt::ItemFlags FolderStatusModel::flags(const QModelIndex &index) const Qt::ItemFlags FolderStatusModel::flags(const QModelIndex &index) const
{ {
if (!_accountState) { if (!_accountState) {
return nullptr; return {};
} }
switch (classify(index)) { switch (classify(index)) {
case AddButton: { case AddButton: {
@ -120,7 +120,7 @@ Qt::ItemFlags FolderStatusModel::flags(const QModelIndex &index) const
case SubFolder: case SubFolder:
return Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable; return Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable;
} }
return nullptr; return {};
} }
QVariant FolderStatusModel::data(const QModelIndex &index, int role) const QVariant FolderStatusModel::data(const QModelIndex &index, int role) const

View file

@ -683,7 +683,7 @@ void ownCloudGui::slotShowShareDialog(const QString &sharePath, const QString &l
| SharePermissionUpdate | SharePermissionCreate | SharePermissionDelete | SharePermissionUpdate | SharePermissionCreate | SharePermissionDelete
| SharePermissionShare; | SharePermissionShare;
if (!resharingAllowed) { if (!resharingAllowed) {
maxSharingPermissions = nullptr; maxSharingPermissions = {};
} }

View file

@ -89,10 +89,10 @@ class SelectiveSyncDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
// Dialog for a specific folder (used from the account settings button) // Dialog for a specific folder (used from the account settings button)
explicit SelectiveSyncDialog(AccountPtr account, Folder *folder, QWidget *parent = nullptr, Qt::WindowFlags f = nullptr); explicit SelectiveSyncDialog(AccountPtr account, Folder *folder, QWidget *parent = nullptr, Qt::WindowFlags f = {});
// Dialog for the whole account (Used from the wizard) // Dialog for the whole account (Used from the wizard)
explicit SelectiveSyncDialog(AccountPtr account, const QString &folder, const QStringList &blacklist, QWidget *parent = nullptr, Qt::WindowFlags f = nullptr); explicit SelectiveSyncDialog(AccountPtr account, const QString &folder, const QStringList &blacklist, QWidget *parent = nullptr, Qt::WindowFlags f = {});
void accept() override; void accept() override;