summaryrefslogtreecommitdiff
path: root/src/resources/wallpaper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-03 21:58:08 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-04 03:06:57 +0300
commit866a71ffd576fd10c4e309195016d86f0c8ed635 (patch)
tree21bbec175afc181cada529598267d62f12fcb671 /src/resources/wallpaper.cpp
parentebecb0cf42f2066943908fa158ac91527e0e6629 (diff)
downloadmanaplus-866a71ffd576fd10c4e309195016d86f0c8ed635.tar.gz
manaplus-866a71ffd576fd10c4e309195016d86f0c8ed635.tar.bz2
manaplus-866a71ffd576fd10c4e309195016d86f0c8ed635.tar.xz
manaplus-866a71ffd576fd10c4e309195016d86f0c8ed635.zip
Add const to more classes.
Diffstat (limited to 'src/resources/wallpaper.cpp')
-rw-r--r--src/resources/wallpaper.cpp12
1 files changed, 6 insertions, 6 deletions
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> 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;