Qt: Pass QStrings by reference in HostInterface

This commit is contained in:
Connor McLaughlin
2020-02-16 00:14:30 +09:00
parent fd8ed08307
commit e5740a5632
4 changed files with 17 additions and 17 deletions

View File

@ -167,11 +167,11 @@ QtDisplayWindow* QtHostInterface::createDisplayWindow()
return m_display_window;
}
void QtHostInterface::bootSystemFromFile(QString filename)
void QtHostInterface::bootSystemFromFile(const QString& filename)
{
if (!isOnWorkerThread())
{
QMetaObject::invokeMethod(this, "bootSystemFromFile", Qt::QueuedConnection, Q_ARG(QString, filename));
QMetaObject::invokeMethod(this, "bootSystemFromFile", Qt::QueuedConnection, Q_ARG(const QString&, filename));
return;
}
@ -527,7 +527,7 @@ void QtHostInterface::pauseSystem(bool paused)
emit emulationPaused(paused);
}
void QtHostInterface::changeDisc(QString new_disc_filename) {}
void QtHostInterface::changeDisc(const QString& new_disc_filename) {}
void QtHostInterface::populateSaveStateMenus(const char* game_code, QMenu* load_menu, QMenu* save_menu)
{
@ -579,11 +579,11 @@ void QtHostInterface::populateSaveStateMenus(const char* game_code, QMenu* load_
}
}
void QtHostInterface::loadState(QString filename)
void QtHostInterface::loadState(const QString& filename)
{
if (!isOnWorkerThread())
{
QMetaObject::invokeMethod(this, "loadState", Qt::QueuedConnection, Q_ARG(QString, filename));
QMetaObject::invokeMethod(this, "loadState", Qt::QueuedConnection, Q_ARG(const QString&, filename));
return;
}