本文整理汇总了C++中KBookmark::description方法的典型用法代码示例。如果您正苦于以下问题:C++ KBookmark::description方法的具体用法?C++ KBookmark::description怎么用?C++ KBookmark::description使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KBookmark
的用法示例。
在下文中一共展示了KBookmark::description方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openBookmark
void BookmarkHandler::openBookmark(const KBookmark& bm, Qt::MouseButtons, Qt::KeyboardModifiers)
{
// qDebug()<<bm.description()<<bm.fullText()<<bm.text()<<bm.address() << bm.url();
if (bm.description().trimmed().length() > 0) {
KUrl aurl = bm.url();
aurl.setPassword("aaaabcd");
aurl.setPassword(bm.description().trimmed());
qDebug()<<aurl << aurl.password();
emit openUrl(aurl);
} else {
emit openUrl(bm.url());
}
}
示例2: KActionMenu
KBookmarkActionMenu::KBookmarkActionMenu(const KBookmark &bm, QObject *parent)
: KActionMenu(QIcon::fromTheme(bm.icon()), bm.text().replace('&', QLatin1String("&&")), parent),
KBookmarkActionInterface(bm)
{
setToolTip(bm.description());
setIconText(text());
}
示例3: echoBookmark
void BookmarksProtocol::echoBookmark( const KBookmark &bm)
{
QString descriptionAsTitle = bm.description().toHtmlEscaped();
if (!descriptionAsTitle.isEmpty())
descriptionAsTitle.prepend(QLatin1String("\" title=\""));
echo ("<li class=\"link\"><a href=\"" + bm.url().url() + descriptionAsTitle + "\"><img src=\"/icon/" + bm.icon() + "\"/>" + bm.text().toHtmlEscaped() + "</a></li>");
}
示例4: redo
void EditCommand::redo()
{
KBookmark bk = m_model->bookmarkManager()->findByAddress(mAddress);
if(mCol==-2)
{
if (mOldValue.isEmpty())
mOldValue = bk.internalElement().attribute("toolbar");
bk.internalElement().setAttribute("toolbar", mNewValue);
}
else if(mCol==-1)
{
if (mOldValue.isEmpty())
mOldValue = bk.icon();
bk.setIcon(mNewValue);
}
else if(mCol==0)
{
if (mOldValue.isEmpty()) // only the first time, not when compressing changes in modify()
mOldValue = bk.fullText();
kDebug() << "mOldValue=" << mOldValue;
bk.setFullText(mNewValue);
}
else if(mCol==1)
{
if (mOldValue.isEmpty())
mOldValue = bk.url().prettyUrl();
const KUrl newUrl(mNewValue);
if (!(newUrl.isEmpty() && !mNewValue.isEmpty())) // prevent emptied line if the currently entered url is invalid
bk.setUrl(newUrl);
}
else if(mCol==2)
{
if (mOldValue.isEmpty())
mOldValue = bk.description();
bk.setDescription(mNewValue);
}
m_model->emitDataChanged(bk);
}
示例5: 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();
}