From ef250617e8163c535931be045aa4e9d59163ace7 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 23 Jan 2008 04:50:24 +0000 Subject: [FIX] Grammer in Changelog [FIX] Made pokemod classes contain their names for later ease [ADD] PokéModr main window form [FIX] Ini and Exception includes fixed [FIX] BugCatcher bugs fixed [FIX] .pro files fixed [ADD] PokéModr main GUI almost complete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@40 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- general/Ini.cpp | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) (limited to 'general/Ini.cpp') diff --git a/general/Ini.cpp b/general/Ini.cpp index 0e65f2b1..c7186bf6 100644 --- a/general/Ini.cpp +++ b/general/Ini.cpp @@ -21,7 +21,6 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include #include #include #include "Ini.h" @@ -30,7 +29,7 @@ Ini::Ini() { } -Ini::Ini(const QString& fname) +Ini::Ini(const QString& fname) throw(Exception) { load(fname); } @@ -94,27 +93,22 @@ void Ini::addField(const QString& n, const bool v) void Ini::addField(const QString& n, const unsigned char v) { - fields[n] = QString("%1").arg(v); + fields[n] = QString::number(v); } void Ini::addField(const QString& n, const int v) { - fields[n] = QString("%1").arg(v); + fields[n] = QString::number(v); } void Ini::addField(const QString& n, const unsigned v) { - fields[n] = QString("%1").arg(v); -} - -void Ini::addField(const QString& n, const float v) -{ - fields[n] = QString("%1").arg(v); + fields[n] = QString::number(v); } void Ini::addField(const QString& n, const double v) { - fields[n] = QString("%1").arg(v); + fields[n] = QString::number(v); } void Ini::addField(const QString& n, const QString& v) @@ -179,19 +173,6 @@ void Ini::getValue(const QString& field, unsigned& val, const unsigned def) val = def; } -void Ini::getValue(const QString& field, float& val, const float def) -{ - if (!fields.contains(field)) - { - val = def; - return; - } - bool ok; - val = fields[field].toFloat(&ok); - if (!ok) - val = def; -} - void Ini::getValue(const QString& field, double& val, const double def) { if (!fields.contains(field)) @@ -214,3 +195,8 @@ void Ini::getValue(const QString& field, QString& val, const QString& def) } val = fields[field]; } + +QStringList Ini::getFields() const +{ + return fields.keys(); +} -- cgit