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

int ImgArchiveSink::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 from QComicBook::ImgDirSink.

Definition at line 172 of file imgarchivesink.cpp.

References archivename, archivepath, close(), QComicBook::ImgDirSink::sinkError(), and tmppath.

{
      QFileInfo info(path);
      archivepath = path;
      archivename = info.fileName();
      if (!info.exists())
      {
            emit sinkError(SINKERR_NOTFOUND);
            return SINKERR_NOTFOUND;
      }
      if (info.isFile())
      {
            if (info.isReadable())
            {
                  tmppath = makeTempDir();
                  int status = extract(path, tmppath);
                  if (status != 0)
                  {
                        emit sinkError(status);
                        close();
                  }
                  return status;
            }
            else
            {
                  emit sinkError(SINKERR_ACCESS);
                  return SINKERR_ACCESS;
            }
      }
      emit sinkError(SINKERR_NOTFILE);
      return SINKERR_NOTFILE;
}


Generated by  Doxygen 1.6.0   Back to index