33 lines
1.4 KiB
Diff
33 lines
1.4 KiB
Diff
|
--- kdelibs-3.5.10/kio/kio/kzip.cpp.orig 2009-12-09 18:42:47.000000000 +0100
|
|||
|
+++ kdelibs-3.5.10/kio/kio/kzip.cpp 2009-12-09 18:45:43.000000000 +0100
|
|||
|
@@ -1051,6 +1051,20 @@
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
+bool KZip::writeDir(const QString& name, const QString& user, const QString& group)
|
|||
|
+{
|
|||
|
+ // Zip files have no explicit directories, they are implicitly created during extraction time
|
|||
|
+ // when file entries have paths in them.
|
|||
|
+ // However, to support empty directories, we must create a dummy file entry which ends with '/'.
|
|||
|
+ QString dirName = name;
|
|||
|
+ if (!name.endsWith("/"))
|
|||
|
+ dirName = dirName.append('/');
|
|||
|
+
|
|||
|
+ mode_t perm = 040755;
|
|||
|
+ time_t the_time = time(0);
|
|||
|
+ return writeFile(dirName, user, group, 0, perm, the_time, the_time, the_time, 0);
|
|||
|
+}
|
|||
|
+
|
|||
|
// Doesn't need to be reimplemented anymore. Remove for KDE-4.0
|
|||
|
bool KZip::writeFile( const QString& name, const QString& user, const QString& group, uint size, const char* data )
|
|||
|
{
|
|||
|
@@ -1114,7 +1128,7 @@
|
|||
|
}
|
|||
|
|
|||
|
// delete entries in the filelist with the same filename as the one we want
|
|||
|
- // to save, so that we don<6F>t have duplicate file entries when viewing the zip
|
|||
|
+ // to save, so that we don<6F>t have duplicate file entries when viewing the zip
|
|||
|
// with konqi...
|
|||
|
// CAUTION: the old file itself is still in the zip and won't be removed !!!
|
|||
|
QPtrListIterator<KZipFileEntry> it( d->m_fileList );
|