While the bool values on lines 6-7 are set up properly, it does not work for the QString on line 13. It returns an empty string, even when the appropiate key (here "General/lastshownwidgets") on the persistent media is set to a non-empty string. What am I missing ?

Qt Code:
  1. globalSettings = new QSettings("./UnderClient.ini",QSettings::IniFormat,this);
  2. //globalSettings->setValue("foo","bar");
  3.  
  4. //Getting settings
  5. globalSettings->beginGroup("General");
  6. //line 6:
  7. minimizeToTrayOnStartUp = globalSettings->value("minimizetotrayonstartup",false).toBool();
  8. //line 7:
  9. autoRestoreLastWidgets = globalSettings->value("autorestorelastwidgets",false).toBool();
  10. if(autoRestoreLastWidgets) {
  11. //QString *temp = new QString(globalSettings->value("General/lastshownwidgets").toString());
  12. //lastShownWidgets = temp->split(',',QString::SkipEmptyParts);
  13. qDebug() << "restoring modules from last session (" << __PRETTY_FUNCTION__ << ")";
  14. //line 13:
  15. qDebug() << "got last shown widgets:" << globalSettings->value("lastshownwidgets").toString();
  16. lastShownWidgets = new QStringList(globalSettings->value("lastshownwidgets").toString().split(',',QString::SkipEmptyParts));
  17. //delete temp;
  18. }
  19. else {
  20. lastShownWidgets = new QStringList;
  21. }
  22. globalSettings->endGroup();
  23.  
  24. qDebug() << "minimizeToTrayOnStartUp:" << minimizeToTrayOnStartUp;
  25. qDebug() << "autoRestoreLastWidgets:" << autoRestoreLastWidgets;
  26. qDebug() << "lastShownWidgets:" << lastShownWidgets->join(",");
  27. //Write-back settings
  28. globalSettings->beginGroup("General");
  29. globalSettings->setValue("minimizetotrayonstartup",minimizeToTrayOnStartUp);
  30. globalSettings->setValue("autorestorelastwidgets",autoRestoreLastWidgets);
  31. globalSettings->setValue("lastshownwidgets",lastShownWidgets->join(","));
  32. globalSettings->endGroup();
To copy to clipboard, switch view to plain text mode 

Thank you in advance