Prevent invalid paths and get custom state dirs working

This commit is contained in:
meepingsnesroms
2019-05-26 20:08:45 -07:00
parent 66f32cdb94
commit d46e146ae7
4 changed files with 10 additions and 1 deletions

View File

@@ -352,7 +352,7 @@ uint32_t EmuWrapper::bootFromFileOrDirectory(const QString& mainPath){
emuSaveStatePath = mainPath + "." + emuOsName + ".states";
//make the place to store the saves
QDir(mainPath + ".states").mkdir(".");
QDir(mainPath + "." + emuOsName + ".states").mkdir(".");
//need this goto because the emulator must be released before returning
errorOccurred:

View File

@@ -8,6 +8,8 @@
#include <QFile>
#include <QDir>
#include <QListWidgetItem>
#include <QRegExp>
#include <QRegExpValidator>
#include "mainwindow.h"
@@ -24,10 +26,14 @@ StateManager::StateManager(QWidget* parent) :
ui->statePreview->installEventFilter(this);
ui->statePreview->setObjectName("statePreview");
noBadPaths = new QRegExpValidator(QRegExp("[a-z0-9_()-\\s]*"));
ui->newStateName->setValidator(noBadPaths);
updateStateList();
}
StateManager::~StateManager(){
delete noBadPaths;
delete ui;
}

View File

@@ -5,6 +5,7 @@
#include <QEvent>
#include <QListWidgetItem>
#include <QString>
#include <QRegExpValidator>
#include "emuwrapper.h"
@@ -35,4 +36,5 @@ private slots:
private:
Ui::StateManager* ui;
EmuWrapper* emu;
QRegExpValidator* noBadPaths;
};

View File

@@ -25,6 +25,7 @@ RetroArch GUI:
*add multithreading and pipeline speedups
Qt GUI:
/TODO: fix state manager not loading until a state is saved
//TODO: get circleci builds for QT port on Win/Mac/Linux
//TODO: allow reiniting the emu without closing the program
*boot button uses install button icon now, changed install button to icon a "+"