当前位置: 首页>>代码示例>>C++>>正文


C++ KBookmark::url方法代码示例

本文整理汇总了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);
    }
}
开发者ID:blue-shell,项目名称:folderview,代码行数:34,代码来源:bookmark_module.cpp

示例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() );
    }
}
开发者ID:,项目名称:,代码行数:27,代码来源:

示例3: fromUserInput

static inline QUrl urlForGroup(const KBookmark &group)
{
    if ( group.url().isValid() )
        return group.url();
    else
        return QUrl::fromUserInput( group.fullText() );
}
开发者ID:KDE,项目名称:okular,代码行数:7,代码来源:bookmarkmanager.cpp

示例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;
}
开发者ID:JPriya,项目名称:Okular,代码行数:7,代码来源:bookmarkmanager.cpp

示例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;
}
开发者ID:KDE,项目名称:okular,代码行数:7,代码来源:bookmarkmanager.cpp

示例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());
    }
}
开发者ID:kitech,项目名称:konsole,代码行数:14,代码来源:BookmarkHandler.cpp

示例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 );
}
开发者ID:,项目名称:,代码行数:26,代码来源:

示例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>");
}
开发者ID:KDE,项目名称:kio-extras,代码行数:7,代码来源:kio_bookmarks_html.cpp

示例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());
}
开发者ID:serghei,项目名称:kde3-apps-dolphin,代码行数:8,代码来源:urlnavigator.cpp

示例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());
 }
开发者ID:JPriya,项目名称:Okular,代码行数:8,代码来源:bookmarkmanager.cpp

示例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));
 }
开发者ID:KDE,项目名称:okular,代码行数:8,代码来源:bookmarkmanager.cpp

示例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());
}
开发者ID:serghei,项目名称:kde3-apps-dolphin,代码行数:10,代码来源:bookmarkssidebarpage.cpp

示例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;
}
开发者ID:walac,项目名称:kde-workspace,代码行数:54,代码来源:kdebrowser.cpp

示例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;
        }
    }
}
开发者ID:KDE,项目名称:kde-baseapps,代码行数:20,代码来源:exporters.cpp

示例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));
    }
}
开发者ID:KDE,项目名称:digikam,代码行数:13,代码来源:gpsbookmarkowner.cpp


注:本文中的KBookmark::url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。