Permalink
Browse files

clean up the plug-in status string

* return right away if there's an error
* remove the file size for loaded plug-ins
* move things around to make it easier to understand (without altering the result)
  • Loading branch information...
1 parent 3b1aaf9 commit 5c3995479aba0b2a88d694cf7f96c72953d72e69 @skurfer committed Feb 21, 2012
Showing with 15 additions and 18 deletions.
  1. +15 −18 Quicksilver/Code-QuickStepCore/QSPlugIn.m
View
33 Quicksilver/Code-QuickStepCore/QSPlugIn.m
@@ -129,32 +129,29 @@ - (NSString *)name {
return name;
}
-- (NSString *)status {
-
+- (NSString *)status
+{
NSString *error = [self loadError];
- NSString *status = nil;
-
- if (!bundle) {
- if (installing)
- return @"Downloading";
- else
- return @"Downloadable";
+ if (error) {
+ return [NSString stringWithFormat:@"Error (%@) ", error];
}
- if ([self isLoaded]) {
- if ( [bundle isLoaded]) {
- int fileSize = [[[[NSFileManager defaultManager] attributesOfItemAtPath:[bundle executablePath] error:nil] objectForKey:NSFileSize] intValue];
-
- status = [NSString stringWithFormat:@"Loaded (%dk) ", fileSize/1024];
- } else {
+ NSString *status = nil;
+ if (bundle) {
+ if ([self isLoaded]) {
status = @"Loaded";
+ } else {
+ status = @"Disabled";
}
- } else if (error) {
- status = [NSString stringWithFormat:@"Error (%@) ", error];
} else {
- status = @"Disabled";
+ if (installing) {
+ status = @"Downloading";
+ } else {
+ status = @"Downloadable";
+ }
}
return status;
}
+
- (NSString *)statusBullet {
if ([self isLoaded]) {
if ([bundle isLoaded])

0 comments on commit 5c39954

Please sign in to comment.