aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/utils')
-rw-r--r--src/core/utils/AsyncUtils.cpp8
-rw-r--r--src/core/utils/GpgUtils.cpp28
-rw-r--r--src/core/utils/IOUtils.cpp16
3 files changed, 26 insertions, 26 deletions
diff --git a/src/core/utils/AsyncUtils.cpp b/src/core/utils/AsyncUtils.cpp
index a6fca88f..a4bc66fa 100644
--- a/src/core/utils/AsyncUtils.cpp
+++ b/src/core/utils/AsyncUtils.cpp
@@ -44,8 +44,8 @@ auto RunGpgOperaAsync(const GpgOperaRunnable& runnable,
"core", "gpgme.ctx.gnupg_version", minial_version);
if (GFCompareSoftwareVersion(gnupg_version, minial_version) < 0) {
- qCWarning(core) << "operation" << operation
- << " not support for gnupg version: " << gnupg_version;
+ LOG_W() << "operation" << operation
+ << " not support for gnupg version: " << gnupg_version;
callback(GPG_ERR_NOT_SUPPORTED, TransferParams());
return Thread::Task::TaskHandler(nullptr);
}
@@ -82,8 +82,8 @@ auto RunGpgOperaSync(const GpgOperaRunnable& runnable, const QString& operation,
"core", "gpgme.ctx.gnupg_version", minial_version);
if (GFCompareSoftwareVersion(gnupg_version, minial_version) < 0) {
- qCWarning(core) << "operation" << operation
- << " not support for gnupg version: " << gnupg_version;
+ LOG_W() << "operation" << operation
+ << " not support for gnupg version: " << gnupg_version;
return {GPG_ERR_NOT_SUPPORTED, TransferParams()};
}
diff --git a/src/core/utils/GpgUtils.cpp b/src/core/utils/GpgUtils.cpp
index 28892063..3d584b8f 100644
--- a/src/core/utils/GpgUtils.cpp
+++ b/src/core/utils/GpgUtils.cpp
@@ -50,9 +50,9 @@ auto GetGpgmeErrorString(gpgme_error_t err) -> QString {
auto CheckGpgError(GpgError err) -> GpgError {
auto err_code = gpg_err_code(err);
if (err_code != GPG_ERR_NO_ERROR) {
- qCWarning(core) << "gpg operation failed [error code: " << err_code
- << "], source: " << gpgme_strsource(err)
- << " description: " << GetGpgmeErrorString(err);
+ LOG_W() << "gpg operation failed [error code: " << err_code
+ << "], source: " << gpgme_strsource(err)
+ << " description: " << GetGpgmeErrorString(err);
}
return err_code;
}
@@ -61,15 +61,15 @@ auto CheckGpgError2ErrCode(GpgError err, GpgError predict) -> GpgErrorCode {
auto err_code = gpg_err_code(err);
if (err_code != gpg_err_code(predict)) {
if (err_code == GPG_ERR_NO_ERROR) {
- qCInfo(core) << "[Warning " << gpg_err_code(err)
- << "] Source: " << gpgme_strsource(err)
- << " description: " << GetGpgmeErrorString(err)
- << " predict: " << GetGpgmeErrorString(predict);
+ LOG_I() << "[Warning " << gpg_err_code(err)
+ << "] Source: " << gpgme_strsource(err)
+ << " description: " << GetGpgmeErrorString(err)
+ << " predict: " << GetGpgmeErrorString(predict);
} else {
- qCWarning(core) << "[Error " << gpg_err_code(err)
- << "] Source: " << gpgme_strsource(err)
- << " description: " << GetGpgmeErrorString(err)
- << " predict: " << GetGpgmeErrorString(predict);
+ LOG_W() << "[Error " << gpg_err_code(err)
+ << "] Source: " << gpgme_strsource(err)
+ << " description: " << GetGpgmeErrorString(err)
+ << " predict: " << GetGpgmeErrorString(predict);
}
}
return err_code;
@@ -81,9 +81,9 @@ auto DescribeGpgErrCode(GpgError err) -> GpgErrorDesc {
auto CheckGpgError(GpgError err, const QString& /*comment*/) -> GpgError {
if (gpg_err_code(err) != GPG_ERR_NO_ERROR) {
- qCWarning(core) << "[Error " << gpg_err_code(err)
- << "] Source: " << gpgme_strsource(err)
- << " description: " << GetGpgmeErrorString(err);
+ LOG_W() << "[Error " << gpg_err_code(err)
+ << "] Source: " << gpgme_strsource(err)
+ << " description: " << GetGpgmeErrorString(err);
}
return err;
}
diff --git a/src/core/utils/IOUtils.cpp b/src/core/utils/IOUtils.cpp
index 11f2b3e8..39f00d19 100644
--- a/src/core/utils/IOUtils.cpp
+++ b/src/core/utils/IOUtils.cpp
@@ -49,7 +49,7 @@ auto GetFileChecksum(const QString& file_name,
auto ReadFile(const QString& file_name, QByteArray& data) -> bool {
QFile file(file_name);
if (!file.open(QIODevice::ReadOnly)) {
- qCWarning(core) << "failed to open file: " << file_name;
+ LOG_W() << "failed to open file: " << file_name;
return false;
}
data = file.readAll();
@@ -60,7 +60,7 @@ auto ReadFile(const QString& file_name, QByteArray& data) -> bool {
auto WriteFile(const QString& file_name, const QByteArray& data) -> bool {
QFile file(file_name);
if (!file.open(QIODevice::WriteOnly)) {
- qCWarning(core) << "failed to open file for writing: " << file_name;
+ LOG_W() << "failed to open file for writing: " << file_name;
return false;
}
file.write(data);
@@ -181,16 +181,16 @@ auto CalculateBinaryChacksum(const QString& path) -> QString {
// check file info and access rights
QFileInfo info(path);
if (!info.exists() || !info.isFile() || !info.isReadable()) {
- qCWarning(core) << "get info for file: " << info.filePath()
- << " error, exists: " << info.exists();
+ LOG_W() << "get info for file: " << info.filePath()
+ << " error, exists: " << info.exists();
return {};
}
// open and read file
QFile f(info.filePath());
if (!f.open(QIODevice::ReadOnly)) {
- qCWarning(core) << "open " << path
- << "to calculate checksum error: " << f.errorString();
+ LOG_W() << "open " << path
+ << "to calculate checksum error: " << f.errorString();
return {};
}
@@ -201,8 +201,8 @@ auto CalculateBinaryChacksum(const QString& path) -> QString {
while (!f.atEnd()) {
QByteArray const buffer = f.read(buffer_size);
if (buffer.isEmpty()) {
- qCWarning(core) << "error reading file: " << path
- << " during checksum calculation";
+ LOG_W() << "error reading file: " << path
+ << " during checksum calculation";
return {};
}
hash_sha.addData(buffer);