Skip to content

Commit

Permalink
alias improve and search improve
Browse files Browse the repository at this point in the history
  • Loading branch information
underthestars-zhy committed Jun 28, 2022
1 parent d2d20f9 commit bdbe264
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions IconChanger.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 10;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"IconChanger/Preview Content\"";
DEVELOPMENT_TEAM = 44BN78992X;
Expand Down Expand Up @@ -397,7 +397,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 10;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"IconChanger/Preview Content\"";
DEVELOPMENT_TEAM = 44BN78992X;
Expand Down
3 changes: 2 additions & 1 deletion IconChanger/AliasName.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ struct AliasName {
"wechatwebdevtools": "wechat dev",
"WebStorm Early Access Program": "WebStorm",
"PyCharm Professional Edition": "PyCharm",
"语雀": "yuque"
"语雀": "yuque",
"System Settings": "Settings"
]

static func getNames() -> [String: String] {
Expand Down
4 changes: 2 additions & 2 deletions IconChanger/IconManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class IconManager: ObservableObject {

func findSearchedImage(_ search: String) -> [LaunchPadManagerDBHelper.AppInfo] {
apps.filter {
$0.name.lowercased().contains(search.lowercased())
$0.name.lowercased().contains(search.lowercased()) || $0.url.deletingPathExtension().lastPathComponent.lowercased().contains(search.lowercased())
}
}

Expand Down Expand Up @@ -142,7 +142,7 @@ class IconManager: ObservableObject {

func getAppBundleName(_ app: LaunchPadManagerDBHelper.AppInfo) throws -> String? {
let plistURL = app.url.universalappending(path: "Contents").universalappending(path: "Info.plist")
let plist = (try NSDictionary(contentsOf: plistURL, error: ())) as? Dictionary<String, AnyObject>
let plist = (try? NSDictionary(contentsOf: plistURL, error: ())) as? Dictionary<String, AnyObject>

return (plist?["CFBundleDisplayName"] as? String) ?? (plist?["CFBundleName"] as? String)
}
Expand Down

0 comments on commit bdbe264

Please sign in to comment.