Based on the code you posted m_settingsPath, which we have to assume is a member variable of the class, has not been initialised at the time restoreRecentFileList() is called.
Based on the code you posted m_settingsPath, which we have to assume is a member variable of the class, has not been initialised at the time restoreRecentFileList() is called.
Sorry, I forgot to update that, here is the constructor actually
Window::Window(QWidget *parent) : QDialog(parent),
m_settingsPath(QDir::homePath() + QString::fromUtf8("/.cfg/recentFiles.ini"))
{
//m_settingsPath is a member variable of the class
}
What actually gets into the ini file?
BTW: QDir::homePath() may not be where you think it is if there is no HOME environment in the running program's environment.
There is something wrong with my Environment I think, It's working as expected on another SLES machine, sorry for that and thanks for the effort.
Another possibility is that your code constructs two Window objects (deliberately or not), one is actively used, the other is dormant so keeps the originally loaded list, and the last one to be destroyed wins. Stick a breakpoint/qDebug() in the destructor to see how many objects of this class are destroyed as you leave the program.
Bookmarks