aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPExportFileUtilities.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPExportFileUtilities.m')
-rw-r--r--Source/SPExportFileUtilities.m17
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/SPExportFileUtilities.m b/Source/SPExportFileUtilities.m
index aafea54d..0cecad91 100644
--- a/Source/SPExportFileUtilities.m
+++ b/Source/SPExportFileUtilities.m
@@ -31,10 +31,12 @@
#import "SPExportFileUtilities.h"
#import "SPExportInitializer.h"
#import "SPExporter.h"
-#import "SPAlertSheets.h"
#import "SPExportFile.h"
#import "SPDatabaseDocument.h"
#import "SPCustomQuery.h"
+#import "SPTableContent.h"
+#import "SPTableContentDelegate.h"
+#import "SPExportController+SharedPrivateAPI.h"
#import <SPMySQL/SPMySQL.h>
@@ -47,13 +49,10 @@ typedef enum
SPExportErrorChoice;
@interface SPExportController (SPExportFileUtilitiesPrivateAPI)
-
- (void)_reopenExportSheet;
-- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
-
@end
-@implementation SPExportController (SPExportFileUtilities)
+@implementation SPExportController (SPExportFileUtilitiesPrivateAPI)
/**
* Writes the CSV file header to the supplied export file.
@@ -115,7 +114,7 @@ SPExportErrorChoice;
if ([exportXMLFormatPopUpButton indexOfSelectedItem] == SPXMLExportMySQLFormat) {
- NSString *tag = @"";
+ NSString *tag;
if (exportSource == SPTableExport) {
tag = [NSString stringWithFormat:@"<mysqldump xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<database name=\"%@\">\n\n", [tableDocumentInstance database]];
@@ -141,6 +140,11 @@ SPExportErrorChoice;
*/
- (void)errorCreatingExportFileHandles:(NSArray *)files
{
+ // We don't know where "files" came from, but we know 2 things:
+ // - NSAlert will NOT retain it as contextInfo
+ // - This method continues execution after [alert beginSheet:...], thus even if files was retained before, it could be released before the alert ends
+ [files retain];
+
// Get the number of files that already exist as well as couldn't be created because of other reasons
NSUInteger filesAlreadyExisting = 0;
NSUInteger parentFoldersMissing = 0;
@@ -270,6 +274,7 @@ SPExportErrorChoice;
[exportProgressWindow orderOut:self];
[alert beginSheetModalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:files];
+ [alert autorelease];
}
/**