summaryrefslogtreecommitdiff
path: root/src/citra_qt/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra_qt/main.cpp')
-rw-r--r--src/citra_qt/main.cpp7
1 files changed, 3 insertions, 4 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) {
310 310
311void GMainWindow::BootGame(const std::string& filename) { 311void GMainWindow::BootGame(const std::string& filename) {
312 LOG_INFO(Frontend, "Citra starting..."); 312 LOG_INFO(Frontend, "Citra starting...");
313 StoreRecentFile(filename); // Put the filename on top of the list
313 314
314 if (!InitializeSystem()) 315 if (!InitializeSystem())
315 return; 316 return;
@@ -374,11 +375,11 @@ void GMainWindow::ShutdownGame() {
374 emulation_running = false; 375 emulation_running = false;
375} 376}
376 377
377void GMainWindow::StoreRecentFile(const QString& filename) 378void GMainWindow::StoreRecentFile(const std::string& filename)
378{ 379{
379 QSettings settings; 380 QSettings settings;
380 QStringList recent_files = settings.value("recentFiles").toStringList(); 381 QStringList recent_files = settings.value("recentFiles").toStringList();
381 recent_files.prepend(filename); 382 recent_files.prepend(QString::fromStdString(filename));
382 recent_files.removeDuplicates(); 383 recent_files.removeDuplicates();
383 while (recent_files.size() > max_recent_files_item) { 384 while (recent_files.size() > max_recent_files_item) {
384 recent_files.removeLast(); 385 recent_files.removeLast();
@@ -426,7 +427,6 @@ void GMainWindow::OnMenuLoadFile() {
426 QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), rom_path, tr("3DS executable (*.3ds *.3dsx *.elf *.axf *.cci *.cxi)")); 427 QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), rom_path, tr("3DS executable (*.3ds *.3dsx *.elf *.axf *.cci *.cxi)"));
427 if (!filename.isEmpty()) { 428 if (!filename.isEmpty()) {
428 settings.setValue("romsPath", QFileInfo(filename).path()); 429 settings.setValue("romsPath", QFileInfo(filename).path());
429 StoreRecentFile(filename);
430 430
431 BootGame(filename.toLocal8Bit().data()); 431 BootGame(filename.toLocal8Bit().data());
432 } 432 }
@@ -462,7 +462,6 @@ void GMainWindow::OnMenuRecentFile() {
462 QFileInfo file_info(filename); 462 QFileInfo file_info(filename);
463 if (file_info.exists()) { 463 if (file_info.exists()) {
464 BootGame(filename.toLocal8Bit().data()); 464 BootGame(filename.toLocal8Bit().data());
465 StoreRecentFile(filename); // Put the filename on top of the list
466 } else { 465 } else {
467 // Display an error message and remove the file from the list. 466 // Display an error message and remove the file from the list.
468 QMessageBox::information(this, tr("File not found"), tr("File \"%1\" not found").arg(filename)); 467 QMessageBox::information(this, tr("File not found"), tr("File \"%1\" not found").arg(filename));