Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/inistream.cc')
-rw-r--r--src/inistream.cc27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/inistream.cc b/src/inistream.cc
index 1e76ab8..c89056f 100644
--- a/src/inistream.cc
+++ b/src/inistream.cc
@@ -121,9 +121,8 @@ bool IniStream::got_key_string(const char *keylabel, QString &valuestring)
if (last_read_was_key && (key_current.compare(keylabel) == 0)) {
valuestring = value_current;
return true;
- } else {
- return false;
}
+ return false;
}
bool IniStream::got_key_vector3f(const char *keylabel, float &x, float &y, float &z)
@@ -134,36 +133,34 @@ bool IniStream::got_key_vector3f(const char *keylabel, float &x, float &y, float
ts >> x;
ts >> y;
ts >> z;
- return true;
- } else {
- return false;
+ return true;
}
+ return false;
}
-/*
-bool IniStream::got_key_label(const char * keylabel, QString & labelstring)
+bool IniStream::got_key_float(const char *keylabel, float & f)
{
if (last_read_was_key && (key_current.compare(keylabel) == 0)) {
- labelstring = value_current.trimmed();
+ QTextStream ts(&value_current, QIODevice::ReadOnly);
+ f = 0;
+ ts >> f;
return true;
- } else {
- return false;
}
+ return false;
}
-bool IniStream::got_key_float(const char * keylabel, float & f)
+/*
+bool IniStream::got_key_label(const char * keylabel, QString & labelstring)
{
if (last_read_was_key && (key_current.compare(keylabel) == 0)) {
- std::istringstream is(value_current);
- if (!(is >> f)) {
- f = 0;
- }
+ labelstring = value_current.trimmed();
return true;
} else {
return false;
}
}
+
bool IniStream::got_key_long(const char * keylabel, long & l)
{
if (last_read_was_key && (key_current.compare(keylabel) == 0)) {