本文整理汇总了C++中KBookmark::url方法的典型用法代码示例。如果您正苦于以下问题:C++ KBookmark::url方法的具体用法?C++ KBookmark::url怎么用?C++ KBookmark::url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KBookmark
的用法示例。
在下文中一共展示了KBookmark::url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotOpenTab
void KonqSidebarBookmarkModule::slotOpenTab()
{
KonqSidebarBookmarkItem *bi = dynamic_cast<KonqSidebarBookmarkItem*>( tree()->selectedItem() );
KBookmark bookmark;
if (bi)
{
bookmark = bi->bookmark();
}
else if(tree()->selectedItem() == m_topLevelItem)
bookmark = s_bookmarkManager->root();
else
return;
KParts::OpenUrlArguments args;
args.setActionRequestedByUser(true);
KParts::BrowserArguments browserArguments;
browserArguments.setNewTab(true);
if (bookmark.isGroup()) {
KBookmarkGroup group = bookmark.toGroup();
bookmark = group.first();
while (!bookmark.isNull()) {
if (!bookmark.isGroup() && !bookmark.isSeparator()) {
emit tree()->createNewWindow(bookmark.url(),
args,
browserArguments);
}
bookmark = group.next(bookmark);
}
} else {
emit tree()->createNewWindow(bookmark.url(),
args,
browserArguments);
}
}
示例2: slotOpenTab
void KonqSidebarBookmarkModule::slotOpenTab()
{
KonqSidebarBookmarkItem *bi = dynamic_cast<KonqSidebarBookmarkItem*>( tree()->selectedItem() );
KBookmark bookmark;
if (bi)
{
bookmark = bi->bookmark();
}
else if(tree()->selectedItem() == m_topLevelItem)
bookmark = KonqBookmarkManager::self()->root();
else
return;
DCOPRef ref(kapp->dcopClient()->appId(), tree()->topLevelWidget()->name());
if (bookmark.isGroup()) {
KBookmarkGroup group = bookmark.toGroup();
bookmark = group.first();
while (!bookmark.isNull()) {
if (!bookmark.isGroup() && !bookmark.isSeparator())
ref.call( "newTab(QString)", bookmark.url().url() );
bookmark = group.next(bookmark);
}
} else {
ref.call( "newTab(QString)", bookmark.url().url() );
}
}
示例3: fromUserInput
static inline QUrl urlForGroup(const KBookmark &group)
{
if ( group.url().isValid() )
return group.url();
else
return QUrl::fromUserInput( group.fullText() );
}
示例4: bookmarkLessThan
static inline bool bookmarkLessThan( const KBookmark &b1, const KBookmark &b2 )
{
DocumentViewport vp1( b1.url().htmlRef() );
DocumentViewport vp2( b2.url().htmlRef() );
return vp1 < vp2;
}
示例5: bookmarkLessThan
static inline bool bookmarkLessThan( const KBookmark &b1, const KBookmark &b2 )
{
DocumentViewport vp1( b1.url().fragment(QUrl::FullyDecoded) );
DocumentViewport vp2( b2.url().fragment(QUrl::FullyDecoded) );
return vp1 < vp2;
}
示例6: 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());
}
}
示例7: slotProperties
void KonqSidebarBookmarkModule::slotProperties(KonqSidebarBookmarkItem *bi)
{
if (!bi) {
bi = dynamic_cast<KonqSidebarBookmarkItem*>( tree()->selectedItem() );
if (!bi)
return;
}
KBookmark bookmark = bi->bookmark();
QString folder = bookmark.isGroup() ? QString::null : bookmark.url().pathOrURL();
BookmarkEditDialog dlg( bookmark.fullText(), folder, 0, 0,
i18n("Bookmark Properties") );
if ( dlg.exec() != KDialogBase::Accepted )
return;
makeTextNodeMod(bookmark, "title", dlg.finalTitle());
if ( !dlg.finalUrl().isNull() )
{
KURL u = KURL::fromPathOrURL(dlg.finalUrl());
bookmark.internalElement().setAttribute("href", u.url(0, 106));
}
KBookmarkGroup parentBookmark = bookmark.parentGroup();
KonqBookmarkManager::self()->emitChanged( parentBookmark );
}
示例8: 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>");
}
示例9: slotBookmarkActivated
void URLNavigator::slotBookmarkActivated(int index)
{
m_dolphinView->statusBar()->clear();
m_dolphinView->requestActivation();
KBookmark bookmark = DolphinSettings::instance().bookmark(index);
m_dolphinView->setURL(bookmark.url());
}
示例10: OkularBookmarkAction
OkularBookmarkAction( const Okular::DocumentViewport& vp, const KBookmark& bk, KBookmarkOwner* owner, QObject *parent )
: KBookmarkAction( bk, owner, parent )
{
if ( vp.isValid() )
setText( QString::number( vp.pageNumber + 1 ) + " - " + text() );
setProperty("pageNumber", vp.pageNumber + 1);
setProperty("htmlRef", bk.url().htmlRef());
}
示例11: OkularBookmarkAction
OkularBookmarkAction( const Okular::DocumentViewport& vp, const KBookmark& bk, KBookmarkOwner* owner, QObject *parent )
: KBookmarkAction( bk, owner, parent )
{
if ( vp.isValid() )
setText( QString::number( vp.pageNumber + 1 ) + QStringLiteral(" - ") + text() );
setProperty("pageNumber", vp.pageNumber + 1);
setProperty("htmlRef", bk.url().fragment(QUrl::FullyDecoded));
}
示例12: slotMouseButtonClicked
void BookmarksSidebarPage::slotMouseButtonClicked(int button, QListBoxItem* item)
{
if ((button != Qt::LeftButton) || (item == 0)) {
return;
}
const int index = m_bookmarksList->index(item);
KBookmark bookmark = DolphinSettings::instance().bookmark(index);
Dolphin::mainWin().activeView()->setURL(bookmark.url());
}
示例13: bookmarkMatch
QList< BookmarkMatch > KDEBrowser::match(const QString& term, bool addEverything)
{
KBookmarkGroup bookmarkGroup = m_bookmarkManager->root();
QList< BookmarkMatch > matches;
QStack<KBookmarkGroup> groups;
KBookmark bookmark = bookmarkGroup.first();
while (!bookmark.isNull()) {
// if (!context.isValid()) {
// return;
// } TODO: restore?
if (bookmark.isSeparator()) {
bookmark = bookmarkGroup.next(bookmark);
continue;
}
if (bookmark.isGroup()) { // descend
//kDebug (kdbg_code) << "descending into" << bookmark.text();
groups.push(bookmarkGroup);
bookmarkGroup = bookmark.toGroup();
bookmark = bookmarkGroup.first();
while (bookmark.isNull() && !groups.isEmpty()) {
// if (!context.isValid()) {
// return;
// } TODO: restore?
bookmark = bookmarkGroup;
bookmarkGroup = groups.pop();
bookmark = bookmarkGroup.next(bookmark);
}
continue;
}
BookmarkMatch bookmarkMatch(m_favicon, term, bookmark.text(), bookmark.url().url() );
bookmarkMatch.addTo(matches, addEverything);
bookmark = bookmarkGroup.next(bookmark);
while (bookmark.isNull() && !groups.isEmpty()) {
// if (!context.isValid()) {
// return;
// } // TODO: restore?
bookmark = bookmarkGroup;
bookmarkGroup = groups.pop();
//kDebug(kdbg_code) << "ascending from" << bookmark.text() << "to" << bookmarkGroup.text();
bookmark = bookmarkGroup.next(bookmark);
}
}
return matches;
}
示例14: visit
void HTMLExporter::visit(const KBookmark &bk) {
// //qDebug() << "visit(" << bk.text() << ")";
if(bk.isSeparator())
{
m_out << bk.fullText() << "<br>"<<endl;
}
else
{
if(m_showAddress)
{
m_out << bk.fullText() <<"<br>"<< endl;
m_out << "<i><div style =\"margin-left: 1em\">" << bk.url().url().toUtf8() << "</div></i>";
}
else
{
m_out << "<a href=\"" << bk.url().url().toUtf8() << "\">";
m_out << bk.fullText() << "</a><br>" << endl;
}
}
}
示例15: openBookmark
void GPSBookmarkOwner::openBookmark(const KBookmark& bookmark, Qt::MouseButtons, Qt::KeyboardModifiers)
{
const QString url = bookmark.url().url().toLower();
bool okay = false;
const GeoIface::GeoCoordinates coordinate = GeoIface::GeoCoordinates::fromGeoUrl(url, &okay);
if (okay)
{
GPSDataContainer position;
position.setCoordinates(coordinate);
emit(positionSelected(position));
}
}