public:
void init(KMessageWidget *);
- KMessageWidget *q;
+ KMessageWidget *q = nullptr;
QFrame *content = nullptr;
QLabel *iconLabel = nullptr;
QLabel *textLabel = nullptr;
bool ignoreShowEventDoingAnimatedShow = false;
KMessageWidget::MessageType messageType;
- bool wordWrap;
+ bool wordWrap = false;
QList<QToolButton *> buttons;
QPixmap contentSnapShot;
if (m_lock_mode != NoLock)
unlock();
- struct flock fl;
+ struct flock fl{};
fl.l_whence = SEEK_SET;
fl.l_start = 0;
fl.l_len = 0;
if (!isLocked())
return true;
- struct flock fl;
+ struct flock fl{};
fl.l_whence = SEEK_SET;
fl.l_start = 0;
fl.l_len = 0;
private:
QtLocalPeer* peer;
- bool block;
+ bool block = false;
};
} // namespace SharedTools
QString user;
QString password;
QString proxy;
- bool silent;
- bool trustSSL;
- bool useNetrc;
- bool interactive;
- bool ignoreHiddenFiles;
+ bool silent = false;
+ bool trustSSL = false;
+ bool useNetrc = false;
+ bool interactive = false;
+ bool ignoreHiddenFiles = false;
QString exclude;
QString unsyncedfolders;
- int restartTimes;
- int downlimit;
- int uplimit;
+ int restartTimes = 0;
+ int downlimit = 0;
+ int uplimit = 0;
};
// we can't use csync_set_userdata because the SyncEngine sets it already.
DWORD mode = 0;
HANDLE hStdin;
#else
- termios tios;
+ termios tios{};
#endif
};
return (qint64)stat.f_bavail * stat.f_frsize;
}
#elif defined(Q_OS_UNIX)
- struct statvfs64 stat;
+ struct statvfs64 stat{};
if (statvfs64(path.toLocal8Bit().data(), &stat) == 0) {
return (qint64)stat.f_bavail * stat.f_frsize;
}
{
}
- QTreeView *folderList;
- FolderStatusModel *model;
+ QTreeView *folderList = nullptr;
+ FolderStatusModel *model = nullptr;
protected:
bool eventFilter(QObject *watched, QEvent *event) override
void AccountSettings::displayMnemonic(const QString &mnemonic)
{
QDialog widget;
- Ui_Dialog ui;
+ Ui_Dialog ui{};
ui.setupUi(&widget);
widget.setWindowTitle(tr("End-to-end encryption mnemonic"));
ui.label->setText(
bool _wasDisabledBefore;
AccountState *_accountState;
UserInfo _userInfo;
- QAction *_toggleSignInOutAction;
- QAction *_addAccountAction;
+ QAction *_toggleSignInOutAction = nullptr;
+ QAction *_addAccountAction = nullptr;
bool _menuShown;
QUrl _serverUrl;
QString _remoteDirPath;
QString _localDirPath;
- bool _isVfsEnabled;
+ bool _isVfsEnabled = false;
};
}
QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this, action](QNetworkReply *reply) {
auto jsonData = reply->readAll();
- QJsonParseError jsonParseError;
+ QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
QString pollToken, pollEndpoint, loginUrl;
QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this](QNetworkReply *reply) {
auto jsonData = reply->readAll();
- QJsonParseError jsonParseError;
+ QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
QUrl serverUrl;
QString loginName, appPassword;
QString _pollToken;
QString _pollEndpoint;
QTimer _pollTimer;
- qint64 _secondsLeft;
- qint64 _secondsInterval;
+ qint64 _secondsLeft = 0LL;
+ qint64 _secondsInterval = 0LL;
bool _isBusy;
bool _hasToken;
bool _enforceHttps = false;
job->setTimeout(qMin(30 * 1000ll, job->timeoutMsec()));
QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this, socket](QNetworkReply *reply) {
auto jsonData = reply->readAll();
- QJsonParseError jsonParseError;
+ QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
QString accessToken = json["access_token"].toString();
QString refreshToken = json["refresh_token"].toString();
QTimer _searchRateLimitingTimer;
- AccountState *_accountState;
+ AccountState *_accountState = nullptr;
QString _searchString;
bool _shareItemIsFolder = false;
bool _fetchOngoing = false;
// 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
// these objects will be deallocated for the entire application. We do not want that!!
- AccountState *_accountState;
- Folder *_folder;
+ AccountState *_accountState = nullptr;
+ Folder *_folder = nullptr;
QString _localPath;
QString _sharePath;
private:
void changeStyle();
- Ui_FolderWizardSourcePage _ui;
+ Ui_FolderWizardSourcePage _ui{};
Folder::Map _folderMap;
AccountPtr _account;
};
LsColJob *runLsColJob(const QString &path);
void recursiveInsert(QTreeWidgetItem *parent, QStringList pathTrail, QString path);
bool selectByPath(QString path);
- Ui_FolderWizardTargetPage _ui;
+ Ui_FolderWizardTargetPage _ui{};
bool _warnWasVisible;
AccountPtr _account;
QTimer _lscolTimer;
// check a environment variable for core dumps
#ifdef Q_OS_UNIX
if (!qEnvironmentVariableIsEmpty("OWNCLOUD_CORE_DUMP")) {
- struct rlimit core_limit;
+ struct rlimit core_limit{};
core_limit.rlim_cur = RLIM_INFINITY;
core_limit.rlim_max = RLIM_INFINITY;
{
const QByteArray replyData = reply()->readAll();
- QJsonParseError error;
+ QJsonParseError error{};
QString message;
int statusCode = 0;
auto json = QJsonDocument::fromJson(replyData, &error);
QDBusConnection _bus;
#endif
- QAction *_actionNewAccountWizard;
- QAction *_actionSettings;
- QAction *_actionEstimate;
+ QAction *_actionNewAccountWizard = nullptr;
+ QAction *_actionSettings = nullptr;
+ QAction *_actionEstimate = nullptr;
QList<QAction *> _recentItemsActions;
void RemoteWipe::checkJobSlot()
{
auto jsonData = _networkReplyCheck->readAll();
- QJsonParseError jsonParseError;
+ QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
bool wipe = false;
void RemoteWipe::notifyServerSuccessJobSlot()
{
auto jsonData = _networkReplySuccess->readAll();
- QJsonParseError jsonParseError;
+ QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
if (_networkReplySuccess->error() != QNetworkReply::NoError ||
jsonParseError.error != QJsonParseError::NoError) {
private:
void init(const AccountPtr &account);
- SelectiveSyncWidget *_selectiveSync;
+ SelectiveSyncWidget *_selectiveSync = nullptr;
Folder *_folder;
- QPushButton *_okButton;
+ QPushButton *_okButton = nullptr;
};
}
socketApiJob->reject(QStringLiteral("command not found"));
}
} else if (command.startsWith("V2/")) {
- QJsonParseError error;
+ QJsonParseError error{};
const auto json = QJsonDocument::fromJson(argument.toUtf8(), &error).object();
if (error.error != QJsonParseError::NoError) {
qCWarning(lcSocketApi()) << "Invalid json" << argument.toString() << error.errorString();
private:
Account *_account = nullptr;
QScopedPointer<Flow2Auth> _asyncAuth;
- Ui_Flow2AuthWidget _ui;
+ Ui_Flow2AuthWidget _ui{};
protected slots:
void slotOpenBrowser();
// TODO: remove when UX decision is made
void refreshVirtualFilesAvailibility(const QString &path);
- Ui_OwncloudAdvancedSetupPage _ui;
+ Ui_OwncloudAdvancedSetupPage _ui{};
bool _checking = false;
bool _created = false;
bool _localFolderValid = false;
QString _token;
QString _refreshToken;
QScopedPointer<OAuth> _asyncAuth;
- Ui_OwncloudOAuthCredsPage _ui;
+ Ui_OwncloudOAuthCredsPage _ui{};
protected slots:
void slotOpenBrowser();
void customizeStyle();
void setupServerAddressDescriptionLabel();
- Ui_OwncloudSetupPage _ui;
+ Ui_OwncloudSetupPage _ui{};
QString _oCUrl;
QString _ocUser;
OwncloudOAuthCredsPage *_browserCredsPage;
Flow2AuthCredsPage *_flow2CredsPage;
OwncloudAdvancedSetupPage *_advancedSetupPage;
- OwncloudWizardResultPage *_resultPage;
+ OwncloudWizardResultPage *_resultPage = nullptr;
AbstractCredentialsWizardPage *_credentialsPage = nullptr;
WebViewPage *_webViewPage = nullptr;
QString _user;
QString _pass;
- bool _useSystemProxy;
+ bool _useSystemProxy = false;
QSize _originalWizardSize;
};
GETFileJob *_relativeLimitCurrentMeasuredJob;
// for measuring how much progress we made at start
- qint64 _relativeDownloadLimitProgressAtMeasuringRestart;
+ qint64 _relativeDownloadLimitProgressAtMeasuringRestart = 0LL;
qint64 _currentDownloadLimit;
};
emit error(_fileId, retCode);
return true;
}
- QJsonParseError error;
+ QJsonParseError error{};
auto json = QJsonDocument::fromJson(reply()->readAll(), &error);
emit jsonReceived(json, reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt());
return true;
return true;
}
- QJsonParseError error;
+ QJsonParseError error{};
const auto json = QJsonDocument::fromJson(reply()->readAll(), &error);
const auto obj = json.object().toVariantMap();
const auto token = obj["ocs"].toMap()["data"].toMap()["e2e-token"].toByteArray();
if (retCode != 200)
qCInfo(lcStorePrivateKeyApiJob()) << "Sending private key ended with" << path() << errorString() << retCode;
- QJsonParseError error;
+ QJsonParseError error{};
auto json = QJsonDocument::fromJson(reply()->readAll(), &error);
emit jsonReceived(json, reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt());
return true;
{
qCInfo(lcStorePrivateKeyApiJob()) << "Sending CSR ended with" << path() << errorString() << reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute);
- QJsonParseError error;
+ QJsonParseError error{};
auto json = QJsonDocument::fromJson(reply()->readAll(), &error);
emit jsonReceived(json, reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt());
return true;
private:
QByteArray _fileId;
QByteArray _token;
- QBuffer *_tokenBuf;
+ QBuffer *_tokenBuf = nullptr;
QPointer<SyncJournalDb> _journalDb;
};
job->setTimeout(qMin(30 * 1000ll, job->timeoutMsec()));
QObject::connect(job, &SimpleNetworkJob::finishedSignal, this, [this](QNetworkReply *reply) {
auto jsonData = reply->readAll();
- QJsonParseError jsonParseError;
+ QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
QString accessToken = json["access_token"].toString();
if (jsonParseError.error != QJsonParseError::NoError || json.isEmpty()) {
protected:
QString _serviceName;
- Account *_account;
+ Account *_account = nullptr;
QString _key;
bool _insecureFallback = false;
bool _autoDelete = true;
qCWarning(lcCheckServerJob) << "error: status.php replied " << httpStatus << body;
emit instanceNotFound(reply());
} else {
- QJsonParseError error;
+ QJsonParseError error{};
auto status = QJsonDocument::fromJson(body, &error);
// empty or invalid response
if (error.error != QJsonParseError::NoError || status.isNull()) {
if(reply()->rawHeaderList().contains("ETag"))
emit etagResponseHeaderReceived(reply()->rawHeader("ETag"), statusCode);
- QJsonParseError error;
+ QJsonParseError error{};
auto json = QJsonDocument::fromJson(jsonStr.toUtf8(), &error);
// 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) {
ProgressInfo::Estimates ProgressInfo::Progress::estimates() const
{
- Estimates est;
+ Estimates est{};
est.estimatedBandwidth = _progressPerSec;
if (_progressPerSec != 0) {
est.estimatedEta = qRound64(static_cast<double>(_total - _completed) / _progressPerSec) * 1000;
Progress _fileProgress;
// All size from completed jobs only.
- qint64 _totalSizeOfCompletedJobs;
+ qint64 _totalSizeOfCompletedJobs = 0LL;
// The fastest observed rate of files per second in this sync.
- double _maxFilesPerSecond;
- double _maxBytesPerSecond;
+ double _maxFilesPerSecond = 0.0;
+ double _maxBytesPerSecond = 0.0;
};
namespace Progress {
}
QByteArray jsonData = reply()->readAll().trimmed();
- QJsonParseError jsonParseError;
+ QJsonParseError jsonParseError{};
QJsonObject json = QJsonDocument::fromJson(jsonData, &jsonParseError).object();
qCInfo(lcPollJob) << ">" << jsonData << "<" << reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() << json << jsonParseError.errorString();
if (jsonParseError.error != QJsonParseError::NoError) {
QString _message;
QString _icon;
OnlineStatus _state = OnlineStatus::Online;
- bool _messagePredefined;
+ bool _messagePredefined = false;
Optional<ClearAt> _clearAt;
};
Q_OBJECT
public:
const FileInfo *fileInfo;
- char payload;
- int size;
+ char payload = 0;
+ int size = 0;
bool aborted = false;
FakeGetReply(FileInfo &remoteRootFileInfo, QNetworkAccessManager::Operation op, const QNetworkRequest &request, QObject *parent);
ValidateChecksumHeader::FailureReason _expectedFailureReason = ValidateChecksumHeader::FailureReason::Success;
QByteArray _expected;
QByteArray _expectedType;
- bool _successDown;
- bool _errorSeen;
+ bool _successDown = false;
+ bool _errorSeen = false;
public slots:
Q_OBJECT
private:
- bool _success;
+ bool _success = false;
QStringList _subdirs;
QStringList _items;