summaryrefslogtreecommitdiffstats
path: root/src/citra_qt
diff options
context:
space:
mode:
authorLittleWhite <lw.demoscene@googlemail.com>2016-03-06 11:22:45 +0100
committerLittleWhite <lw.demoscene@googlemail.com>2016-03-16 22:20:39 +0100
commit5912c9c32774320a74eb1980850738180fcf5cca (patch)
treeba0dbf07f39437bd5281ab69cbe82d2b4f74b0d3 /src/citra_qt
parentMerge pull request #1496 from JayFoxRox/align-attribs (diff)
downloadyuzu-5912c9c32774320a74eb1980850738180fcf5cca.tar
yuzu-5912c9c32774320a74eb1980850738180fcf5cca.tar.gz
yuzu-5912c9c32774320a74eb1980850738180fcf5cca.tar.bz2
yuzu-5912c9c32774320a74eb1980850738180fcf5cca.tar.lz
yuzu-5912c9c32774320a74eb1980850738180fcf5cca.tar.xz
yuzu-5912c9c32774320a74eb1980850738180fcf5cca.tar.zst
yuzu-5912c9c32774320a74eb1980850738180fcf5cca.zip
Diffstat (limited to 'src/citra_qt')
-rw-r--r--src/citra_qt/main.cpp7
-rw-r--r--src/citra_qt/main.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 57adbc136..32cceaf7e 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -310,6 +310,7 @@ bool GMainWindow::LoadROM(const std::string& filename) {
void GMainWindow::BootGame(const std::string& filename) {
LOG_INFO(Frontend, "Citra starting...");
+ StoreRecentFile(filename); // Put the filename on top of the list
if (!InitializeSystem())
return;
@@ -374,11 +375,11 @@ void GMainWindow::ShutdownGame() {
emulation_running = false;
}
-void GMainWindow::StoreRecentFile(const QString& filename)
+void GMainWindow::StoreRecentFile(const std::string& filename)
{
QSettings settings;
QStringList recent_files = settings.value("recentFiles").toStringList();
- recent_files.prepend(filename);
+ recent_files.prepend(QString::fromStdString(filename));
recent_files.removeDuplicates();
while (recent_files.size() > max_recent_files_item) {
recent_files.removeLast();
@@ -426,7 +427,6 @@ void GMainWindow::OnMenuLoadFile() {
QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), rom_path, tr("3DS executable (*.3ds *.3dsx *.elf *.axf *.cci *.cxi)"));
if (!filename.isEmpty()) {
settings.setValue("romsPath", QFileInfo(filename).path());
- StoreRecentFile(filename);
BootGame(filename.toLocal8Bit().data());
}
@@ -462,7 +462,6 @@ void GMainWindow::OnMenuRecentFile() {
QFileInfo file_info(filename);
if (file_info.exists()) {
BootGame(filename.toLocal8Bit().data());
- StoreRecentFile(filename); // Put the filename on top of the list
} else {
// Display an error message and remove the file from the list.
QMessageBox::information(this, tr("File not found"), tr("File \"%1\" not found").arg(filename));
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h
index 945aea0cd..6e4e56689 100644
--- a/src/citra_qt/main.h
+++ b/src/citra_qt/main.h
@@ -75,7 +75,7 @@ private:
*
* @param filename the filename to store
*/
- void StoreRecentFile(const QString& filename);
+ void StoreRecentFile(const std::string& filename);
/**
* Updates the recent files menu.