From: Matthieu Gallien Date: Mon, 6 Feb 2023 08:14:48 +0000 (+0100) Subject: more fixes for attributes without init value X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~11^2~9^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f15d8dcdc5080706f94833b412612c2dca55de89;p=nextcloud-desktop.git more fixes for attributes without init value done with clang-tidy run-clang-tidy -p build -header-filter='.*' -config="{Checks: '*', CheckOptions: [{key: UseAssignment, value: true}]}" -checks='-*,cppcoreguidelines-pro-type-member-init' -fix Signed-off-by: Matthieu Gallien --- diff --git a/src/common/ownsql.h b/src/common/ownsql.h index 47c87b2e8..a3476e20d 100644 --- a/src/common/ownsql.h +++ b/src/common/ownsql.h @@ -164,7 +164,7 @@ private: sqlite3 *_db = nullptr; sqlite3_stmt *_stmt = nullptr; QString _error; - int _errId; + int _errId = 0; QByteArray _sql; friend class SqlDatabase; diff --git a/src/common/syncjournaldb.h b/src/common/syncjournaldb.h index 4a0d3f54d..4660e9357 100644 --- a/src/common/syncjournaldb.h +++ b/src/common/syncjournaldb.h @@ -131,8 +131,8 @@ public: { QString _file; // The relative path of a file QString _url; // the poll url. (This pollinfo is invalid if _url is empty) - qint64 _modtime; // The modtime of the file being uploaded - qint64 _fileSize; + qint64 _modtime = 0LL; // The modtime of the file being uploaded + qint64 _fileSize = 0LL; }; DownloadInfo getDownloadInfo(const QString &file); diff --git a/src/gui/accountstate.h b/src/gui/accountstate.h index 2f46f9a86..67b58c002 100644 --- a/src/gui/accountstate.h +++ b/src/gui/accountstate.h @@ -226,7 +226,7 @@ private: ConnectionStatus _connectionStatus; ConnectionStatus _lastConnectionValidatorStatus = ConnectionStatus::Undefined; QStringList _connectionErrors; - bool _waitingForNewCredentials; + bool _waitingForNewCredentials = false; QDateTime _timeOfLastETagCheck; QPointer _connectionValidator; QByteArray _notificationsEtagResponseHeader; @@ -242,20 +242,20 @@ private: /** * Milliseconds for which to delay reconnection after 503/maintenance. */ - int _maintenanceToConnectedDelay; + int _maintenanceToConnectedDelay = 0; /** * Connects remote wipe check with the account * the log out triggers the check (loads app password -> create request) */ - RemoteWipe *_remoteWipe; + RemoteWipe *_remoteWipe = nullptr; /** * Holds the App names and URLs available on the server */ AccountAppList _apps; - bool _isDesktopNotificationsAllowed; + bool _isDesktopNotificationsAllowed = false; int _retryCount = 0; diff --git a/src/gui/folderwatcher_linux.h b/src/gui/folderwatcher_linux.h index f251456ea..62f6c72ba 100644 --- a/src/gui/folderwatcher_linux.h +++ b/src/gui/folderwatcher_linux.h @@ -54,13 +54,13 @@ protected: void removeFoldersBelow(const QString &path); private: - FolderWatcher *_parent; + FolderWatcher *_parent = nullptr; QString _folder; QHash _watchToPath; QMap _pathToWatch; QScopedPointer _socket; - int _fd; + int _fd = 0; }; } diff --git a/src/gui/socketapi/socketapi.h b/src/gui/socketapi/socketapi.h index 0806158a2..22ce587ca 100644 --- a/src/gui/socketapi/socketapi.h +++ b/src/gui/socketapi/socketapi.h @@ -89,7 +89,7 @@ private: // Relative path of the file locally, without any vfs suffix [[nodiscard]] QString folderRelativePathNoVfsSuffix() const; - Folder *folder; + Folder *folder = nullptr; // Absolute path of the file locally. (May be a virtual file) QString localPath; // Relative path of the file locally, as in the DB. (May be a virtual file) diff --git a/src/gui/tray/activitydata.h b/src/gui/tray/activitydata.h index 5aea790f3..947cea5fb 100644 --- a/src/gui/tray/activitydata.h +++ b/src/gui/tray/activitydata.h @@ -50,7 +50,7 @@ public: QString _label; QString _link; QByteArray _verb; - bool _primary; + bool _primary = false; }; /** @@ -73,9 +73,9 @@ public: QString _source; QString _link; QString _mimeType; - int _fileId; + int _fileId = 0; QString _view; - bool _isMimeTypeIcon; + bool _isMimeTypeIcon = false; QString _filename; }; @@ -123,9 +123,9 @@ public: }; Type _type; - qlonglong _id; + qlonglong _id = 0LL; QString _fileAction; - int _objectId; + int _objectId = 0; TalkNotificationData _talkNotificationData; QString _objectType; QString _objectName; @@ -137,7 +137,7 @@ public: QString _folder; QString _file; QString _renamedFile; - bool _isMultiObjectActivity; + bool _isMultiObjectActivity = false; QUrl _link; QDateTime _dateTime; qint64 _expireAtMsecs = -1; diff --git a/src/gui/tray/unifiedsearchresult.h b/src/gui/tray/unifiedsearchresult.h index 75ceb96c3..d9ab18ac6 100644 --- a/src/gui/tray/unifiedsearchresult.h +++ b/src/gui/tray/unifiedsearchresult.h @@ -44,8 +44,8 @@ struct UnifiedSearchResult QUrl _resourceUrl; QString _darkIcons; QString _lightIcons; - bool _darkIconsIsThumbnail; - bool _lightIconsIsThumbnail; + bool _darkIconsIsThumbnail = false; + bool _lightIconsIsThumbnail = false; Type _type = Type::Default; }; } diff --git a/src/libsync/bulkpropagatorjob.h b/src/libsync/bulkpropagatorjob.h index 451bcf88f..3daf9da26 100644 --- a/src/libsync/bulkpropagatorjob.h +++ b/src/libsync/bulkpropagatorjob.h @@ -44,7 +44,7 @@ class BulkPropagatorJob : public PropagatorJob struct UploadFileInfo { QString _file; /// I'm still unsure if I should use a SyncFilePtr here. QString _path; /// the full path on disk. - qint64 _size; + qint64 _size = 0LL; }; struct BulkUploadItem diff --git a/src/libsync/clientsideencryption.h b/src/libsync/clientsideencryption.h index 239bf877e..e4b0807e0 100644 --- a/src/libsync/clientsideencryption.h +++ b/src/libsync/clientsideencryption.h @@ -180,8 +180,8 @@ struct EncryptedFile { QByteArray authenticationTag; QString encryptedFilename; QString originalFilename; - int fileVersion; - int metadataKey; + int fileVersion = 0; + int metadataKey = 0; }; class OWNCLOUDSYNC_EXPORT FolderMetadata { diff --git a/src/libsync/discoveryphase.h b/src/libsync/discoveryphase.h index 2b48c009b..b2547be65 100644 --- a/src/libsync/discoveryphase.h +++ b/src/libsync/discoveryphase.h @@ -274,10 +274,10 @@ public: // input QString _localDir; // absolute path to the local directory. ends with '/' QString _remoteFolder; // remote folder, ends with '/' - SyncJournalDb *_statedb; + SyncJournalDb *_statedb = nullptr; AccountPtr _account; SyncOptions _syncOptions; - ExcludedFiles *_excludes; + ExcludedFiles *_excludes = nullptr; QRegularExpression _invalidFilenameRx; // FIXME: maybe move in ExcludedFiles QStringList _serverBlacklistedFiles; // The blacklist from the capabilities QStringList _leadingAndTrailingSpacesFilesAllowed; diff --git a/src/libsync/propagateupload.h b/src/libsync/propagateupload.h index 12e06177a..c536b7d55 100644 --- a/src/libsync/propagateupload.h +++ b/src/libsync/propagateupload.h @@ -232,7 +232,7 @@ protected: struct UploadFileInfo { QString _file; /// I'm still unsure if I should use a SyncFilePtr here. QString _path; /// the full path on disk. - qint64 _size; + qint64 _size = 0LL; }; UploadFileInfo _fileToUpload; QByteArray _transmissionChecksumHeader; @@ -389,7 +389,7 @@ private: // (Only used from slotPropfindIterate/slotPropfindFinished because the LsColJob use signals to report data.) struct ServerChunkInfo { - qint64 size; + qint64 size = 0LL; QString originalName; }; QMap _serverChunks; diff --git a/src/libsync/propagatorjobs.h b/src/libsync/propagatorjobs.h index 099286829..5bfa0ce81 100644 --- a/src/libsync/propagatorjobs.h +++ b/src/libsync/propagatorjobs.h @@ -45,7 +45,7 @@ public: private: bool removeRecursively(const QString &path); QString _error; - bool _moveToTrash; + bool _moveToTrash = false; }; /** diff --git a/src/libsync/syncengine.h b/src/libsync/syncengine.h index 68982e63b..e7db1565d 100644 --- a/src/libsync/syncengine.h +++ b/src/libsync/syncengine.h @@ -250,7 +250,7 @@ private: // See SyncEngine::groupNeededScheduledSyncRuns and // SyncEngine::slotScheduleFilesDelayedSync for usage. struct ScheduledSyncBucket { - qint64 scheduledSyncTimerSecs; + qint64 scheduledSyncTimerSecs = 0LL; QVector files; }; diff --git a/src/libsync/userstatusconnector.h b/src/libsync/userstatusconnector.h index 20d12347f..dead9a9a8 100644 --- a/src/libsync/userstatusconnector.h +++ b/src/libsync/userstatusconnector.h @@ -41,8 +41,8 @@ struct OWNCLOUDSYNC_EXPORT ClearAt { ClearAtType _type = ClearAtType::Period; - quint64 _timestamp; - int _period; + quint64 _timestamp = 0ULL; + int _period = 0; QString _endof; }; diff --git a/test/sharetestutils.h b/test/sharetestutils.h index c539547fe..dd4365dfc 100644 --- a/test/sharetestutils.h +++ b/test/sharetestutils.h @@ -34,16 +34,16 @@ struct FakeFileReplyDefinition QString fileOwnerUid; QString fileOwnerDisplayName; QString fileTarget; - bool fileHasPreview; + bool fileHasPreview = false; QString fileFileParent; QString fileSource; QString fileItemSource; QString fileItemType; - int fileMailSend; + int fileMailSend = 0; QString fileMimeType; QString fileParent; QString filePath; - int fileStorage; + int fileStorage = 0; QString fileStorageId; }; @@ -60,17 +60,17 @@ struct FakeShareDefinition FakeFileReplyDefinition fileDefinition; QString shareId; - bool shareCanDelete; - bool shareCanEdit; + bool shareCanDelete = false; + bool shareCanEdit = false; QString shareUidOwner; QString shareDisplayNameOwner; QString sharePassword; - int sharePermissions; + int sharePermissions = 0; QString shareNote; - int shareHideDownload; + int shareHideDownload = 0; QString shareExpiration; - bool shareSendPasswordByTalk; - int shareType; + bool shareSendPasswordByTalk = false; + int shareType = 0; QString shareShareWith; QString shareShareWithDisplayName; QString shareToken;