From a634acc541a85b7e5d2477d221a7fd8829dae99c Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 8 Oct 2011 11:13:38 +0200 Subject: [PATCH] Changed: Use all existing icons for Ryzom --- code/ryzom/client/src/init.cpp | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 55d09c69e..a43dd97c0 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -921,20 +921,32 @@ void prelogInit() Driver->setWindowTitle(CI18N::get("TheSagaOfRyzom")); #if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) - vector bitmaps; - - string fileName = "/usr/share/pixmaps/ryzom.png"; + // add all existing icons + vector filenames; + filenames.push_back("/usr/share/icons/hicolor/128x128/apps/ryzom.png"); + filenames.push_back("/usr/share/icons/hicolor/48x48/apps/ryzom.png"); + filenames.push_back("/usr/share/icons/hicolor/32x32/apps/ryzom.png"); + filenames.push_back("/usr/share/icons/hicolor/24x24/apps/ryzom.png"); + filenames.push_back("/usr/share/icons/hicolor/22x22/apps/ryzom.png"); + filenames.push_back("/usr/share/icons/hicolor/16x16/apps/ryzom.png"); + filenames.push_back("/usr/share/pixmaps/ryzom.png"); + // check if an icon is present in registered paths if(CPath::exists("ryzom.png")) - fileName = CPath::lookup("ryzom.png"); + filenames.push_back(CPath::lookup("ryzom.png")); - CIFile file; - - if (file.open(fileName)) + vector bitmaps; + + for(size_t i = 0; i < filenames.size(); ++i) { - CBitmap bitmap; - if (bitmap.load(file)) - bitmaps.push_back(bitmap); + CIFile file; + + if (CFile::fileExists(filenames[i]) && file.open(filenames[i])) + { + CBitmap bitmap; + if (bitmap.load(file)) + bitmaps.push_back(bitmap); + } } Driver->setWindowIcon(bitmaps);