Skip to content

Commit d176357

Browse files
improve search engine
1 parent 941ba0f commit d176357

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

IconChanger.xcodeproj/project.pbxproj

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
9017B5F8294DBBA9005709C6 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 9017B5F7294DBBA9005709C6 /* Sparkle */; };
1717
9017B5FA294ED626005709C6 /* IconRes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9017B5F9294ED626005709C6 /* IconRes.swift */; };
1818
9017B5FC294EDAB4005709C6 /* LocalImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9017B5FB294EDAB4005709C6 /* LocalImageView.swift */; };
19-
9017B6162951B514005709C6 /* Sentry in Frameworks */ = {isa = PBXBuildFile; productRef = 9017B6152951B514005709C6 /* Sentry */; };
20-
9017B6182951B514005709C6 /* Sentry-Dynamic in Frameworks */ = {isa = PBXBuildFile; productRef = 9017B6172951B514005709C6 /* Sentry-Dynamic */; };
2119
9017B61E295282ED005709C6 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 9017B61D295282ED005709C6 /* LICENSE */; };
2220
9053434F286B2A6800237F98 /* AutoUpdater.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9053434E286B2A6800237F98 /* AutoUpdater.swift */; };
2321
90534352286C8BDA00237F98 /* fileicon in Resources */ = {isa = PBXBuildFile; fileRef = 90534351286C8BDA00237F98 /* fileicon */; };
@@ -82,11 +80,9 @@
8280
isa = PBXFrameworksBuildPhase;
8381
buildActionMask = 2147483647;
8482
files = (
85-
9017B6182951B514005709C6 /* Sentry-Dynamic in Frameworks */,
8683
9017B5F8294DBBA9005709C6 /* Sparkle in Frameworks */,
8784
9083CCE92867FDBD0093A1B2 /* SwiftyJSON in Frameworks */,
8885
9083CCEC2867FDDD0093A1B2 /* LaunchPadManagerDBHelper in Frameworks */,
89-
9017B6162951B514005709C6 /* Sentry in Frameworks */,
9086
);
9187
runOnlyForDeploymentPostprocessing = 0;
9288
};
@@ -192,8 +188,6 @@
192188
9083CCE82867FDBD0093A1B2 /* SwiftyJSON */,
193189
9083CCEB2867FDDD0093A1B2 /* LaunchPadManagerDBHelper */,
194190
9017B5F7294DBBA9005709C6 /* Sparkle */,
195-
9017B6152951B514005709C6 /* Sentry */,
196-
9017B6172951B514005709C6 /* Sentry-Dynamic */,
197191
);
198192
productName = IconChanger;
199193
productReference = 900D1CE5281934C7007ABB12 /* IconChanger.app */;
@@ -227,7 +221,6 @@
227221
9083CCE72867FDBD0093A1B2 /* XCRemoteSwiftPackageReference "SwiftyJSON" */,
228222
9083CCEA2867FDDD0093A1B2 /* XCRemoteSwiftPackageReference "LaunchPadManagerDBHelper" */,
229223
9017B5F6294DBBA9005709C6 /* XCRemoteSwiftPackageReference "Sparkle" */,
230-
9017B6142951B514005709C6 /* XCRemoteSwiftPackageReference "sentry-cocoa" */,
231224
);
232225
productRefGroup = 900D1CE6281934C7007ABB12 /* Products */;
233226
projectDirPath = "";
@@ -425,7 +418,7 @@
425418
"@executable_path/../Frameworks",
426419
);
427420
MACOSX_DEPLOYMENT_TARGET = 12.3;
428-
MARKETING_VERSION = 1.3.0;
421+
MARKETING_VERSION = 1.2.6;
429422
PRODUCT_BUNDLE_IDENTIFIER = com.zhuhaoyu.IconChanger;
430423
PRODUCT_NAME = "$(TARGET_NAME)";
431424
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -458,7 +451,7 @@
458451
"@executable_path/../Frameworks",
459452
);
460453
MACOSX_DEPLOYMENT_TARGET = 12.3;
461-
MARKETING_VERSION = 1.3.0;
454+
MARKETING_VERSION = 1.2.6;
462455
PRODUCT_BUNDLE_IDENTIFIER = com.zhuhaoyu.IconChanger;
463456
PRODUCT_NAME = "$(TARGET_NAME)";
464457
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -499,14 +492,6 @@
499492
minimumVersion = 2.3.0;
500493
};
501494
};
502-
9017B6142951B514005709C6 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
503-
isa = XCRemoteSwiftPackageReference;
504-
repositoryURL = "https://github.com/getsentry/sentry-cocoa.git";
505-
requirement = {
506-
kind = upToNextMajorVersion;
507-
minimumVersion = 7.0.0;
508-
};
509-
};
510495
9083CCE72867FDBD0093A1B2 /* XCRemoteSwiftPackageReference "SwiftyJSON" */ = {
511496
isa = XCRemoteSwiftPackageReference;
512497
repositoryURL = "https://github.com/SwiftyJSON/SwiftyJSON";
@@ -531,16 +516,6 @@
531516
package = 9017B5F6294DBBA9005709C6 /* XCRemoteSwiftPackageReference "Sparkle" */;
532517
productName = Sparkle;
533518
};
534-
9017B6152951B514005709C6 /* Sentry */ = {
535-
isa = XCSwiftPackageProductDependency;
536-
package = 9017B6142951B514005709C6 /* XCRemoteSwiftPackageReference "sentry-cocoa" */;
537-
productName = Sentry;
538-
};
539-
9017B6172951B514005709C6 /* Sentry-Dynamic */ = {
540-
isa = XCSwiftPackageProductDependency;
541-
package = 9017B6142951B514005709C6 /* XCRemoteSwiftPackageReference "sentry-cocoa" */;
542-
productName = "Sentry-Dynamic";
543-
};
544519
9083CCE82867FDBD0093A1B2 /* SwiftyJSON */ = {
545520
isa = XCSwiftPackageProductDependency;
546521
package = 9083CCE72867FDBD0093A1B2 /* XCRemoteSwiftPackageReference "SwiftyJSON" */;

IconChanger/AliasName.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ struct AliasName {
1515
"语雀": "yuque",
1616
"System Settings": "Settings",
1717
"Readwise_iBooks": "Readwise",
18+
"Adobe Photoshop (Beta)": "Photoshop",
19+
"Adobe Bridge (Beta)": "Bridge",
20+
"Adobe Illustrator (Beta)": "Illustrator",
21+
"Adobe Illustrator 2023": "Illustrator",
1822
]
1923

2024
static func getNames() -> [String: String] {
@@ -43,6 +47,19 @@ struct AliasName {
4347

4448
UserDefaults.standard.synchronize()
4549
}
50+
51+
static func setEmpty(for raw: String) {
52+
do {
53+
if let data = UserDefaults.standard.data(forKey: "AliasName"), var names = try? JSONDecoder().decode([String : String].self, from: data) {
54+
names[raw] = nil
55+
UserDefaults.standard.set(try JSONEncoder().encode(names), forKey: "AliasName")
56+
}
57+
} catch {
58+
print(error)
59+
}
60+
61+
UserDefaults.standard.synchronize()
62+
}
4663
}
4764

4865
extension Dictionary {

IconChanger/IconManager.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,23 @@ class IconManager: ObservableObject {
151151

152152
func getIcons(_ app: LaunchPadManagerDBHelper.AppInfo) async throws -> [IconRes] {
153153
let appName = app.name
154-
let urlName = AliasName.getNames(for: app.url.deletingPathExtension().lastPathComponent) ?? app.url.deletingPathExtension().lastPathComponent
154+
let urlName = app.url.deletingPathExtension().lastPathComponent
155155
let bundleName = try getAppBundleName(app)
156+
let aliasName = AliasName.getNames(for: app.url.deletingPathExtension().lastPathComponent)
156157

157158
var res = [IconRes]()
158159

159160
res.append(contentsOf: try await MyQueryRequestController().sendRequest(appName))
160161
res.append(contentsOf: try await MyQueryRequestController().sendRequest(urlName))
162+
161163
if let bundleName {
162164
res.append(contentsOf: try await MyQueryRequestController().sendRequest(bundleName))
163165
}
164166

167+
if let aliasName {
168+
res.append(contentsOf: try await MyQueryRequestController().sendRequest(aliasName))
169+
}
170+
165171
return Set(res).map { $0 }
166172
}
167173

IconChanger/Request.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class MyQueryRequestController {
6565
*/
6666
let query = qeuryMix(query)
6767

68+
print(query)
69+
6870
let sessionConfig = URLSessionConfiguration.default
6971

7072
/* Create session, and optionally set a URLSessionDelegate. */

IconChanger/SetAliasNameView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct SetAliasNameView: View {
2929
ToolbarItem(placement: .confirmationAction) {
3030
Button("Finish") {
3131
if text.isEmpty {
32-
AliasName.setName(raw, for: raw)
32+
AliasName.setEmpty(for: raw)
3333
} else {
3434
AliasName.setName(text, for: raw)
3535
}

0 commit comments

Comments
 (0)