summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar LittleWhite2016-03-06 11:22:45 +0100
committerGravatar LittleWhite2016-03-16 22:20:39 +0100
commit5912c9c32774320a74eb1980850738180fcf5cca (patch)
treeba0dbf07f39437bd5281ab69cbe82d2b4f74b0d3 /src
parentMerge pull request #1496 from JayFoxRox/align-attribs (diff)
downloadyuzu-5912c9c32774320a74eb1980850738180fcf5cca.tar.gz
yuzu-5912c9c32774320a74eb1980850738180fcf5cca.tar.xz
yuzu-5912c9c32774320a74eb1980850738180fcf5cca.zip
Register ROM started through the gamelist in the list of ROM recently started
Diffstat (limited to '')
-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) {
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));
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:
75 * 75 *
76 * @param filename the filename to store 76 * @param filename the filename to store
77 */ 77 */
78 void StoreRecentFile(const QString& filename); 78 void StoreRecentFile(const std::string& filename);
79 79
80 /** 80 /**
81 * Updates the recent files menu. 81 * Updates the recent files menu.