Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jan Paul Batrina
Ark
Commits
238b301a
Commit
238b301a
authored
Aug 16, 2008
by
Harald Hvaal
Browse files
Making libarchive a readwrite plugin. not working yet, though.
svn path=/trunk/KDE/kdeutils/ark/; revision=847695
parent
dd5f81a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/libarchive/libarchivehandler.cpp
View file @
238b301a
...
...
@@ -42,7 +42,7 @@
#include <QDateTime>
LibArchiveInterface
::
LibArchiveInterface
(
const
QString
&
filename
,
QObject
*
parent
)
:
Read
Only
ArchiveInterface
(
filename
,
parent
),
:
Read
Write
ArchiveInterface
(
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"
plugins/libarchive/libarchivehandler.h
View file @
238b301a
...
...
@@ -30,7 +30,7 @@
using
namespace
Kerfuffle
;
class
LibArchiveInterface
:
public
Read
Only
ArchiveInterface
class
LibArchiveInterface
:
public
Read
Write
ArchiveInterface
{
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment