From 866a71ffd576fd10c4e309195016d86f0c8ed635 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 3 Sep 2012 21:58:08 +0300 Subject: Add const to more classes. --- src/resources/wallpaper.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/resources/wallpaper.cpp') diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp index 9ee87e33a..3a5cd05b7 100644 --- a/src/resources/wallpaper.cpp +++ b/src/resources/wallpaper.cpp @@ -44,7 +44,7 @@ struct WallpaperData int height; }; -static bool wallpaperCompare(WallpaperData a, WallpaperData b); +static bool wallpaperCompare(const WallpaperData &a, const WallpaperData &b); static std::vector wallpaperData; static bool haveBackup; // Is the backup (no size given) version available? @@ -55,7 +55,7 @@ static std::string wallpaperFile; // Search for the wallpaper path values sequentially.. static void initDefaultWallpaperPaths() { - ResourceManager *resman = ResourceManager::getInstance(); + ResourceManager *const resman = ResourceManager::getInstance(); // Init the path wallpaperPath = branding.getStringValue("wallpapersPath"); @@ -78,10 +78,10 @@ static void initDefaultWallpaperPaths() wallpaperFile = "login_wallpaper.png"; } -static bool wallpaperCompare(WallpaperData a, WallpaperData b) +static bool wallpaperCompare(const WallpaperData &a, const WallpaperData &b) { - int aa = a.width * a.height; - int ab = b.width * b.height; + const int aa = a.width * a.height; + const int ab = b.width * b.height; return (aa > ab || (aa == ab && a.width > b.width)); } @@ -135,7 +135,7 @@ void Wallpaper::loadWallpapers() std::sort(wallpaperData.begin(), wallpaperData.end(), wallpaperCompare); } -std::string Wallpaper::getWallpaper(int width, int height) +std::string Wallpaper::getWallpaper(const int width, const int height) { WallpaperData wp; -- cgit v1.2.3-60-g2f50