Fix bug in FileChooser

This commit is contained in:
Jim Norman 2006-09-07 20:19:43 +00:00
parent 79814b1f00
commit 307ed2444c

View File

@ -111,16 +111,19 @@ namespace Novell.CASA.GUI
if (m_sFileSelected != null) if (m_sFileSelected != null)
{ {
// is there a filter? if (m_iAction != FileChooser.ACTION_CHOOSE_DIR)
if (m_currentFilter.Length > 0)
{ {
int dotPosition = m_currentFilter.LastIndexOf("."); // is there a filter?
if (dotPosition > 0) if (m_currentFilter.Length > 0)
{ {
string sFileExt = m_currentFilter.Substring(dotPosition); int dotPosition = m_currentFilter.LastIndexOf(".");
if (!m_sFileSelected.EndsWith(sFileExt)) if (dotPosition > 0)
{ {
return m_currentDirectory + m_sFileSelected + sFileExt; string sFileExt = m_currentFilter.Substring(dotPosition);
if (!m_sFileSelected.EndsWith(sFileExt) && (!sFileExt.EndsWith("*")))
{
return m_currentDirectory + m_sFileSelected + sFileExt;
}
} }
} }
} }