summaryrefslogtreecommitdiff
path: root/src/resources/wallpaper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/wallpaper.cpp')
-rw-r--r--src/resources/wallpaper.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp
index a1990ed0..e8167b6b 100644
--- a/src/resources/wallpaper.cpp
+++ b/src/resources/wallpaper.cpp
@@ -21,17 +21,12 @@
#include "resources/wallpaper.h"
-#include "resources/resourcemanager.h"
-#include "log.h"
-
-#include "utils/stringutils.h"
#include "configuration.h"
#include <physfs.h>
#include <algorithm>
#include <cstring>
-#include <ctime>
#include <vector>
struct WallpaperData
@@ -144,16 +139,12 @@ std::string Wallpaper::getWallpaper(int width, int height)
WallpaperData wallpaper;
// Search for the smallest wallpaper at least as large as the screen
- std::vector<WallpaperData>::iterator iter;
- for (iter = wallpaperData.begin(); iter != wallpaperData.end(); iter++)
+ for (auto &wp : wallpaperData)
{
- const WallpaperData &wp = *iter;
-
if (wp.width >= width && wp.height >= height)
{
- if (wallpaper.filename.empty() ||
- (wallpaper.width < wp.width &&
- wallpaper.height < wp.height))
+ if (wallpaper.filename.empty() || (wallpaper.width < wp.width &&
+ wallpaper.height < wp.height))
{
wallpaper = wp;
}