appDisplay: use ShellAppCache to translate folder names
This was performing quite a bit of I/O on the main thread previously. Now, all the I/O is deferred to a worker thread and the translated names are cached for immediate lookup.
This commit is contained in:
parent
2c549bfbbe
commit
f87b9f374a
@ -93,15 +93,7 @@ function _getFolderName(folder) {
|
|||||||
let name = folder.get_string('name');
|
let name = folder.get_string('name');
|
||||||
|
|
||||||
if (folder.get_boolean('translate')) {
|
if (folder.get_boolean('translate')) {
|
||||||
let keyfile = new GLib.KeyFile();
|
return Shell.AppCache.get_default().translate_folder(name);
|
||||||
let path = 'desktop-directories/' + name;
|
|
||||||
|
|
||||||
try {
|
|
||||||
keyfile.load_from_data_dirs(path, GLib.KeyFileFlags.NONE);
|
|
||||||
name = keyfile.get_locale_string('Desktop Entry', 'Name', null);
|
|
||||||
} catch(e) {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
Loading…
Reference in New Issue
Block a user