|
|
|
--- 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 TQString& name, const TQString& user, const TQString& 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 '/'.
|
|
|
|
+ TQString 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 TQString& name, const TQString& user, const TQString& group, uint size, const char* data )
|
|
|
|
{
|
|
|
|
diff -up kdelibs-3.5.10/kio/kio/kzip.h.orig kdelibs-3.5.10/kio/kio/kzip.h
|
|
|
|
--- kdelibs-3.5.10/kio/kio/kzip.h.orig 2009-12-09 19:35:42.000000000 +0100
|
|
|
|
+++ kdelibs-3.5.10/kio/kio/kzip.h 2009-12-09 19:35:48.000000000 +0100
|
|
|
|
@@ -191,10 +191,7 @@ protected:
|
|
|
|
/// Closes the archive
|
|
|
|
virtual bool closeArchive();
|
|
|
|
|
|
|
|
- /**
|
|
|
|
- * @internal Not needed for zip
|
|
|
|
- */
|
|
|
|
- virtual bool writeDir( const TQString& name, const TQString& user, const TQString& group) { Q_UNUSED(name); Q_UNUSED(user); Q_UNUSED(group); return true; }
|
|
|
|
+ virtual bool writeDir(const TQString& name, const TQString& user, const TQString& group);
|
|
|
|
// TODO(BIC) uncomment and make virtual for KDE 4.
|
|
|
|
// bool writeDir( const TQString& name, const TQString& user, const TQString& group,
|
|
|
|
// mode_t perm, time_t atime, time_t mtime, time_t ctime );
|