Example #1
0
KBookmark* KBookmark::findBookmark( const char *_url )
{
  if ( !strcmp ( url(), _url ))
    return this;

  KBookmark *bm;
  
  for ( bm = children()->first(); bm != NULL; bm = children()->next() )
  {
    if ( !strcmp ( bm->url(), _url ))
      return bm;
    
    if ( bm->type() == Folder )
    {
      KBookmark *b = bm->findBookmark( _url );
      if ( b )
	return b;
    }
  }

  return 0L;
}
Example #2
0
KBookmark* KBookmark::findBookmark( int _id )
{
  if ( _id == id() )
    return this;

  KBookmark *bm;
  
  for ( bm = children()->first(); bm != NULL; bm = children()->next() )
  {
    if ( bm->id() == _id )
      return bm;
    
    if ( bm->type() == Folder )
    {
      KBookmark *b = bm->findBookmark( _id );
      if ( b )
	return b;
    }
  }

  return 0L;
}