[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #39290] EOModelEditor could not save a new document
From: |
Graham Lee |
Subject: |
[bug #39290] EOModelEditor could not save a new document |
Date: |
Wed, 19 Jun 2013 14:46:09 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/536.30.1 (KHTML, like Gecko) Version/6.0.5 Safari/536.30.1 |
URL:
<http://savannah.gnu.org/bugs/?39290>
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 http://savannah.gnu.org/bugs/index.php?30348"
-#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:
<http://savannah.gnu.org/bugs/?39290>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [bug #39290] EOModelEditor could not save a new document,
Graham Lee <=