@@ -72,6 +72,7 @@ - (id)_resultDataItemAtRow:(NSInteger)row columnIndex:(NSUInteger)column preserv
7272+ (NSString *)linkToHelpTopic : (NSString *)aTopic ;
7373- (void )documentWillClose : (NSNotification *)notification ;
7474- (void )queryFavoritesHaveBeenUpdated : (NSNotification *)notification ;
75+ - (void )historyItemsHaveBeenUpdated : (NSNotification *)notification ;
7576
7677@end
7778
@@ -1621,7 +1622,7 @@ - (void)setConnection:(SPMySQLConnection *)theConnection
16211622
16221623#ifndef SP_CODA
16231624 if ( [[SPQueryController sharedQueryController ] historyForFileURL: [tableDocumentInstance fileURL ]] )
1624- [self performSelectorOnMainThread: @selector (historyItemsHaveBeenUpdated: ) withObject: self waitUntilDone: YES ];
1625+ [self performSelectorOnMainThread: @selector (historyItemsHaveBeenUpdated: ) withObject: nil waitUntilDone: YES ];
16251626
16261627 // Populate query favorites
16271628 [self queryFavoritesHaveBeenUpdated: nil ];
@@ -3369,8 +3370,12 @@ - (BOOL)windowShouldClose:(id)sender
33693370
33703371/* *
33713372 * Rebuild history popup menu.
3373+ *
3374+ * Warning: notification may be nil if invoked directly from within this class.
3375+ *
3376+ * MUST BE CALLED ON THE UI THREAD!
33723377 */
3373- - (void )historyItemsHaveBeenUpdated:(id )manager
3378+ - (void )historyItemsHaveBeenUpdated:(NSNotification *)notification
33743379{
33753380 // Abort if the connection has been closed already - sign of a closed window
33763381 if (![mySQLConnection isConnected ]) return ;
@@ -3997,6 +4002,10 @@ - (void)awakeFromNib
39974002 selector: @selector (queryFavoritesHaveBeenUpdated: )
39984003 name: SPQueryFavoritesHaveBeenUpdatedNotification
39994004 object: nil ];
4005+ [[NSNotificationCenter defaultCenter ] addObserver: self
4006+ selector: @selector (historyItemsHaveBeenUpdated: )
4007+ name: SPHistoryItemsHaveBeenUpdatedNotification
4008+ object: nil ];
40004009
40014010#ifndef SP_CODA
40024011 [prefs addObserver: self forKeyPath: SPGlobalResultTableFont options: NSKeyValueObservingOptionNew context: NULL ];
0 commit comments