Browse Source

Improved File::moveFileTo and made file renaming in the introjucer more robust.

tags/2021-05-28
jules 13 years ago
parent
commit
75ad35f786
2 changed files with 5 additions and 1 deletions
  1. +2
    -1
      extras/Introjucer/Source/Project/jucer_Project.cpp
  2. +3
    -0
      modules/juce_core/files/juce_File.cpp

+ 2
- 1
extras/Introjucer/Source/Project/jucer_Project.cpp View File

@@ -542,7 +542,8 @@ bool Project::Item::renameFile (const File& newFile)
{
const File oldFile (getFile());
if (oldFile.moveFileTo (newFile))
if (oldFile.moveFileTo (newFile)
|| (newFile.exists() && ! oldFile.exists()))
{
setFile (newFile);
OpenDocumentManager::getInstance()->fileHasBeenRenamed (oldFile, newFile);


+ 3
- 0
modules/juce_core/files/juce_File.cpp View File

@@ -229,6 +229,9 @@ bool File::moveFileTo (const File& newFile) const
if (newFile.fullPath == fullPath)
return true;
if (! exists())
return false;
#if ! NAMES_ARE_CASE_SENSITIVE
if (*this != newFile)
#endif


Loading…
Cancel
Save