Skip to content

Commit

Permalink
bring back the default context option. There is a two update loop del…
Browse files Browse the repository at this point in the history
…ay before it becomes active
  • Loading branch information
dustinrue committed Oct 6, 2013
1 parent b66bdaa commit 724100b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Source/CPController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,10 @@ - (void)doUpdateForReal {
// of the configured contexts, which ones have rule hits?
NSMutableDictionary *guesses = [self getGuessesForRules:matchingRules];

// Don't include the default context yet because
// under multiple active contexts it'll show as active
// when it shouldn't (default context always meets minimum
// confidence required)
if (![self useMultipleActiveContexts])
[self applyDefaultContextTo:guesses];

Expand Down Expand Up @@ -1371,9 +1375,9 @@ - (void)changeActiveContextsBasedOnGuesses:(NSMutableDictionary *)guesses {

// apply the default context *only* if no other contexts apply
if ([newActiveContexts count] == 0 && [self.activeContexts count] == 0) {
//[self applyDefaultContextTo:guesses];
//[contextsDataSource updateConfidencesFromGuesses:guesses];
//[activeContexts addObject:[self getMostConfidentContext:guesses]];
[self applyDefaultContextTo:guesses];
[contextsDataSource updateConfidencesFromGuesses:guesses];
[newActiveContexts addObject:[self getMostConfidentContext:guesses]];
}

#ifdef DEBUG_MODE
Expand Down

0 comments on commit 724100b

Please sign in to comment.