QSettings::setPath() being ignored
Posted: Sun Aug 28 2022 7:47 pm
Per this doc for setPath()
https://www.copperspice.com/docs/cs_api/class_qsettings.html#acd273b6e9d88af199eb278231a5bd24a
should cause config files to be created
in /home/roland/.config/LogikalSolutions/RedDiamond
when
is used. They actually get created here:
even forcing "/" onto the end of the directory path will not fix it.
The deprecated setUserIniPath() works perfectly.
https://www.copperspice.com/docs/cs_api/class_qsettings.html#acd273b6e9d88af199eb278231a5bd24a
Code: Select all
QStringList configLocations = QStandardPaths::standardLocations( QStandardPaths::AppConfigLocation );
qDebug() << "AppConfigLocation: " << configLocations << "\n";
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, configLocations[0] );
Code: Select all
AppConfigLocation: (/home/roland/.config/LogikalSolutions/RedDiamond, /etc/xdg/xdg-ubuntu/LogikalSolutions/RedDiamond, /etc/xdg/LogikalSolutions/RedDiamond)
when
Code: Select all
m_settings = new QSettings( m_configName, QSettings::IniFormat, this );
Code: Select all
roland@roland-HP-EliteDesk-800-G2-SFF:~/.config$ ls LogikalSolutions
RedDiamondDefault.conf RedDiamondLastUsed.conf
roland@roland-HP-EliteDesk-800-G2-SFF:~/.config$
The deprecated setUserIniPath() works perfectly.