shex
shex copied to clipboard
Fix Windows issue with files being exclusively owned by shex once opened
Currently when opening a rom in shex, shex will keep the QFile object open. This, on Windows, causes the rom to be impossible to open in certain other programs (e.g. BizHawk), with an error like "This file is already open in another process (shex.exe)".
Since keeping the QFile object open is not necessary, the fix for this issue is simply to close the QFile after reading all of its data and then re-opening it only once we want to write into it.
This patch is simple and it doesn't do any error checking on open/read/write, because the code that was already existing didn't do any error checking either.
This patch also fixes a few missing or misplaced emit
keywords as reported by QtCreator.