QSRequirements bundles doesn't work #1002

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

Comments

Projects
None yet
3 participants
Owner

HenningJ commented Jul 18, 2012

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.

Owner

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 ;-).

@ghost ghost assigned skurfer Aug 28, 2012

@skurfer skurfer closed this in 9b2271d Sep 4, 2012

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