Fix behaviour when closing KTorrent to system tray
KStatusNotifierIcon hides the QWindow, while GUI hides the main QWidget. It seems like hiding both of these was causing issues where the QWidget was considered visible but the QWindow was considered hidden (i.e. clicking on the tray icon did not close the window when it was visible).
Also fixes the group view not being visible on startup after KTorrent was closed whilst minimized to the tray. Previously we were saving the window state after hiding the window, so the group view was always considered to be not visible. Now we save the state before hiding.
Edited by Jack Hill