Skip to content

wifi: Change existing toast at each forget network

Merge request !2093 (merged) fixed 3 crashes in the Saved Networks Dialog, but unfortunately added another one. Upon undoing an AdwToast after deleting a network, Settings crashes.

Furthermore, the title of the toast is quite verbose, meaning it often gets ellipsized. Also, deleting many networks is somewhat annoying because many toasts get generated. Since only the latest toast is saved in the NetDeviceWifi, mixed dismissing and undoing of multiple toasts doesn't work properly either.

We fix all these issues by having only one toast, that either says "Network deleted" or "%d networks deleted". The networks are kept in a GPtrArray, for which the free function is set to either really forget the networks or to undo forgetting them.

I am not sure how I managed to overlook this in !2093 (merged), but here's a fix anyways 😅. Note that the first commit actually does not fix the crash, it just refactors slightly.

Edited by Matthijs Velsink

Merge request reports