Commit 238b301a authored by Harald Hvaal's avatar Harald Hvaal
Browse files

Making libarchive a readwrite plugin. not working yet, though.

svn path=/trunk/KDE/kdeutils/ark/; revision=847695
parent dd5f81a0
......@@ -42,7 +42,7 @@
#include <QDateTime>
LibArchiveInterface::LibArchiveInterface( const QString & filename, QObject *parent )
: ReadOnlyArchiveInterface( filename, parent ),
: ReadWriteArchiveInterface( filename, parent ),
cachedArchiveEntryCount(0),
extractedFilesSize(0),
overwriteAll(false)
......@@ -275,6 +275,43 @@ void LibArchiveInterface::copyData( struct archive *source, struct archive *dest
}
}
bool LibArchiveInterface::addFiles( const QStringList & files )
{
struct archive *arch, *writer;
struct archive_entry *entry;
int ret;
error("No worky yet - wait a few commits!");
return false;
#if 0
arch = archive_write_new();
archive_write_set_compression_gzip(arch);
archive_write_set_format_ustar(arch);
ret = archive_write_open_filename(arch, QFile::encodeName( filename() ));
foreach(const QString& file, files) {
entry = archive_entry_new();
}
ret = archive_write_finish(arch);
#endif
}
bool LibArchiveInterface::deleteFiles( const QList<QVariant> & files )
{
return false;
}
KERFUFFLE_PLUGIN_FACTORY( LibArchiveInterface )
#include "libarchivehandler.moc"
......@@ -30,7 +30,7 @@
using namespace Kerfuffle;
class LibArchiveInterface: public ReadOnlyArchiveInterface
class LibArchiveInterface: public ReadWriteArchiveInterface
{
Q_OBJECT
public:
......@@ -40,6 +40,9 @@ class LibArchiveInterface: public ReadOnlyArchiveInterface
bool list();
bool copyFiles( const QList<QVariant> & files, const QString & destinationDirectory, bool preservePaths );
bool addFiles( const QStringList & files );
bool deleteFiles( const QList<QVariant> & files );
private:
int extractionFlags() const;
void copyData( struct archive *source, struct archive *dest, bool partialprogress = true );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment