SVN commit 707063 by teske: Add two convenience function showInToolbar and setShowInToolbar. Which can be used to set wheter the given bookmark is shown in a filtered toolbar. M +17 -0 kbookmark.cc M +14 -0 kbookmark.h --- trunk/KDE/kdelibs/kio/bookmarks/kbookmark.cc #707062:707063 @@ -343,6 +343,23 @@ element.setAttribute("icon", icon); } +bool KBookmark::showInToolbar() const +{ + if(element.hasAttribute("showintoolbar")) + { + bool show = element.attribute("showintoolbar") == "yes"; + const_cast(&element)->removeAttribute("showintoolbar"); + const_cast(this)->setShowInToolbar(show); + } + return metaDataItem("showintoolbar") == "yes"; +} + + +void KBookmark::setShowInToolbar(bool show) +{ + setMetaDataItem("showintoolbar", show ? "yes" : "no"); +} + KBookmarkGroup KBookmark::parentGroup() const { return KBookmarkGroup( element.parentNode().toElement() ); --- trunk/KDE/kdelibs/kio/bookmarks/kbookmark.h #707062:707063 @@ -145,7 +145,21 @@ */ void setIcon(const QString &icon); + /** + * @return if the bookmark should be shown in the toolbar + * (used by the filtered toolbar) + * + */ + bool showInToolbar() const; + + /** + * Set wheter this bookmark is show in a filterd toolbar + */ + void setShowInToolbar(bool show); + + + /** * @return the group containing this bookmark */ KBookmarkGroup parentGroup() const;