Skip to content

Commit 09de472

Browse files
committed
Update gnome-shell-extensions submodule + fix coding standard issues
Notes: - gnome-shell-extensions default branch was renamed to "main" - Fixed issues from new ESLint rules - Fixed issues from review https://extensions.gnome.org/review/27899 - Removed compatibility with pre-v3.34 versions of GNOME Shell since initTranslations() and getSettings() are present in extensionUtils only since
1 parent 3c77ecc commit 09de472

File tree

8 files changed

+228
-121
lines changed

8 files changed

+228
-121
lines changed

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "gnome-shell-extensions"]
22
path = gnome-shell-extensions
33
url = https://gitlab.gnome.org/GNOME/gnome-shell-extensions.git
4+
branch = main

convenience.js

Lines changed: 0 additions & 96 deletions
This file was deleted.

extension.js

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
const History = imports.misc.history;
2020

2121
const ExtensionUtils = imports.misc.extensionUtils;
22-
const Me = ExtensionUtils.getCurrentExtension();
23-
const Convenience = Me.imports.convenience;
24-
const Prefs = Me.imports.prefs;
2522

2623
let historyManagerInjections = {};
2724
let settings;
2825

26+
/** GNOME Shell Extension API */
2927
function enable() {
28+
settings = ExtensionUtils.getSettings();
29+
3030
historyManagerInjections['prevItemPrefix'] = undefined;
3131
historyManagerInjections['nextItemPrefix'] = undefined;
3232
historyManagerInjections['_onEntryKeyPress'] = undefined;
@@ -83,6 +83,11 @@ function enable() {
8383
});
8484
}
8585

86+
/**
87+
* @param {object} objectPrototype - object prototype to be modified
88+
* @param {string} functionName - name of the function to be overriden
89+
* @param {Function} injectedFunction - new function to be injected instead of @functionName
90+
*/
8691
function overrideFunction(objectPrototype, functionName, injectedFunction) {
8792
let originalFunction = objectPrototype[functionName];
8893

@@ -98,6 +103,11 @@ function overrideFunction(objectPrototype, functionName, injectedFunction) {
98103
return originalFunction;
99104
}
100105

106+
/**
107+
* @param {object} objectPrototype - object prototype to be modified
108+
* @param {string} functionName - name of the original function after which @injectedFunction will be executed
109+
* @param {Function} injectedFunction - new function to be executed after @functionName
110+
*/
101111
function injectAfterFunction(objectPrototype, functionName, injectedFunction) {
102112
let originalFunction = objectPrototype[functionName];
103113

@@ -117,23 +127,33 @@ function injectAfterFunction(objectPrototype, functionName, injectedFunction) {
117127
return originalFunction;
118128
}
119129

130+
/**
131+
* @param {object} objectPrototype - object prototype to be modified
132+
* @param {Function} injection - original function to be returned to the @objectPrototype
133+
* @param {Function} functionName - name of the function in the @objectPrototype
134+
*/
120135
function removeInjection(objectPrototype, injection, functionName) {
121136
if (injection[functionName] === undefined)
122137
delete objectPrototype[functionName];
123138
else
124139
objectPrototype[functionName] = injection[functionName];
125140
}
126141

142+
/** GNOME Shell Extension API */
127143
function disable() {
128144
for (let i in historyManagerInjections)
129145
removeInjection(History.HistoryManager.prototype, historyManagerInjections, i);
146+
147+
settings = null;
130148
}
131149

150+
/** GNOME Shell Extension API */
132151
function init() {
133-
settings = Convenience.getSettings(Prefs.PREFS_SCHEMA);
134152
}
135153

136-
// 3.0 API backward compatibility
154+
/**
155+
* 3.0 API backward compatibility
156+
*/
137157
function main() {
138158
init();
139159
enable();

gnome-shell-extensions

Submodule gnome-shell-extensions updated from 83c4ced to 5729d0b

metadata.json

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
{
22
"shell-version": [
3-
"3.6",
4-
"3.7",
5-
"3.7.3",
6-
"3.8",
7-
"3.10",
8-
"3.12",
9-
"3.14",
10-
"3.16",
11-
"3.18",
12-
"3.20",
13-
"3.22",
14-
"3.24",
15-
"3.26",
16-
"3.28",
3+
"3.34",
174
"40",
185
"41",
196
"42",

0 commit comments

Comments
 (0)