Plugin respository now uses table columns again.

This commit is contained in:
Michael Starke
2018-10-12 16:22:52 +02:00
parent 94a36fac36
commit 5be3265c17
16 changed files with 187 additions and 161 deletions

View File

@@ -24,7 +24,6 @@
#import "MPPluginRepositoryItemVersionInfo.h"
#import "MPPluginVersion.h"
#import "MPPluginHost.h"
#import "MPPlugin.h"
#import "NSError+Messages.h"
@@ -39,7 +38,7 @@ NSString *const MPPluginItemCompatibiltyKey = @"compatibilty";
@interface MPPluginRepositoryItem ()
@property (copy) NSString *name;
@property (copy) NSString *currentVersion;
@property (copy) MPPluginVersion *currentVersion;
@property (copy) NSString *descriptionText;
@property (copy) NSURL *sourceURL;
@property (copy) NSURL *downloadURL;
@@ -64,7 +63,7 @@ NSString *const MPPluginItemCompatibiltyKey = @"compatibilty";
self.descriptionText = dict[MPPluginItemDescriptionKey];
self.downloadURL = [NSURL URLWithString:dict[MPPluginItemDownloadURLKey]];
self.sourceURL = [NSURL URLWithString:dict[MPPluginItemSourceURLKey]];
self.currentVersion = dict[MPPluginItemCurrentVersionKey];
self.currentVersion = [MPPluginVersion versionWithVersionString:dict[MPPluginItemCurrentVersionKey]];
self.bundleIdentifier = dict[MPPluginItemBundleIdentifierKey];
[self _buildVersionInfos:dict[MPPluginItemCompatibiltyKey]];
@@ -77,19 +76,12 @@ NSString *const MPPluginItemCompatibiltyKey = @"compatibilty";
return (self.name.length > 0 && self.downloadURL);
}
- (BOOL)isPluginVersion:(NSString *)pluginVersionString compatibleWithHost:(MPPluginHost *)host {
if(pluginVersionString.length == 0) {
return NO;
}
MPPluginVersion *pluginVersion = [MPPluginVersion versionWithVersionString:pluginVersionString];
- (BOOL)isPluginVersionCompatibleWithHost:(MPPluginVersion *)pluginVersion {
if(!pluginVersion) {
return NO;
}
if(host.version.length == 0) {
return NO;
}
MPPluginVersion *hostVersion = [MPPluginVersion versionWithVersionString:host.version];
MPPluginVersion *hostVersion = MPPluginHost.sharedHost.version;
if(!hostVersion) {
return NO;
}