diff options
author | Arne Morten Kvarving <cptspiff@gmail.com> | 2015-03-27 20:07:47 +0100 |
---|---|---|
committer | montellese <montellese@kodi.tv> | 2015-07-12 19:22:30 +0200 |
commit | 8e7879fd78c550fcd2b5a56369789dc89be80092 (patch) | |
tree | ac4a21cad2f5e76a6a8eb696bb75ac333e77590b | |
parent | e65b74942a3cc87a8a17e08e32289e25dc209d55 (diff) |
changed: read weather icons from a resource addon
-rw-r--r-- | xbmc/utils/Weather.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/xbmc/utils/Weather.cpp b/xbmc/utils/Weather.cpp index 99530d7f25..1e219f3328 100644 --- a/xbmc/utils/Weather.cpp +++ b/xbmc/utils/Weather.cpp @@ -57,17 +57,13 @@ using namespace XFILE; #define LOCALIZED_TOKEN_FIRSTID4 71 #define LOCALIZED_TOKEN_LASTID4 97 +static const std::string IconAddonPath = "resource://resource.images.weather.default"; + /* FIXME'S >strings are not centered */ -#define WEATHER_BASE_PATH "special://temp/weather/" -#define WEATHER_ICON_PATH "special://temp/weather/" -#define WEATHER_SOURCE_FILE "special://xbmc/media/weather.zip" - -bool CWeatherJob::m_imagesOkay = false; - CWeatherJob::CWeatherJob(int location) { m_location = location; @@ -102,12 +98,6 @@ bool CWeatherJob::DoWork() break; Sleep(100); } - if (!m_imagesOkay) - { - CDirectory::Create(WEATHER_BASE_PATH); - g_ZipManager.ExtractArchive(WEATHER_SOURCE_FILE, WEATHER_BASE_PATH); - m_imagesOkay = true; - } SetFromProperties(); @@ -248,7 +238,7 @@ static std::string ConstructPath(std::string in) // copy intended if (in.empty() || in == "N/A") in = "na.png"; - return URIUtils::AddFileToFolder(WEATHER_ICON_PATH,in); + return URIUtils::AddFileToFolder(IconAddonPath, in); } void CWeatherJob::SetFromProperties() @@ -322,7 +312,7 @@ CWeather::~CWeather(void) std::string CWeather::BusyInfo(int info) const { if (info == WEATHER_IMAGE_CURRENT_ICON) - return URIUtils::AddFileToFolder(WEATHER_ICON_PATH,"na.png"); + return URIUtils::AddFileToFolder(IconAddonPath, "na.png"); return CInfoLoader::BusyInfo(info); } |