Fixing translate plugin; attempted dispose call

This commit is contained in:
itdominator 2024-03-11 22:28:42 -05:00
parent d65ea8dec8
commit 02c31719d1
2 changed files with 8 additions and 4 deletions

View File

@ -184,8 +184,8 @@ class Plugin(PluginBase):
response = requests.post(self.vqd_link, headers=self.vqd_headers, data=self.vqd_data, timeout=2)
if response.status_code == 200:
data = response.content
vqd_start_index = data.index(b"vqd='") + 5
vqd_end_index = data.index(b"'", vqd_start_index)
vqd_start_index = data.index(b"vqd=\"") + 5
vqd_end_index = data.index(b"\"", vqd_start_index)
self._vqd_attrib = data[vqd_start_index:vqd_end_index].decode("utf-8")
print(f"Translation VQD: {self._vqd_attrib}")

View File

@ -75,6 +75,10 @@ class IconGridWidget(Gtk.IconView):
return self.get_model()
def clear_and_set_new_store(self):
store = self.get_model()
if store:
store.run_dispose()
self.set_model(None)
store = Gtk.ListStore(GdkPixbuf.Pixbuf or GdkPixbuf.PixbufAnimation or None, str or None)
# store = Gtk.ListStore(Gtk.DirectoryList)