本文整理汇总了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;
}
示例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);
}
示例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;
}
}