This commit is contained in:
Birunthan Mohanathas 2012-05-30 08:10:12 +03:00
parent 659cb563bd
commit 0891ee4b91
3 changed files with 9 additions and 11 deletions

View File

@ -254,7 +254,7 @@ const WCHAR* CMeasure::CheckSubstitute(const WCHAR* buffer)
if (re == NULL)
{
MakePlainSubstitute(str, i);
LogWithArgs(LOG_NOTICE, L"%S", error);
LogWithArgs(LOG_NOTICE, L"Substitute: %S", error);
}
else
{

View File

@ -1230,27 +1230,25 @@ void CSystem::SetWallpaper(const std::wstring& wallpaper, const std::wstring& st
** Copies files and folders from one location to another.
**
*/
bool CSystem::CopyFiles(const std::wstring& strFrom, const std::wstring& strTo, bool bMove)
bool CSystem::CopyFiles(std::wstring from, std::wstring to, bool bMove)
{
std::wstring tmpFrom(strFrom), tmpTo(strTo);
// The strings must end with double nul
tmpFrom.append(1, L'\0');
tmpTo.append(1, L'\0');
// The strings must end with double \0
from.append(1, L'\0');
to.append(1, L'\0');
SHFILEOPSTRUCT fo =
{
NULL,
bMove ? FO_MOVE : FO_COPY,
tmpFrom.c_str(),
tmpTo.c_str(),
from.c_str(),
to.c_str(),
FOF_NO_UI | FOF_NOCONFIRMATION | FOF_ALLOWUNDO
};
int result = SHFileOperation(&fo);
if (result != 0)
{
LogWithArgs(LOG_ERROR, L"Unable to copy files from %s to %s (%i)", strFrom.c_str(), strTo.c_str(), result);
LogWithArgs(LOG_ERROR, L"Copy error: From %s to %s (%i)", from.c_str(), to.c_str(), result);
return false;
}
return true;

View File

@ -82,7 +82,7 @@ public:
static void SetClipboardText(const std::wstring& text);
static void SetWallpaper(const std::wstring& wallpaper, const std::wstring& style);
static bool CopyFiles(const std::wstring& strFrom, const std::wstring& strTo, bool bMove = false);
static bool CopyFiles(std::wstring from, std::wstring to, bool bMove = false);
static bool RemoveFile(const std::wstring& file);
static bool RemoveFolder(const std::wstring& strFolder);