bugGNUstep - Bugs: bug #39290, EOModelEditor could not save a new...


You are not allowed to post comments on this tracker with your current authentication level.

bug #39290: EOModelEditor could not save a new document

Submitted by:  Graham Lee <leeg>
Submitted on:  Wed 19 Jun 2013 02:46:08 PM UTC  
Category: gdl2Severity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Sebastian Reitenbach <buzzdee>
Open/Closed: Closed

Sun 23 Jun 2013 07:15:21 AM UTC, 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


Sebastian Reitenbach <buzzdee>
Project MemberIn charge of this item.
Sat 22 Jun 2013 04:21:43 PM UTC, comment #2:

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.

Graham Lee <leeg>
Sat 22 Jun 2013 04:16:27 PM UTC, comment #1:

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?

Sebastian Reitenbach <buzzdee>
Project MemberIn charge of this item.
Wed 19 Jun 2013 02:46:08 PM UTC, original submission:

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);

-#ifdef GNUSTEP
-#warning "see http://savannah.gnu.org/bugs/index.php?30348"
- NSFileManager * manager = [NSFileManager defaultManager];
- [manager copyItemAtURL:[self fileURL]
- toURL:absoluteURL error:outError];
- [_eomodel writeToFile: [absoluteURL path]];
+ [_eomodel writeToFile: [absoluteURL path]];
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[localException reason]

@@ -470,8 +465,6 @@
return NO;
- // 'file://localhost/Users/dave/dev/PBXBilling/trunk/PBX.eomodeld/'
- // NSLog(@"fileURL '%@'", [self fileURL]);
return YES;

Graham Lee <leeg>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by buzzdee (Posted a comment)
  • -unavailable- added by leeg (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 23 Jun 2013 07:15:21 AM UTCbuzzdeeStatusNone=>Fixed
      Assigned toNone=>buzzdee

    Back to the top

    Powered by Savane 3.1-cleanup1