Fix French ResMed leak string, solve Q_FOREACH problem with Qt 5.4.2

This commit is contained in:
Mark Watkins 2015-08-02 15:53:09 +10:00
parent fbea37dcb5
commit 0f2f8f85ba
3 changed files with 53 additions and 21 deletions

View File

@ -15,6 +15,7 @@
#include <QProgressBar>
#include <QTextStream>
#include <QDebug>
#include <QStringList>
#include <cmath>
#include "resmed_loader.h"
@ -745,40 +746,62 @@ void ResmedImport::run()
}
loader->saveMutex.unlock();
Q_FOREACH(QString file, files[EDF_PLD]) {
if (files.contains(EDF_PLD)) {
QStringList & sl = files[EDF_PLD];
for (int i=0; i<sl.size(); ++i) {
QString file = sl.at(i);
loader->LoadPLD(sess, file);
#ifdef SESSION_DEBUG
sess->session_files.append(file);
#endif
}
Q_FOREACH(QString file, files[EDF_BRP]) {
}
if (files.contains(EDF_BRP)) {
QStringList & sl = files[EDF_BRP];
for (int i=0; i<sl.size(); ++i) {
QString file = sl.at(i);
loader->LoadBRP(sess, file);
#ifdef SESSION_DEBUG
sess->session_files.append(file);
#endif
}
Q_FOREACH(QString file, files[EDF_SAD]) {
}
if (files.contains(EDF_SAD)) {
QStringList & sl = files[EDF_SAD];
for (int i=0; i<sl.size(); ++i) {
QString file = sl.at(i);
loader->LoadSAD(sess, file);
#ifdef SESSION_DEBUG
sess->session_files.append(file);
#endif
}
}
Q_FOREACH(QString file, files[EDF_CSL]) {
if (files.contains(EDF_CSL)) {
QStringList & sl = files[EDF_CSL];
for (int i=0; i<sl.size(); ++i) {
QString file = sl.at(i);
loader->LoadCSL(sess, file);
#ifdef SESSION_DEBUG
sess->session_files.append(file);
#endif
}
}
bool haveeve = false;
Q_FOREACH(QString file, files[EDF_EVE]) {
if (files.contains(EDF_EVE)) {
QStringList & sl = files[EDF_EVE];
for (int i=0; i<sl.size(); ++i) {
QString file = sl.at(i);
loader->LoadEVE(sess, file);
#ifdef SESSION_DEBUG
sess->session_files.append(file);
#endif
haveeve = true;
}
}
if (!haveeve) {
sess->AddEventList(CPAP_Obstructive, EVL_Event);
@ -1524,6 +1547,7 @@ int ResmedLoader::scanFiles(Machine * mach, QString datalog_path)
QMap<QString, EDFduration> newfiles; // used for duplicate checking, and session overlap testing to group sessions
QHash<EDFType, QList<EDFduration *> > filesbytype;
// Scan through all folders looking for EDF files, skip any already imported and peek inside to get durations
for (int d=0; d < dirs.size(); ++d) {
dir.setPath(dirs.at(d));
@ -1587,6 +1611,7 @@ int ResmedLoader::scanFiles(Machine * mach, QString datalog_path)
EDForder.push_back(EDF_PLD);
EDForder.push_back(EDF_BRP);
EDForder.push_back(EDF_SAD);
QHash<EDFType, QStringList>::iterator gi;
for (int i=0; i<3; i++) {
EDFType basetype = EDForder.takeFirst();
@ -1602,6 +1627,14 @@ int ResmedLoader::scanFiles(Machine * mach, QString datalog_path)
quint32 end = dur->end;
QHash<EDFType, QStringList> grp;
// grp[EDF_PLD] = QStringList();
// grp[EDF_SAD] = QStringList();
// grp[EDF_BRP] = QStringList();
// grp[EDF_EVE] = QStringList();
// grp[EDF_CSL] = QStringList();
grp[basetype].append(create_backups ? backup(dur->path, backup_path) : dur->path);
@ -3026,6 +3059,7 @@ void ResInitModelMap()
resmed_codes[CPAP_Leak].push_back("Leak"); // Leak Leck Lekk Läck Fuites
resmed_codes[CPAP_Leak].push_back("Leck");
resmed_codes[CPAP_Leak].push_back("Fuites");
resmed_codes[CPAP_Leak].push_back("Fuite");
resmed_codes[CPAP_Leak].push_back("\xE6\xBC\x8F\xE6\xB0\x94");
resmed_codes[CPAP_Leak].push_back("Lekk");
@ -3102,7 +3136,7 @@ void ResInitModelMap()
// PLD file
resmed_codes[CPAP_MaskPressure].push_back("MaskPress.2s");
resmed_codes[CPAP_Pressure].push_back("Press.2s");
//resmed_codes[RMS9_EPRPressure].push_back("EPRPress.2s");
resmed_codes[CPAP_EPAP].push_back("EPRPress.2s");
resmed_codes[CPAP_Leak].push_back("Leak.2s");
resmed_codes[CPAP_RespRate].push_back("RespRate.2s");
resmed_codes[CPAP_TidalVolume].push_back("TidVol.2s");

View File

@ -360,7 +360,7 @@ struct EDFGroup {
class ResmedImport:public ImportTask
{
public:
ResmedImport(ResmedLoader * l, SessionID s, QHash<EDFType, QStringList> f, Machine * m): loader(l), sessionid(s), files(f), mach(m) {}
ResmedImport(ResmedLoader * l, SessionID s, QHash<EDFType, QStringList> grp, Machine * m): loader(l), sessionid(s), files(grp), mach(m) {}
virtual ~ResmedImport() {}
virtual void run();

View File

@ -43,9 +43,7 @@ void initTranslations(QSettings & settings) {
QHash<QString, QString> langFiles;
#ifdef Q_OS_MAC
QString transdir = QDir::cleanPath(QCoreApplication::applicationDirPath() +
"/../Resources/Translations/");
QString transdir = QDir::cleanPath(QCoreApplication::applicationDirPath() + "/../Resources/Translations/");
#else
const QString transdir = QCoreApplication::applicationDirPath() + "/Translations/";
#endif