gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnustep-cvs] Commit Update


From: Stefan Urbanek
Subject: Re: [Gnustep-cvs] Commit Update
Date: Sun, 09 May 2004 12:04:27 +0200

Hi,

Would it be possible to send only diffs from */ChangeLog files and list of 
changed files instead of full patches?

Stefan

On 2004-05-08 23:06:01 +0200 Adam Fedor <address@hidden> wrote:

Index: dev-apps/Gorm/ChangeLog
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-apps/Gorm/ChangeLog,v
retrieving revision 1.379
retrieving revision 1.380
diff -u -r1.379 -r1.380
--- dev-apps/Gorm/ChangeLog     8 May 2004 15:42:26 -0000       1.379
+++ dev-apps/Gorm/ChangeLog     8 May 2004 20:04:07 -0000       1.380
@@ -1,5 +1,20 @@
2004-05-08 08:53 Gregory John Casamento <address@hidden>

+       * GormDocument.m: [GormDocument loadDocument:] added code
+       to prevent users from invoking "open objects.gorm" or opening
+       "objects.gorm" directly when in GWorkspace.  This caused Gorm
+       to convert the objects.gorm file as if it were an old-style file
+       before gorm packages.  It now issues a warning.  Also added code
+ to [GormDocument openDocument:] to check for a duplicate open + of a model which is already opened. This can cause confusion.
+       * Gorm.m: Added a new method [Gorm documentNameIsUnique:] which
+       checks all existing open documents for a duplicate name and
+       returns NO, if it's not unique.
+       * GormPrivate.h: Added declaration of the method mentioned above
+       to the Gorm class interface.
+       
+2004-05-08 08:53 Gregory John Casamento <address@hidden>
+
* GModelDecoder.m: [GModelDecoder openGModel:] Corrected issue which was causing a crash.
        * GormDocument.m: Cleaned up a memory leak.  Commented/Documented
Index: dev-apps/Gorm/Gorm.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-apps/Gorm/Gorm.m,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -r1.141 -r1.142
--- dev-apps/Gorm/Gorm.m        8 May 2004 15:42:26 -0000       1.141
+++ dev-apps/Gorm/Gorm.m        8 May 2004 20:04:09 -0000       1.142
@@ -1503,6 +1503,25 @@
       [window orderFront: sender];
     }
}
+
+- (BOOL) documentNameIsUnique: (NSString *)filename
+{
+  NSEnumerator *en = [documents objectEnumerator];
+  id document;
+  BOOL unique = YES;
+
+  while((document = [en nextObject]) != nil)
+    {
+      NSString *docPath = [document documentPath];
+      if([docPath isEqual: filename])
+       {
+         unique = NO;
+         break;
+       }
+    }
+  +  return unique;
+}
@end

// custom class additions...
Index: dev-apps/Gorm/GormDocument.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-apps/Gorm/GormDocument.m,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -r1.196 -r1.197
--- dev-apps/Gorm/GormDocument.m        8 May 2004 15:42:27 -0000       1.196
+++ dev-apps/Gorm/GormDocument.m        8 May 2004 20:04:10 -0000       1.197
@@ -2049,6 +2049,20 @@
// if the data is in a directory, then load from objects.gorm if (isDir == NO)
        {
+         NSString *lastComponent = [aFile lastPathComponent];
+         NSString *parent = [aFile stringByDeletingLastPathComponent];
+         NSString *parentExt = [parent pathExtension];
+
+         // test if we're doing it wrong...
+ if([lastComponent isEqual: @"objects.gorm"] && + [parentExt isEqual: @"gorm"])
+           {
+             NSRunAlertPanel(NULL,
+ _(@"Cannot load directly from objects.gorm file, please load from the gorm package."),
+                             @"OK", NULL, NULL);
+             return nil;
+           }
+
          data = [NSData dataWithContentsOfFile: aFile];
          NSDebugLog(@"Loaded data from file...");
        }
@@ -2345,19 +2359,30 @@
     {
       NSString *filename = [oPanel filename];
       NSString *ext      = [filename pathExtension];
+      BOOL uniqueName = [(Gorm *)NSApp documentNameIsUnique: filename];

-      [[NSUserDefaults standardUserDefaults] setObject: [oPanel directory]
-                                            forKey:@"OpenDir"];
-      if ([ext isEqualToString:@"gorm"] || [ext isEqualToString:@"nib"])
+      if(uniqueName)
        {
-         return [self loadDocument: filename];
+         [[NSUserDefaults standardUserDefaults] setObject: [oPanel directory]
+                                                forKey:@"OpenDir"];
+         if ([ext isEqualToString:@"gorm"] || [ext isEqualToString:@"nib"])
+           {
+             return [self loadDocument: filename];
+           }
+         else if ([ext isEqualToString:@"gmodel"])
+           {
+             return [self openGModel: filename];
+           }
        }
-      else if ([ext isEqualToString:@"gmodel"])
+      else
        {
-         return [self openGModel: filename];
+         // if we get this far, we didn't succeed..
+ NSRunAlertPanel(NULL,_( @"Attempted to load a model which is already opened."), + _(@"OK"), NULL, NULL);
        }
     }
-  return nil;          /* Failed       */
+
+  return nil; /* Failed */
}

- (id<IBEditors>) openEditorForObject: (id)anObject
Index: dev-apps/Gorm/GormPrivate.h
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-apps/Gorm/GormPrivate.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- dev-apps/Gorm/GormPrivate.h 15 Feb 2004 00:50:50 -0000      1.48
+++ dev-apps/Gorm/GormPrivate.h 8 May 2004 20:04:13 -0000       1.49
@@ -153,6 +153,9 @@
- (void) createSubclass: (id)sender;
- (void) instantiateClass: (id)sender;
- (NSMenu*) classMenu;
+
+// utility...
+- (BOOL) documentNameIsUnique: (NSString *)filename;
@end

@interface GormClassEditor : NSObject <IBSelectionOwners>





--
http://stefan.agentfarms.net

First they ignore you, then they laugh at you, then they fight you, then you 
win.
- Mahatma Gandhi






reply via email to

[Prev in Thread] Current Thread [Next in Thread]