Skip to content

Commit

Permalink
int64 to int for getLogEstimatedSize.
Browse files Browse the repository at this point in the history
  • Loading branch information
herve-er committed Apr 19, 2024
1 parent e0ae230 commit 9dd1f32
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/gui/debuggingdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ void DebuggingDialog::onSaveButtonTriggered(bool checked) {
}

void DebuggingDialog::onSendLogButtonTriggered() {
int64_t size;
int size;
ExitCode exitCode = GuiRequests::getAproximateLogSize(size);
if (exitCode != ExitCode::ExitCodeOk) {
onSendLogConfirmed(true); // Send all logs by default if we can't get the aproximate size
Expand Down
2 changes: 1 addition & 1 deletion src/gui/guirequests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ ExitCode GuiRequests::setRootPinState(int syncDbId, PinState pinState) {
return exitCode;
}

ExitCode GuiRequests::getAproximateLogSize(int64_t &size) {
ExitCode GuiRequests::getAproximateLogSize(int &size) {
QByteArray results;
if (!CommClient::instance()->execute(REQUEST_NUM_GET_LOG_ESTIMATED_SIZE, QByteArray(), results)) {
return ExitCodeSystemError;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/guirequests.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct GuiRequests {
static ExitCode resolveUnsupportedCharErrors(int driveDbId);
static ExitCode setSupportsVirtualFiles(int syncDbId, bool value);
static ExitCode setRootPinState(int syncDbId, PinState pinState);
static ExitCode getAproximateLogSize(int64_t &size);
static ExitCode getAproximateLogSize(int &size);
static ExitCode sendLogToSupport(bool sendAllLogs);

#ifdef Q_OS_WIN
Expand Down
6 changes: 5 additions & 1 deletion src/gui/parametersdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ QString ParametersDialog::getAppErrorText(QString fctCode, ExitCode exitCode, Ex
"Please empty the history and if the error persists, contact our support team.")
.arg(err);
break;
case ExitCodeNoDriveFound:
return tr("No kDrive found (error %1).<br>"
"Log in to your kDrive account and add a kDrive.")
.arg(err);
case ExitCodeOk:
case ExitCodeNeedRestart:
case ExitCodeInconsistencyError:
Expand Down Expand Up @@ -575,7 +579,7 @@ QString ParametersDialog::getSyncPalErrorText(QString fctCode, ExitCode exitCode
break;
case ExitCodeNoDriveFound:
return tr("No kDrive found (error %1).<br>"
"Log in to your kDrive account and add a kDrive.")
"Log in to your kDrive account and add a kDrive.")
.arg(err);
break;
case ExitCodeOk:
Expand Down
4 changes: 2 additions & 2 deletions src/libcommonserver/log/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Log::Log(const log4cplus::tstring &filePath) {
LOG_INFO(_logger, "Logger initialization done");
}

int64_t Log::getLogEstimatedSize(IoError &ioError) {
int Log::getLogEstimatedSize(IoError &ioError) {
SyncPath logPath;

IoHelper::logDirectoryPath(logPath, ioError);
Expand All @@ -134,7 +134,7 @@ int64_t Log::getLogEstimatedSize(IoError &ioError) {
}

// Estimate the size of the log files
int64_t size = 0;
int size = 0;
DirectoryEntry entry;
bool retried = true;
ioError = IoErrorSuccess;
Expand Down
2 changes: 1 addition & 1 deletion src/libcommonserver/log/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class COMMONSERVER_EXPORT Log {
* \param ioError The error object to be filled in case of error.
* \return The estimated size of the log files in bytes.
*/
int64_t getLogEstimatedSize(IoError &ioError);
int getLogEstimatedSize(IoError &ioError);

/*! Generates a support archive containing the logs and the parms.db file.
* \param includeOldLogs If true, the old logs will be included in the archive.
Expand Down
2 changes: 1 addition & 1 deletion src/server/appserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ void AppServer::onRequestReceived(int id, RequestNum num, const QByteArray &para
case REQUEST_NUM_GET_LOG_ESTIMATED_SIZE: {
// Get estimated size of the log file
IoError ioError = IoErrorSuccess;
int64_t size = Log::instance()->getLogEstimatedSize(ioError);
int size = Log::instance()->getLogEstimatedSize(ioError);
if (size >= 0) {
resultStream << ExitCodeOk;
resultStream << size;
Expand Down

0 comments on commit 9dd1f32

Please sign in to comment.