Commit 186baa53 authored by Toni Asensi Esteve's avatar Toni Asensi Esteve
Browse files

Archives: Replace "KRarcObserver" with "KrArcObserver" in order to follow norms

Differential Revision: https://phabricator.kde.org/D28867
parent 84893e79
......@@ -248,7 +248,7 @@ void AbstractThreadedJob::slotDescription(KJob *, const QString &title, const QP
emit description(this, mytitle, field1, field2);
}
class AbstractJobObserver : public KRarcObserver
class AbstractJobObserver : public KrArcObserver
{
protected:
AbstractJobThread * _jobThread;
......@@ -519,7 +519,7 @@ void AbstractJobThread::countLocalFiles(const QUrl &baseUrl, const QStringList &
delete calcSpaceFileSystem;
}
KRarcObserver * AbstractJobThread::observer()
KrArcObserver * AbstractJobThread::observer()
{
if (_observer)
return _observer;
......
......@@ -39,7 +39,7 @@
class AbstractJobThread;
class QTemporaryDir;
class UserEvent;
class KRarcObserver;
class KrArcObserver;
class QTemporaryFile;
class AbstractThreadedJob : public KIO::Job
......@@ -97,7 +97,7 @@ public:
virtual ~AbstractJobThread();
void abort();
KRarcObserver * observer();
KrArcObserver * observer();
protected slots:
virtual void slotStart() = 0;
......@@ -140,7 +140,7 @@ protected:
QEventLoop *_loop;
QTemporaryDir *_downloadTempDir;
KRarcObserver *_observer;
KrArcObserver *_observer;
QTemporaryFile *_tempFile;
QString _tempFileName;
......
......@@ -46,11 +46,11 @@
#include "../../krArc/krlinecountingprocess.h"
#if 0
class DefaultKRarcObserver : public KRarcObserver
class DefaultKrArcObserver : public KrArcObserver
{
public:
DefaultKRarcObserver() {}
virtual ~DefaultKRarcObserver() {}
DefaultKrArcObserver() {}
virtual ~DefaultKrArcObserver() {}
virtual void processEvents() override {
usleep(1000);
......@@ -195,7 +195,7 @@ bool KrArcHandler::arcSupported(QString type)
|| (type == "7z" && lst.contains("7z"));
}
long KrArcHandler::arcFileCount(const QString& archive, const QString& type, const QString& password, KRarcObserver *observer)
long KrArcHandler::arcFileCount(const QString& archive, const QString& type, const QString& password, KrArcObserver *observer)
{
int divideWith = 1;
......@@ -274,7 +274,7 @@ long KrArcHandler::arcFileCount(const QString& archive, const QString& type, con
return count / divideWith;
}
bool KrArcHandler::unpack(QString archive, const QString& type, const QString& password, const QString& dest, KRarcObserver *observer)
bool KrArcHandler::unpack(QString archive, const QString& type, const QString& password, const QString& dest, KrArcObserver *observer)
{
KConfigGroup group(krConfig, "Archives");
if (group.readEntry("Test Before Unpack", _TestBeforeUnpack)) {
......@@ -374,9 +374,9 @@ bool KrArcHandler::unpack(QString archive, const QString& type, const QString& p
// tell the user to wait
observer->subJobStarted(i18n("Unpacking File(s)"), count);
if (count != 0) {
connect(&proc, &KrLinecountingProcess::newOutputLines, observer, &KRarcObserver::incrementProgress);
connect(&proc, &KrLinecountingProcess::newOutputLines, observer, &KrArcObserver::incrementProgress);
if (type == "rpm")
connect(&proc, &KrLinecountingProcess::newErrorLines, observer, &KRarcObserver::incrementProgress);
connect(&proc, &KrLinecountingProcess::newErrorLines, observer, &KrArcObserver::incrementProgress);
}
// start the unpacking process
......@@ -404,7 +404,7 @@ bool KrArcHandler::unpack(QString archive, const QString& type, const QString& p
return true; // SUCCESS
}
bool KrArcHandler::test(const QString& archive, const QString& type, const QString& password, KRarcObserver *observer, long count)
bool KrArcHandler::test(const QString& archive, const QString& type, const QString& password, KrArcObserver *observer, long count)
{
// choose the right packer for the job
QStringList packer;
......@@ -448,7 +448,7 @@ bool KrArcHandler::test(const QString& archive, const QString& type, const QStri
// tell the user to wait
observer->subJobStarted(i18n("Testing Archive"), count);
if (count != 0)
connect(&proc, &KrLinecountingProcess::newOutputLines, observer, &KRarcObserver::incrementProgress);
connect(&proc, &KrLinecountingProcess::newOutputLines, observer, &KrArcObserver::incrementProgress);
// start the unpacking process
proc.start();
......@@ -470,7 +470,7 @@ bool KrArcHandler::test(const QString& archive, const QString& type, const QStri
return true; // SUCCESS
}
bool KrArcHandler::pack(QStringList fileNames, QString type, const QString& dest, long count, QMap<QString, QString> extraProps, KRarcObserver *observer)
bool KrArcHandler::pack(QStringList fileNames, QString type, const QString& dest, long count, QMap<QString, QString> extraProps, KrArcObserver *observer)
{
// set the right packer to do the job
QStringList packer;
......@@ -575,7 +575,7 @@ bool KrArcHandler::pack(QStringList fileNames, QString type, const QString& dest
// tell the user to wait
observer->subJobStarted(i18n("Packing File(s)"), count);
if (count != 0)
connect(&proc, &KrLinecountingProcess::newOutputLines, observer, &KRarcObserver::incrementProgress);
connect(&proc, &KrLinecountingProcess::newOutputLines, observer, &KrArcObserver::incrementProgress);
// start the packing process
proc.start();
......
......@@ -35,11 +35,11 @@ namespace KWallet {
class Wallet;
}
class KRarcObserver : public QObject
class KrArcObserver : public QObject
{
Q_OBJECT
public:
~KRarcObserver() override = default;
~KrArcObserver() override = default;
virtual void processEvents() = 0;
virtual void subJobStarted(const QString & jobTitle, int count) = 0;
......@@ -59,13 +59,13 @@ public:
explicit KrArcHandler(QObject *parent = nullptr);
// return the number of files in the archive
long arcFileCount(const QString& archive, const QString& type, const QString& password, KRarcObserver *observer);
long arcFileCount(const QString& archive, const QString& type, const QString& password, KrArcObserver *observer);
// unpack an archive to destination directory
bool unpack(QString archive, const QString& type, const QString& password, const QString& dest, KRarcObserver *observer );
bool unpack(QString archive, const QString& type, const QString& password, const QString& dest, KrArcObserver *observer );
// pack an archive to destination directory
bool pack(QStringList fileNames, QString type, const QString& dest, long count, QMap<QString, QString> extraProps, KRarcObserver *observer );
bool pack(QStringList fileNames, QString type, const QString& dest, long count, QMap<QString, QString> extraProps, KrArcObserver *observer );
// test an archive
bool test(const QString& archive, const QString& type, const QString& password, KRarcObserver *observer, long count = 0L );
bool test(const QString& archive, const QString& type, const QString& password, KrArcObserver *observer, long count = 0L );
// returns `true` if the right unpacker exist in the system
static bool arcSupported(QString type);
// return the list of supported packers
......
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