mirror of
https://github.com/libretro/Mu.git
synced 2026-09-23 07:05:37 +00:00
Prevent invalid paths and get custom state dirs working
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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 "+"
|
||||
|
||||
Reference in New Issue
Block a user