From a8b5d847f91dd4e08bc882d9d3accfdc760493dc Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Wed, 1 Oct 2014 02:13:05 +1000 Subject: [PATCH] Fix for PRS1 model numbers that don't end in P --- .../SleepLib/loader_plugins/prs1_loader.cpp | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp index e43dfccc..ace27382 100644 --- a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp @@ -214,18 +214,24 @@ QString PRS1Loader::checkDir(const QString & path) void parseModel(MachineInfo & info, QString modelnum) { info.modelnumber = modelnum; - if (!modelnum.endsWith("P")) { - qDebug() << "Weird PRS1 Model number" << modelnum; - } - modelnum.chop(1); - int country = modelnum[modelnum.length() - 1].digitValue(); - modelnum.chop(1); - int ser = modelnum[modelnum.length() - 1].digitValue(); - modelnum.chop(1); - bool ok; - int typ = modelnum.toInt(&ok); - switch (typ) { + QString modelstr; + for (int i=0; i