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

int ImgDirSink::open ( const QString &  path  )  [virtual]

Opens this comic book sink with specifiled path.

Parameters:
path comic book location
Returns:
value grater than 0 for error; 0 on success

Reimplemented in QComicBook::ImgArchiveSink.

Definition at line 116 of file imgdirsink.cpp.

References dirpath, numOfImages(), progress(), recurseDir(), sinkError(), and sinkReady().

{
        int status;
        emit progress(0, 1);
        QFileInfo info(path);
        if (!info.exists())
                status = SINKERR_NOTFOUND;
        else
        {
                if (info.isDir())
                {
                        if (info.isReadable() && info.isExecutable())
                        {
                                dirpath = path;
                                recurseDir(path);
                                status = (numOfImages() > 0) ? 0 : SINKERR_EMPTY;
                        }
                        else
                                status = SINKERR_ACCESS;
                }
                else status = SINKERR_NOTDIR;
        }
        setComicBookName(path);
        if (status == 0)
        {
                emit progress(1, 1);
                emit sinkReady(path);
        }
        else
                emit sinkError(status);
        return status;
}


Generated by  Doxygen 1.6.0   Back to index