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)
{
// is there a filter?
if (m_currentFilter.Length > 0)
if (m_iAction != FileChooser.ACTION_CHOOSE_DIR)
{
int dotPosition = m_currentFilter.LastIndexOf(".");
if (dotPosition > 0)
// is there a filter?
if (m_currentFilter.Length > 0)
{
string sFileExt = m_currentFilter.Substring(dotPosition);
if (!m_sFileSelected.EndsWith(sFileExt))
int dotPosition = m_currentFilter.LastIndexOf(".");
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;
}
}
}
}