From 883b6a65bb4c947ace6f077f6f0490cbcca6750a Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 17 Feb 2020 22:16:23 +0100 Subject: [PATCH] Drop compatibility with 3.10 and older With all the recent changes to fix warnings about using deprecated APIs I'm pretty sure that the code will no longer work with something like GNOME 3.10 or the even older 3.4. Drop all the code which specifically deals with older version. Signed-off-by: Hans de Goede --- src/extension.js | 37 ++++--------------------------------- src/utils.js | 4 ---- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/src/extension.js b/src/extension.js index 429b491..39c5dbe 100644 --- a/src/extension.js +++ b/src/extension.js @@ -42,21 +42,9 @@ class PopupTeaMenuItem extends PopupMenu.PopupBaseMenuItem { }); } - if (this.actor instanceof St.BoxLayout) { - // will be used for gnome-shell 3.10 and possibly above where this.actor is BoxLayout - this.add(this.tealabel); - if (nBrewtime != 0) { - this.add(this.timelabel); - } - } else { - this.addActor(this.tealabel, { - expand: true - }); - if (nBrewtime != 0) { - this.addActor(this.timelabel, { - expand: false - }); - } + this.add(this.tealabel); + if (nBrewtime != 0) { + this.add(this.timelabel); } this._delegate = this; @@ -202,24 +190,7 @@ class TeaTime extends PanelMenu.Button { } _showNotification(subject, text) { - let source = (Utils.isGnome34()) ? - new MessageTray.Source(_("TeaTime applet")) : - new MessageTray.Source(_("TeaTime applet"), 'utilities-teatime'); - - if (Utils.isGnome34()) { - source.createNotificationIcon = - function () { - let iconBox = new St.Bin(); - iconBox._size = this.ICON_SIZE; - iconBox.child = new St.Icon({ - icon_name: 'utilities-teatime', - icon_type: St.IconType.FULLCOLOR, - icon_size: iconBox._size - }); - return iconBox; - } // createNotificationIcon - } - + let source = new MessageTray.Source(_("TeaTime applet"), 'utilities-teatime'); Main.messageTray.add(source); let notification = new MessageTray.Notification(source, subject, text); diff --git a/src/utils.js b/src/utils.js index 591c0c4..60ca334 100644 --- a/src/utils.js +++ b/src/utils.js @@ -151,7 +151,3 @@ function getGlobalDisplayScaleFactor() { function isType(value, typename) { return typeof value == typename; } - -function isGnome34() { - return imports.misc.extensionUtils.versionCheck(["3.4"], imports.misc.config.PACKAGE_VERSION); -}