summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-02-16 22:32:22 -0800
committerGravatar Yuri Kunde Schlesner2017-02-17 21:44:00 -0800
commit5f00fe905c8b5f9802a66e1cfd0f21873b769147 (patch)
treefeb311173963598c92009be3bf77029d1c7f4b1f /src
parentHID: move enable_accelerometer/gyroscope_count initialization into Init() (#2... (diff)
downloadyuzu-5f00fe905c8b5f9802a66e1cfd0f21873b769147.tar.gz
yuzu-5f00fe905c8b5f9802a66e1cfd0f21873b769147.tar.xz
yuzu-5f00fe905c8b5f9802a66e1cfd0f21873b769147.zip
Qt: Remove unnecessary std::string usage
Diffstat (limited to 'src')
-rw-r--r--src/citra_qt/main.cpp23
-rw-r--r--src/citra_qt/main.h6
2 files changed, 15 insertions, 14 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 3c1ae8848..78538c5a7 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -75,7 +75,7 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) {
75 75
76 QStringList args = QApplication::arguments(); 76 QStringList args = QApplication::arguments();
77 if (args.length() >= 2) { 77 if (args.length() >= 2) {
78 BootGame(args[1].toStdString()); 78 BootGame(args[1]);
79 } 79 }
80} 80}
81 81
@@ -272,7 +272,7 @@ void GMainWindow::OnDisplayTitleBars(bool show) {
272 } 272 }
273} 273}
274 274
275bool GMainWindow::LoadROM(const std::string& filename) { 275bool GMainWindow::LoadROM(const QString& filename) {
276 // Shutdown previous session if the emu thread is still active... 276 // Shutdown previous session if the emu thread is still active...
277 if (emu_thread != nullptr) 277 if (emu_thread != nullptr)
278 ShutdownGame(); 278 ShutdownGame();
@@ -290,12 +290,13 @@ bool GMainWindow::LoadROM(const std::string& filename) {
290 290
291 Core::System& system{Core::System::GetInstance()}; 291 Core::System& system{Core::System::GetInstance()};
292 292
293 const Core::System::ResultStatus result{system.Load(render_window, filename)}; 293 const Core::System::ResultStatus result{system.Load(render_window, filename.toStdString())};
294 294
295 if (result != Core::System::ResultStatus::Success) { 295 if (result != Core::System::ResultStatus::Success) {
296 switch (result) { 296 switch (result) {
297 case Core::System::ResultStatus::ErrorGetLoader: 297 case Core::System::ResultStatus::ErrorGetLoader:
298 LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filename.c_str()); 298 LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!",
299 filename.toStdString().c_str());
299 QMessageBox::critical(this, tr("Error while loading ROM!"), 300 QMessageBox::critical(this, tr("Error while loading ROM!"),
300 tr("The ROM format is not supported.")); 301 tr("The ROM format is not supported."));
301 break; 302 break;
@@ -335,7 +336,7 @@ bool GMainWindow::LoadROM(const std::string& filename) {
335 return true; 336 return true;
336} 337}
337 338
338void GMainWindow::BootGame(const std::string& filename) { 339void GMainWindow::BootGame(const QString& filename) {
339 LOG_INFO(Frontend, "Citra starting..."); 340 LOG_INFO(Frontend, "Citra starting...");
340 StoreRecentFile(filename); // Put the filename on top of the list 341 StoreRecentFile(filename); // Put the filename on top of the list
341 342
@@ -411,8 +412,8 @@ void GMainWindow::ShutdownGame() {
411 emulation_running = false; 412 emulation_running = false;
412} 413}
413 414
414void GMainWindow::StoreRecentFile(const std::string& filename) { 415void GMainWindow::StoreRecentFile(const QString& filename) {
415 UISettings::values.recent_files.prepend(QString::fromStdString(filename)); 416 UISettings::values.recent_files.prepend(filename);
416 UISettings::values.recent_files.removeDuplicates(); 417 UISettings::values.recent_files.removeDuplicates();
417 while (UISettings::values.recent_files.size() > max_recent_files_item) { 418 while (UISettings::values.recent_files.size() > max_recent_files_item) {
418 UISettings::values.recent_files.removeLast(); 419 UISettings::values.recent_files.removeLast();
@@ -447,7 +448,7 @@ void GMainWindow::UpdateRecentFiles() {
447} 448}
448 449
449void GMainWindow::OnGameListLoadFile(QString game_path) { 450void GMainWindow::OnGameListLoadFile(QString game_path) {
450 BootGame(game_path.toStdString()); 451 BootGame(game_path);
451} 452}
452 453
453void GMainWindow::OnGameListOpenSaveFolder(u64 program_id) { 454void GMainWindow::OnGameListOpenSaveFolder(u64 program_id) {
@@ -477,7 +478,7 @@ void GMainWindow::OnMenuLoadFile() {
477 if (!filename.isEmpty()) { 478 if (!filename.isEmpty()) {
478 UISettings::values.roms_path = QFileInfo(filename).path(); 479 UISettings::values.roms_path = QFileInfo(filename).path();
479 480
480 BootGame(filename.toStdString()); 481 BootGame(filename);
481 } 482 }
482} 483}
483 484
@@ -506,7 +507,7 @@ void GMainWindow::OnMenuRecentFile() {
506 QString filename = action->data().toString(); 507 QString filename = action->data().toString();
507 QFileInfo file_info(filename); 508 QFileInfo file_info(filename);
508 if (file_info.exists()) { 509 if (file_info.exists()) {
509 BootGame(filename.toStdString()); 510 BootGame(filename);
510 } else { 511 } else {
511 // Display an error message and remove the file from the list. 512 // Display an error message and remove the file from the list.
512 QMessageBox::information(this, tr("File not found"), 513 QMessageBox::information(this, tr("File not found"),
@@ -634,7 +635,7 @@ void GMainWindow::dropEvent(QDropEvent* event) {
634 if (IsSingleFileDropEvent(event) && ConfirmChangeGame()) { 635 if (IsSingleFileDropEvent(event) && ConfirmChangeGame()) {
635 const QMimeData* mimeData = event->mimeData(); 636 const QMimeData* mimeData = event->mimeData();
636 QString filename = mimeData->urls().at(0).toLocalFile(); 637 QString filename = mimeData->urls().at(0).toLocalFile();
637 BootGame(filename.toStdString()); 638 BootGame(filename);
638 } 639 }
639} 640}
640 641
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h
index 102fd151d..7ae972937 100644
--- a/src/citra_qt/main.h
+++ b/src/citra_qt/main.h
@@ -79,8 +79,8 @@ private:
79 * @returns Whether the system was properly initialized. 79 * @returns Whether the system was properly initialized.
80 */ 80 */
81 bool InitializeSystem(u32 system_mode); 81 bool InitializeSystem(u32 system_mode);
82 bool LoadROM(const std::string& filename); 82 bool LoadROM(const QString& filename);
83 void BootGame(const std::string& filename); 83 void BootGame(const QString& filename);
84 void ShutdownGame(); 84 void ShutdownGame();
85 85
86 /** 86 /**
@@ -94,7 +94,7 @@ private:
94 * 94 *
95 * @param filename the filename to store 95 * @param filename the filename to store
96 */ 96 */
97 void StoreRecentFile(const std::string& filename); 97 void StoreRecentFile(const QString& filename);
98 98
99 /** 99 /**
100 * Updates the recent files menu. 100 * Updates the recent files menu.