Hello,
I have a simple program that uses QSettings to load and store some information. I use the following code to init it:
I use something like this to store settings:Code:settingsFilePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation); settings = new QSettings(settingsFilePath + "/config", QSettings::IniFormat);
And something like this to load settings:Code:settings->beginGroup("Application Settings"); if(ui.cbnumOfNewsItems->currentIndex() == 5) settings->setValue("NumOfNewsItemsShown", 9999); else settings->setValue("NumOfNewsItemsShown", ui.cbnumOfNewsItems->currentIndex()+1); settings->endGroup();
Now, here's my problem. Code works well in emulator on S60v5, S60v3fp1 and S60v3fp2. But when I build it for phones, it only works on S60v5. On S60v3 the settings file is created I think, because once you save something, it's saved while application is runing. But after the app is restarted it behaves as if no data was ever stored and you need to enter it again. Same story after that, data is loaded until app is restarted.Code:settings->beginGroup("Application Settings"); if(settings->value("NumOfNewsItemsShown").toInt() < 6) ui.cbnumOfNewsItems->setCurrentIndex(settings->value("NumOfNewsItemsShown").toInt()-1); else ui.cbnumOfNewsItems->setCurrentIndex(5); settings->endGroup();
Could someone tell me what could be causing problems?



