mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
ark: connect to the KArchive progress signal
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
9d9f4c765d
commit
19c071ae34
2 changed files with 13 additions and 4 deletions
|
@ -68,13 +68,14 @@ bool LibArchiveInterface::list()
|
|||
return false;
|
||||
}
|
||||
|
||||
emit progress(0.1);
|
||||
foreach (const KArchiveEntry &karchiveentry, karchive.list()) {
|
||||
ArchiveEntry archiveentry;
|
||||
copyEntry(&archiveentry, &karchiveentry);
|
||||
emit entry(archiveentry);
|
||||
}
|
||||
|
||||
emit progress(1.0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -109,12 +110,12 @@ bool LibArchiveInterface::copyFiles(const QVariantList& files, const QString &de
|
|||
fileslist.append(variant.toString());
|
||||
}
|
||||
}
|
||||
connect(&karchive, SIGNAL(progress(qreal)), this, SLOT(emitProgress(qreal)));
|
||||
if (!karchive.extract(fileslist, destinationDirectory, preservePaths)) {
|
||||
emit error(karchive.errorString());
|
||||
return false;
|
||||
}
|
||||
|
||||
emit progress(1.0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -144,6 +145,7 @@ bool LibArchiveInterface::addFiles(const QStringList &files, const CompressionOp
|
|||
|
||||
const QList<KArchiveEntry> oldEntries = karchive.list();
|
||||
const QString strip(QDir::cleanPath(globalWorkDir) + QDir::separator());
|
||||
connect(&karchive, SIGNAL(progress(qreal)), this, SLOT(emitProgress(qreal)));
|
||||
if (!karchive.add(files, QFile::encodeName(strip), QFile::encodeName(rootNode))) {
|
||||
emit error(karchive.errorString());
|
||||
return false;
|
||||
|
@ -157,7 +159,6 @@ bool LibArchiveInterface::addFiles(const QStringList &files, const CompressionOp
|
|||
}
|
||||
}
|
||||
|
||||
emit progress(1.0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -178,6 +179,7 @@ bool LibArchiveInterface::deleteFiles(const QVariantList &files)
|
|||
foreach (const QVariant &variant, files) {
|
||||
fileslist.append(variant.toString());
|
||||
}
|
||||
connect(&karchive, SIGNAL(progress(qreal)), this, SLOT(emitProgress(qreal)));
|
||||
if (!karchive.remove(fileslist)) {
|
||||
emit error(karchive.errorString());
|
||||
return false;
|
||||
|
@ -187,10 +189,14 @@ bool LibArchiveInterface::deleteFiles(const QVariantList &files)
|
|||
emit entryRemoved(file);
|
||||
}
|
||||
|
||||
emit progress(1.0);
|
||||
return true;
|
||||
}
|
||||
|
||||
void LibArchiveInterface::emitProgress(const qreal value)
|
||||
{
|
||||
emit progress(value);
|
||||
}
|
||||
|
||||
KERFUFFLE_EXPORT_PLUGIN(LibArchiveInterface)
|
||||
|
||||
#include "moc_libarchivehandler.cpp"
|
||||
|
|
|
@ -44,6 +44,9 @@ public:
|
|||
bool copyFiles(const QVariantList& files, const QString &destinationDirectory, ExtractionOptions options) final;
|
||||
bool addFiles(const QStringList& files, const CompressionOptions &options) final;
|
||||
bool deleteFiles(const QVariantList& files) final;
|
||||
|
||||
private Q_SLOTS:
|
||||
void emitProgress(const qreal value);
|
||||
};
|
||||
|
||||
#endif // LIBARCHIVEHANDLER_H
|
||||
|
|
Loading…
Add table
Reference in a new issue