more fixes for attributes without init value
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Mon, 6 Feb 2023 08:14:48 +0000 (09:14 +0100)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Mon, 6 Feb 2023 10:55:08 +0000 (10:55 +0000)
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 <matthieu.gallien@nextcloud.com>
15 files changed:
src/common/ownsql.h
src/common/syncjournaldb.h
src/gui/accountstate.h
src/gui/folderwatcher_linux.h
src/gui/socketapi/socketapi.h
src/gui/tray/activitydata.h
src/gui/tray/unifiedsearchresult.h
src/libsync/bulkpropagatorjob.h
src/libsync/clientsideencryption.h
src/libsync/discoveryphase.h
src/libsync/propagateupload.h
src/libsync/propagatorjobs.h
src/libsync/syncengine.h
src/libsync/userstatusconnector.h
test/sharetestutils.h

index 47c87b2e893ac8b6af98035d22a12e581b63848e..a3476e20d09b41fe9cd741ff34e606b1ec225321 100644 (file)
@@ -164,7 +164,7 @@ private:
     sqlite3 *_db = nullptr;
     sqlite3_stmt *_stmt = nullptr;
     QString _error;
-    int _errId;
+    int _errId = 0;
     QByteArray _sql;
 
     friend class SqlDatabase;
index 4a0d3f54dafcf26cc08f808fbeaa298a4ba63eeb..4660e93574d8ce6c4001edf501b3f215038573f4 100644 (file)
@@ -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);
index 2f46f9a8618e490241ed8444ffc218182f984055..67b58c0029e708d39d0f6c0d528e6aa19c8cc614 100644 (file)
@@ -226,7 +226,7 @@ private:
     ConnectionStatus _connectionStatus;
     ConnectionStatus _lastConnectionValidatorStatus = ConnectionStatus::Undefined;
     QStringList _connectionErrors;
-    bool _waitingForNewCredentials;
+    bool _waitingForNewCredentials = false;
     QDateTime _timeOfLastETagCheck;
     QPointer<ConnectionValidator> _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;
 
index f251456eab813f898ba3ea96dc005008070a63d2..62f6c72ba7bbb4026a436d482d80580ec51066eb 100644 (file)
@@ -54,13 +54,13 @@ protected:
     void removeFoldersBelow(const QString &path);
 
 private:
-    FolderWatcher *_parent;
+    FolderWatcher *_parent = nullptr;
 
     QString _folder;
     QHash<int, QString> _watchToPath;
     QMap<QString, int> _pathToWatch;
     QScopedPointer<QSocketNotifier> _socket;
-    int _fd;
+    int _fd = 0;
 };
 }
 
index 0806158a2004e61be48ec914beeaf24aa034217a..22ce587ca0f054355c29867d10f11b0e651c1923 100644 (file)
@@ -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)
index 5aea790f31b000222f0b60917b23e14b3de06e48..947cea5fb7c265de80c207412e33d51548ef3394 100644 (file)
@@ -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;
index 75ceb96c38a5d4e844c7029d002aaa8335e5a233..d9ab18ac6e891173b246f3fc2b1ff9882229ca77 100644 (file)
@@ -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;
 };
 }
index 451bcf88f7d43833dffd13309ad85bc4b08eba17..3daf9da2627e480ac2d08f6fdcc200b0e04e7f95 100644 (file)
@@ -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
index 239bf877e9a0eb1ce98f24eb5367a79e76a9c938..e4b0807e0fc1c017b373270205c03800a0f75066 100644 (file)
@@ -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 {
index 2b48c009bba42d1d5cee33031f94c85da1c965ca..b2547be652c9eec1e8fee1e219b47e07eb33d138 100644 (file)
@@ -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;
index 12e06177a3340797f58ad149d8d486f7af72d3f6..c536b7d5548040d1b74954bad632f208d4e8e791 100644 (file)
@@ -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<qint64, ServerChunkInfo> _serverChunks;
index 099286829398dfb14f8e758c51af6b6143d4b0d4..5bfa0ce814a97f9392df6cda5078546378acecf6 100644 (file)
@@ -45,7 +45,7 @@ public:
 private:
     bool removeRecursively(const QString &path);
     QString _error;
-    bool _moveToTrash;
+    bool _moveToTrash = false;
 };
 
 /**
index 68982e63be678bee92239c8a50e277251cae269c..e7db1565dd2f1eb9e849a2aaadbd97dc3ed96f5b 100644 (file)
@@ -250,7 +250,7 @@ private:
     // See SyncEngine::groupNeededScheduledSyncRuns and
     // SyncEngine::slotScheduleFilesDelayedSync for usage.
     struct ScheduledSyncBucket {
-        qint64 scheduledSyncTimerSecs;
+        qint64 scheduledSyncTimerSecs = 0LL;
         QVector<QString> files;
     };
 
index 20d12347f8422885e19eaa26a3ba36b0d5308163..dead9a9a878b94e66a2f1053c2b395ec4b19d87a 100644 (file)
@@ -41,8 +41,8 @@ struct OWNCLOUDSYNC_EXPORT ClearAt
 {
     ClearAtType _type = ClearAtType::Period;
 
-    quint64 _timestamp;
-    int _period;
+    quint64 _timestamp = 0ULL;
+    int _period = 0;
     QString _endof;
 };
 
index c539547fe4445a616b13c1ae86bae56f0a82b8bd..dd4365dfc53ef6f4122b3b02c3b6feb448f8a5ec 100644 (file)
@@ -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;