From eabd42b3e2f74eb1e41318c10b6b92081cb0fb79 Mon Sep 17 00:00:00 2001 From: Sebastian Reitenbach Date: Sun, 24 Mar 2013 16:13:48 +0000 Subject: [PATCH] * Apps/EOModelEditor/EOModelEditorApp.m set the model name correctly for SQLite3 databases too, use the file name git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@36417 72102866-910b-0410-8b05-ffd578937521 --- Apps/EOModelEditor/EOModelEditorApp.m | 6 +++++- ChangeLog | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Apps/EOModelEditor/EOModelEditorApp.m b/Apps/EOModelEditor/EOModelEditorApp.m index 3fb1454..63b7642 100644 --- a/Apps/EOModelEditor/EOModelEditorApp.m +++ b/Apps/EOModelEditor/EOModelEditorApp.m @@ -131,7 +131,11 @@ [channel openChannel]; newModel = [channel describeModelWithTableNames:[channel describeTableNames]]; [newModel setConnectionDictionary:[adaptor connectionDictionary]]; - [newModel setName: [[adaptor connectionDictionary] objectForKey:@"databaseName"]]; + // PostgreSQL has a databaseName, SQLite3 has a databasePath in its connectionDictionary + if ([[adaptor connectionDictionary] objectForKey:@"databaseName"] != nil) + [newModel setName: [[adaptor connectionDictionary] objectForKey:@"databaseName"]]; + else + [newModel setName: [[[adaptor connectionDictionary] objectForKey:@"databasePath"] lastPathComponent]]; [channel closeChannel]; [self newDocumentWithModel:newModel]; } diff --git a/ChangeLog b/ChangeLog index e968265..a0ef877 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ * EOAdaptors/SQLiteAdaptor/SQLite3Channel.m implement describeModelWithTableNames:, inspired from the PostgreSQLChannel.m + * Apps/EOModelEditor/EOModelEditorApp.m set the model name + correctly for SQLite3 databases too, use the file name 2013-03-14: Sebastian Reitenbach * EOAdaptors/SQLiteAdaptor/LoginPanel/SQLite3LoginPanel.m