Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 5c3995479aba0b2a88d694cf7f96c72953d72e69 1 parent 3b1aaf9
Rob McBroom authored

Showing 1 changed file with 15 additions and 18 deletions. Show diff stats Hide diff stats

  1. +15 18 Quicksilver/Code-QuickStepCore/QSPlugIn.m
33 Quicksilver/Code-QuickStepCore/QSPlugIn.m
@@ -129,32 +129,29 @@ - (NSString *)name {
129 129
130 130 return name;
131 131 }
132   -- (NSString *)status {
133   -
  132 +- (NSString *)status
  133 +{
134 134 NSString *error = [self loadError];
135   - NSString *status = nil;
136   -
137   - if (!bundle) {
138   - if (installing)
139   - return @"Downloading";
140   - else
141   - return @"Downloadable";
  135 + if (error) {
  136 + return [NSString stringWithFormat:@"Error (%@) ", error];
142 137 }
143   - if ([self isLoaded]) {
144   - if ( [bundle isLoaded]) {
145   - int fileSize = [[[[NSFileManager defaultManager] attributesOfItemAtPath:[bundle executablePath] error:nil] objectForKey:NSFileSize] intValue];
146   -
147   - status = [NSString stringWithFormat:@"Loaded (%dk) ", fileSize/1024];
148   - } else {
  138 + NSString *status = nil;
  139 + if (bundle) {
  140 + if ([self isLoaded]) {
149 141 status = @"Loaded";
  142 + } else {
  143 + status = @"Disabled";
150 144 }
151   - } else if (error) {
152   - status = [NSString stringWithFormat:@"Error (%@) ", error];
153 145 } else {
154   - status = @"Disabled";
  146 + if (installing) {
  147 + status = @"Downloading";
  148 + } else {
  149 + status = @"Downloadable";
  150 + }
155 151 }
156 152 return status;
157 153 }
  154 +
158 155 - (NSString *)statusBullet {
159 156 if ([self isLoaded]) {
160 157 if ([bundle isLoaded])

0 comments on commit 5c39954

Please sign in to comment.
Something went wrong with that request. Please try again.