summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qzip.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qzip.cpp')
-rw-r--r--src/gui/text/qzip.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp
index b68c36fd9e..fc7fbcac12 100644
--- a/src/gui/text/qzip.cpp
+++ b/src/gui/text/qzip.cpp
@@ -391,7 +391,6 @@ struct CentralFileHeader
uchar internal_file_attributes[2];
uchar external_file_attributes[4];
uchar offset_local_header[4];
- LocalFileHeader toLocalHeader() const;
};
Q_DECLARE_TYPEINFO(CentralFileHeader, Q_PRIMITIVE_TYPE);
@@ -541,19 +540,19 @@ public:
void addEntry(EntryType type, const QString &fileName, const QByteArray &contents);
};
-LocalFileHeader CentralFileHeader::toLocalHeader() const
+static LocalFileHeader toLocalHeader(const CentralFileHeader &ch)
{
LocalFileHeader h;
writeUInt(h.signature, 0x04034b50);
- copyUShort(h.version_needed, version_needed);
- copyUShort(h.general_purpose_bits, general_purpose_bits);
- copyUShort(h.compression_method, compression_method);
- copyUInt(h.last_mod_file, last_mod_file);
- copyUInt(h.crc_32, crc_32);
- copyUInt(h.compressed_size, compressed_size);
- copyUInt(h.uncompressed_size, uncompressed_size);
- copyUShort(h.file_name_length, file_name_length);
- copyUShort(h.extra_field_length, extra_field_length);
+ copyUShort(h.version_needed, ch.version_needed);
+ copyUShort(h.general_purpose_bits, ch.general_purpose_bits);
+ copyUShort(h.compression_method, ch.compression_method);
+ copyUInt(h.last_mod_file, ch.last_mod_file);
+ copyUInt(h.crc_32, ch.crc_32);
+ copyUInt(h.compressed_size, ch.compressed_size);
+ copyUInt(h.uncompressed_size, ch.uncompressed_size);
+ copyUShort(h.file_name_length, ch.file_name_length);
+ copyUShort(h.extra_field_length, ch.extra_field_length);
return h;
}
@@ -751,7 +750,7 @@ void QZipWriterPrivate::addEntry(EntryType type, const QString &fileName, const
fileHeaders.append(header);
- LocalFileHeader h = header.h.toLocalHeader();
+ LocalFileHeader h = toLocalHeader(header.h);
device->write((const char *)&h, sizeof(LocalFileHeader));
device->write(header.file_name);
device->write(data);