X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/blobdiff_plain/024bfc4643b56158f3307049bf1bc30ba9376398..c57d3e56328e8205c97c2b41426aa35ba1a990ec:/src/gui/alpinetab.cpp diff --git a/src/gui/alpinetab.cpp b/src/gui/alpinetab.cpp index 44528b4..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" @@ -61,7 +64,7 @@ AlpineTab::AlpineTab(QWidget * parent/*= 0*/): QWidget(parent) // useHostAudio = new QCheckBox(tr("Enable audio playback")); // useUnknownSoftware = new QCheckBox(tr("Allow unknown software in file chooser")); // Currently, this is unused, so let's signal this to the user: - writeROM->setDisabled(true); + //writeROM->setDisabled(true); layout4->addWidget(writeROM); // layout4->addWidget(useDSP); @@ -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; +}