mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer: Various fixes and improvements to PIPGenerator
This commit is contained in:
parent
711e75bdc8
commit
ef2d1fa9fd
12 changed files with 194 additions and 28 deletions
|
|
@ -491,13 +491,39 @@ void Project::moveTemporaryDirectory (const File& newParentDirectory)
|
|||
auto newDirectory = newParentDirectory.getChildFile (tempDirectory.getFileName());
|
||||
auto oldJucerFileName = getFile().getFileName();
|
||||
|
||||
saveProjectRootToFile();
|
||||
|
||||
tempDirectory.copyDirectoryTo (newDirectory);
|
||||
tempDirectory.deleteRecursively();
|
||||
tempDirectory = File();
|
||||
|
||||
// reload project from new location
|
||||
if (auto* window = ProjucerApplication::getApp().mainWindowList.getMainWindowForFile (getFile()))
|
||||
window->moveProject (newDirectory.getChildFile (oldJucerFileName));
|
||||
{
|
||||
Component::SafePointer<MainWindow> safeWindow (window);
|
||||
|
||||
MessageManager::callAsync ([safeWindow, newDirectory, oldJucerFileName]
|
||||
{
|
||||
if (safeWindow != nullptr)
|
||||
safeWindow.getComponent()->moveProject (newDirectory.getChildFile (oldJucerFileName));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
bool Project::saveProjectRootToFile()
|
||||
{
|
||||
ScopedPointer<XmlElement> xml (projectRoot.createXml());
|
||||
|
||||
if (xml == nullptr)
|
||||
{
|
||||
jassertfalse;
|
||||
return false;
|
||||
}
|
||||
|
||||
MemoryOutputStream mo;
|
||||
xml->writeToStream (mo, {});
|
||||
|
||||
return FileHelpers::overwriteFileWithNewDataIfDifferent (getFile(), mo);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue