initialize many attributes that could have been left without init value

done with clang-tidy

run-clang-tidy -p build -config="{Checks: '*', CheckOptions: [{key: UseAssignment, value: true}]}" -checks='-*,cppcoreguidelines-pro-type-member-init' -fix

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2023-02-03 18:38:52 +01:00
parent d21da0d3af
commit d2f5c6a5c7
No known key found for this signature in database
GPG key ID: 7D0F74F05C22F553
39 changed files with 68 additions and 68 deletions

View file

@ -40,7 +40,7 @@ class KMessageWidgetPrivate
public: public:
void init(KMessageWidget *); void init(KMessageWidget *);
KMessageWidget *q; KMessageWidget *q = nullptr;
QFrame *content = nullptr; QFrame *content = nullptr;
QLabel *iconLabel = nullptr; QLabel *iconLabel = nullptr;
QLabel *textLabel = nullptr; QLabel *textLabel = nullptr;
@ -50,7 +50,7 @@ public:
bool ignoreShowEventDoingAnimatedShow = false; bool ignoreShowEventDoingAnimatedShow = false;
KMessageWidget::MessageType messageType; KMessageWidget::MessageType messageType;
bool wordWrap; bool wordWrap = false;
QList<QToolButton *> buttons; QList<QToolButton *> buttons;
QPixmap contentSnapShot; QPixmap contentSnapShot;

View file

@ -52,7 +52,7 @@ bool QtLockedFile::lock(LockMode mode, bool block)
if (m_lock_mode != NoLock) if (m_lock_mode != NoLock)
unlock(); unlock();
struct flock fl; struct flock fl{};
fl.l_whence = SEEK_SET; fl.l_whence = SEEK_SET;
fl.l_start = 0; fl.l_start = 0;
fl.l_len = 0; fl.l_len = 0;
@ -82,7 +82,7 @@ bool QtLockedFile::unlock()
if (!isLocked()) if (!isLocked())
return true; return true;
struct flock fl; struct flock fl{};
fl.l_whence = SEEK_SET; fl.l_whence = SEEK_SET;
fl.l_start = 0; fl.l_start = 0;
fl.l_len = 0; fl.l_len = 0;

View file

@ -55,7 +55,7 @@ Q_SIGNALS:
private: private:
QtLocalPeer* peer; QtLocalPeer* peer;
bool block; bool block = false;
}; };
} // namespace SharedTools } // namespace SharedTools

View file

@ -71,16 +71,16 @@ struct CmdOptions
QString user; QString user;
QString password; QString password;
QString proxy; QString proxy;
bool silent; bool silent = false;
bool trustSSL; bool trustSSL = false;
bool useNetrc; bool useNetrc = false;
bool interactive; bool interactive = false;
bool ignoreHiddenFiles; bool ignoreHiddenFiles = false;
QString exclude; QString exclude;
QString unsyncedfolders; QString unsyncedfolders;
int restartTimes; int restartTimes = 0;
int downlimit; int downlimit = 0;
int uplimit; int uplimit = 0;
}; };
// we can't use csync_set_userdata because the SyncEngine sets it already. // we can't use csync_set_userdata because the SyncEngine sets it already.
@ -118,7 +118,7 @@ private:
DWORD mode = 0; DWORD mode = 0;
HANDLE hStdin; HANDLE hStdin;
#else #else
termios tios; termios tios{};
#endif #endif
}; };

View file

@ -228,7 +228,7 @@ qint64 Utility::freeDiskSpace(const QString &path)
return (qint64)stat.f_bavail * stat.f_frsize; return (qint64)stat.f_bavail * stat.f_frsize;
} }
#elif defined(Q_OS_UNIX) #elif defined(Q_OS_UNIX)
struct statvfs64 stat; struct statvfs64 stat{};
if (statvfs64(path.toLocal8Bit().data(), &stat) == 0) { if (statvfs64(path.toLocal8Bit().data(), &stat) == 0) {
return (qint64)stat.f_bavail * stat.f_frsize; return (qint64)stat.f_bavail * stat.f_frsize;
} }

View file

@ -123,8 +123,8 @@ public:
{ {
} }
QTreeView *folderList; QTreeView *folderList = nullptr;
FolderStatusModel *model; FolderStatusModel *model = nullptr;
protected: protected:
bool eventFilter(QObject *watched, QEvent *event) override bool eventFilter(QObject *watched, QEvent *event) override
@ -1004,7 +1004,7 @@ void AccountSettings::slotSetSubFolderAvailability(Folder *folder, const QString
void AccountSettings::displayMnemonic(const QString &mnemonic) void AccountSettings::displayMnemonic(const QString &mnemonic)
{ {
QDialog widget; QDialog widget;
Ui_Dialog ui; Ui_Dialog ui{};
ui.setupUi(&widget); ui.setupUi(&widget);
widget.setWindowTitle(tr("End-to-end encryption mnemonic")); widget.setWindowTitle(tr("End-to-end encryption mnemonic"));
ui.label->setText( ui.label->setText(

View file

@ -143,8 +143,8 @@ private:
bool _wasDisabledBefore; bool _wasDisabledBefore;
AccountState *_accountState; AccountState *_accountState;
UserInfo _userInfo; UserInfo _userInfo;
QAction *_toggleSignInOutAction; QAction *_toggleSignInOutAction = nullptr;
QAction *_addAccountAction; QAction *_addAccountAction = nullptr;
bool _menuShown; bool _menuShown;

View file

@ -45,7 +45,7 @@ private:
QUrl _serverUrl; QUrl _serverUrl;
QString _remoteDirPath; QString _remoteDirPath;
QString _localDirPath; QString _localDirPath;
bool _isVfsEnabled; bool _isVfsEnabled = false;
}; };
} }

View file

@ -91,7 +91,7 @@ void Flow2Auth::fetchNewToken(const TokenAction action)
QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this, action](QNetworkReply *reply) { QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this, action](QNetworkReply *reply) {
auto jsonData = reply->readAll(); auto jsonData = reply->readAll();
QJsonParseError jsonParseError; QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object(); QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
QString pollToken, pollEndpoint, loginUrl; QString pollToken, pollEndpoint, loginUrl;
@ -208,7 +208,7 @@ void Flow2Auth::slotPollTimerTimeout()
QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this](QNetworkReply *reply) { QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this](QNetworkReply *reply) {
auto jsonData = reply->readAll(); auto jsonData = reply->readAll();
QJsonParseError jsonParseError; QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object(); QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
QUrl serverUrl; QUrl serverUrl;
QString loginName, appPassword; QString loginName, appPassword;

View file

@ -77,8 +77,8 @@ private:
QString _pollToken; QString _pollToken;
QString _pollEndpoint; QString _pollEndpoint;
QTimer _pollTimer; QTimer _pollTimer;
qint64 _secondsLeft; qint64 _secondsLeft = 0LL;
qint64 _secondsInterval; qint64 _secondsInterval = 0LL;
bool _isBusy; bool _isBusy;
bool _hasToken; bool _hasToken;
bool _enforceHttps = false; bool _enforceHttps = false;

View file

@ -99,7 +99,7 @@ void OAuth::start()
job->setTimeout(qMin(30 * 1000ll, job->timeoutMsec())); job->setTimeout(qMin(30 * 1000ll, job->timeoutMsec()));
QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this, socket](QNetworkReply *reply) { QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this, socket](QNetworkReply *reply) {
auto jsonData = reply->readAll(); auto jsonData = reply->readAll();
QJsonParseError jsonParseError; QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object(); QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
QString accessToken = json["access_token"].toString(); QString accessToken = json["access_token"].toString();
QString refreshToken = json["refresh_token"].toString(); QString refreshToken = json["refresh_token"].toString();

View file

@ -92,7 +92,7 @@ private:
QTimer _searchRateLimitingTimer; QTimer _searchRateLimitingTimer;
AccountState *_accountState; AccountState *_accountState = nullptr;
QString _searchString; QString _searchString;
bool _shareItemIsFolder = false; bool _shareItemIsFolder = false;
bool _fetchOngoing = false; bool _fetchOngoing = false;

View file

@ -196,8 +196,8 @@ private:
// We cannot pass objects instantiated in QML using smart pointers through the property interface // We cannot pass objects instantiated in QML using smart pointers through the property interface
// so we have to pass the pointer here. If we kill the dialog using a smart pointer then // so we have to pass the pointer here. If we kill the dialog using a smart pointer then
// these objects will be deallocated for the entire application. We do not want that!! // these objects will be deallocated for the entire application. We do not want that!!
AccountState *_accountState; AccountState *_accountState = nullptr;
Folder *_folder; Folder *_folder = nullptr;
QString _localPath; QString _localPath;
QString _sharePath; QString _sharePath;

View file

@ -70,7 +70,7 @@ protected slots:
private: private:
void changeStyle(); void changeStyle();
Ui_FolderWizardSourcePage _ui; Ui_FolderWizardSourcePage _ui{};
Folder::Map _folderMap; Folder::Map _folderMap;
AccountPtr _account; AccountPtr _account;
}; };
@ -114,7 +114,7 @@ private:
LsColJob *runLsColJob(const QString &path); LsColJob *runLsColJob(const QString &path);
void recursiveInsert(QTreeWidgetItem *parent, QStringList pathTrail, QString path); void recursiveInsert(QTreeWidgetItem *parent, QStringList pathTrail, QString path);
bool selectByPath(QString path); bool selectByPath(QString path);
Ui_FolderWizardTargetPage _ui; Ui_FolderWizardTargetPage _ui{};
bool _warnWasVisible; bool _warnWasVisible;
AccountPtr _account; AccountPtr _account;
QTimer _lscolTimer; QTimer _lscolTimer;

View file

@ -116,7 +116,7 @@ int main(int argc, char **argv)
// check a environment variable for core dumps // check a environment variable for core dumps
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
if (!qEnvironmentVariableIsEmpty("OWNCLOUD_CORE_DUMP")) { if (!qEnvironmentVariableIsEmpty("OWNCLOUD_CORE_DUMP")) {
struct rlimit core_limit; struct rlimit core_limit{};
core_limit.rlim_cur = RLIM_INFINITY; core_limit.rlim_cur = RLIM_INFINITY;
core_limit.rlim_max = RLIM_INFINITY; core_limit.rlim_max = RLIM_INFINITY;

View file

@ -110,7 +110,7 @@ bool OcsJob::finished()
{ {
const QByteArray replyData = reply()->readAll(); const QByteArray replyData = reply()->readAll();
QJsonParseError error; QJsonParseError error{};
QString message; QString message;
int statusCode = 0; int statusCode = 0;
auto json = QJsonDocument::fromJson(replyData, &error); auto json = QJsonDocument::fromJson(replyData, &error);

View file

@ -120,9 +120,9 @@ private:
QDBusConnection _bus; QDBusConnection _bus;
#endif #endif
QAction *_actionNewAccountWizard; QAction *_actionNewAccountWizard = nullptr;
QAction *_actionSettings; QAction *_actionSettings = nullptr;
QAction *_actionEstimate; QAction *_actionEstimate = nullptr;
QList<QAction *> _recentItemsActions; QList<QAction *> _recentItemsActions;

View file

@ -70,7 +70,7 @@ void RemoteWipe::startCheckJobWithAppPassword(QString pwd){
void RemoteWipe::checkJobSlot() void RemoteWipe::checkJobSlot()
{ {
auto jsonData = _networkReplyCheck->readAll(); auto jsonData = _networkReplyCheck->readAll();
QJsonParseError jsonParseError; QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object(); QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
bool wipe = false; bool wipe = false;
@ -148,7 +148,7 @@ void RemoteWipe::notifyServerSuccessJob(AccountState *accountState, bool dataWip
void RemoteWipe::notifyServerSuccessJobSlot() void RemoteWipe::notifyServerSuccessJobSlot()
{ {
auto jsonData = _networkReplySuccess->readAll(); auto jsonData = _networkReplySuccess->readAll();
QJsonParseError jsonParseError; QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object(); QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
if (_networkReplySuccess->error() != QNetworkReply::NoError || if (_networkReplySuccess->error() != QNetworkReply::NoError ||
jsonParseError.error != QJsonParseError::NoError) { jsonParseError.error != QJsonParseError::NoError) {

View file

@ -111,9 +111,9 @@ public:
private: private:
void init(const AccountPtr &account); void init(const AccountPtr &account);
SelectiveSyncWidget *_selectiveSync; SelectiveSyncWidget *_selectiveSync = nullptr;
Folder *_folder; Folder *_folder;
QPushButton *_okButton; QPushButton *_okButton = nullptr;
}; };
} }

View file

@ -411,7 +411,7 @@ void SocketApi::slotReadSocket()
socketApiJob->reject(QStringLiteral("command not found")); socketApiJob->reject(QStringLiteral("command not found"));
} }
} else if (command.startsWith("V2/")) { } else if (command.startsWith("V2/")) {
QJsonParseError error; QJsonParseError error{};
const auto json = QJsonDocument::fromJson(argument.toUtf8(), &error).object(); const auto json = QJsonDocument::fromJson(argument.toUtf8(), &error).object();
if (error.error != QJsonParseError::NoError) { if (error.error != QJsonParseError::NoError) {
qCWarning(lcSocketApi()) << "Invalid json" << argument.toString() << error.errorString(); qCWarning(lcSocketApi()) << "Invalid json" << argument.toString() << error.errorString();

View file

@ -50,7 +50,7 @@ signals:
private: private:
Account *_account = nullptr; Account *_account = nullptr;
QScopedPointer<Flow2Auth> _asyncAuth; QScopedPointer<Flow2Auth> _asyncAuth;
Ui_Flow2AuthWidget _ui; Ui_Flow2AuthWidget _ui{};
protected slots: protected slots:
void slotOpenBrowser(); void slotOpenBrowser();

View file

@ -87,7 +87,7 @@ private:
// TODO: remove when UX decision is made // TODO: remove when UX decision is made
void refreshVirtualFilesAvailibility(const QString &path); void refreshVirtualFilesAvailibility(const QString &path);
Ui_OwncloudAdvancedSetupPage _ui; Ui_OwncloudAdvancedSetupPage _ui{};
bool _checking = false; bool _checking = false;
bool _created = false; bool _created = false;
bool _localFolderValid = false; bool _localFolderValid = false;

View file

@ -56,7 +56,7 @@ public:
QString _token; QString _token;
QString _refreshToken; QString _refreshToken;
QScopedPointer<OAuth> _asyncAuth; QScopedPointer<OAuth> _asyncAuth;
Ui_OwncloudOAuthCredsPage _ui; Ui_OwncloudOAuthCredsPage _ui{};
protected slots: protected slots:
void slotOpenBrowser(); void slotOpenBrowser();

View file

@ -78,7 +78,7 @@ private:
void customizeStyle(); void customizeStyle();
void setupServerAddressDescriptionLabel(); void setupServerAddressDescriptionLabel();
Ui_OwncloudSetupPage _ui; Ui_OwncloudSetupPage _ui{};
QString _oCUrl; QString _oCUrl;
QString _ocUser; QString _ocUser;

View file

@ -125,7 +125,7 @@ private:
OwncloudOAuthCredsPage *_browserCredsPage; OwncloudOAuthCredsPage *_browserCredsPage;
Flow2AuthCredsPage *_flow2CredsPage; Flow2AuthCredsPage *_flow2CredsPage;
OwncloudAdvancedSetupPage *_advancedSetupPage; OwncloudAdvancedSetupPage *_advancedSetupPage;
OwncloudWizardResultPage *_resultPage; OwncloudWizardResultPage *_resultPage = nullptr;
AbstractCredentialsWizardPage *_credentialsPage = nullptr; AbstractCredentialsWizardPage *_credentialsPage = nullptr;
WebViewPage *_webViewPage = nullptr; WebViewPage *_webViewPage = nullptr;

View file

@ -40,7 +40,7 @@ private:
QString _user; QString _user;
QString _pass; QString _pass;
bool _useSystemProxy; bool _useSystemProxy = false;
QSize _originalWizardSize; QSize _originalWizardSize;
}; };

View file

@ -96,7 +96,7 @@ private:
GETFileJob *_relativeLimitCurrentMeasuredJob; GETFileJob *_relativeLimitCurrentMeasuredJob;
// for measuring how much progress we made at start // for measuring how much progress we made at start
qint64 _relativeDownloadLimitProgressAtMeasuringRestart; qint64 _relativeDownloadLimitProgressAtMeasuringRestart = 0LL;
qint64 _currentDownloadLimit; qint64 _currentDownloadLimit;
}; };

View file

@ -54,7 +54,7 @@ bool GetMetadataApiJob::finished()
emit error(_fileId, retCode); emit error(_fileId, retCode);
return true; return true;
} }
QJsonParseError error; QJsonParseError error{};
auto json = QJsonDocument::fromJson(reply()->readAll(), &error); auto json = QJsonDocument::fromJson(reply()->readAll(), &error);
emit jsonReceived(json, reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt()); emit jsonReceived(json, reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt());
return true; return true;
@ -285,7 +285,7 @@ bool LockEncryptFolderApiJob::finished()
return true; return true;
} }
QJsonParseError error; QJsonParseError error{};
const auto json = QJsonDocument::fromJson(reply()->readAll(), &error); const auto json = QJsonDocument::fromJson(reply()->readAll(), &error);
const auto obj = json.object().toVariantMap(); const auto obj = json.object().toVariantMap();
const auto token = obj["ocs"].toMap()["data"].toMap()["e2e-token"].toByteArray(); const auto token = obj["ocs"].toMap()["data"].toMap()["e2e-token"].toByteArray();
@ -364,7 +364,7 @@ bool StorePrivateKeyApiJob::finished()
if (retCode != 200) if (retCode != 200)
qCInfo(lcStorePrivateKeyApiJob()) << "Sending private key ended with" << path() << errorString() << retCode; qCInfo(lcStorePrivateKeyApiJob()) << "Sending private key ended with" << path() << errorString() << retCode;
QJsonParseError error; QJsonParseError error{};
auto json = QJsonDocument::fromJson(reply()->readAll(), &error); auto json = QJsonDocument::fromJson(reply()->readAll(), &error);
emit jsonReceived(json, reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt()); emit jsonReceived(json, reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt());
return true; return true;
@ -401,7 +401,7 @@ bool SignPublicKeyApiJob::finished()
{ {
qCInfo(lcStorePrivateKeyApiJob()) << "Sending CSR ended with" << path() << errorString() << reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute); qCInfo(lcStorePrivateKeyApiJob()) << "Sending CSR ended with" << path() << errorString() << reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute);
QJsonParseError error; QJsonParseError error{};
auto json = QJsonDocument::fromJson(reply()->readAll(), &error); auto json = QJsonDocument::fromJson(reply()->readAll(), &error);
emit jsonReceived(json, reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt()); emit jsonReceived(json, reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt());
return true; return true;

View file

@ -193,7 +193,7 @@ signals:
private: private:
QByteArray _fileId; QByteArray _fileId;
QByteArray _token; QByteArray _token;
QBuffer *_tokenBuf; QBuffer *_tokenBuf = nullptr;
QPointer<SyncJournalDb> _journalDb; QPointer<SyncJournalDb> _journalDb;
}; };

View file

@ -430,7 +430,7 @@ bool HttpCredentials::refreshAccessToken()
job->setTimeout(qMin(30 * 1000ll, job->timeoutMsec())); job->setTimeout(qMin(30 * 1000ll, job->timeoutMsec()));
QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this](QNetworkReply *reply) { QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this](QNetworkReply *reply) {
auto jsonData = reply->readAll(); auto jsonData = reply->readAll();
QJsonParseError jsonParseError; QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object(); QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
QString accessToken = json["access_token"].toString(); QString accessToken = json["access_token"].toString();
if (jsonParseError.error != QJsonParseError::NoError || json.isEmpty()) { if (jsonParseError.error != QJsonParseError::NoError || json.isEmpty()) {

View file

@ -74,7 +74,7 @@ public:
protected: protected:
QString _serviceName; QString _serviceName;
Account *_account; Account *_account = nullptr;
QString _key; QString _key;
bool _insecureFallback = false; bool _insecureFallback = false;
bool _autoDelete = true; bool _autoDelete = true;

View file

@ -530,7 +530,7 @@ bool CheckServerJob::finished()
qCWarning(lcCheckServerJob) << "error: status.php replied " << httpStatus << body; qCWarning(lcCheckServerJob) << "error: status.php replied " << httpStatus << body;
emit instanceNotFound(reply()); emit instanceNotFound(reply());
} else { } else {
QJsonParseError error; QJsonParseError error{};
auto status = QJsonDocument::fromJson(body, &error); auto status = QJsonDocument::fromJson(body, &error);
// empty or invalid response // empty or invalid response
if (error.error != QJsonParseError::NoError || status.isNull()) { if (error.error != QJsonParseError::NoError || status.isNull()) {
@ -862,7 +862,7 @@ bool JsonApiJob::finished()
if(reply()->rawHeaderList().contains("ETag")) if(reply()->rawHeaderList().contains("ETag"))
emit etagResponseHeaderReceived(reply()->rawHeader("ETag"), statusCode); emit etagResponseHeaderReceived(reply()->rawHeader("ETag"), statusCode);
QJsonParseError error; QJsonParseError error{};
auto json = QJsonDocument::fromJson(jsonStr.toUtf8(), &error); auto json = QJsonDocument::fromJson(jsonStr.toUtf8(), &error);
// empty or invalid response and status code is != 304 because jsonStr is expected to be empty // empty or invalid response and status code is != 304 because jsonStr is expected to be empty
if ((error.error != QJsonParseError::NoError || json.isNull()) && httpStatusCode != notModifiedStatusCode) { if ((error.error != QJsonParseError::NoError || json.isNull()) && httpStatusCode != notModifiedStatusCode) {

View file

@ -369,7 +369,7 @@ void ProgressInfo::recomputeCompletedSize()
ProgressInfo::Estimates ProgressInfo::Progress::estimates() const ProgressInfo::Estimates ProgressInfo::Progress::estimates() const
{ {
Estimates est; Estimates est{};
est.estimatedBandwidth = _progressPerSec; est.estimatedBandwidth = _progressPerSec;
if (_progressPerSec != 0) { if (_progressPerSec != 0) {
est.estimatedEta = qRound64(static_cast<double>(_total - _completed) / _progressPerSec) * 1000; est.estimatedEta = qRound64(static_cast<double>(_total - _completed) / _progressPerSec) * 1000;

View file

@ -227,11 +227,11 @@ private:
Progress _fileProgress; Progress _fileProgress;
// All size from completed jobs only. // All size from completed jobs only.
qint64 _totalSizeOfCompletedJobs; qint64 _totalSizeOfCompletedJobs = 0LL;
// The fastest observed rate of files per second in this sync. // The fastest observed rate of files per second in this sync.
double _maxFilesPerSecond; double _maxFilesPerSecond = 0.0;
double _maxBytesPerSecond; double _maxBytesPerSecond = 0.0;
}; };
namespace Progress { namespace Progress {

View file

@ -130,7 +130,7 @@ bool PollJob::finished()
} }
QByteArray jsonData = reply()->readAll().trimmed(); QByteArray jsonData = reply()->readAll().trimmed();
QJsonParseError jsonParseError; QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object(); QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
qCInfo(lcPollJob) << ">" << jsonData << "<" << reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() << json << jsonParseError.errorString(); qCInfo(lcPollJob) << ">" << jsonData << "<" << reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() << json << jsonParseError.errorString();
if (jsonParseError.error != QJsonParseError::NoError) { if (jsonParseError.error != QJsonParseError::NoError) {

View file

@ -94,7 +94,7 @@ private:
QString _message; QString _message;
QString _icon; QString _icon;
OnlineStatus _state = OnlineStatus::Online; OnlineStatus _state = OnlineStatus::Online;
bool _messagePredefined; bool _messagePredefined = false;
Optional<ClearAt> _clearAt; Optional<ClearAt> _clearAt;
}; };

View file

@ -304,8 +304,8 @@ class FakeGetReply : public FakeReply
Q_OBJECT Q_OBJECT
public: public:
const FileInfo *fileInfo; const FileInfo *fileInfo;
char payload; char payload = 0;
int size; int size = 0;
bool aborted = false; bool aborted = false;
FakeGetReply(FileInfo &remoteRootFileInfo, QNetworkAccessManager::Operation op, const QNetworkRequest &request, QObject *parent); FakeGetReply(FileInfo &remoteRootFileInfo, QNetworkAccessManager::Operation op, const QNetworkRequest &request, QObject *parent);

View file

@ -28,8 +28,8 @@ using namespace OCC::Utility;
ValidateChecksumHeader::FailureReason _expectedFailureReason = ValidateChecksumHeader::FailureReason::Success; ValidateChecksumHeader::FailureReason _expectedFailureReason = ValidateChecksumHeader::FailureReason::Success;
QByteArray _expected; QByteArray _expected;
QByteArray _expectedType; QByteArray _expectedType;
bool _successDown; bool _successDown = false;
bool _errorSeen; bool _errorSeen = false;
public slots: public slots:

View file

@ -15,7 +15,7 @@ class TestXmlParse : public QObject
Q_OBJECT Q_OBJECT
private: private:
bool _success; bool _success = false;
QStringList _subdirs; QStringList _subdirs;
QStringList _items; QStringList _items;