notify Gorm only if the file was really saved, or it will reload the old file

This commit is contained in:
Riccardo Mottola 2021-02-18 00:32:47 +01:00
parent 80d0c2575e
commit aa2ce8fd73

View file

@ -658,18 +658,18 @@
postNotificationName:PCEditorWillSaveNotification
object:self];
// Send the notification to Gorm...
if([[_path pathExtension] isEqual: @"h"])
{
[[NSDistributedNotificationCenter defaultCenter]
postNotificationName: @"GormParseClassNotification"
object: _path];
}
saved = [[_storage string] writeToFile:_path atomically:YES];
if (saved == YES)
{
// Send the notification to Gorm...
if([[_path pathExtension] isEqual: @"h"])
{
[[NSDistributedNotificationCenter defaultCenter]
postNotificationName: @"GormParseClassNotification"
object: _path];
}
[self setIsEdited:NO];
[[NSNotificationCenter defaultCenter]
postNotificationName:PCEditorDidSaveNotification