@INVALIDNOREPLY: "URL:
  <<url>
                 Summary: EOModelEditor could not save a new document
                 Project: GNUstep
            Submitted by: leeg
            Submitted on: Wed 19 Jun 2013 02:46:08 PM GMT
                Category: gdl2
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
    _______________________________________________________
Details:
There are a couple of aspects to this fix:
 - on receiving -[EOMEDocument writeToURL:ofType:error:] the document would
first try to copy its file URL to the destination, then it would try to write
the EOModel to the destination (which would override the first activity).
However, the -fileURL for a new, never before saved document is nil, so an
exception was raised that caused saving to fail.
 - new, untitled documents don't have a _eomodel, which means that saving
wouldn't do anything anyway. This also introduces a lot of other bugs working
with documents created with file->new, particularly related to setting the
outline view selection.
This patch addresses both of these issues. It also removes a conditional check
for -gui vs. AppKit, because the referenced bug in -gui has since been
closed.
Index: Apps/EOModelEditor/EOMEDocument.m
===================================================================
- Apps/EOModelEditor/EOMEDocument.m	(revision 36732)
+++ Apps/EOModelEditor/EOMEDocument.m	(working copy)
@@ -69,6 +69,15 @@
 //  [storedProceduresItem retain];
 }
+- (id) init
+{
+  self = [super init];
+  if (self)
+    {
+      _eomodel = [EOModel new];
+    }
+  return self;
+}
 - (void) dealloc
 {
@@ -446,22 +455,8 @@
   NSLog(@"%s:%@", __PRETTY_FUNCTION__, typeName);
   NS_DURING {
-    
-#ifdef GNUSTEP
-
-#warning "see <url>
-#else    
-    NSFileManager * manager = [NSFileManager defaultManager];
-    
-    [manager copyItemAtURL:[self fileURL] 
-                     toURL:absoluteURL error:outError];
-    
-#endif
-  
-  [_eomodel writeToFile: [absoluteURL path]];
-  
+    [_eomodel writeToFile: [absoluteURL path]];
   } NS_HANDLER {
-    
     NSDictionary *userInfo = [NSDictionary
dictionaryWithObject:[localException reason]
                                 forKey:NSLocalizedDescriptionKey];
@@ -470,8 +465,6 @@
                                 userInfo:userInfo];
     return NO;
   } NS_ENDHANDLER;
-  // 'file://localhost/Users/dave/dev/PBXBilling/trunk/PBX.eomodeld/'
-  // NSLog(@"fileURL '%@'", [self fileURL]);
   return YES;
 }
    _______________________________________________________
Reply to this item at:
  <<url>
_______________________________________________
  Message sent via/by Savannah
  <url>"
    @INVALIDNOREPLY: "Follow-up Comment #1, bug #39290 (project gnustep):
For me, on OpenBSD, I can create a new model, and the
"save as" works for me as expected, saving the eomodel.
Besides I cannot reproduce the problem, it still works for me with your
patch.
Where does the problem happen to you, on the MAC or with GNUstep?
    _______________________________________________________
Reply to this item at:
  <<url>
_______________________________________________
  Message sent via/by Savannah
  <url>"
    @INVALIDNOREPLY: "Follow-up Comment #2, bug #39290 (project gnustep):
This is on the Mac. The symptoms for me are that saving does not work, and the
Inspector is always blank because there is "No selection." If the selection in
the outline view _should_ represent the _eomodel ivar itself, an exception is
raised because +[NSArray arrayWithObject: nil] is called.
I'm not sure why it'd work differently with -gui instead of AppKit. I couldn't
readily see where the _eomodel ivar gets set up for a new document, perhaps I
missed that being done somewhere that doesn't get called on the Apple
platform.
    _______________________________________________________
Reply to this item at:
  <<url>
_______________________________________________
  Message sent via/by Savannah
  <url>"
    @INVALIDNOREPLY: "Update of bug #39290 (project gnustep):
                  Status:                    None => Fixed                  
             Assigned to:                    None => buzzdee                
             Open/Closed:                    Open => Closed                 
    _______________________________________________________
Follow-up Comment #3:
after a discussion with David, and because it doesn't seem to break anything
for me on OpenBSD the patch is now applied in SVN rev: 36745
thanks,
Sebastian
    _______________________________________________________
Reply to this item at:
  <<url>
_______________________________________________
  Message sent via/by Savannah
  <url>"
{'source': 'USENET', 'other_information': '{"reply_count": 3, "forum_name": "gnu.gnustep.bug.20140404.mbox"}', 'file': 'data/output/usenet-gnu.gnustep.parquet'}