Commit 2d2d1926 authored by Jan Lepper's avatar Jan Lepper
Browse files

remove KRarcHandler::defaultObserver

parent c9305fd9
...@@ -87,7 +87,6 @@ public: ...@@ -87,7 +87,6 @@ public:
static QStringList arcProtocols = QString("tar;bzip;bzip2;lzma;gzip;krarc;zip").split(';'); static QStringList arcProtocols = QString("tar;bzip;bzip2;lzma;gzip;krarc;zip").split(';');
KWallet::Wallet * KRarcHandler::wallet = 0; KWallet::Wallet * KRarcHandler::wallet = 0;
KRarcObserver * KRarcHandler::defaultObserver = new DefaultKRarcObserver();
QStringList KRarcHandler::supportedPackers() QStringList KRarcHandler::supportedPackers()
{ {
...@@ -271,7 +270,7 @@ bool KRarcHandler::unpack(QString archive, QString type, QString password, QStri ...@@ -271,7 +270,7 @@ bool KRarcHandler::unpack(QString archive, QString type, QString password, QStri
KConfigGroup group(krConfig, "Archives"); KConfigGroup group(krConfig, "Archives");
if (group.readEntry("Test Before Unpack", _TestBeforeUnpack)) { if (group.readEntry("Test Before Unpack", _TestBeforeUnpack)) {
// test first - or be sorry later... // test first - or be sorry later...
if (type != "-rpm" && type != "-deb" && !test(archive, type, password, 0, observer)) { if (type != "-rpm" && type != "-deb" && !test(archive, type, password, observer, 0)) {
observer->error(i18n("Failed to unpack") + " \"" + archive + "\" !"); observer->error(i18n("Failed to unpack") + " \"" + archive + "\" !");
return false; return false;
} }
...@@ -395,7 +394,7 @@ bool KRarcHandler::unpack(QString archive, QString type, QString password, QStri ...@@ -395,7 +394,7 @@ bool KRarcHandler::unpack(QString archive, QString type, QString password, QStri
return true; // SUCCESS return true; // SUCCESS
} }
bool KRarcHandler::test(QString archive, QString type, QString password, long count, KRarcObserver *observer) bool KRarcHandler::test(QString archive, QString type, QString password, KRarcObserver *observer, long count)
{ {
// choose the right packer for the job // choose the right packer for the job
QStringList packer; QStringList packer;
...@@ -576,7 +575,7 @@ bool KRarcHandler::pack(QStringList fileNames, QString type, QString dest, long ...@@ -576,7 +575,7 @@ bool KRarcHandler::pack(QStringList fileNames, QString type, QString dest, long
KConfigGroup group(krConfig, "Archives"); KConfigGroup group(krConfig, "Archives");
if (group.readEntry("Test Archives", _TestArchives) && if (group.readEntry("Test Archives", _TestArchives) &&
!test(dest, type, password, count, observer)) { !test(dest, type, password, observer, count)) {
observer->error(i18n("Failed to pack: ") + dest); observer->error(i18n("Failed to pack: ") + dest);
return false; return false;
} }
......
...@@ -59,16 +59,14 @@ class KRarcHandler: public QObject ...@@ -59,16 +59,14 @@ class KRarcHandler: public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
static KRarcObserver *defaultObserver;
// return the number of files in the archive // return the number of files in the archive
static long arcFileCount(QString archive, QString type, QString password, KRarcObserver *observer = defaultObserver); static long arcFileCount(QString archive, QString type, QString password, KRarcObserver *observer);
// unpack an archive to destination directory // unpack an archive to destination directory
static bool unpack(QString archive, QString type, QString password, QString dest, KRarcObserver *observer = defaultObserver); static bool unpack(QString archive, QString type, QString password, QString dest, KRarcObserver *observer );
// pack an archive to destination directory // pack an archive to destination directory
static bool pack(QStringList fileNames, QString type, QString dest, long count, QMap<QString, QString> extraProps, KRarcObserver *observer = defaultObserver); static bool pack(QStringList fileNames, QString type, QString dest, long count, QMap<QString, QString> extraProps, KRarcObserver *observer );
// test an archive // test an archive
static bool test(QString archive, QString type, QString password, long count = 0L, KRarcObserver *observer = defaultObserver); static bool test(QString archive, QString type, QString password, KRarcObserver *observer,long count = 0L );
// true - if the right unpacker exist in the system // true - if the right unpacker exist in the system
static bool arcSupported(QString type); static bool arcSupported(QString type);
// true - if supported and the user want us to handle this kind of archive // true - if supported and the user want us to handle this kind of archive
......
...@@ -134,7 +134,7 @@ void TestArchiveThread::slotStart() ...@@ -134,7 +134,7 @@ void TestArchiveThread::slotStart()
QString password = encrypted ? getPassword(path) : QString(); QString password = encrypted ? getPassword(path) : QString();
// test the archive // test the archive
if (!KRarcHandler::test(path, type, password, 0, observer())) { if (!KRarcHandler::test(path, type, password, observer(), 0)) {
sendError(KIO::ERR_NO_CONTENT, i18n("%1, test failed!", arcName)); sendError(KIO::ERR_NO_CONTENT, i18n("%1, test failed!", arcName));
return ; return ;
} }
......
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