From 746072e95db9530c82013ff32e5bf1a24254eb2e Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Fri, 2 Jul 2021 11:19:04 +0200 Subject: [PATCH] fix all usage of _com_error(cfExecuteresult).ErrorMessage() _com_error(cfExecuteresult).ErrorMessage() calls should be translated to QString before use with qDebug and related logging facilities Signed-off-by: Matthieu Gallien --- src/libsync/vfs/cfapi/cfapiwrapper.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libsync/vfs/cfapi/cfapiwrapper.cpp b/src/libsync/vfs/cfapi/cfapiwrapper.cpp index e6e0f8da8..81f4c3400 100644 --- a/src/libsync/vfs/cfapi/cfapiwrapper.cpp +++ b/src/libsync/vfs/cfapi/cfapiwrapper.cpp @@ -631,7 +631,7 @@ OCC::Result OCC::CfApiWrapper::setPinState(const FileHandle &hand if (result == S_OK) { return {}; } else { - qCWarning(lcCfApiWrapper) << "Couldn't set pin state" << state << "for" << pathForHandle(handle) << "with recurse mode" << mode << ":" << _com_error(result).ErrorMessage(); + qCWarning(lcCfApiWrapper) << "Couldn't set pin state" << state << "for" << pathForHandle(handle) << "with recurse mode" << mode << ":" << QString::fromWCharArray(_com_error(result).ErrorMessage()); return { "Couldn't set pin state" }; } } @@ -666,7 +666,7 @@ OCC::Result OCC::CfApiWrapper::createPlaceholderInfo(const QStrin const qint64 result = CfCreatePlaceholders(localBasePath.data(), &cloudEntry, 1, CF_CREATE_FLAG_NONE, nullptr); if (result != S_OK) { - qCWarning(lcCfApiWrapper) << "Couldn't create placeholder info for" << path << ":" << _com_error(result).ErrorMessage(); + qCWarning(lcCfApiWrapper) << "Couldn't create placeholder info for" << path << ":" << QString::fromWCharArray(_com_error(result).ErrorMessage()); return { "Couldn't create placeholder info" }; } @@ -708,7 +708,7 @@ OCC::Result OCC::CfApiWrapper::updatePlaceholderInfo(const FileHa nullptr, 0, CF_UPDATE_FLAG_MARK_IN_SYNC, nullptr, nullptr); if (result != S_OK) { - qCWarning(lcCfApiWrapper) << "Couldn't update placeholder info for" << pathForHandle(handle) << ":" << _com_error(result).ErrorMessage(); + qCWarning(lcCfApiWrapper) << "Couldn't update placeholder info for" << pathForHandle(handle) << ":" << QString::fromWCharArray(_com_error(result).ErrorMessage()); return { "Couldn't update placeholder info" }; } @@ -732,7 +732,7 @@ OCC::Result OCC::CfApiWrapper::convertToPlaceholder(const FileHan const qint64 result = CfConvertToPlaceholder(handle.get(), fileIdentity.data(), sizeToDWORD(fileIdentitySize), CF_CONVERT_FLAG_MARK_IN_SYNC, nullptr, nullptr); Q_ASSERT(result == S_OK); if (result != S_OK) { - qCCritical(lcCfApiWrapper) << "Couldn't convert to placeholder" << pathForHandle(handle) << ":" << _com_error(result).ErrorMessage(); + qCCritical(lcCfApiWrapper) << "Couldn't convert to placeholder" << pathForHandle(handle) << ":" << QString::fromWCharArray(_com_error(result).ErrorMessage()); return { "Couldn't convert to placeholder" }; }