Logo Search packages:      
Sourcecode: qcomicbook version File versions  Download package

void ImgDirSink::recurseDir ( const QString &  s  )  [protected]

Scans directories recursively for image and text files.

Scans directories for jpg, png, gif, xpm image files and .nfo and file_id.diz text files. Images file names are stored in imgfiles; text file names are stored in txtfiles. Other files are store in otherfiles. All directories are stored in dirs.

Parameters:
s starting directory
See also:
imgfiles

txtfiles

otherfiles

dirs

Definition at line 86 of file imgdirsink.cpp.

References imgfiles, otherfiles, timestamps, and txtfiles.

Referenced by open().

{
        QDir dir(s);
        dir.setSorting(QDir::DirsFirst|QDir::Name);
        dir.setMatchAllDirs(true);
        const QStringList files = dir.entryList();
        for (QStringList::const_iterator it = files.begin(); it!=files.end(); ++it)
        {
                if (*it == "." || *it == "..")
                        continue;

                QFileInfo finf(dir.absFilePath(*it, false));
                if (finf.isFile())
                {
                  if (knownImageExtension(*it))
                                imgfiles.append(finf.absFilePath());
                        else if ((*it).endsWith(".nfo", false) || (*it) == "file_id.diz")
                                txtfiles.append(finf.absFilePath());
                        else
                                otherfiles.append(finf.absFilePath());
                  timestamps.insert(finf.absFilePath(), FileStatus(finf.lastModified()));
                }
                else if (finf.isDir() && (finf.absFilePath()!=s))
                {
                        dirs.append(finf.absFilePath());
                        recurseDir(finf.absFilePath());
                }
        }
}


Generated by  Doxygen 1.6.0   Back to index