コード例 #1
0
ファイル: qdiriterator.cpp プロジェクト: 3163504123/phantomjs
/*!
    \internal
*/
void QDirIteratorPrivate::pushDirectory(const QFileInfo &fileInfo)
{
    QString path = fileInfo.filePath();

#ifdef Q_OS_WIN
    if (fileInfo.isSymLink())
        path = fileInfo.canonicalFilePath();
#endif

    if (iteratorFlags & QDirIterator::FollowSymlinks)
        visitedLinks << fileInfo.canonicalFilePath();

    if (engine) {
        engine->setFileName(path);
        QAbstractFileEngineIterator *it = engine->beginEntryList(filters, nameFilters);
        if (it) {
            it->setPath(path);
            fileEngineIterators << it;
        } else {
            // No iterator; no entry list.
        }
    } else {
#ifndef QT_NO_FILESYSTEMITERATOR
        QFileSystemIterator *it = new QFileSystemIterator(fileInfo.d_ptr->fileEntry,
            filters, nameFilters, iteratorFlags);
        nativeIterators << it;
#endif
    }
}
コード例 #2
0
/*!
    \internal
*/
void QDirIteratorPrivate::pushDirectory(const QFileInfo &fileInfo)
{
    QString path = fileInfo.filePath();

#ifdef Q_OS_WIN
    if (fileInfo.isSymLink())
        path = fileInfo.canonicalFilePath();
#endif

    if (iteratorFlags & QDirIterator::FollowSymlinks)
        visitedLinks << fileInfo.canonicalFilePath();

    if (engine) {
        engine->setFileName(path);
        QAbstractFileEngineIterator *it = engine->beginEntryList(filters, nameFilters);
        if (it) {
            it->setPath(path);
            fileEngineIterators << it;
        } else {
            // No iterator; no entry list.
        }
    }
}
コード例 #3
0
ファイル: qdiriterator.cpp プロジェクト: Fale/qtmoko
/*!
    \internal
*/
void QDirIteratorPrivate::pushSubDirectory(const QString &path, const QStringList &nameFilters,
                                           QDir::Filters filters)
{
    if (iteratorFlags & QDirIterator::FollowSymlinks) {
        if (nextFileInfo.filePath() != path)
            nextFileInfo.setFile(path);
        if (nextFileInfo.isSymLink()) {
            visitedLinks << nextFileInfo.canonicalFilePath();
        } else {
            visitedLinks << nextFileInfo.absoluteFilePath();
        }
    }
    
    if (engine || (engine = QAbstractFileEngine::create(this->path))) {
        engine->setFileName(path);
        QAbstractFileEngineIterator *it = engine->beginEntryList(filters, nameFilters);
        if (it) {
            it->setPath(path);
            fileEngineIterators << it;
        } else {
            // No iterator; no entry list.
        }
    }
}