Skip to content

Commit

Permalink
More debug code to find cause of #2266
Browse files Browse the repository at this point in the history
  • Loading branch information
dmoagx committed Mar 29, 2017
1 parent fc4b19b commit 64929b3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Source/SPDatabaseDocument.m
Expand Up @@ -427,7 +427,10 @@ - (void)setConnection:(SPMySQLConnection *)theConnection

#ifndef SP_CODA
// Set the fileURL and init the preferences (query favs, filters, and history) if available for that URL
[self setFileURL:[[SPQueryController sharedQueryController] registerDocumentWithFileURL:[self fileURL] andContextInfo:spfPreferences]];
NSURL *newURL = [[SPQueryController sharedQueryController] registerDocumentWithFileURL:[self fileURL] andContextInfo:spfPreferences];
#warning debug code for #2266
if(!newURL) NSLog(@"#2266: Trying to set nil fileURL in %s from queryController=%@ oldFileURL=%@ contextInfo=%@", __func__, [SPQueryController sharedQueryController], [self fileURL], spfPreferences);
[self setFileURL:newURL];

// ...but hide the icon while the document is temporary
if ([self isUntitled]) [[parentWindow standardWindowButton:NSWindowDocumentIconButton] setImage:nil];
Expand Down Expand Up @@ -3534,7 +3537,10 @@ - (BOOL)saveDocumentWithFilePath:(NSString *)fileName inBackground:(BOOL)saveInB
[preferences setObject:[spfStructure objectForKey:SPContentFilters] forKey:SPContentFilters];
[[SPQueryController sharedQueryController] registerDocumentWithFileURL:[NSURL fileURLWithPath:fileName] andContextInfo:preferences];

[self setFileURL:[NSURL fileURLWithPath:fileName]];
NSURL *newURL = [NSURL fileURLWithPath:fileName];
#warning debug code for #2266
if(!newURL) NSLog(@"#2266: Trying to set nil fileURL in %s from fileName=%@", __func__, fileName);
[self setFileURL:newURL];
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:[NSURL fileURLWithPath:fileName]];

[self updateWindowTitle:self];
Expand Down Expand Up @@ -5088,7 +5094,10 @@ - (BOOL)setStateFromConnectionFile:(NSString *)path
}

if (![self isSaveInBundle]) {
[self setFileURL:[NSURL fileURLWithPath:path]];
NSURL *newURL = [NSURL fileURLWithPath:path];
#warning debug code for #2266
if(!newURL) NSLog(@"#2266: Trying to set nil fileURL in %s from path=%@", __func__, path);
[self setFileURL:newURL];
}

[spfDocData setObject:[NSNumber numberWithBool:([[data objectForKey:@"connection"] objectForKey:@"password"]) ? YES : NO] forKey:@"save_password"];
Expand Down

0 comments on commit 64929b3

Please sign in to comment.