Check for invalid filenames and in case, reset to the original file name.

This commit is contained in:
Riccardo Mottola 2021-02-03 23:17:42 +01:00
parent 1541788856
commit 76b8316b5c
2 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2021-02-03 Riccardo Mottola <rm@gnu.org>
* Framework/PCProjectInspector.m
Check for invalid filenames and in case, reset to the original
file name.
2021-02-03 Riccardo Mottola <rm@gnu.org>
* Framework/PCEditorManager.m:

View file

@ -1,7 +1,7 @@
/*
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
Copyright (C) 2000-2010 Free Software Foundation
Copyright (C) 2000-2021 Free Software Foundation
Authors: Philippe C.D. Robert
Serg Stoyan
@ -977,10 +977,20 @@
- (void)fileNameDidChange:(id)sender
{
if ([fileName isEqualToString:[fileNameField stringValue]])
NSString *newName;
newName = [fileNameField stringValue];
if ([fileName isEqualToString:newName])
{
[fileNameField setStringValue:fileName];
return;
}
if ([[newName stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] == 0)
{
[fileNameField setStringValue:fileName];
return NO;
}
/* PCLogInfo(self, @"{%@} file name changed from: %@ to: %@",
[project projectName], fileName, [fileNameField stringValue]);*/