Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QSRequirements bundles doesn't work #1002

Closed
HenningJ opened this issue Jul 18, 2012 · 1 comment
Closed

QSRequirements bundles doesn't work #1002

HenningJ opened this issue Jul 18, 2012 · 1 comment
Assignees
Milestone

Comments

@HenningJ
Copy link
Contributor

I mentioned this on IRC and in issue #1001, but want to make sure we remember:
The bundles key in the QSRequirements of plugins is ignored. That's because of the break in line of 582 QSPlugins.m. I guess it will be fine once it's removed, but some testing is needed.
It also looks like the version checking of the bundles was never even implemented. See the warning a few lines below.

@tiennou
Copy link
Member

tiennou commented Jul 19, 2012

Untested GitHub code :

        if (![[NSUserDefaults standardUserDefaults] boolForKey:@"QSIgnorePlugInBundleRequirements"]) {
            for(NSDictionary * bundleDict in bundles) {
                NSString *identifier = [bundleDict objectForKey:@"id"];
                NSString *name = [bundleDict objectForKey:@"name"];
                NSString *version = [bundleDict objectForKey:@"version"];
                NSBundle *bundle;
                NSString *path;

                /* Check that the bundle exists... */
                path = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:identifier];
                if (path)
                    bundle = [NSBundle bundleWithPath:path];

                if (!bundle) {
                    /* Bundle not found, error out */
                    if (error)
                        *error = [NSString stringWithFormat:@"Requires Bundle '%@'", name ? name : identifier];
                    return NO;
                }

                if (version) {
#warning add support for version checking   
                    NSString *bundleVersion = [[bundle infoDictionary] objectForKey:CFBundleVersion];
                }
            }
        }

Version number parsing is for the next episode ;-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants