示例#1
0
void BookmarkList::slotExecuted( QTreeWidgetItem * item )
{
    BookmarkItem* bmItem = dynamic_cast<BookmarkItem*>( item );
    if ( !bmItem || !bmItem->viewport().isValid() )
        return;

    goTo( bmItem );
}
示例#2
0
void BookmarkList::slotChanged( QTreeWidgetItem * item )
{
    BookmarkItem* bmItem = dynamic_cast<BookmarkItem*>( item );
    if ( bmItem && bmItem->viewport().isValid() )
    {
        bmItem->bookmark().setFullText( bmItem->text( 0 ) );
        m_document->bookmarkManager()->save();
    }

    FileItem* fItem = dynamic_cast<FileItem*>( item );
    if ( fItem )
    {
        const KUrl url = fItem->data( 0, UrlRole ).value< KUrl >();
        m_document->bookmarkManager()->renameBookmark( url, fItem->text( 0 ) );
        m_document->bookmarkManager()->save();
    }
}