Skip to content

Commit

Permalink
Merge pull request #645 from jhsrennie/master
Browse files Browse the repository at this point in the history
Make sure keymaps are always loaded when a profile is loaded
  • Loading branch information
John Rennie committed Jan 21, 2012
2 parents aea36b1 + ae726a1 commit 4e3e8f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions xbmc/input/ButtonTranslator.cpp
Expand Up @@ -416,7 +416,7 @@ void CButtonTranslator::RemoveDevice(CStdString& strDevice)
Load();
}

bool CButtonTranslator::Load(void)
bool CButtonTranslator::Load(bool AlwaysLoad)
{
m_translatorMap.clear();

Expand All @@ -429,8 +429,11 @@ bool CButtonTranslator::Load(void)
};
bool success = false;

// If we've already loaded the m_baseMap we don't need to load it again
if (m_Loaded)
// If we've already loaded the m_baseMap we don't need to load it
// again - this speeds up reloads caused by plugging and unplugging
// HID devices. However if AlwaysLoad is true always load the keymaps
// from scratch.
if (m_Loaded && !AlwaysLoad)
{
m_translatorMap = m_baseMap;
}
Expand Down
2 changes: 1 addition & 1 deletion xbmc/input/ButtonTranslator.h
Expand Up @@ -69,7 +69,7 @@ class CButtonTranslator
void RemoveDevice(CStdString& strDevice);

/// loads Lircmap.xml/IRSSmap.xml (if enabled) and Keymap.xml
bool Load(void);
bool Load(bool AlwaysLoad = false);
/// clears the maps
void Clear();

Expand Down
2 changes: 1 addition & 1 deletion xbmc/settings/Settings.cpp
Expand Up @@ -951,7 +951,7 @@ bool CSettings::LoadProfile(unsigned int index)
CStdString strLanguagePath;
strLanguagePath.Format("special://xbmc/language/%s/strings.xml", strLanguage.c_str());

CButtonTranslator::GetInstance().Load();
CButtonTranslator::GetInstance().Load(true);
g_localizeStrings.Load(strLanguagePath);

g_Mouse.SetEnabled(g_guiSettings.GetBool("input.enablemouse"));
Expand Down

0 comments on commit 4e3e8f3

Please sign in to comment.