Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

set a default value for the ranker preference #1380

Merged
merged 1 commit into from Feb 9, 2013

Conversation

Projects
None yet
3 participants
Owner

skurfer commented Feb 9, 2013

Prevents a notification that implies the ranker couldn't be loaded.

pjrobertson added a commit that referenced this pull request Feb 9, 2013

Merge pull request #1380 from skurfer/defaultRanker
set a default value for the ranker preference

@pjrobertson pjrobertson merged commit 5fdef39 into quicksilver:master Feb 9, 2013

Owner

pjrobertson commented Feb 9, 2013

Did we forget a release branch this time? Aaah well :)

@skurfer skurfer deleted the skurfer:defaultRanker branch Feb 9, 2013

Owner

skurfer commented Feb 9, 2013

I did create a release branch just before submitting this, but forgot to change the base. I'll get it into release manually. Thanks.

keith commented Mar 9, 2013

This could have also probably been fixed by changing this method in QSObjectRanker.m to:

+ (void)initialize {
    NSString *className = [[NSUserDefaults standardUserDefaults] stringForKey:@"QSStringRankers"];
    if (!className) {
        className = @"QSDefaultStringRanker";
    }

    [self setDefaultStringRanker:className];
}
Owner

skurfer commented Mar 9, 2013

True, but we already have code that uses default values from the plist. We need to be in the habit of defining defaults there for every preference. (Same goes for any plug-ins that provide custom prefs.) Plus, there could be more than one class that uses a pref. We wouldn't want to initialize the same default in every one. 😃

keith commented Mar 9, 2013

Yes I agree that setting the preference is better for this. Although if the preference wasn't set it would make sense to default to one. But obviously once this update is out that shouldn't happen. Just wanted to document that just in case anything involving this came up in the future 😃

Owner

skurfer commented Mar 11, 2013

OK, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment