aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2010-02-27 08:02:42 +0000
committerjmarshallnz <jmarshallnz@svn>2010-02-27 08:02:42 +0000
commitb63386c787a5c2f7439cd99b5f373b0352ea017a (patch)
tree3460a0814d8a208d67de3d12cb57d3c0426def26
parent0645044ddbebaed19686ab408efd55cd994d3a66 (diff)
changed: Now that we're no longer using non-MD5 passwords for scrobbling, edit controls may assume any set label is an MD5 digest.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@28176 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--guilib/GUIEditControl.cpp12
-rw-r--r--guilib/GUIEditControl.h1
2 files changed, 6 insertions, 7 deletions
diff --git a/guilib/GUIEditControl.cpp b/guilib/GUIEditControl.cpp
index c61de590c2..592e668f9c 100644
--- a/guilib/GUIEditControl.cpp
+++ b/guilib/GUIEditControl.cpp
@@ -63,6 +63,7 @@ void CGUIEditControl::DefaultConstructor()
m_smsKeyIndex = 0;
m_label.SetAlign(m_label.GetLabelInfo().align & XBFONT_CENTER_Y); // left align
m_label2.GetLabelInfo().offsetX = 0;
+ m_isMD5 = false;
}
CGUIEditControl::CGUIEditControl(const CGUIButtonControl &button)
@@ -453,6 +454,7 @@ void CGUIEditControl::SetLabel2(const std::string &text)
g_charsetConverter.utf8ToW(text, newText);
if (newText != m_text2)
{
+ m_isMD5 = m_inputType == INPUT_TYPE_PASSWORD_MD5;
m_text2 = newText;
m_cursorPos = m_text2.size();
SetInvalid();
@@ -463,23 +465,19 @@ CStdString CGUIEditControl::GetLabel2() const
{
CStdString text;
g_charsetConverter.wToUTF8(m_text2, text);
- if (m_inputType == INPUT_TYPE_PASSWORD_MD5 && !XBMC::XBMC_MD5::IsValidMD5(text))
+ if (m_inputType == INPUT_TYPE_PASSWORD_MD5 && !m_isMD5)
return XBMC::XBMC_MD5::GetMD5(text);
return text;
}
bool CGUIEditControl::ClearMD5()
{
- if (m_inputType != INPUT_TYPE_PASSWORD_MD5)
- return false;
-
- CStdString utf8;
- g_charsetConverter.wToUTF8(m_text2, utf8);
- if (!XBMC::XBMC_MD5::IsValidMD5(utf8))
+ if (m_inputType != INPUT_TYPE_PASSWORD_MD5 || !m_isMD5)
return false;
m_text2.Empty();
m_cursorPos = 0;
+ m_isMD5 = false;
return true;
}
diff --git a/guilib/GUIEditControl.h b/guilib/GUIEditControl.h
index efb1e2ee3f..ada7bd8f79 100644
--- a/guilib/GUIEditControl.h
+++ b/guilib/GUIEditControl.h
@@ -104,6 +104,7 @@ protected:
int m_inputHeading;
INPUT_TYPE m_inputType;
+ bool m_isMD5;
std::vector<CGUIActionDescriptor> m_textChangeActions;