From 7cbed6c58a3a6bf5d7fac0503325cc20b6b903ba Mon Sep 17 00:00:00 2001 From: Pieter van der Kloet Date: Sun, 26 Jun 2011 23:35:23 +0200 Subject: [PATCH] Replaced some costly string-comparisons with QLatin1String --- apps/launcher/graphicspage.cpp | 15 ++++++++------- apps/launcher/maindialog.cpp | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 0566b3d23f..d758aadb2f 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -270,7 +270,7 @@ void GraphicsPage::readConfig() } index = mOGLAntiAliasingComboBox->findText(getConfigValue("FSAA", mOpenGLRenderSystem)); - if ( index != -1) { + if ( index != -1){ mOGLAntiAliasingComboBox->setCurrentIndex(index); } @@ -285,17 +285,18 @@ void GraphicsPage::readConfig() } // Now we do the same for the checkboxes - if (QString::compare(getConfigValue("VSync", mOpenGLRenderSystem), QString("Yes")) == 0) { + if (getConfigValue("VSync", mOpenGLRenderSystem) == QLatin1String("Yes")) { mOGLVSyncCheckBox->setCheckState(Qt::Checked); } - if (QString::compare(getConfigValue("Full Screen", mOpenGLRenderSystem), QString("Yes")) == 0) { + if (getConfigValue("Full Screen", mOpenGLRenderSystem) == QLatin1String("Yes")) { mOGLFullScreenCheckBox->setCheckState(Qt::Checked); } } if (mDirect3DRenderSystem) { - int index = mD3DRenderDeviceComboBox->findText(getConfigValue("Rendering Device", mDirect3DRenderSystem)); + + int index = mD3DRenderDeviceComboBox->findText(getConfigValue("Rendering Device", mDirect3DRenderSystem)); if ( index != -1) { mD3DRenderDeviceComboBox->setCurrentIndex(index); } @@ -315,15 +316,15 @@ void GraphicsPage::readConfig() mD3DResolutionComboBox->setCurrentIndex(index); } - if (QString::compare(getConfigValue("Allow NVPerfHUD", mDirect3DRenderSystem), QString("Yes")) == 0) { + if (getConfigValue("Allow NVPerfHUD", mDirect3DRenderSystem) == QLatin1String("Yes")) { mD3DNvPerfCheckBox->setCheckState(Qt::Checked); } - if (QString::compare(getConfigValue("VSync", mDirect3DRenderSystem), QString("Yes")) == 0) { + if (getConfigValue("VSync", mDirect3DRenderSystem) == QLatin1String("Yes")) { mD3DVSyncCheckBox->setCheckState(Qt::Checked); } - if (QString::compare(getConfigValue("Full Screen", mDirect3DRenderSystem), QString("Yes")) == 0) { + if (getConfigValue("Full Screen", mDirect3DRenderSystem) == QLatin1String("Yes")) { mD3DFullScreenCheckBox->setCheckState(Qt::Checked); } } diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 841d4de3bd..7f92fa8ccf 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -178,11 +178,11 @@ void MainDialog::profileChanged(int index) } QString currentPage = mIconWidget->currentItem()->data(Qt::DisplayRole).toString(); - if (currentPage == QString("Play")) { + if (currentPage == QLatin1String("Play")) { mDataFilesPage->mProfilesComboBox->setCurrentIndex(index); } - if (currentPage == QString("Data Files")) { + if (currentPage == QLatin1String("Data Files")) { mPlayPage->mProfilesComboBox->setCurrentIndex(index); } }