KURL SiteSettingsDialog::remoteBaseDir()
{
  if(m_edRemoteBaseDir->text().isEmpty())
  {
    return KURL();
  }
  else
  {
    KURL url;
    url.setDirectory(m_edRemoteBaseDir->text()); 
    return url;
  }
}
KURL SiteSettingsDialog::localBaseDir()
{
  if(m_edLocalBaseDir->url().isEmpty())
  {
    return KURL();
  }
  else
  {
    KURL url;
    url.setDirectory(m_edLocalBaseDir->url()); 
    return url;
  }
}
void DirMappingWidget::slotAdd()
{
  KURL local;
  local.setDirectory(m_edLocalDir->url()); 

  KURL remote;
  remote.setDirectory(m_edRemoteDir->text());

  if(m_edLocalDir->url().isEmpty() || !local.isValid())
  {
    KMessageBox::sorry(this, i18n("\"Local dir\" is not valid."));
    return;
  }

  if(m_edRemoteDir->text().isEmpty() || !remote.isValid())
  {
    KMessageBox::sorry(this, i18n("\"Remote dir\" is not valid."));
    return;
  }

  QString l = m_edLocalDir->url();
  if(!l.endsWith("/"))
  {
    l += "/";
  }

  if(itemExists(l))
  {
    KMessageBox::sorry(this, i18n("\"Local dir\" already exists."));
    return;
  }

  addMapping(m_edLocalDir->url(), m_edRemoteDir->text());

  m_listView->clearSelection();

  m_edLocalDir->clear();
  m_edRemoteDir->clear();
}