PDA

View Full Version : QSettings own memory for earch app execution



mero
26th July 2011, 04:06
Hello,

I've got problem. I'm using QSettings in my app and everything is ok when my app is running only ones. But when I run my app more than one, second (and next) app is reading settings from first app.
What should I do if I want run my app more than one and each running app need their own QSettings memory ?

Maybe I need change application name (or/and setOrganizationName) to random for every execution ?
QCoreApplication::setApplicationName("xyz-random");

ChrisW67
26th July 2011, 04:16
Don't use a persistent shared data store for the settings if they are temporary and not to be shared. If you randomise the application name as you are suggesting then you will be leaving behind a trail of rubbish data in the system registry/configuration file areas. You won't be able to use them between runs anyway.