cb927be
--- kdelibs-3.5.10/kio/kio/kzip.cpp.orig	2009-12-09 18:42:47.000000000 +0100
cb927be
+++ kdelibs-3.5.10/kio/kio/kzip.cpp	2009-12-09 18:45:43.000000000 +0100
cb927be
@@ -1051,6 +1051,20 @@
cb927be
     return true;
cb927be
 }
cb927be
 
cb927be
+bool KZip::writeDir(const QString& name, const QString& user, const QString& group)
cb927be
+{
cb927be
+    // Zip files have no explicit directories, they are implicitly created during extraction time
cb927be
+    // when file entries have paths in them.
cb927be
+    // However, to support empty directories, we must create a dummy file entry which ends with '/'.
cb927be
+    QString dirName = name;
cb927be
+    if (!name.endsWith("/"))
cb927be
+        dirName = dirName.append('/');
cb927be
+
cb927be
+    mode_t perm = 040755;
cb927be
+    time_t the_time = time(0);
cb927be
+    return writeFile(dirName, user, group, 0, perm, the_time, the_time, the_time, 0);
cb927be
+}
cb927be
+
cb927be
 // Doesn't need to be reimplemented anymore. Remove for KDE-4.0
cb927be
 bool KZip::writeFile( const QString& name, const QString& user, const QString& group, uint size, const char* data )
cb927be
 {
cb927be
@@ -1114,7 +1128,7 @@
cb927be
     }
cb927be
 
cb927be
     // delete entries in the filelist with the same filename as the one we want
cb927be
-    // to save, so that we don´t have duplicate file entries when viewing the zip
cb927be
+    // to save, so that we don�t have duplicate file entries when viewing the zip
cb927be
     // with konqi...
cb927be
     // CAUTION: the old file itself is still in the zip and won't be removed !!!
cb927be
     QPtrListIterator<KZipFileEntry> it( d->m_fileList );
e8a9a9b
diff -up kdelibs-3.5.10/kio/kio/kzip.h.orig kdelibs-3.5.10/kio/kio/kzip.h
e8a9a9b
--- kdelibs-3.5.10/kio/kio/kzip.h.orig	2009-12-09 19:35:42.000000000 +0100
e8a9a9b
+++ kdelibs-3.5.10/kio/kio/kzip.h	2009-12-09 19:35:48.000000000 +0100
e8a9a9b
@@ -191,10 +191,7 @@ protected:
e8a9a9b
     /// Closes the archive
e8a9a9b
     virtual bool closeArchive();
e8a9a9b
 
e8a9a9b
-    /**
e8a9a9b
-     * @internal Not needed for zip
e8a9a9b
-     */
e8a9a9b
-    virtual bool writeDir( const QString& name, const QString& user, const QString& group) { Q_UNUSED(name); Q_UNUSED(user); Q_UNUSED(group); return true; }
e8a9a9b
+    virtual bool writeDir(const QString& name, const QString& user, const QString& group);
e8a9a9b
     // TODO(BIC) uncomment and make virtual for KDE 4.
e8a9a9b
 //    bool writeDir( const QString& name, const QString& user, const QString& group,
e8a9a9b
 //                        mode_t perm, time_t atime, time_t mtime, time_t ctime );