Skip to content

Commit

Permalink
Adjusting code to account for the fact that the returned app_id no lo…
Browse files Browse the repository at this point in the history
…nger ends with the .desktop suffix (#205)

relies on canonical/mir#3629

## What's new?
- We dont' want a `.desktop` file suffix in the applicaiton id
  • Loading branch information
AlanGriffiths authored Jan 16, 2025
2 parents e74ef96 + 78cb0f0 commit 196d5c5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions launcher/lib/services/desktop_file_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 196d5c5

Please sign in to comment.