removed history bloat
This commit is contained in:
@@ -328,11 +328,18 @@ class MyApp(Adw.Application):
|
||||
if settings["save_conn"]:
|
||||
password = conn_info["passwd"]
|
||||
useratip = conn_info["user"] + "@" + conn_info["ip"]
|
||||
with open(HOMEDIR+"/.config/rdpconnect/history.json", "w") as hist_file:
|
||||
hist_id = str(int(max(hist_info, default=0)) + 1)
|
||||
hist_info[hist_id] = useratip
|
||||
js = json.dumps(hist_info, sort_keys=True, indent=4, separators=(',', ': '))
|
||||
hist_file.write(js)
|
||||
|
||||
new_conn = 1
|
||||
for i in hist_info:
|
||||
if hist_info[i] == useratip:
|
||||
new_conn = 0
|
||||
if new_conn == 1:
|
||||
with open(HOMEDIR+"/.config/rdpconnect/history.json", "w") as hist_file:
|
||||
hist_id = str(int(max(hist_info, default=0)) + 1)
|
||||
hist_info[hist_id] = useratip
|
||||
js = json.dumps(hist_info, sort_keys=True, indent=4, separators=(',', ': '))
|
||||
hist_file.write(js)
|
||||
|
||||
try:
|
||||
keyring.set_password("com.angoosh.RDPConnect", useratip, password)
|
||||
except:
|
||||
|
||||
Reference in New Issue
Block a user