2
Copyright (c) 2012 Montel Laurent <montel@kde.org>
4
This program is free software; you can redistribute it and/or modify it
5
under the terms of the GNU General Public License, version 2, as
6
published by the Free Software Foundation.
8
This program is distributed in the hope that it will be useful, but
9
WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
General Public License for more details.
13
You should have received a copy of the GNU General Public License along
14
with this program; if not, write to the Free Software Foundation, Inc.,
15
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
#include "archivestorage.h"
22
ArchiveStorage::ArchiveStorage(const QString& filename, QObject *parent)
23
:QObject(parent), mArchive(new KZip(filename))
27
ArchiveStorage::~ArchiveStorage()
34
void ArchiveStorage::closeArchive()
36
if(mArchive && mArchive->isOpen()) {
41
bool ArchiveStorage::openArchive(bool write)
43
bool result = mArchive->open(write ? QIODevice::WriteOnly : QIODevice::ReadOnly);
46
Q_EMIT error(i18n("Archive cannot be opened in write mode."));
48
Q_EMIT error(i18n("Archive cannot be opened in read mode."));
54
KZip *ArchiveStorage::archive()
59
#include "archivestorage.moc"