Changed the way whitespace was removed from retrieved Ogre values

This commit is contained in:
Pieter van der Kloet 2012-02-28 17:18:01 +01:00
parent 9a4cd6c2b1
commit 1512481c07

View file

@ -246,13 +246,7 @@ void GraphicsPage::setupOgre()
if (mOpenGLRenderSystem) { if (mOpenGLRenderSystem) {
mOGLRTTComboBox->addItems(getAvailableOptions(QString("RTT Preferred Mode"), mOpenGLRenderSystem)); mOGLRTTComboBox->addItems(getAvailableOptions(QString("RTT Preferred Mode"), mOpenGLRenderSystem));
mOGLAntiAliasingComboBox->addItems(getAvailableOptions(QString("FSAA"), mOpenGLRenderSystem)); mOGLAntiAliasingComboBox->addItems(getAvailableOptions(QString("FSAA"), mOpenGLRenderSystem));
mOGLResolutionComboBox->addItems(getAvailableOptions(QString("Video Mode"), mOpenGLRenderSystem));
QStringList videoModes = getAvailableOptions(QString("Video Mode"), mOpenGLRenderSystem);
// Remove extraneous spaces
videoModes.replaceInStrings(QRegExp("\\s{2,}"), QString(" "));
videoModes.replaceInStrings(QRegExp("^\\s"), QString());
mOGLResolutionComboBox->addItems(videoModes);
mOGLFrequencyComboBox->addItems(getAvailableOptions(QString("Display Frequency"), mOpenGLRenderSystem)); mOGLFrequencyComboBox->addItems(getAvailableOptions(QString("Display Frequency"), mOpenGLRenderSystem));
} }
@ -261,12 +255,7 @@ void GraphicsPage::setupOgre()
mD3DRenderDeviceComboBox->addItems(getAvailableOptions(QString("Rendering Device"), mDirect3DRenderSystem)); mD3DRenderDeviceComboBox->addItems(getAvailableOptions(QString("Rendering Device"), mDirect3DRenderSystem));
mD3DAntiAliasingComboBox->addItems(getAvailableOptions(QString("FSAA"), mDirect3DRenderSystem)); mD3DAntiAliasingComboBox->addItems(getAvailableOptions(QString("FSAA"), mDirect3DRenderSystem));
mD3DFloatingPointComboBox->addItems(getAvailableOptions(QString("Floating-point mode"), mDirect3DRenderSystem)); mD3DFloatingPointComboBox->addItems(getAvailableOptions(QString("Floating-point mode"), mDirect3DRenderSystem));
mD3DResolutionComboBox->addItems(getAvailableOptions(QString("Video Mode"), mDirect3DRenderSystem));
QStringList videoModes = getAvailableOptions(QString("Video Mode"), mDirect3DRenderSystem);
// Remove extraneous spaces
videoModes.replaceInStrings(QRegExp("\\s{2,}"), QString(" "));
videoModes.replaceInStrings(QRegExp("^\\s"), QString());
mD3DResolutionComboBox->addItems(videoModes);
} }
} }
@ -481,7 +470,7 @@ QStringList GraphicsPage::getAvailableOptions(const QString &key, Ogre::RenderSy
{ {
if (strcmp (key.toStdString().c_str(), i->first.c_str()) == 0) if (strcmp (key.toStdString().c_str(), i->first.c_str()) == 0)
result << (*opt_it).c_str(); result << QString::fromStdString((*opt_it).c_str()).simplified();
} }
} }