From: <ho...@us...> - 2011-01-30 10:10:46
|
Revision: 17710 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=17710&view=rev Author: hofman Date: 2011-01-30 10:10:40 +0000 (Sun, 30 Jan 2011) Log Message: ----------- set flag to ignore selection change while resorting rather than unsetting the delegate, because we may need other delegate methods Modified Paths: -------------- trunk/bibdesk/BibDocument.h trunk/bibdesk/BibDocument.m trunk/bibdesk/BibDocument_DataSource.m Modified: trunk/bibdesk/BibDocument.h =================================================================== --- trunk/bibdesk/BibDocument.h 2011-01-30 07:34:21 UTC (rev 17709) +++ trunk/bibdesk/BibDocument.h 2011-01-30 10:10:40 UTC (rev 17710) @@ -248,6 +248,7 @@ unsigned int displayMigrationAlert:1; unsigned int inOptionKeyState:1; unsigned int isAnimating:1; + unsigned int ignoreSelectionChange:1; unsigned int ignoreGroupSelectionChange:1; } docFlags; Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2011-01-30 07:34:21 UTC (rev 17709) +++ trunk/bibdesk/BibDocument.m 2011-01-30 10:10:40 UTC (rev 17710) @@ -244,6 +244,7 @@ docState.lastFileViewWidth = 0.0; docState.lastWebViewFraction = 0.0; docFlags.isAnimating = NO; + docFlags.ignoreSelectionChange = NO; docFlags.ignoreGroupSelectionChange = NO; // these are temporary state variables @@ -2504,7 +2505,7 @@ // @@ DON'T RETURN WITHOUT RESETTING THIS! // this is a hack to keep us from getting selection change notifications while sorting (which updates the TeX and attributed text previews) - [tableView setDelegate:nil]; + docFlags.ignoreSelectionChange = YES; // cache the selection; this works for multiple publications NSArray *pubsToSelect = nil; @@ -2525,8 +2526,8 @@ [self selectPublications:pubsToSelect]; [tableView scrollRowToCenter:[tableView selectedRow]]; // just go to the last one - // reset ourself as delegate - [tableView setDelegate:self]; + // reset + docFlags.ignoreSelectionChange = YES; } - (void)saveSortOrder{ Modified: trunk/bibdesk/BibDocument_DataSource.m =================================================================== --- trunk/bibdesk/BibDocument_DataSource.m 2011-01-30 07:34:21 UTC (rev 17709) +++ trunk/bibdesk/BibDocument_DataSource.m 2011-01-30 10:10:40 UTC (rev 17710) @@ -173,6 +173,8 @@ } - (void)tableViewSelectionDidChange:(NSNotification *)aNotification{ + if (docFlags.ignoreSelectionChange) + return; NSTableView *tv = [aNotification object]; if(tv == tableView || ([self isDisplayingFileContentSearch] && tv == [fileSearchController tableView])){ NSNotification *note = [NSNotification notificationWithName:BDSKTableSelectionChangedNotification object:self]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |