Replaced some costly string-comparisons with QLatin1String

pull/21/head
Pieter van der Kloet 14 years ago
parent 6716bf649e
commit 7cbed6c58a

@ -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);
}
}

@ -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);
}
}

Loading…
Cancel
Save