Browse Source

Projucer: Ensure that saving always continues after moving a project

v6.1.6
reuk 3 years ago
parent
commit
f1e766ec18
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
2 changed files with 9 additions and 5 deletions
  1. +8
    -3
      extras/Projucer/Source/Application/jucer_MainWindow.cpp
  2. +1
    -2
      extras/Projucer/Source/ProjectSaving/jucer_ProjectSaver.cpp

+ 8
- 3
extras/Projucer/Source/Application/jucer_MainWindow.cpp View File

@@ -300,11 +300,16 @@ void MainWindow::moveProject (File newProjectFileToOpen, OpenInIDE openInIDE)
parent->openFile (newProjectFileToOpen, [parent, openInIDE] (bool openedSuccessfully)
{
if (parent == nullptr)
if (! (openedSuccessfully && parent != nullptr && parent->currentProject != nullptr && openInIDE == OpenInIDE::yes))
return;
if (openedSuccessfully && parent->currentProject != nullptr && openInIDE == OpenInIDE::yes)
ProjucerApplication::getApp().getCommandManager().invokeDirectly (CommandIDs::saveAndOpenInIDE, false);
// The project component knows how to process the saveAndOpenInIDE command, but the
// main application does not. In order to process the command successfully, we need
// to ensure that the project content component has focus.
auto& manager = ProjucerApplication::getApp().getCommandManager();
manager.setFirstCommandTarget (parent->getProjectContentComponent());
ProjucerApplication::getApp().getCommandManager().invokeDirectly (CommandIDs::saveAndOpenInIDE, false);
manager.setFirstCommandTarget (nullptr);
});
});
}


+ 1
- 2
extras/Projucer/Source/ProjectSaving/jucer_ProjectSaver.cpp View File

@@ -64,8 +64,7 @@ void ProjectSaver::saveProjectAsync (ProjectExporter* exporterToSave, std::funct
ref->saveThread->waitForThreadToExit (-1);
ref->saveThread = nullptr;
if (onCompletion != nullptr)
onCompletion (result);
NullCheckedInvocation::invoke (onCompletion, result);
});
saveThread->launchThread();
}


Loading…
Cancel
Save