From 78cb0f043b556153e4b8bdab433447b84db5e562 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Fri, 11 Oct 2024 11:26:15 -0400 Subject: [PATCH] Adjusting code to account for the fact that the returned app_id no longer ends with the .desktop suffix --- launcher/lib/services/desktop_file_manager.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/launcher/lib/services/desktop_file_manager.dart b/launcher/lib/services/desktop_file_manager.dart index ae0cc10..8aa1037 100644 --- a/launcher/lib/services/desktop_file_manager.dart +++ b/launcher/lib/services/desktop_file_manager.dart @@ -103,12 +103,16 @@ class DesktopFileManager { return null; } - if (!f.path.endsWith('.desktop')) { + const String desktopFileSuffix = '.desktop'; + if (!f.path.endsWith(desktopFileSuffix)) { return null; } - final desktopFile = ApplicationFileDesktopFile( - f.path, Uri.parse(f.path).path.split("/").last); + String applicationId = Uri.parse(f.path).path.split("/").last; + applicationId = applicationId.substring( + 0, applicationId.length - desktopFileSuffix.length); + + final desktopFile = ApplicationFileDesktopFile(f.path, applicationId); if (!await desktopFile.load()) { _logger.shout("Unable to load desktop file: ${f.path}"); return null;