Skip to content

Commit 2686c95

Browse files
committed
windows try 5
1 parent 0ced2e2 commit 2686c95

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/windows/windows_utils.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,11 @@ impl OsHelper {
223223

224224
let icon_filename = app_id.to_string() + ".png";
225225
let full_stored_icon_path = icons_root_dir.join(icon_filename);
226-
let icon_path_str = full_stored_icon_path
227-
.as_path()
228-
.to_str()
229-
.unwrap_or("invalid");
226+
let icon_path = full_stored_icon_path.as_path();
230227

231228
app_info
232229
.icon_path
233-
.map(|icon_path| create_icon_for_app(icon_path.as_str(), icon_path_str));
230+
.map(|icon_path| create_icon_for_app(icon_path.as_str(), icon_path));
234231

235232
// "C:\Users\Browsers\AppData\Local\Programs\WorkFlowy\WorkFlowy.exe" "%1"
236233
// "C:\Users\Browsers\AppData\Roaming\Spotify\Spotify.exe" --protocol-uri="%1"
@@ -266,6 +263,8 @@ impl OsHelper {
266263
let profiles =
267264
supported_app.find_profiles(executable_path_best_guess.clone(), app_config_dir_abs);
268265

266+
let icon_path_str = full_stored_icon_path.to_str().unwrap_or("invalid");
267+
269268
let browser = InstalledBrowser {
270269
command: command_parts.clone(),
271270
executable_path: executable_path_best_guess.to_str().unwrap().to_string(),
@@ -290,7 +289,7 @@ fn remove_quotes(binary_path: &str) -> &str {
290289
return binary_path;
291290
}
292291

293-
pub fn create_icon_for_app(full_path_and_index: &str, icon_path: &str) {
292+
pub fn create_icon_for_app(full_path_and_index: &str, icon_path: &Path) {
294293
// e.g `C:\Program Files (x86)\Google\Chrome\Application\chrome.exe,0`
295294
// or `"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe",0`
296295
let split: Vec<&str> = full_path_and_index.split(",").collect();

0 commit comments

Comments
 (0)