Exemple #1
0
void KateFileSelector::cmbPathReturnPressed( const TQString& u )
{
  KURL typedURL( u );
  if ( typedURL.hasPass() )
    typedURL.setPass( TQString::null );

  TQStringList urls = cmbPath->urls();
  urls.remove( typedURL.url() );
  urls.prepend( typedURL.url() );
  cmbPath->setURLs( urls, KURLComboBox::RemoveBottom );
  dir->setFocus();
  dir->setURL( KURL(u), true );
}
void URLNavigator::slotReturnPressed(const QString& text)
{
    // Parts of the following code have been taken
    // from the class KateFileSelector located in
    // kate/app/katefileselector.hpp of Kate.
    // Copyright (C) 2001 Christoph Cullmann <*****@*****.**>
    // Copyright (C) 2001 Joseph Wenninger <*****@*****.**>
    // Copyright (C) 2001 Anders Lund <*****@*****.**>

    KURL typedURL(text);
    if (typedURL.hasPass()) {
        typedURL.setPass(QString::null);
    }

    QStringList urls = m_pathBox->urls();
    urls.remove(typedURL.url());
    urls.prepend(typedURL.url());
    m_pathBox->setURLs(urls, KURLComboBox::RemoveBottom);

    setURL(typedURL);
    // The URL might have been adjusted by URLNavigator::setURL(), hence
    // synchronize the result in the path box.
    m_pathBox->setURL(url());
}