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


C++ QFileInfoList::end方法代码示例

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


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

示例1: initMidiInstruments

void initMidiInstruments()
      {
      genericMidiInstrument = new MidiInstrument(QWidget::tr("generic midi"));
      midiInstruments.push_back(genericMidiInstrument);
      if (MusEGlobal::debugMsg)
        printf("load user instrument definitions from <%s>\n", MusEGlobal::museUserInstruments.toLatin1().constData());
      QDir usrInstrumentsDir(MusEGlobal::museUserInstruments, QString("*.idf"));
      if (usrInstrumentsDir.exists()) {
            QFileInfoList list = usrInstrumentsDir.entryInfoList();
            QFileInfoList::iterator it=list.begin(); // ddskrjo
            while(it != list.end()) { // ddskrjo
                  loadIDF(&*it);
                  ++it;
                  }
            }

      if (MusEGlobal::debugMsg)
        printf("load instrument definitions from <%s>\n", MusEGlobal::museInstruments.toLatin1().constData());
      QDir instrumentsDir(MusEGlobal::museInstruments, QString("*.idf"));
      if (instrumentsDir.exists()) {
            QFileInfoList list = instrumentsDir.entryInfoList();
            QFileInfoList::iterator it=list.begin(); // ddskrjo
            while(it!=list.end()) {
                  loadIDF(&*it);
                  ++it;
                  }
            }
      else
        printf("Instrument directory not found: %s\n", MusEGlobal::museInstruments.toLatin1().constData());

      }
开发者ID:UIKit0,项目名称:muse,代码行数:31,代码来源:minstrument.cpp

示例2: loadDir

void ThumbGenerator::loadDir(QImage& image, const QFileInfo& fi)
{
    QDir dir(fi.absoluteFilePath());
    dir.setFilter(QDir::Files);

    QFileInfoList list = dir.entryInfoList();
    QFileInfoList::const_iterator it = list.begin();
    const QFileInfo *f;

    bool found = false;
    while (it != list.end())
    {
        f = &(*it);
        QImageReader testread(f->absoluteFilePath());
        testread.setAutoDetectImageFormat(false);
        if (testread.canRead())
        {
            found = true;
            break;
        }
        ++it;
    }

    if (found)
    {
        loadFile(image, *f);
        return;
    }
    else
    {
        // if we didn't find the image yet
        // go into subdirs and keep looking
        dir.setFilter(QDir::Dirs);
        QFileInfoList dirlist = dir.entryInfoList();
        if (dirlist.isEmpty())
            return;

        QFileInfoList::const_iterator it = dirlist.begin();
        const QFileInfo *f;

        while (it != dirlist.end() && image.isNull() )
        {

            f = &(*it);
            ++it;

            if (f->fileName() == "." || f->fileName() == "..")
                continue;

            loadDir(image, *f);
        }
    }
}
开发者ID:Openivo,项目名称:mythtv,代码行数:53,代码来源:thumbgenerator.cpp

示例3: getAllIncludes

void getAllIncludes(QString path, QFileInfoList h_files, QFileInfoList cpp_files, QStringList& includes)
{
	for(QFileInfoList::iterator it = h_files.begin(); it != h_files.end(); it++)
	{		
		QFile file(it->absoluteFilePath());
		
		if(file.open(QFile::ReadOnly))
		{
			QTextStream textStream(&file);
			
			while(!textStream.atEnd())
			{
				QString line = textStream.readLine();
				
				if( line.indexOf("#include ") != -1 && line.indexOf("Q") != -1 )
				{
					addToStringList(includes, line);
				}
			}
			
			file.close();
		}
	}

	for(QFileInfoList::iterator it = cpp_files.begin(); it != cpp_files.end(); it++)
	{
		QFile file(it->absoluteFilePath());
		if(file.open(QFile::ReadOnly))
		{
			QTextStream textStream(&file);
			
			while(!textStream.atEnd())
			{
				QString line = textStream.readLine();

				if( line.indexOf("//") == -1 && 
					line.indexOf("#include ") != -1 && 
					line.indexOf("Q") != -1
				   )
				{
					addToStringList(includes, line);
				}
			}
			
			file.close();
		}
	}
}
开发者ID:yduv,项目名称:qttools,代码行数:48,代码来源:get_all_includes.cpp

示例4: read_dir

//*******************************************************************
// read_dir                                                  PRIVATE
//-------------------------------------------------------------------
// Rekursywne odczytywanie calej zawartosci wskazanego katalogu.
// Odczytana zawrtosc katalogu jest zapamietywania w hash-tablicy.
//*******************************************************************
void QBtCompareDirsDialog::read_dir( const QString& in_parent,
                                     const QString& in_dir,
                                     DirMap& out_data ) const
{
   static const int sflag = QDir::AllDirs
                          | QDir::Files
                          | QDir::NoDotAndDotDot
                          | QDir::Readable
                          | QDir::Writable
                          | QDir::Hidden;
                   
   const QDir dir( in_dir, "*", QDir::Unsorted, QFlags<QDir::Filter>( sflag ) );
   const QFileInfoList items = dir.entryInfoList();

   FileMap files_map = FileMap();
   QFileInfoList::const_iterator it = items.begin();
   const QFileInfoList::const_iterator end = items.end();
   while( continue_ && ( it != end ) ) {
      if( it->isDir() ) read_dir( in_parent, it->absoluteFilePath(), out_data );
      else              files_map.insert( it->fileName(), *it );
      ++it;
   }
   QString path = in_dir;
   out_data.insert( path.remove( in_parent ), files_map );
}
开发者ID:sclown,项目名称:bsc,代码行数:31,代码来源:QBtCompareDirsDialog.cpp

示例5: loadFromImages

void LoadVideoThread::loadFromImages()
{
    qDebug() << "Start loading frames...";

    QDir dirImages(filePath);
    QFileInfoList listImages = dirImages.entryInfoList(QStringList() << "*.tif" << "*.tiff" << "*.jpg" << "*.png");

    if (0 == listImages.count())
    {
        emit completeLoading(false);
    }
    else
    {
        QFileInfoList::const_iterator it = listImages.begin();
        while(it != listImages.end())
        {
            cv::Mat frame = cv::imread(it->filePath().toStdString());
            cv::Mat rgbFrame;
            cv::cvtColor(frame, rgbFrame, CV_BGR2RGB);

            gtv->appendFrame(rgbFrame);
            it++;
        }
        emit completeLoading(true);
    }
    exit(0);
}
开发者ID:gccheng,项目名称:GTgenerator,代码行数:27,代码来源:loadvideothread.cpp

示例6: find_file

void SkinWidget::find_file(QString path)
{
    QDir picdir(path);
    QStringList filters;
    filters << "*.bmp" << "*.jpg" << "*.png" << "*.gif";
    picdir.setNameFilters(filters);

    if (!picdir.exists()) {
        return;
    }

    picdir.setFilter(QDir::Dirs | QDir::Files);
    picdir.setSorting(QDir::DirsFirst);
    QFileInfoList list = picdir.entryInfoList();
    for_each(list.begin(), list.end(),
    [&](QFileInfoList::value_type fileInfo) {
        if (pic_list.count(fileInfo.fileName())
            || (fileInfo.fileName() == ".")
            || (fileInfo.fileName() == "..")) {
            return;
        } else {
            pic_list.append(fileInfo.fileName());
            init_skin(fileInfo.fileName());
        }
    });
}
开发者ID:karllen,项目名称:kuplayer,代码行数:26,代码来源:skin_widget.cpp

示例7: LoadFonts

/**
 *  \brief Loads the fonts in font files within the given directory structure
 *
 *   Recursively scans all directories under directory looking for TrueType
 *   (.ttf) and OpenType (.otf) font files or TrueType font collections (.ttc)
 *   and loads the fonts to make them available to the application.
 *
 *  \param directory      The directory to scan
 *  \param registeredFor  The user of the font. Used with releaseFonts() to
 *                        unload the font if no longer in use (by any users)
 *  \param maxDirs        The maximum number of subdirectories to scan
 */
void MythFontManager::LoadFonts(const QString &directory,
                                const QString &registeredFor, int *maxDirs)
{
    if (directory.isEmpty() || directory == "/" || registeredFor.isEmpty())
        return;
    (*maxDirs)--;
    if (*maxDirs < 1)
    {
        LOG(VB_GENERAL, LOG_WARNING, LOC +
            "Reached the maximum directory depth "
            "for a font directory structure. Terminating font scan.");
        return;
    }

    // Load the font files from this directory
    LoadFontsFromDirectory(directory, registeredFor);
    // Recurse through subdirectories
    QDir dir(directory);
    QFileInfoList files = dir.entryInfoList();
    QFileInfo info;
    for (QFileInfoList::const_iterator it = files.begin();
         ((it != files.end()) && (*maxDirs > 0)); ++it)
    {
        info = *it;
        // Skip '.' and '..' and other files starting with "." by checking
        // baseName()
        if (!info.baseName().isEmpty() && info.isDir())
            LoadFonts(info.absoluteFilePath(), registeredFor, maxDirs);
    }
}
开发者ID:tomhughes,项目名称:mythtv,代码行数:42,代码来源:mythfontmanager.cpp

示例8: scanDirectory

void ImportCoverArtDialog::scanDirectory()
{
    QDir d(m_sourceDir);

    if (!d.exists())
        return;

    QString nameFilter = gCoreContext->GetSetting("AlbumArtFilter",
                                              "*.png;*.jpg;*.jpeg;*.gif;*.bmp");

    QFileInfoList list = d.entryInfoList(nameFilter);
    if (list.isEmpty())
        return;

    QFileInfoList::const_iterator it = list.begin();
    const QFileInfo *fi;

    while (it != list.end())
    {
        fi = &(*it);
        ++it;
        if (fi->fileName() == "." || fi->fileName() == "..")
            continue;
        QString filename = fi->absoluteFilePath();
        if (!fi->isDir())
        {
            m_filelist.append(filename);
        }
    }

    m_currentFile = 0;
    updateTypeSelector();
    updateStatus();
}
开发者ID:txase,项目名称:mythtv,代码行数:34,代码来源:importmusic.cpp

示例9: MoveDirectory

bool GalleryUtil::MoveDirectory(const QFileInfo src, QFileInfo &dst)
{
    QDir srcDir(src.absoluteFilePath());

    dst = MakeUniqueDirectory(dst);
    if (!dst.exists())
    {
        srcDir.mkdir(dst.absoluteFilePath());
        dst.refresh();
    }

    if (!dst.exists() || !dst.isDir())
        return false;

    bool ok = true;
    QDir dstDir(dst.absoluteFilePath());
    srcDir.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
    QFileInfoList list = srcDir.entryInfoList();
    QFileInfoList::const_iterator it = list.begin();
    for (; it != list.end(); ++it)
    {
        const QString fn = it->fileName();
        QFileInfo dfi(dstDir, fn);
        ok &= Move(*it, dfi);
    }

    return ok && FileDelete(src);
}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:28,代码来源:galleryutil.cpp

示例10: themeDirs

QList<ThemeInfo> MythUIHelper::GetThemes(ThemeType type)
{
    QFileInfoList fileList;
    QList<ThemeInfo> themeList;
    QDir themeDirs(GetThemesParentDir());
    themeDirs.setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
    themeDirs.setSorting(QDir::Name | QDir::IgnoreCase);

    fileList.append(themeDirs.entryInfoList());

    themeDirs.setPath(d->m_userThemeDir);

    fileList.append(themeDirs.entryInfoList());

    for (QFileInfoList::iterator it =  fileList.begin();
         it != fileList.end(); ++it)
    {
        QFileInfo  &theme = *it;

        if (theme.baseName() == "default" ||
            theme.baseName() == "default-wide" ||
            theme.baseName() == "Slave")
            continue;

        ThemeInfo themeInfo(theme.absoluteFilePath());

        if (themeInfo.GetType() & type)
            themeList.append(themeInfo);
    }

    return themeList;
}
开发者ID:chadparry,项目名称:mythtv,代码行数:32,代码来源:mythuihelper.cpp

示例11: directory

void
DialogCleanup::Cleanup(
	)
{
	// Get size before.
	unsigned int startSize = FileUtils::GetFolderSize( m_Path );
	m_UI.output->appendPlainText( "Cleaning '" + m_Path + "' ..." );

	// Go through files.
	QDir directory( m_Path );
	QFileInfoList files = directory.entryInfoList();
	for ( QFileInfoList::iterator i = files.begin(); i != files.end(); i++ ) {
		QFileInfo file = *i;
		if ( !file.isReadable() ) continue;
		if ( file.fileName() == "." || file.fileName() == ".." ) continue;
		if ( std::find( m_Preserved.begin(), m_Preserved.end(), file.fileName() ) == m_Preserved.end() ) {
			m_UI.output->appendPlainText( "Removing: " + file.fileName() );
			if ( file.isDir() ) FileUtils::DeleteFolder( file.absoluteFilePath() );
			if ( file.isFile() ) QFile::remove(file.absoluteFilePath());
		}
	}

	// Get size after.
	unsigned int endSize = FileUtils::GetFolderSize( m_Path );
	m_UI.output->appendPlainText( "Cleaning complete." );
	m_UI.output->appendPlainText( "Cleaned " + QString::number( startSize - endSize ) + " megabytes." );

	// Change UI to reflect completion.
	m_UI.btnDone->setText( "Close" );
}
开发者ID:NullCascade,项目名称:Infinity-Engine-Modlist-Installer,代码行数:30,代码来源:DialogCleanup.cpp

示例12: dir

LADSPAPresetManager::LADSPAPresetManager()
{
    m_iPresetCount = 0;

    LADSPALoader * loader = new LADSPALoader();

    QDir dir(WWidget::getPath(QString("../../ladspa_presets"))); // TODO
    QFileInfoList files = dir.entryInfoList();
    m_Presets.resize(files.count());
    for (QFileInfoList::iterator fileIter = files.begin(); fileIter != files.end(); fileIter++)
    {
        qDebug() << "LADSPA: file " << (*fileIter).filePath();
        if ((*fileIter).isDir())
        {
            continue;
        }

        QFile file((* fileIter).filePath());

        QDomDocument document("Preset");
        file.open(QIODevice::ReadOnly);
        document.setContent(&file);
        file.close();

        LADSPAPreset * preset = new LADSPAPreset(document.documentElement(), loader);
        m_Presets [m_iPresetCount] = preset;
        m_iPresetCount++;
    }
}
开发者ID:Shunty,项目名称:mixxx,代码行数:29,代码来源:ladspapresetmanager.cpp

示例13: findZoneinfoFile

/* Helper function for getSystemTimeZoneID() that compares the
   zoneinfo_file_path (regular) file with files in the zoneinfo_dir_path until
   it finds a match.  The matching file's name is used to determine the time
   zone ID. */
static QString findZoneinfoFile(QString zoneinfo_file_path,
                                QString zoneinfo_dir_path)
{
    QString zone_id("UNDEF");
    QDir zoneinfo_dir(zoneinfo_dir_path);
    QFileInfoList dirlist = zoneinfo_dir.entryInfoList();
    QFileInfo info;
    QString basename;
    QFileInfo zoneinfo_file_info(zoneinfo_file_path);

    for (QFileInfoList::const_iterator it = dirlist.begin();
         it != dirlist.end(); ++it)
    {
        info = *it;
         // Skip '.' and '..' and other files starting with "." and
         // skip localtime (which is often a link to zoneinfo_file_path)
        basename = info.baseName();
        if (basename.isEmpty() || (basename == "localtime")) {
            continue;
        }
        if (info.isDir())
        {
            zone_id = findZoneinfoFile(zoneinfo_file_path,
                                       info.absoluteFilePath());
            if (zone_id != "UNDEF")
                return zone_id;
        }
        else if (compare_zone_files(zoneinfo_file_info, info))
        {
            zone_id = info.absoluteFilePath();
            break;
        }
    }
    return zone_id;
}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:39,代码来源:mythtimezone.cpp

示例14: setDirectory

bool SimpleSearchEngine::setDirectory(const QString &path)
{
    QDir dir(path);
    if(!dir.exists())
    {
        Log().warning("SimpleSearchEngine: set directory failed: directory doesn't"
                "exist '%s'",
                qPrintable(path));
        return false;
    }

    Log().debug("SimpleSearchEngine: set directory '%s'", qPrintable(path));

    QFileInfoList fileInfoList = dir.entryInfoList(
            QDir::Files);

    mFilenames.clear();

    QFileInfoList::const_iterator iter = fileInfoList.begin();
    for(; iter != fileInfoList.end(); ++iter)
        mFilenames.append(iter->absoluteFilePath());

    updateResults();

    return true;
}
开发者ID:xffox,项目名称:piclex,代码行数:26,代码来源:SimpleSearchEngine.cpp

示例15: CopyDirectory

bool GalleryUtil::CopyDirectory(const QFileInfo src, QFileInfo &dst)
{
    QDir srcDir(src.absoluteFilePath());

    dst = MakeUniqueDirectory(dst);
    if (!dst.exists())
    {
        srcDir.mkdir(dst.absoluteFilePath());
        dst.refresh();
    }

    if (!dst.exists() || !dst.isDir())
        return false;

    bool ok = true;
    QDir dstDir(dst.absoluteFilePath());
    QFileInfoList list = srcDir.entryInfoList();
    QFileInfoList::const_iterator it = list.begin();
    for (; it != list.end(); ++it)
    {
        const QString fn = it->fileName();
        if (fn != "." && fn != "..")
        {
            QFileInfo dfi(dstDir, fn);
            ok &= Copy(*it, dfi);
        }
    }

    return ok;
}
开发者ID:freelyfree,项目名称:mythtv,代码行数:30,代码来源:galleryutil.cpp


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