ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/XmlTools2/trunk/util.cpp
(Generate patch)

Comparing XmlTools2/trunk/util.cpp (file contents):
Revision 980 by s10k, Thu Mar 6 16:40:35 2014 UTC vs.
Revision 1055 by s10k, Fri Oct 28 21:05:06 2016 UTC

# Line 7 | Line 7 | QString AppExecutable=AppName+".exe";
7   #else
8   QString AppExecutable="./"+AppName; // Mac OS needs unix like executing
9   #endif
10 < QString AppVersion="2.0b";
10 > QString AppVersion="2.0c";
11   }
12  
13   namespace Util{
# Line 132 | Line 132 | QList<int> qListIntFromSpacedString(cons
132      stringList = mySpacedString.split(" ");
133  
134      foreach(QString value, stringList){
135 <        intList << value.toInt();
135 >        bool ok;
136 >
137 >        intList << value.toInt(&ok);
138 >
139 >        if(!ok){
140 >            throw std::runtime_error(QString("Impossible to convert string '" + value + "' to int!").toUtf8().constData());
141 >        }
142      }
143  
144      return intList;
# Line 145 | Line 151 | QList<double> qListDoubleFromSpacedStrin
151      stringList = mySpacedString.split(" ");
152  
153      foreach(QString value, stringList){
154 <        doubleList << value.toDouble();
154 >        bool ok;
155 >
156 >        doubleList << value.toDouble(&ok);
157 >
158 >        if(!ok){
159 >            throw std::runtime_error(QString("Impossible to convert string '" + value + "' to double!").toUtf8().constData());
160 >        }
161      }
162  
163      return doubleList;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)