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


C++ KUrl::isParentOf方法代码示例

本文整理汇总了C++中KUrl::isParentOf方法的典型用法代码示例。如果您正苦于以下问题:C++ KUrl::isParentOf方法的具体用法?C++ KUrl::isParentOf怎么用?C++ KUrl::isParentOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KUrl的用法示例。


在下文中一共展示了KUrl::isParentOf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: foreach

static KUrl::List thread_getProjectFiles(const KUrl dir, bool recursive, const QStringList include,
                                         const QStringList exlude, volatile bool &abort)
{
    ///@todo This is not thread-safe!
    KDevelop::IProject *project = KDevelop::ICore::self()->projectController()->findProjectForUrl( dir );
    KUrl::List res;
    if(!project)
        return res;

    const QSet<IndexedString> fileSet = project->fileSet();
    foreach( const IndexedString &item, fileSet )
    {
        if(abort)
            break;
        KUrl url = item.toUrl();
        if( !url.equals(dir) )
        {
            if( recursive && !dir.isParentOf(url) )
                continue;
            if( !recursive && !url.upUrl().equals(dir, KUrl::CompareWithoutTrailingSlash))
                continue;
        }
        if( QDir::match(include, url.fileName()) && !QDir::match(exlude, url.toLocalFile()) )
            res << url;
    }

    return res;
}
开发者ID:caidongyun,项目名称:kdevplatform,代码行数:28,代码来源:grepfindthread.cpp

示例2: slotSelection

void MainDialog::slotSelection()
{
    KUrl::List urlList;

    if (m_selectedFilesButton->isChecked())
    {
        m_ImagesFilesListBox->listView()->clear();
        urlList = m_sharedData->iface()->currentSelection().images();
    }
    else if (m_allFilesButton->isChecked())
    {
        KUrl currentPath = m_sharedData->iface()->currentAlbum().path();
        QList<KIPI::ImageCollection> albumList;
        albumList        = m_sharedData->iface()->allAlbums();

        m_ImagesFilesListBox->listView()->clear();
        urlList = m_sharedData->iface()->currentAlbum().images();

        QList<KIPI::ImageCollection>::iterator it;
        for (it = albumList.begin(); it != albumList.end(); ++it)
        {
            if (currentPath.isParentOf((*it).path()) && !((*it).path() == currentPath))
            {
                urlList += (*it).images();
            }
        }
    }

    bool customize = m_customButton->isChecked();

    if (!urlList.isEmpty() && !customize)
    {
        addItems(urlList);
    }

    m_ImagesFilesListBox->enableControlButtons(customize);
    m_ImagesFilesListBox->enableDragAndDrop(customize);
}
开发者ID:UIKit0,项目名称:digikam-2012-kipi-plugins,代码行数:38,代码来源:maindialog.cpp

示例3: isDirInCollection

    bool AmarokCollectionScript::isDirInCollection( const QString& path ) const
    {
        DEBUG_BLOCK

        KUrl url = KUrl( path );
        KUrl parentUrl;
        foreach( const QString &dir, collectionLocation() )
        {
            debug() << "Collection Location: " << dir;
            debug() << "path: " << path;
            debug() << "scan Recursively: " << AmarokConfig::scanRecursively();
            parentUrl.setPath( dir );
            if ( !AmarokConfig::scanRecursively() )
            {
                if ( ( dir == path ) || ( QString( dir + '/' ) == path ) )
                    return true;
            }
            else //scan recursively
            {
                if ( parentUrl.isParentOf( path ) )
                    return true;
            }
        }
开发者ID:ErrAza,项目名称:amarok,代码行数:23,代码来源:AmarokCollectionScript.cpp


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