Skip to content

Commit

Permalink
Update data.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvladus committed Apr 26, 2023
1 parent dad44ec commit 97162ea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def set(self, data: dict):
json.dump(data, f)

# Port todos from older versions (for updates)
@classmethod
def convert(self):
# 44.1.x
todos_v1 = data["gsettings"].get_value("todos").unpack()
Expand All @@ -48,6 +49,7 @@ def convert(self):
"color": "",
}
self.set(new_data)
data["gsettings"].set_value("todos", GLib.Variant("as", []))
# 44.2.x
todos_v2 = data["gsettings"].get_value("todos-v2").unpack()
if todos_v2 != []:
Expand All @@ -58,3 +60,4 @@ def convert(self):
"color": "",
}
self.set(new_data)
data["gsettings"].set_value("todos-v2", GLib.Variant("aas", []))

0 comments on commit 97162ea

Please sign in to comment.