[gnome-shell] appDisplay: Properly check for TerminalEmulator in the Categories key
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] appDisplay: Properly check for TerminalEmulator in the Categories key
- Date: Tue, 28 Jan 2014 18:32:51 +0000 (UTC)
commit 887a21afb97aaa358017a4722c23654aaa7e3d72
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Jan 28 12:09:35 2014 -0500
appDisplay: Properly check for TerminalEmulator in the Categories key
get_categories() returns an unparsed string, not a list of categories.
We need to parse the list by splitting on ';' to deterine whether the
actual 'TerminalEmulator' category is in the list, rather than something
like 'X-GNOME-TerminalEmulator'. It's an edge case, but I need to split
the list properly for the new folders, so I might as well fix this.
https://bugzilla.gnome.org/show_bug.cgi?id=723179
js/ui/appDisplay.js | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index b30e49d..921d83b 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -46,11 +46,18 @@ const INDICATORS_ANIMATION_MAX_TIME = 0.75;
const PAGE_SWITCH_TRESHOLD = 0.2;
const PAGE_SWITCH_TIME = 0.3;
+function _getCategories(info) {
+ let categoriesStr = info.get_categories();
+ if (!categoriesStr)
+ return [];
+ return categoriesStr.split(';');
+}
+
function _isTerminal(app) {
let info = app.get_app_info();
if (!info)
return false;
- let categories = info.get_categories() || [];
+ let categories = _getCategories(info);
return categories.indexOf('TerminalEmulator') > -1;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]