Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc code cleanups #14046

Merged
merged 3 commits into from Jun 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions xbmc/LangInfo.cpp
Expand Up @@ -912,9 +912,9 @@ const std::string& CLangInfo::MeridiemSymbolToString(MeridiemSymbol symbol)
// Fills the array with the region names available for this language
void CLangInfo::GetRegionNames(std::vector<std::string>& array)
{
for (ITMAPREGIONS it=m_regions.begin(); it!=m_regions.end(); ++it)
for (const auto &region : m_regions)
{
std::string strName=it->first;
std::string strName=region.first;
if (strName=="N/A")
strName=g_localizeStrings.Get(416);
array.emplace_back(std::move(strName));
Expand Down Expand Up @@ -1110,8 +1110,8 @@ void CLangInfo::SettingOptionsLanguageNamesFiller(SettingConstPtr setting, std::
if (!CServiceBroker::GetAddonMgr().GetAddons(addons, ADDON::ADDON_RESOURCE_LANGUAGE))
return;

for (ADDON::VECADDONS::const_iterator addon = addons.begin(); addon != addons.end(); ++addon)
list.emplace_back((*addon)->Name(), (*addon)->Name());
for (const auto &addon : addons)
list.emplace_back(addon->Name(), addon->Name());

sort(list.begin(), list.end(), SortLanguage());
}
Expand All @@ -1121,8 +1121,8 @@ void CLangInfo::SettingOptionsISO6391LanguagesFiller(SettingConstPtr setting, st
// get a list of language names
std::vector<std::string> languages = g_LangCodeExpander.GetLanguageNames(CLangCodeExpander::ISO_639_1, true);
sort(languages.begin(), languages.end(), sortstringbyname());
for (std::vector<std::string>::const_iterator language = languages.begin(); language != languages.end(); ++language)
list.emplace_back(*language, *language);
for (const auto &language : languages)
list.emplace_back(language, language);
}

void CLangInfo::SettingOptionsAudioStreamLanguagesFiller(SettingConstPtr setting, std::vector< std::pair<std::string, std::string> > &list, std::string &current, void *data)
Expand Down
1 change: 1 addition & 0 deletions xbmc/powermanagement/DPMSSupport.cpp
Expand Up @@ -290,6 +290,7 @@ bool DPMSSupport::PlatformSpecificDisablePowerSaving()
{
CWinSystemGbm *winSystem = dynamic_cast<CWinSystemGbm*>(CServiceBroker::GetWinSystem());
winSystem->Show();
return true;
}

#else
Expand Down
7 changes: 5 additions & 2 deletions xbmc/utils/ISerializable.h
Expand Up @@ -24,7 +24,10 @@ class CVariant;

class ISerializable
{
public:
protected:
/* make sure nobody deletes a pointer to this class */
~ISerializable() = default;

public:
virtual void Serialize(CVariant& value) const = 0;
virtual ~ISerializable() = default;
};