本文整理汇总了C++中KBookmark::hasParent方法的典型用法代码示例。如果您正苦于以下问题:C++ KBookmark::hasParent方法的具体用法?C++ KBookmark::hasParent怎么用?C++ KBookmark::hasParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KBookmark
的用法示例。
在下文中一共展示了KBookmark::hasParent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nextOne
void BookmarkIterator::nextOne()
{
// kDebug() << "BookmarkIterator::nextOne";
// Look for an interesting bookmark
while (!m_bookmarkList.isEmpty()) {
KBookmark bk = m_bookmarkList.takeFirst();
if (bk.hasParent() && isApplicable(bk)) {
m_bk = bk;
doAction();
// Async action started, we'll have to come back later
return;
}
}
if (m_bookmarkList.isEmpty()) {
holder()->removeIterator(this); // deletes "this"
return;
}
}
示例2: showBookmark
// SHUFFLE all these functions around, the order is just plain stupid
void BookmarkInfoWidget::showBookmark(const KBookmark &bk)
{
// Fast exit if already shown, otherwise editing a title leads to a command after each keypress
if (m_bk == bk)
return;
commitChanges();
m_bk = bk;
if (m_bk.isNull()) {
// all read only and blank
m_title_le->setReadOnly(true);
m_title_le->setText(QString());
m_url_le->setReadOnly(true);
m_url_le->setText(QString());
m_comment_le->setReadOnly(true);
m_comment_le->setText(QString());
m_visitdate_le->setReadOnly(true);
m_visitdate_le->setText(QString());
m_credate_le->setReadOnly(true);
m_credate_le->setText(QString());
m_visitcount_le->setReadOnly(true);
m_visitcount_le->setText(QString());
return;
}
// read/write fields
m_title_le->setReadOnly( (bk.isSeparator()|| !bk.hasParent() )? true : false);
if (bk.fullText() != m_title_le->text())
m_title_le->setText(bk.fullText());
m_url_le->setReadOnly(bk.isGroup() || bk.isSeparator());
if (bk.isGroup()) {
m_url_le->setText(QString());
}
else {
// Update the text if and only if the text represents a different URL to that
// of the current bookmark - the old method, "m_url_le->text() != bk.url().pathOrUrl()",
// created difficulties due to the ambiguity of converting URLs to text. (#172647)
if (QUrl::fromUserInput(m_url_le->text()) != bk.url()) {
const int cursorPosition = m_url_le->cursorPosition();
m_url_le->setText(bk.url().url(QUrl::PreferLocalFile));
m_url_le->setCursorPosition(cursorPosition);
}
}
m_comment_le->setReadOnly((bk.isSeparator()|| !bk.hasParent()) ? true : false );
QString commentText = bk.description();
if (m_comment_le->text() != commentText) {
const int cursorPosition = m_comment_le->cursorPosition();
m_comment_le->setText(commentText);
m_comment_le->setCursorPosition(cursorPosition);
}
// readonly fields
updateStatus();
}