diff options
author | Robert Bieber <robby@bieberphoto.com> | 2010-07-15 06:24:11 +0000 |
---|---|---|
committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-15 06:24:11 +0000 |
commit | 15488a00eae8d10249015b88e4b7bdc47365b854 (patch) | |
tree | 62439c56fa8a926b148c7a3cc843a0c60f3aac21 /utils/themeeditor/gui/devicestate.cpp | |
parent | 387af97a26105fce79e6a8726752cf183d40939e (diff) | |
download | rockbox-15488a00eae8d10249015b88e4b7bdc47365b854.tar.gz rockbox-15488a00eae8d10249015b88e4b7bdc47365b854.zip |
Theme Editor: Committed FS#11477 to add a DECIMAL parameter type in the parser and adapt the Theme Editor to accomodate the change by Johnathan Gordon. Fixed bug in the parser caused by the patch (error was thrown on zero value) and adapted tag rendering for new format
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27426 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/gui/devicestate.cpp')
-rw-r--r-- | utils/themeeditor/gui/devicestate.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/themeeditor/gui/devicestate.cpp b/utils/themeeditor/gui/devicestate.cpp index 89985bf730..e766a64835 100644 --- a/utils/themeeditor/gui/devicestate.cpp +++ b/utils/themeeditor/gui/devicestate.cpp | |||
@@ -225,7 +225,7 @@ QVariant DeviceState::data(QString tag, int paramCount, | |||
225 | QString path = tag[0].isLower() | 225 | QString path = tag[0].isLower() |
226 | ? data("file").toString() : data("nextfile").toString(); | 226 | ? data("file").toString() : data("nextfile").toString(); |
227 | if(paramCount > 0) | 227 | if(paramCount > 0) |
228 | return directory(path, params[0].data.numeric); | 228 | return directory(path, params[0].data.number); |
229 | else | 229 | else |
230 | return QVariant(); | 230 | return QVariant(); |
231 | } | 231 | } |
@@ -255,7 +255,7 @@ QVariant DeviceState::data(QString tag, int paramCount, | |||
255 | else if(tag == "pS") | 255 | else if(tag == "pS") |
256 | { | 256 | { |
257 | double threshhold = paramCount > 0 | 257 | double threshhold = paramCount > 0 |
258 | ? std::atof(params[0].data.text) : 10; | 258 | ? params[0].data.number / 10. : 10; |
259 | if(data("?pc").toDouble() <= threshhold) | 259 | if(data("?pc").toDouble() <= threshhold) |
260 | return true; | 260 | return true; |
261 | else | 261 | else |
@@ -264,7 +264,7 @@ QVariant DeviceState::data(QString tag, int paramCount, | |||
264 | else if(tag == "pE") | 264 | else if(tag == "pE") |
265 | { | 265 | { |
266 | double threshhold = paramCount > 0 | 266 | double threshhold = paramCount > 0 |
267 | ? std::atof(params[0].data.text) : 10; | 267 | ? params[0].data.number / 10. : 10; |
268 | if(data("?pt").toDouble() - data("?pc").toDouble() <= threshhold) | 268 | if(data("?pt").toDouble() - data("?pc").toDouble() <= threshhold) |
269 | return true; | 269 | return true; |
270 | else | 270 | else |