perl -pi -e 'if (/.include .karchive\.h./) { print "\#define private public // need protected for m_open access for the HACK, and public for setting KArchiveFile::m_size\n$_\#undef private\n"; }' kozip.h
perl -pi -e 'if (/virtual bool doneWriting/) { print $_; $_ = " virtual void close(); // HACK for misplaced closeArchive() call in KDE-3.0''s KArchive\n virtual bool closeArchive() { return true; } // part of the same hack\n"; }' kozip.h
perl -pi -e 'if (/KoZip::doneWriting/) { print "void KoZip::close() { // HACK for misplaced closeArchive() call in KDE-3.0''s KArchive\n if (!isOpened()) return;\n closeArchiveHack();\n device()->close();\n m_open = false;\n}\n\n"; }' kozip.cpp