1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2025-02-24 09:45:59 +01:00

Enable the modernize-user-nullptr check on clang-tidy

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
Kevin Ottens 2020-08-12 16:14:48 +02:00 committed by Kevin Ottens
parent 3ff899cff9
commit cdf6e7d72b
13 changed files with 17 additions and 16 deletions

View File

@ -18,6 +18,7 @@ Checks: '-*,
modernize-use-nodiscard,
modernize-use-noexcept,
modernize-user-override,
modernize-use-nullptr,
modernize-use-transparent-functors,
modernize-use-uncaught-exceptions,
modernize-use-using,

View File

@ -42,7 +42,7 @@ class QProgressIndicator : public QWidget
Q_PROPERTY(bool displayedWhenStopped READ isDisplayedWhenStopped WRITE setDisplayedWhenStopped)
Q_PROPERTY(QColor color READ color WRITE setColor)
public:
QProgressIndicator(QWidget* parent = 0);
QProgressIndicator(QWidget* parent = nullptr);
/*! Returns the delay between animation steps.
\return The number of milliseconds between animation steps. By default, the animation delay is set to 40 milliseconds.

View File

@ -40,7 +40,7 @@ class QtLocalPeer : public QObject
Q_OBJECT
public:
explicit QtLocalPeer(QObject *parent = 0, const QString &appId = QString());
explicit QtLocalPeer(QObject *parent = nullptr, const QString &appId = QString());
bool isClient();
bool sendMessage(const QString &message, int timeout, bool block);
QString applicationId() const

View File

@ -70,7 +70,7 @@ class OCSYNC_EXPORT ComputeChecksum : public QObject
{
Q_OBJECT
public:
explicit ComputeChecksum(QObject *parent = 0);
explicit ComputeChecksum(QObject *parent = nullptr);
/**
* Sets the checksum type to be used. The default is empty.
@ -112,7 +112,7 @@ class OCSYNC_EXPORT ValidateChecksumHeader : public QObject
{
Q_OBJECT
public:
explicit ValidateChecksumHeader(QObject *parent = 0);
explicit ValidateChecksumHeader(QObject *parent = nullptr);
/**
* Check a file's actual checksum against the provided checksumHeader

View File

@ -107,7 +107,7 @@ namespace FileSystem {
* Equivalent to QFile::remove(), except on Windows, where it will also
* successfully remove read-only files.
*/
bool OCSYNC_EXPORT remove(const QString &fileName, QString *errorString = 0);
bool OCSYNC_EXPORT remove(const QString &fileName, QString *errorString = nullptr);
/**
* Move the specified file or folder to the trash. (Only implemented on linux)

View File

@ -42,7 +42,7 @@ class OCSYNC_EXPORT SyncJournalDb : public QObject
{
Q_OBJECT
public:
explicit SyncJournalDb(const QString &dbFilePath, QObject *parent = 0);
explicit SyncJournalDb(const QString &dbFilePath, QObject *parent = nullptr);
virtual ~SyncJournalDb();
/// Create a journal path for a specific configuration

View File

@ -188,7 +188,7 @@ namespace Utility {
/** Returns a new settings pre-set in a specific group. The Settings will be created
with the given parent. If no parent is specified, the caller must destroy the settings */
OCSYNC_EXPORT std::unique_ptr<QSettings> settingsWithGroup(const QString &group, QObject *parent = 0);
OCSYNC_EXPORT std::unique_ptr<QSettings> settingsWithGroup(const QString &group, QObject *parent = nullptr);
/** Sanitizes a string that shall become part of a filename.
*

View File

@ -229,7 +229,7 @@ class AccountApp : public QObject
public:
AccountApp(const QString &name, const QUrl &url,
const QString &id, const QUrl &iconUrl,
QObject* parent = 0);
QObject* parent = nullptr);
QString name() const;
QUrl url() const;

View File

@ -73,7 +73,7 @@ class HeaderBanner : public QWidget
{
Q_OBJECT
public:
HeaderBanner(QWidget *parent = 0);
HeaderBanner(QWidget *parent = nullptr);
void setup(const QString &title, const QPixmap &logo, const QPixmap &banner,
const Qt::TextFormat titleFormat, const QString &styleSheet);

View File

@ -56,7 +56,7 @@ public:
AccountConnectedRole,
SyncFileStatusRole};
explicit ActivityListModel(AccountState *accountState, QObject* parent = 0);
explicit ActivityListModel(AccountState *accountState, QObject* parent = nullptr);
QVariant data(const QModelIndex &index, int role) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;

View File

@ -22,7 +22,7 @@ class User : public QObject
Q_PROPERTY(bool hasLocalFolder READ hasLocalFolder NOTIFY hasLocalFolderChanged)
Q_PROPERTY(bool serverHasTalk READ serverHasTalk NOTIFY serverHasTalkChanged)
public:
User(AccountStatePtr &account, const bool &isCurrent = false, QObject* parent = 0);
User(AccountStatePtr &account, const bool &isCurrent = false, QObject* parent = nullptr);
AccountPtr account() const;
@ -143,7 +143,7 @@ protected:
private:
static UserModel *_instance;
UserModel(QObject *parent = 0);
UserModel(QObject *parent = nullptr);
QList<User*> _users;
int _currentUserId = 0;
bool _init = true;
@ -185,7 +185,7 @@ protected:
private:
static UserAppsModel *_instance;
UserAppsModel(QObject *parent = 0);
UserAppsModel(QObject *parent = nullptr);
AccountAppList _apps;
};

View File

@ -147,7 +147,7 @@ class OWNCLOUDSYNC_EXPORT DirectEditor : public QObject
{
Q_OBJECT
public:
DirectEditor(const QString &id, const QString &name, QObject* parent = 0);
DirectEditor(const QString &id, const QString &name, QObject* parent = nullptr);
void addMimetype(const QByteArray &mimeType);
void addOptionalMimetype(const QByteArray &mimeType);

View File

@ -238,7 +238,7 @@ public:
etag = file->etag;
return file;
}
return 0;
return nullptr;
}
FileInfo *createDir(const QString &relativePath) {
@ -816,7 +816,7 @@ public:
protected:
QNetworkReply *createRequest(Operation op, const QNetworkRequest &request,
QIODevice *outgoingData = 0) {
QIODevice *outgoingData = nullptr) {
if (_override) {
if (auto reply = _override(op, request, outgoingData))
return reply;