Renaming with identical name throws two error dialogs

Found a bug or something that needs fixing?
Post Reply
Edgar5
Posts: 63
Joined: Sun Apr 02, 2017 7:22 am

Renaming with identical name throws two error dialogs

Post by Edgar5 »

I'm not sure if this is an enhancement request or a bug report <grin>.
Which version of Windows you are using:
Windows 7 Pro SP1
Which version of Explorer++ you are using, and the build type (32-bit or 64-bit):
1.3.5 32-bit
Whether the bug arose in previous versions of Explorer++:
unknown - I'm new to using & compiling Explorer++
What you were doing at the time of the crash/what caused the bug:
Trying to rename a file with the exact same new name as the old name.
This brings up two sequential error dialogs before the expected result
(the file retains its name). The error dialogs aren't very descriptive.

The behavior I would like is that the two error dialogs are suppressed
and the file retain its name. This is easy to accomplish; in file:
explorer++_1.3.5_src\Explorer++\Helper\FileOperations.cpp
at or near line number 29, add one new line:

[code]BOOL NFileOperations::RenameFile(const std::wstring &strOldFilename,
const std::wstring &strNewFilename)
{
if (strOldFilename == strNewFilename) return true;//efm5 Bypass the error dialogs

TCHAR *pszOldFilename = new TCHAR[strOldFilename.size() + 2];[/code]
David Erceg
Site Admin
Posts: 933
Joined: Sat Apr 18, 2009 1:46 am

Re: Renaming with identical name throws two error dialogs

Post by David Erceg »

It definitely sounds like this would be worthwhile. Could you file a pull request?
Edgar5
Posts: 63
Joined: Sun Apr 02, 2017 7:22 am

Re: Renaming with identical name throws two error dialogs

Post by Edgar5 »

Sorry David, I have no idea how to do "pull requests". As it is just a matter of adding a single line of code in file:
explorer++_1.3.5_src\Explorer++\Helper\FileOperations.cpp
at or near line number 29:
if (strOldFilename == strNewFilename) return true;

I'm hoping that a pull request is overkill <grin>.
Post Reply