aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDotExporter.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-01-22 12:19:21 +0000
committerstuconnolly <stuart02@gmail.com>2012-01-22 12:19:21 +0000
commit1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f (patch)
tree6c08ad29618ea02caf302180706d010c90cd57e0 /Source/SPDotExporter.m
parente23ba5155a53c43a106ac9646f51321ccc7d86f4 (diff)
downloadsequelpro-1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f.tar.gz
sequelpro-1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f.tar.bz2
sequelpro-1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f.zip
Bring outlinew view branch up to date with trunk (r3375:3468).
Diffstat (limited to 'Source/SPDotExporter.m')
-rw-r--r--Source/SPDotExporter.m20
1 files changed, 13 insertions, 7 deletions
diff --git a/Source/SPDotExporter.m b/Source/SPDotExporter.m
index e0c1a294..cd00b61f 100644
--- a/Source/SPDotExporter.m
+++ b/Source/SPDotExporter.m
@@ -108,16 +108,16 @@
// Process the tables
for (NSUInteger i = 0; i < [[self dotExportTables] count]; i++)
{
-
// Check for cancellation flag
if ([self isCancelled]) {
[fkInfo release];
[pool release];
+
return;
}
NSString *tableName = NSArrayObjectAtIndex([self dotExportTables], i);
- NSString *tableLinkName = [self dotForceLowerTableNames]?[tableName lowercaseString]:tableName;
+ NSString *tableLinkName = [self dotForceLowerTableNames] ? [tableName lowercaseString] : tableName;
NSDictionary *tableInfo = [[self dotTableData] informationForTable:tableName];
// Set the current table
@@ -154,21 +154,24 @@
// Check if any relations are available for the table
NSArray *tableConstraints = [tableInfo objectForKey:@"constraints"];
+
if ([tableConstraints count]) {
- for (NSDictionary* aConstraint in tableConstraints) {
-
+
+ for (NSDictionary* constraint in tableConstraints)
+ {
// Check for cancellation flag
if ([self isCancelled]) {
[fkInfo release];
[pool release];
+
return;
}
// Get the column references. Currently the columns themselves are an array,
// while reference columns and tables are comma separated if there are more than
// one. Only use the first of each for the time being.
- NSArray *originColumns = [aConstraint objectForKey:@"columns"];
- NSArray *referenceColumns = [[aConstraint objectForKey:@"ref_columns"] componentsSeparatedByString:@","];
+ NSArray *originColumns = [constraint objectForKey:@"columns"];
+ NSArray *referenceColumns = [[constraint objectForKey:@"ref_columns"] componentsSeparatedByString:@","];
NSString *extra = @"";
@@ -176,12 +179,13 @@
extra = @" [ arrowhead=crow, arrowtail=odiamond ]";
}
- [fkInfo addObject:[NSString stringWithFormat:@"%@:%@ -> %@:%@ %@", tableLinkName, [originColumns objectAtIndex:0], [aConstraint objectForKey:@"ref_table"], [[referenceColumns objectAtIndex:0] lowercaseString], extra]];
+ [fkInfo addObject:[NSString stringWithFormat:@"%@:%@ -> %@:%@ %@", tableLinkName, [originColumns objectAtIndex:0], [constraint objectForKey:@"ref_table"], [[referenceColumns objectAtIndex:0] lowercaseString], extra]];
}
}
// Update progress
NSInteger progress = (i * ([self exportMaxProgress] / [[self dotExportTables] count]));
+
[self setExportProgressValue:progress];
[delegate performSelectorOnMainThread:@selector(dotExportProcessProgressUpdated:) withObject:self waitUntilDone:NO];
}
@@ -193,7 +197,9 @@
// Get the relations
for (id item in fkInfo)
+ {
[metaString appendFormat:@"%@;\n", item];
+ }
[fkInfo release];