diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 0af127edc..e3c678f7f 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -7,6 +7,17 @@ #include #include +//sort resolutions descending +bool resolutionLessThan(const QString &str1, const QString &str2) +{ + // Get the first parts of the resolution strings + int width1 = str1.left(str1.indexOf(" ")).toInt(); + int width2 = str2.left(str2.indexOf(" ")).toInt(); + + return (width1 > width2); +} + + GraphicsPage::GraphicsPage(Files::ConfigurationManager &cfg, QWidget *parent) : QWidget(parent) , mCfgMgr(cfg) @@ -162,7 +173,7 @@ bool GraphicsPage::setupOgre() mAntiAliasingComboBox->clear(); mResolutionComboBox->clear(); mAntiAliasingComboBox->addItems(getAvailableOptions(QString("FSAA"), mSelectedRenderSystem)); - mResolutionComboBox->addItems(getAvailableOptions(QString("Video Mode"), mSelectedRenderSystem)); + mResolutionComboBox->addItems(getAvailableResolutions(mSelectedRenderSystem)); readConfig(); return true; @@ -229,6 +240,8 @@ QStringList GraphicsPage::getAvailableOptions(const QString &key, Ogre::RenderSy } + // Sort ascending + result.sort(); return result; } @@ -265,6 +278,8 @@ QStringList GraphicsPage::getAvailableResolutions(Ogre::RenderSystem *renderer) } + // Sort the resolutions in descending order + qSort(result.begin(), result.end(), resolutionLessThan); return result; } diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index ab6eb0b73..ed67eb3b5 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -229,7 +229,6 @@ void MainDialog::closeEvent(QCloseEvent *event) // Save user settings const std::string settingspath = (mCfgMgr.getUserPath() / "settings.cfg").string(); - qDebug() << QString::fromStdString(settingspath); mSettings.saveUser(settingspath); event->accept(); diff --git a/apps/launcher/pluginsview.cpp b/apps/launcher/pluginsview.cpp index 27af45c56..26cf337fb 100644 --- a/apps/launcher/pluginsview.cpp +++ b/apps/launcher/pluginsview.cpp @@ -1,4 +1,3 @@ -#include #include #include "pluginsview.hpp"