Skip to content

Commit

Permalink
Fix bug with images in plist
Browse files Browse the repository at this point in the history
  • Loading branch information
tinymind committed Dec 23, 2015
1 parent 655f26f commit 42ac7be
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions LSUnusedResources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1</string>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2</string>
<string>3</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion LSUnusedResources/Model/ResourceStringSearcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern NSString * const kNotificationResourceStringQueryDone;

+ (instancetype)sharedObject;

- (void)startWithProjectPath:(NSString *)projectPath fileSuffixs:(NSArray *)fileSuffixs;
- (void)startWithProjectPath:(NSString *)projectPath resourceSuffixs:(NSArray *)resourceSuffixs fileSuffixs:(NSArray *)fileSuffixs;
- (void)reset;

- (BOOL)containsResourceName:(NSString *)name;
Expand Down
6 changes: 4 additions & 2 deletions LSUnusedResources/Model/ResourceStringSearcher.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ @interface ResourceStringSearcher ()

@property (strong, nonatomic) NSMutableSet *resStringSet;
@property (strong, nonatomic) NSString *projectPath;
@property (strong, nonatomic) NSArray *resSuffixs;
@property (strong, nonatomic) NSArray *fileSuffixs;
@property (assign, nonatomic) BOOL isRunning;

Expand All @@ -46,7 +47,7 @@ + (instancetype)sharedObject {
return _sharedInstance;
}

- (void)startWithProjectPath:(NSString *)projectPath fileSuffixs:(NSArray *)fileSuffixs {
- (void)startWithProjectPath:(NSString *)projectPath resourceSuffixs:(NSArray *)resourceSuffixs fileSuffixs:(NSArray *)fileSuffixs {
if (self.isRunning) {
return;
}
Expand All @@ -56,6 +57,7 @@ - (void)startWithProjectPath:(NSString *)projectPath fileSuffixs:(NSArray *)file

self.isRunning = YES;
self.projectPath = projectPath;
self.resSuffixs = resourceSuffixs;
self.fileSuffixs = fileSuffixs;

[self runSearchTask];
Expand Down Expand Up @@ -193,7 +195,7 @@ - (void)parseFileAtPath:(NSString *)path withType:(LSFileType)fileType {
case LSFileTypePlist:
case LSFileTypeH:
case LSFileTypeC:
pattern = @"(\\S+)\\.(png|gif|jpg|jpeg)";//*.png
pattern = [NSString stringWithFormat:@"([a-zA-Z0-9_-]+)\\.(%@)", self.resSuffixs.count ? [self.resSuffixs componentsJoinedByString:@"|"] : @"png|gif|jpg|jpeg"]; //*.(png|gif|jpg|jpeg)
groupIndex = 1;
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion LSUnusedResources/ViewController/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ - (IBAction)onSearchButtonClicked:(id)sender {
NSArray *fileSuffixs = [self includeFileSuffixs];

[[ResourceFileSearcher sharedObject] startWithProjectPath:projectPath resourceSuffixs:resourceSuffixs];
[[ResourceStringSearcher sharedObject] startWithProjectPath:projectPath fileSuffixs:fileSuffixs];
[[ResourceStringSearcher sharedObject] startWithProjectPath:projectPath resourceSuffixs:resourceSuffixs fileSuffixs:fileSuffixs];
}

- (IBAction)onExportButtonClicked:(id)sender {
Expand Down
Binary file modified Release/LSUnusedResources.app.zip
Binary file not shown.

0 comments on commit 42ac7be

Please sign in to comment.