コード例 #1
0
ファイル: personview.cpp プロジェクト: cornelius/polka
void PersonView::commentLink( const QString &id )
{
  Polka::Link l = m_identity.links().findLink( id );

  Polka::Comment comment = l.comment();

  CommentEditor *editor = new CommentEditor( this );
  editor->setComment( comment.value() );
  if ( editor->exec() == CommentEditor::Accepted ) {
    Polka::Links ls = m_identity.links();
    comment.setValue( editor->comment() );
    l.setComment( comment );
    ls.insert( l );
    m_identity.setLinks( ls );

    m_model->insert( m_identity, i18n("Edit comment of link %2")
      .arg( l.url() ) );
  }
}