From: Jean-Paul Mari Date: Wed, 5 Sep 2018 17:56:03 +0000 (-0400) Subject: Fixed slash/backslash issue, in the Alpine tab, to follow platform requirement X-Git-Tag: v2.1.3-R4~37 X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/commitdiff_plain/87d08e099b36dcaee7bfa4172b932d5ff8aa119a Fixed slash/backslash issue, in the Alpine tab, to follow platform requirement --- diff --git a/src/gui/alpinetab.cpp b/src/gui/alpinetab.cpp index a1fcf42..23f8b24 100644 --- a/src/gui/alpinetab.cpp +++ b/src/gui/alpinetab.cpp @@ -6,10 +6,13 @@ // See the README and GPLv3 files for licensing and warranty information // // JLH = James Hammons +// JPM = Jean-Paul Mari // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ // JLH 07/15/2011 Created this file +// JPM 09/03/2018 Depend the platform transform slashes or backslashes +// #include "alpinetab.h" #include "settings.h" @@ -94,9 +97,20 @@ void AlpineTab::SetSettings(void) { bool ok; - strcpy(vjs.alpineROMPath, edit1->text().toUtf8().data()); - strcpy(vjs.absROMPath, edit2->text().toUtf8().data()); + strcpy(vjs.alpineROMPath, CheckForSlashes(edit1->text()).toUtf8().data()); + strcpy(vjs.absROMPath, CheckForSlashes(edit2->text()).toUtf8().data()); vjs.refresh = edit3->text().toUInt(&ok, 10); vjs.allowWritesToROM = writeROM->isChecked(); } + +// Depend the platform transform slashes or backslashes +QString AlpineTab::CheckForSlashes(QString s) +{ +#ifdef _WIN32 + s.replace(QString("/"), QString("\\")); +#else + s.replace(QString("\\"), QString("/")); +#endif + return s; +} diff --git a/src/gui/alpinetab.h b/src/gui/alpinetab.h index 877a7e4..81adae8 100644 --- a/src/gui/alpinetab.h +++ b/src/gui/alpinetab.h @@ -13,13 +13,15 @@ class AlpineTab: public QWidget void SetSettings(void); void GetSettings(void); + private: + QString CheckForSlashes(QString); + public: QLineEdit * edit1; QLineEdit * edit2; QLineEdit * edit3; // QLineEdit * edit3; // QLineEdit * edit4; - QCheckBox * writeROM; // QCheckBox * useDSP; // QCheckBox * useHostAudio;