Configure debug mode
Fix a bug with filename generation

Previously the filenames were generated from a QDir object, which returned
a QString with the directory name. The QString created a QByteArray from
which we obtained a pointer to its constant data. All of this was done in
one line, and I think the problem was that since the QByteArray was never
stored in a named variable on the stack, it immediately went out of scope
and thus its data was destroyed. This turned out to not be an issue in
release mode, probably because the destruction of the string was optimized
out. With this bug fixed, we can now debug the program.