changed: use new getter/setter for the KBookmark description property

svn path=/trunk/KDE/kdebase/apps/; revision=1066996
This commit is contained in:
Friedrich W. H. Kossebau 2009-12-28 16:23:44 +00:00
parent 1175cd72a0
commit 72ced8535d
3 changed files with 6 additions and 10 deletions

View file

@ -87,7 +87,7 @@ void BookmarkInfoWidget::showBookmark(const KBookmark &bk) {
}
m_comment_le->setReadOnly((bk.isSeparator()|| !bk.hasParent()) ? true : false );
QString commentText = EditCommand::getNodeText(bk, QStringList() << "desc");
QString commentText = bk.description();
if (m_comment_le->text() != commentText) {
const int cursorPosition = m_comment_le->cursorPosition();
m_comment_le->setText(commentText);

View file

@ -94,12 +94,8 @@ QVariant KBookmarkModel::data(const QModelIndex &index, int role) const
return QVariant( bk.fullText() );
case 1:
return QVariant( bk.url().pathOrUrl() );
case 2: {
QDomNode subnode = bk.internalElement().namedItem("desc");
return (subnode.firstChild().isNull())
? QString()
: subnode.firstChild().toText().data();
}
case 2:
return QVariant( bk.description() );
case 3: { //Status column
QString text1; //FIXME favicon state
QString text2; //FIXME link state

View file

@ -267,8 +267,8 @@ void EditCommand::redo()
}
else if(mCol==2)
{
mOldValue = getNodeText(bk, QStringList()<<"desc");
setNodeText(bk, QStringList()<<"desc", mNewValue);
mOldValue = bk.description();
bk.setDescription(mNewValue);
}
CurrentMgr::self()->model()->emitDataChanged(bk);
}
@ -295,7 +295,7 @@ void EditCommand::undo()
}
else if(mCol==2)
{
setNodeText(bk, QStringList()<<"desc", mOldValue);
bk.setDescription(mOldValue);
}
CurrentMgr::self()->model()->emitDataChanged(bk);
}