mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Tweaks
This commit is contained in:
parent
659cb563bd
commit
0891ee4b91
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user