Skip to content

Commit 74c26ab

Browse files
authored
Move spices download cache to XDG_CACHE_HOME directory (#11176)
Users will need to redownload the cache, there are no other side effects.
1 parent 4229af9 commit 74c26ab

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

files/usr/bin/xlet-about-dialog

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import gettext
77
import datetime
88
import gi
99
gi.require_version('Gtk', '3.0')
10-
from gi.repository import Gtk, GdkPixbuf
10+
from gi.repository import Gtk, GdkPixbuf, GLib
1111

1212
usage = """
1313
usage : xlet-about-dialog applets/desklets/extensions uuid
@@ -81,15 +81,15 @@ class AboutDialog(Gtk.AboutDialog):
8181

8282
def get_spices_id(self):
8383
try:
84-
cache_path = os.path.join(home, '.cinnamon', 'spices.cache', self.stype[0:-1], 'index.json')
84+
cache_path = os.path.join(GLib.get_user_cache_dir(), 'cinnamon', 'spices', self.stype[0:-1], 'index.json'),
8585
if os.path.exists(cache_path):
8686
with open(cache_path, 'r') as cache_file:
8787
index_cache = json.load(cache_file)
8888
if self.metadata['uuid'] in index_cache:
8989
return index_cache[self.metadata['uuid']]['spices-id']
9090
return None
9191
except Exception as e:
92-
print('Failed to load/parse index.json');
92+
print('Failed to load/parse index.json')
9393
print(e)
9494
return None
9595

files/usr/share/cinnamon/cinnamon-settings/bin/Spices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def __init__(self, collection_type, window=None):
149149
self.total_jobs = 0
150150
self.download_total_files = 0
151151
self.download_current_file = 0
152-
self.cache_folder = '%s/.cinnamon/spices.cache/%s/' % (home, self.collection_type)
152+
self.cache_folder = os.path.join(GLib.get_user_cache_dir(), 'cinnamon', 'spices', self.collection_type)
153153

154154
if self.themes:
155155
self.settings = Gio.Settings.new('org.cinnamon.theme')

python3/cinnamon/harvester.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
gi.require_version('Gtk', '3.0')
2222
gi.require_version('Gdk', '3.0')
2323
gi.require_version('Gio', '2.0')
24-
from gi.repository import Gdk, Gtk, Gio
24+
from gi.repository import Gdk, Gtk, Gio, GLib
2525

2626
from . import logger
2727
from . import proxygsettings
@@ -125,7 +125,7 @@ def __init__(self, spice_type, uuid, index_node, meta_node):
125125

126126
class SpicePathSet():
127127
def __init__(self, cache_item, spice_type):
128-
cache_folder = Path('%s/.cinnamon/spices.cache/%s/' % (home, spice_type))
128+
cache_folder = os.path.join(GLib.get_user_cache_dir(), 'cinnamon', 'spices', spice_type)
129129

130130
is_theme = spice_type == "theme"
131131

0 commit comments

Comments
 (0)