From 5746fb12c6e7353483cf130b83fb2ab88f0217a2 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Wed, 10 Mar 2010 12:30:07 +0100 Subject: Add `QIODevice* device() const` public method to QZip classes. allows to fetch some extra info from the used device (errorString() for ex.) Reviewed-by: Benjamin Poulain --- src/gui/text/qzip.cpp | 16 ++++++++++++++++ src/gui/text/qzipreader_p.h | 2 ++ src/gui/text/qzipwriter_p.h | 2 ++ 3 files changed, 20 insertions(+) diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp index d30c996..fab6891 100644 --- a/src/gui/text/qzip.cpp +++ b/src/gui/text/qzip.cpp @@ -750,6 +750,14 @@ QZipReader::~QZipReader() } /*! + Returns device used for reading zip archive. +*/ +QIODevice* QZipReader::device() const +{ + return d->device; +} + +/*! Returns true if the user can read the file; otherwise returns false. */ bool QZipReader::isReadable() const @@ -1022,6 +1030,14 @@ QZipWriter::~QZipWriter() } /*! + Returns device used for writing zip archive. +*/ +QIODevice* QZipWriter::device() const +{ + return d->device; +} + +/*! Returns true if the user can write to the archive; otherwise returns false. */ bool QZipWriter::isWritable() const diff --git a/src/gui/text/qzipreader_p.h b/src/gui/text/qzipreader_p.h index 9b73373..d838957 100644 --- a/src/gui/text/qzipreader_p.h +++ b/src/gui/text/qzipreader_p.h @@ -70,6 +70,8 @@ public: explicit QZipReader(QIODevice *device); ~QZipReader(); + QIODevice* device() const; + bool isReadable() const; bool exists() const; diff --git a/src/gui/text/qzipwriter_p.h b/src/gui/text/qzipwriter_p.h index 9322f4a..a50c172 100644 --- a/src/gui/text/qzipwriter_p.h +++ b/src/gui/text/qzipwriter_p.h @@ -69,6 +69,8 @@ public: explicit QZipWriter(QIODevice *device); ~QZipWriter(); + QIODevice* device() const; + bool isWritable() const; bool exists() const; -- cgit v0.12