mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-20 11:09:58 +01:00
Fix warning about QSettings: now QSettings use native format for windows osx and other unix. See Qt documentation for more information.
http://doc.qt.io/qt-5/qsettings.html#details git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4206 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "reportproperties.h"
|
||||
#include "qetapp.h"
|
||||
#include <QSettings>
|
||||
|
||||
ReportProperties::ReportProperties()
|
||||
{}
|
||||
@@ -25,7 +25,8 @@ ReportProperties::ReportProperties()
|
||||
* @brief ReportProperties::defaultProperties
|
||||
* @return the default properties stored in the setting file
|
||||
*/
|
||||
QString ReportProperties::defaultProperties() {
|
||||
QSettings &settings= QETApp::settings();
|
||||
QString ReportProperties::defaultProperties()
|
||||
{
|
||||
QSettings settings;
|
||||
return(settings.value("diagrameditor/defaultreportlabel", "%f-%l%c").toString());
|
||||
}
|
||||
|
||||
@@ -103,15 +103,19 @@ void XRefProperties::fromXml(const QDomElement &xml_element) {
|
||||
* For coil, stored with the string "coil" in the returned QHash.
|
||||
* For protection, stored with the string "protection" in the returned QHash.
|
||||
*/
|
||||
QHash<QString, XRefProperties> XRefProperties::defaultProperties() {
|
||||
QHash<QString, XRefProperties> XRefProperties::defaultProperties()
|
||||
{
|
||||
QHash <QString, XRefProperties> hash;
|
||||
QStringList keys;
|
||||
keys << "coil" << "protection" << "commutator";
|
||||
|
||||
foreach (QString key, keys) {
|
||||
QSettings settings;
|
||||
|
||||
foreach (QString key, keys)
|
||||
{
|
||||
XRefProperties properties;
|
||||
QString str("diagrameditor/defaultxref");
|
||||
properties.fromSettings(QETApp::settings(), str += key);
|
||||
properties.fromSettings(settings, str += key);
|
||||
hash.insert(key, properties);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user