Skip to content

Commit feb20b0

Browse files
authored
SpiceSpy and xsession: Increase stability (#7937)
1 parent 85f506a commit feb20b0

File tree

6 files changed

+31
-38
lines changed

6 files changed

+31
-38
lines changed

SpiceSpy@claudiux/files/SpiceSpy@claudiux/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### v5.5.2~20251101
2+
* Increase stability.
3+
14
### v5.5.1~20250925
25
* Updated README.
36
* Minor changes in menu about new commits.

SpiceSpy@claudiux/files/SpiceSpy@claudiux/applet.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,12 @@ class SpiceSpy extends Applet.TextIconApplet {
656656
this.update_issues();
657657
this.update_comments();
658658

659-
this.settings.setValue("spices_to_spy", this.spices_to_spy);
660-
this.settings.setValue("old_spices_to_spy", this.old_spices_to_spy);
659+
let spices_to_spy = this.spices_to_spy;
660+
this.settings.setValue("spices_to_spy", spices_to_spy);
661+
let old_spices_to_spy = this.old_spices_to_spy;
662+
this.settings.setValue("old_spices_to_spy", old_spices_to_spy);
663+
spices_to_spy = null;
664+
old_spices_to_spy = null;
661665
}
662666
this.fistTime = false;
663667
this.set_applet_tooltip(this.metadata.name);
@@ -988,10 +992,12 @@ class SpiceSpy extends Applet.TextIconApplet {
988992
} // End of on_applet_added_to_panel
989993

990994
on_applet_clicked() {
991-
this.settings.setValue("spices_to_spy", this.spices_to_spy);
995+
let spices_to_spy = this.spices_to_spy;
996+
this.settings.setValue("spices_to_spy", spices_to_spy);
992997
if (!this.menu || (this.menu && !this.menu.isOpen))
993998
this.make_menu();
994999
if (this.menu) this.menu.toggle();
1000+
spices_to_spy = null;
9951001
} // End of on_applet_clicked
9961002

9971003
on_applet_removed_from_panel() {

SpiceSpy@claudiux/files/SpiceSpy@claudiux/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"uuid": "SpiceSpy@claudiux",
33
"name": "SpiceSpy",
44
"description": "Notifies you when there's a change to your favorite Spices on the website.",
5-
"version": "5.5.1",
5+
"version": "5.5.2",
66
"max-instances": 1,
77
"author": "claudiux"
88
}

xsession@claudiux/files/xsession@claudiux/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### v5.1.2~20251101
2+
* Increase stability.
3+
14
### v5.1.1~20251031
25
* Avoids paint() errors.
36

xsession@claudiux/files/xsession@claudiux/applet.js

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,12 @@ class ReloadAllMenuItem extends PopupMenu.PopupBaseMenuItem {
119119
let icon_file = Gio.file_new_for_path(icon_path);
120120
let icon, gicon;
121121

122-
//~ let icon = new St.Icon({ icon_name: type+"-symbolic", icon_type: St.IconType.SYMBOLIC, icon_size: this.parent.icon_size });
123-
124122
gicon = Gio.icon_new_for_string(icon_path);
125-
//~ icon = new St.Icon({ gicon: gicon, icon_type: St.IconType.FULLCOLOR, icon_size: this.parent.icon_size });
126-
//~ icon = new St.Icon({ gicon: gicon, icon_type: St.IconType.SYMBOLIC, icon_size: this.parent.icon_size, });
127-
//~ icon = new St.Icon({ gicon: gicon, icon_type: St.IconType.SYMBOLIC, });
128123
icon = new St.Icon();
129124
icon.set_icon_size(this.parent.icon_size);
130125
icon.set_icon_type(St.IconType.SYMBOLIC);
131126
icon.set_gicon(gicon);
132127

133-
//~ let icon = new St.Icon({ icon_name: ICONS_DIR + "/" + type+"-symbolic", icon_type: St.IconType.SYMBOLIC, icon_size: this.parent.icon_size });
134128
try {
135129
icon_box.add_actor(icon);
136130
} catch(e) {
@@ -157,40 +151,29 @@ class LGSMenuItem extends PopupMenu.PopupBaseMenuItem {
157151
let label = new St.Label({ style: "spacing: .25em;" , x_align: St.Align.START, x_expand: true, text: uuid, reactive: true, track_hover: true });
158152

159153
let icon_box = new St.BoxLayout({ style: "spacing: .25em;" , x_align: St.Align.START, x_expand: false, reactive: true, track_hover: true });
160-
let icon_path = HOME_DIR+"/.cache/cinnamon/spices/"+type.slice(0,-1)+"/"+uuid+".png";
161-
let icon_file = Gio.file_new_for_path(icon_path);
154+
let icon_path, icon_file;
162155
let icon, gicon;
163156

157+
icon_path = SPICES_DIR + "/" + type + "/" + uuid + "/icon.png";
158+
icon_file = Gio.file_new_for_path(icon_path);
164159
if (icon_file.query_exists(null)) {
165160
gicon = Gio.icon_new_for_string(icon_path);
166161
icon = new St.Icon({ gicon: gicon, icon_type: St.IconType.FULLCOLOR, icon_size: this.parent.icon_size });
167-
//~ icon = new St.Icon({ gicon: gicon, icon_type: St.IconType.FULLCOLOR, });
168162
} else {
169-
icon_path = SPICES_DIR + "/" + type + "/" + uuid + "/icon.png";
170-
icon_file = Gio.file_new_for_path(icon_path);
171-
if (icon_file.query_exists(null)) {
172-
gicon = Gio.icon_new_for_string(icon_path);
173-
icon = new St.Icon({ gicon: gicon, icon_type: St.IconType.FULLCOLOR, icon_size: this.parent.icon_size });
174-
//~ icon = new St.Icon({ gicon: gicon, icon_type: St.IconType.FULLCOLOR, });
175-
} else {
176-
let metadataJson_path = SPICES_DIR + "/" + type + "/" + uuid + "/metadata.json";
177-
let metadataJson_file = Gio.file_new_for_path(metadataJson_path);
178-
if (metadataJson_file.query_exists(null)) {
179-
let [success, array_chars] = GLib.file_get_contents(metadataJson_path);
180-
let contents = to_string(array_chars);
181-
let metadata = JSON.parse(contents);
182-
if (metadata["icon"]) {
183-
icon = new St.Icon({ icon_name: metadata["icon"], icon_type: St.IconType.SYMBOLIC, icon_size: this.parent.icon_size });
184-
//~ icon = new St.Icon({ icon_name: metadata["icon"], icon_type: St.IconType.SYMBOLIC, });
185-
} else {
186-
icon = new St.Icon({ icon_name: type+"-symbolic", icon_type: St.IconType.SYMBOLIC, icon_size: this.parent.icon_size });
187-
//~ icon = new St.Icon({ icon_name: type+"-symbolic", icon_type: St.IconType.SYMBOLIC, });
188-
}
189-
GLib.free(array_chars);
163+
let metadataJson_path = SPICES_DIR + "/" + type + "/" + uuid + "/metadata.json";
164+
let metadataJson_file = Gio.file_new_for_path(metadataJson_path);
165+
if (metadataJson_file.query_exists(null)) {
166+
let [success, array_chars] = GLib.file_get_contents(metadataJson_path);
167+
let contents = to_string(array_chars);
168+
let metadata = JSON.parse(contents);
169+
if (metadata["icon"]) {
170+
icon = new St.Icon({ icon_name: metadata["icon"], icon_type: St.IconType.SYMBOLIC, icon_size: this.parent.icon_size });
190171
} else {
191172
icon = new St.Icon({ icon_name: type+"-symbolic", icon_type: St.IconType.SYMBOLIC, icon_size: this.parent.icon_size });
192-
//~ icon = new St.Icon({ icon_name: type+"-symbolic", icon_type: St.IconType.SYMBOLIC, });
193173
}
174+
GLib.free(array_chars);
175+
} else {
176+
icon = new St.Icon({ icon_name: type+"-symbolic", icon_type: St.IconType.SYMBOLIC, icon_size: this.parent.icon_size });
194177
}
195178
}
196179

@@ -387,7 +370,6 @@ class LGS extends Applet.IconApplet {
387370
sectionReload.addMenuItem(subMenuReloadApplets);
388371

389372
if (this.show_reload_all) {
390-
//~ let itemReloadAllApplets = new PopupMenu.PopupMenuItem(_("RELOAD ALL"), {style_class: "menu-selected-app-title"}); // make it bold.
391373
let itemReloadAllApplets = new ReloadAllMenuItem(this, "applets", {});
392374
itemReloadAllApplets.connect(
393375
"activate",
@@ -414,7 +396,6 @@ class LGS extends Applet.IconApplet {
414396
sectionReload.addMenuItem(subMenuReloadDesklets);
415397

416398
if (this.show_reload_all) {
417-
//~ let itemReloadAllDesklets = new PopupMenu.PopupMenuItem(_("RELOAD ALL"), {style_class: "menu-selected-app-title"}); // make it bold.
418399
let itemReloadAllDesklets = new ReloadAllMenuItem(this, "desklets", {});
419400
itemReloadAllDesklets.connect(
420401
"activate",

xsession@claudiux/files/xsession@claudiux/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "Xsession",
44
"max-instances": "1",
55
"hide-configuration": false,
6-
"version": "5.1.1",
6+
"version": "5.1.2",
77
"description": "Restart, access source code and configure your Spices (Applets, Desklets, Extensions). View the contents of your .xsession-errors file in real time. Restart Cinnamon.",
88
"author": "claudiux"
99
}

0 commit comments

Comments
 (0)