From 89dee80dcff9b726d8132f74a6e0754d3338ee61 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Sun, 23 Jun 2013 21:04:49 +0200 Subject: [PATCH] simpler remove of duplicates --- apps/launcher/graphicspage.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index b185b3cd2f..333dff1219 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -285,7 +285,6 @@ QStringList GraphicsPage::getAvailableResolutions(int screen) return result; } - QList resolutions; for (modeIndex = 0; modeIndex < modes; modeIndex++) { if (SDL_GetDisplayMode(screen, modeIndex, &mode) < 0) @@ -294,19 +293,6 @@ QStringList GraphicsPage::getAvailableResolutions(int screen) return result; } - bool isDuplicate = false; - for (int i = 0; i < resolutions.count(); i++) - { - SDL_DisplayMode omode = resolutions.at(i); - if (omode.w == mode.w && omode.h == mode.h) - { - isDuplicate = true; - break; - } - } - if (isDuplicate) - continue; - QString aspect = getAspect(mode.w, mode.h); QString resolution = QString::number(mode.w) + QString(" x ") + QString::number(mode.h); @@ -317,10 +303,10 @@ QStringList GraphicsPage::getAvailableResolutions(int screen) resolution.append(tr("\t(Standard 4:3)")); } - resolutions.append(mode); result.append(resolution); } + result.removeDuplicates(); return result; }