Skip to content

Commit 4eb5828

Browse files
committed
clarify which log function we are using
1 parent 074cda6 commit 4eb5828

File tree

6 files changed

+73
-73
lines changed

6 files changed

+73
-73
lines changed

BWClipboard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ export default class BWClipboard {
2020
try {
2121
let file = Gio.File.new_for_path(filename);
2222
let [success, image_data] = file.load_contents(null);
23-
//log('error: '+success);
23+
//console.log('error: '+success);
2424
if (success)
2525
this.clipboard.set_content(CLIPBOARD_TYPE, 'image/jpeg', image_data);
2626
} catch (err) {
27-
log('unable to set clipboard to data in '+filename);
27+
console.log('unable to set clipboard to data in '+filename);
2828
}
2929
}
3030

blur.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ var debug = false;
3232
var promptActive = false; // default GNOME method of testing this relies on state of a transisiton
3333
// so we are being explicit here (do not want any races, thanks)
3434

35-
function log(msg) {
35+
function BingLog(msg) {
3636
if (debug) // set 'debug' above to false to keep the noise down in journal
3737
console.log("BingWallpaper extension/Blur: " + msg);
3838
}
3939

4040
// we patch UnlockDialog._updateBackgroundEffects()
4141
export function _updateBackgroundEffects_BWP(monitorIndex) {
4242
// GNOME shell 3.36.4 and above
43-
log("_updateBackgroundEffects_BWP() called for shell >= 3.36.4");
43+
BingLog("_updateBackgroundEffects_BWP() called for shell >= 3.36.4");
4444
const themeContext = St.ThemeContext.get_for_stage(global.stage);
4545
for (const widget of this._backgroundGroup.get_children()) {
4646
// set blur effects, we have two modes in lockscreen: login prompt or clock
4747
// blur on when clock is visible is adjustable
4848
const effect = widget.get_effect('blur');
4949
if (promptActive) {
50-
log('default blur active');
50+
BingLog('default blur active');
5151
if (effect) {
5252
effect.set({ // GNOME defaults when login prompt is visible
5353
brightness: BLUR_BRIGHTNESS,
@@ -56,7 +56,7 @@ export function _updateBackgroundEffects_BWP(monitorIndex) {
5656
}
5757
}
5858
else {
59-
log('adjustable blur active');
59+
BingLog('adjustable blur active');
6060
if (effect) {
6161
effect.set({ // adjustable blur when clock is visible
6262
brightness: BWP_BLUR_BRIGHTNESS * 0.01, // we use 0-100 rather than 0-1, so divide by 100
@@ -92,17 +92,17 @@ export function _clampValue(value) {
9292
export default class Blur {
9393
constructor() {
9494
this.enabled = false;
95-
log('Bing Wallpaper adjustable blur is '+(supportedVersion()?'available':'not available'));
95+
BingLog('Bing Wallpaper adjustable blur is '+(supportedVersion()?'available':'not available'));
9696
}
9797

9898
set_blur_strength(value) {
9999
BWP_BLUR_SIGMA = _clampValue(value);
100-
log("lockscreen blur strength set to "+BWP_BLUR_SIGMA);
100+
BingLog("lockscreen blur strength set to "+BWP_BLUR_SIGMA);
101101
}
102102

103103
set_blur_brightness(value) {
104104
BWP_BLUR_BRIGHTNESS = _clampValue(value);
105-
log("lockscreen brightness set to " + BWP_BLUR_BRIGHTNESS);
105+
BingLog("lockscreen brightness set to " + BWP_BLUR_BRIGHTNESS);
106106
}
107107

108108
_switch(enabled) {
@@ -116,7 +116,7 @@ export default class Blur {
116116

117117
_enable() {
118118
if (supportedVersion()) {
119-
log("Blur._enable() called on GNOME "+Config.PACKAGE_VERSION);
119+
BingLog("Blur._enable() called on GNOME "+Config.PACKAGE_VERSION);
120120
UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects = _updateBackgroundEffects_BWP;
121121
// we override _showClock and _showPrompt to patch in updates to blur effect before calling the GNOME functions
122122
UnlockDialog.UnlockDialog.prototype._showClock = _showClock_BWP;
@@ -133,7 +133,7 @@ export default class Blur {
133133
_disable() {
134134
if (!this.enabled)
135135
return;
136-
log("_lockscreen_blur_disable() called");
136+
BingLog("_lockscreen_blur_disable() called");
137137
if (supportedVersion()) {
138138
// restore default functions
139139
UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects = _updateBackgroundEffects;

carousel.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class Carousel {
3030
this.searchEntry = null;
3131
this.extensionPath = extensionPath
3232

33-
this.log('create carousel...');
33+
this._log('create carousel...');
3434

3535
this.flowBox = prefs_flowbox;
3636
this.flowBox.insert(this._create_placeholder_item(), -1);
@@ -72,7 +72,7 @@ export default class Carousel {
7272

7373
if (Utils.isFavourite(image)) {
7474
favButton.set_visible(false);
75-
this.log('image is favourited');
75+
this._log('image is favourited');
7676
}
7777
else {
7878
unfavButton.set_visible(false);
@@ -84,7 +84,7 @@ export default class Carousel {
8484
catch (e) {
8585
galleryImage.set_from_icon_name('image-missing');
8686
galleryImage.set_icon_size = 2; // Gtk.GTK_ICON_SIZE_LARGE;
87-
this.log('create_gallery_image: '+e);
87+
this._log('create_gallery_image: '+e);
8888
}
8989

9090
galleryImage.set_tooltip_text(image.copyright);
@@ -96,16 +96,16 @@ export default class Carousel {
9696

9797
applyButton.connect('clicked', () => {
9898
this.settings.set_string('selected-image', Utils.getImageUrlBase(image));
99-
this.log('gallery selected '+Utils.getImageUrlBase(image));
99+
this._log('gallery selected '+Utils.getImageUrlBase(image));
100100
});
101101

102102
infoButton.connect('clicked', () => {
103103
Utils.openInSystemViewer(image.copyrightlink, false);
104-
this.log('info page link opened '+image.copyrightlink);
104+
this._log('info page link opened '+image.copyrightlink);
105105
});
106106

107107
deleteButton.connect('clicked', (widget) => {
108-
this.log('Delete requested for '+filename);
108+
this._log('Delete requested for '+filename);
109109
Utils.deleteImage(filename);
110110
Utils.setImageHiddenStatus(this.settings, image.urlbase, true);
111111
Utils.purgeImages(this.settings); // hide image instead
@@ -116,15 +116,15 @@ export default class Carousel {
116116

117117
// button is unchecked, so we want to make the checked one visible
118118
favButton.connect('clicked', (widget) => {
119-
this.log('favourited '+Utils.getImageUrlBase(image));
119+
this._log('favourited '+Utils.getImageUrlBase(image));
120120
widget.set_visible(false);
121121
unfavButton.set_visible(true);
122122
Utils.setImageFavouriteStatus(this.settings, image.urlbase, true);
123123
});
124124

125125
// button is checked, so we want to make the unchecked one visible
126126
unfavButton.connect('clicked', (widget) => {
127-
this.log('unfavourited '+Utils.getImageUrlBase(image));
127+
this._log('unfavourited '+Utils.getImageUrlBase(image));
128128
widget.set_visible(false);
129129
favButton.set_visible(true);
130130
Utils.setImageFavouriteStatus(this.settings, image.urlbase, false);
@@ -148,7 +148,7 @@ export default class Carousel {
148148
applyButton.connect('clicked', (widget) => {
149149
this.settings.set_string('random-interval-mode', interval);
150150
this.settings.set_boolean('random-mode-enabled', true);
151-
this.log('gallery selected random with interval '+interval+' ('+title+')');
151+
this._log('gallery selected random with interval '+interval+' ('+title+')');
152152
});
153153

154154
let item = buildable.get_object('flowBoxRandom');
@@ -212,7 +212,7 @@ export default class Carousel {
212212
}
213213
catch (e) {
214214
this._set_blank_image(galleryImage);
215-
this.log('create_gallery_image: '+e);
215+
this._log('create_gallery_image: '+e);
216216
}
217217
}
218218
}
@@ -222,7 +222,7 @@ export default class Carousel {
222222
//galleryImage.set_icon_size = 2; // Gtk.GTK_ICON_SIZE_LARGE;
223223
}
224224

225-
log(msg) {
225+
_log(msg) {
226226
if (this.settings.get_boolean('debug-logging'))
227227
console.log("BingWallpaper extension: " + msg); // disable to keep the noise down in journal
228228
}

0 commit comments

Comments
 (0)