Save a file in the same directory as QSettings
-
Ok I found my answer:
@QString settingsPath = QFileInfo(settings.fileName()).absolutePath();@ -
Why is this path wrong?
On win7, qsettings are stored in appData/Roaming while QDesktopServices::DataLocation points to appData/Local -
Saving arbitrary data in a preferences folder is wrong. Such data belongs elsewhere. These methods are there for a reason.
The problem with roaming/local on Windows 7 might be fixed in a future release. Is there a bug report open? Would be good, to brings that to the Troll's attention.
-
[quote author="Gerolf" date="1308499376"]What path is returned, if you sue QSettinsg with native format on windows? The settings are then stored in the registry...[/quote]
According to API docs:
bq. On Windows, if the format is QSettings::NativeFormat, the return value is a system registry path, not a file path.
-
Are you sure it is a bug?
[quote author="Volker" date="1308498317"]The problem with roaming/local on Windows 7 might be fixed in a future release. Is there a bug report open? Would be good, to brings that to the Troll's attention.[/quote] -
I can understand this. However I don't know what I should request. I just said
[quote author="neFAST" date="1307718701"]On win7, qsettings are stored in appData/Roaming while QDesktopServices::DataLocation points to appData/Local[/quote] but is it a bug? What should be the correct behavior? -
[quote author="neFAST" date="1308696036"]I can understand this. However I don't know what I should request. I just said
[quote author="neFAST" date="1307718701"]On win7, qsettings are stored in appData/Roaming while QDesktopServices::DataLocation points to appData/Local[/quote] but is it a bug? What should be the correct behavior?[/quote]I do not have an idea. I would have to read on that topic first. Maybe some googling gives you more information. Sorry that I cannot give you a more useful answer.