Commit d1bf5925 authored by Florian Müllner's avatar Florian Müllner
Browse files

apps-menu: Handle non-UTF8 filename encodings more gracefully

Instead of failing completely if any .desktop file uses a filename
encoding other than UTF-8, just filter out the offending apps.

https://bugzilla.gnome.org/show_bug.cgi?id=651503
parent 6062284a
...@@ -393,7 +393,13 @@ const ApplicationsButton = new Lang.Class({ ...@@ -393,7 +393,13 @@ const ApplicationsButton = new Lang.Class({
if (nextType == GMenu.TreeItemType.ENTRY) { if (nextType == GMenu.TreeItemType.ENTRY) {
let entry = iter.get_entry(); let entry = iter.get_entry();
let appInfo = entry.get_app_info(); let appInfo = entry.get_app_info();
let app = appSys.lookup_app(entry.get_desktop_file_id()); let id;
try {
id = appInfo.get_id(); // catch non-UTF8 filenames
} catch(e) {
continue;
}
let app = appSys.lookup_app(id);
if (appInfo.should_show()) { if (appInfo.should_show()) {
let menu_id = dir.get_menu_id(); let menu_id = dir.get_menu_id();
this.applicationsByCategory[categoryId].push(app); this.applicationsByCategory[categoryId].push(app);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment