[gnome-shell/T27795: 57/138] appStore: Report metrics when adding applications to the icon grid
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/T27795: 57/138] appStore: Report metrics when adding applications to the icon grid
- Date: Tue, 1 Oct 2019 23:34:07 +0000 (UTC)
commit adf391cfd709ad8e37d051e370be6b5f4eddb551
Author: Mario Sanchez Prada <mario endlessm com>
Date: Thu Sep 14 16:19:08 2017 +0100
appStore: Report metrics when adding applications to the icon grid
Make sure not to send metric on AddAppIfNotVisible for IDs in the desktop,
though, since that pollutes the metrics server due to apps like Chrome, which
already have an icon in the desktop even before being actually installed.
https://phabricator.endlessm.com/T19717
js/ui/shellDBus.js | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js
index ac43ed5991..81a170519f 100644
--- a/js/ui/shellDBus.js
+++ b/js/ui/shellDBus.js
@@ -1,7 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported GnomeShell, ScreenSaverDBus */
-const { Gio, GLib, Meta, Shell } = imports.gi;
+const { EosMetrics, Gio, GLib, Meta, Shell } = imports.gi;
const Config = imports.misc.config;
const ExtensionDownloader = imports.ui.extensionDownloader;
@@ -390,17 +390,28 @@ var AppStoreService = class {
}
AddApplication(id) {
+ let eventRecorder = EosMetrics.EventRecorder.get_default();
+ let appId = new GLib.Variant('s', id);
+ eventRecorder.record_event(SHELL_APP_ADDED_EVENT, appId);
+
if (!IconGridLayout.layout.iconIsFolder(id))
IconGridLayout.layout.appendIcon(id, IconGridLayout.DESKTOP_GRID_ID);
}
AddAppIfNotVisible(id) {
+ let visibleIcons = IconGridLayout.layout.getIcons(IconGridLayout.DESKTOP_GRID_ID);
+ let isIconVisible = visibleIcons.indexOf(id) !== -1;
+
+ if (!isIconVisible) {
+ let eventRecorder = EosMetrics.EventRecorder.get_default();
+ let appId = new GLib.Variant('s', id);
+ eventRecorder.record_event(SHELL_APP_ADDED_EVENT, appId);
+ }
+
if (IconGridLayout.layout.iconIsFolder(id))
return;
- let visibleIcons = IconGridLayout.layout.getIcons(IconGridLayout.DESKTOP_GRID_ID);
- if (visibleIcons.indexOf(id) == -1)
- IconGridLayout.layout.appendIcon(id, IconGridLayout.DESKTOP_GRID_ID);
+ IconGridLayout.layout.appendIcon(id, IconGridLayout.DESKTOP_GRID_ID);
}
RemoveApplication(id) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]