[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / addons / FontResource.cpp
blob0ed843bb28a972196637aa74d83aaff30fc54f26
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8 #include "FontResource.h"
10 #include "ServiceBroker.h"
11 #include "addons/AddonManager.h"
12 #include "addons/addoninfo/AddonInfo.h"
13 #include "addons/addoninfo/AddonType.h"
14 #include "filesystem/SpecialProtocol.h"
15 #include "messaging/ApplicationMessenger.h"
16 #include "settings/Settings.h"
17 #include "settings/SettingsComponent.h"
18 #include "utils/FileUtils.h"
20 namespace ADDON
23 CFontResource::CFontResource(const AddonInfoPtr& addonInfo)
24 : CResource(addonInfo, AddonType::RESOURCE_FONT)
28 void CFontResource::OnPostInstall(bool update, bool modal)
30 std::string skin = CServiceBroker::GetSettingsComponent()->GetSettings()->GetString(CSettings::SETTING_LOOKANDFEEL_SKIN);
31 const auto& deps =
32 CServiceBroker::GetAddonMgr().GetDepsRecursive(skin, OnlyEnabledRootAddon::CHOICE_YES);
33 for (const auto& it : deps)
34 if (it.id == ID())
35 CServiceBroker::GetAppMessenger()->PostMsg(TMSG_EXECUTE_BUILT_IN, -1, -1, nullptr,
36 "ReloadSkin");
39 bool CFontResource::GetFont(const std::string& file, std::string& path) const
41 std::string result = CSpecialProtocol::TranslatePathConvertCase(Path()+"/resources/"+file);
42 if (CFileUtils::Exists(result))
44 path = result;
45 return true;
48 return false;