Commit 45f1b0ed authored by Fabian Kosmale's avatar Fabian Kosmale

C++11ified code with clang-modernize

parent ed7f2429
......@@ -126,7 +126,7 @@ class SQLiteException : public std::exception
public:
SQLiteException(const char *m) : message(m) {}
virtual const char *what() const throw() {
virtual const char *what() const throw() override {
return message;
}
......
......@@ -34,7 +34,7 @@ public:
ReadWrite
};
Private()
: connection(0), setupDbusDatabase(false), lastQueryDBus(false)
: connection(nullptr), setupDbusDatabase(false), lastQueryDBus(false)
{
qRegisterMetaType< QList<Row> >("QList<Row>");
}
......
......@@ -48,7 +48,7 @@ public:
* @param name the database filename
* @param readonly true if read-only access, false for read-write
*/
void connectToDB(QString const&, bool);
void connectToDB(QString const&, bool) override;
/**
* Executes a query on the database
......@@ -56,7 +56,7 @@ public:
* @param q the query string
* @returns a SQLiteResource object with the result, if present
*/
SQLiteResource query(const QString &q);
SQLiteResource query(const QString &q) override;
/**
* Executes multiple queries on the database
......@@ -65,22 +65,22 @@ public:
* @param bindings the bindings we're going to use
* this is pair of values, the key is a string determining the binding name, the value is a stringlist which contains all the values
*/
void query(const QString &q, const QVariantMap &bindings);
void query(const QString &q, const QVariantMap &bindings) override;
/**
* If the table interested by the last query as an autoincremented primary key,
* gets the last value assigned to the key
*/
qint64 getLastRowId();
qint64 getLastRowId() override;
/**
* Creates a "macro" (fake name) that maps into an integer, a QString, or a QByteArray
* The next query can contain the defined macros in place of the actual values.
* @note All bindings stay valid only for the subsequent call of query().
*/
void bind(QString const&, int);
void bind(QString const&, QString const&);
void bind(QString const&, QByteArray const&);
void bind(QString const&, int) override;
void bind(QString const&, QString const&) override;
void bind(QString const&, QByteArray const&) override;
private:
// Disable copy constructor and default constructor
......
......@@ -39,8 +39,8 @@ class SQLiteConnection::Private
public:
Private()
: isConnected(false)
, dbHandle(0)
, statement(0)
, dbHandle(nullptr)
, statement(nullptr)
{}
~Private()
......@@ -103,11 +103,11 @@ void SQLiteConnection::connectToDB(QString const& dbName, bool readonly)
std::string tmp = dbName.toStdString();
const char* name( tmp.c_str() );
int retvalue(sqlite3_open_v2(name, &(d->dbHandle), flags, NULL));
int retvalue(sqlite3_open_v2(name, &(d->dbHandle), flags, nullptr));
d->checkForErrors(retvalue);
sqlite3_create_function_v2(d->dbHandle, "REGEXP_REPLACE", 2, SQLITE_ANY, NULL, regExpReplace, NULL, NULL, NULL);
sqlite3_create_function_v2(d->dbHandle, "REGEXP", 2, SQLITE_ANY, NULL, regExp, NULL, NULL, NULL);
sqlite3_create_function_v2(d->dbHandle, "REGEXP_REPLACE", 2, SQLITE_ANY, nullptr, regExpReplace, nullptr, nullptr, nullptr);
sqlite3_create_function_v2(d->dbHandle, "REGEXP", 2, SQLITE_ANY, nullptr, regExp, nullptr, nullptr, nullptr);
d->isConnected = true;
}
......@@ -128,7 +128,7 @@ QList<Row> SQLiteConnection::rowQuery(const QString &q)
*/
std::string tmp = q.toStdString();
const char* query( tmp.c_str() );
int retvalue = sqlite3_prepare_v2(d->dbHandle, query, -1, &(d->statement), NULL);
int retvalue = sqlite3_prepare_v2(d->dbHandle, query, -1, &(d->statement), nullptr);
d->checkForErrors(retvalue);
if (!d->intBindings.isEmpty()) {
......@@ -213,7 +213,7 @@ SQLiteConnection::Row SQLiteConnection::Private::getRowFromStatement(sqlite3_stm
QString name(sqlite3_column_name(statement, i));
QVariant record;
const unsigned char* ptr(0);
const unsigned char* ptr(nullptr);
int bytes(0);
switch (sqlite3_column_type(statement, i)) {
......
......@@ -61,7 +61,7 @@ public:
* @param name the database filename
* @param readonly true if read-only access, false for read-write
*/
virtual void connectToDB(QString const&, bool);
virtual void connectToDB(QString const&, bool) override;
/**
* Executes a query on the database
......@@ -69,7 +69,7 @@ public:
* @param q the query string
* @returns a SQLiteResource object with the result, if present
*/
virtual SQLiteResource query(const QString &q);
virtual SQLiteResource query(const QString &q) override;
/**
* Executes multiple queries on the database
......@@ -78,7 +78,7 @@ public:
* @param bindings the bindings we're going to use
* this is pair of values, the key is a string determining the binding name, the value is a stringlist which contains all the values
*/
virtual void query(const QString &q, const QVariantMap &bindings);
virtual void query(const QString &q, const QVariantMap &bindings) override;
/**
* Executes a query on the database
......@@ -92,16 +92,16 @@ public:
* If the table interested by the last query as an autoincremented primary key,
* gets the last value assigned to the key
*/
virtual qint64 getLastRowId();
virtual qint64 getLastRowId() override;
/**
* Creates a "macro" (fake name) that maps into an integer, a QString, or a QByteArray
* The next query can contain the defined macros in place of the actual values.
* @note All bindings stay valid only for the subsequent call of query().
*/
virtual void bind(QString const&, int);
virtual void bind(QString const&, QString const&);
virtual void bind(QString const&, QByteArray const&);
virtual void bind(QString const&, int) override;
virtual void bind(QString const&, QString const&) override;
virtual void bind(QString const&, QByteArray const&) override;
private:
// Disable copy constructor and default constructor
......
......@@ -319,7 +319,7 @@ void BackendPrivate::__k__initializationFinished()
{
Q_Q(Backend);
databases.clear();
localDatabase = 0;
localDatabase = nullptr;
// Let's see what we got
QHash< QString, Database* > const& rethash = initializationWatcher->result();
......@@ -399,7 +399,7 @@ void BackendPrivate::orphanQueryFinished()
foreach (QList< Package* > res, future.results()) {
result += res;
}
result.removeAll(0);
result.removeAll(nullptr);
emit q->queryOrphansCompleted(uuid, result);
}
......@@ -497,7 +497,7 @@ class BackendHelper
{
public:
BackendHelper()
: q( 0 )
: q( nullptr )
{
}
......@@ -547,7 +547,7 @@ Backend::~Backend()
void Backend::setLocale(const QString& locale)
{
QTranslator * translator = new QTranslator(this);
auto translator = new QTranslator(this);
translator->load("akabeicore_" + locale + ".qm", "/usr/share/akabeicore/translations/");//FIXME: Use translations from install dir
QCoreApplication::instance()->installTranslator(translator);
}
......@@ -615,7 +615,7 @@ QUuid Backend::queryGroups(const QString& sql)
QList<Database*> allDbs;
allDbs << d->localDatabase << d->databases;
QFutureWatcher< QList< Group* > > *watcher = new QFutureWatcher< QList< Group* > >();
auto watcher = new QFutureWatcher< QList< Group* > >();
watcher->setProperty("__Akabei_Query_Uuid", uuid.toString());
connect(watcher, SIGNAL(finished()), d, SLOT(groupQueryFinished()));
d->queryGroupFuturePool.insert(uuid, watcher);
......@@ -636,7 +636,7 @@ QUuid Backend::queryPackages(const QString& sql)
QList<Database*> allDbs;
allDbs << d->localDatabase << d->databases;
QFutureWatcher< QList< Package* > >* watcher = new QFutureWatcher< QList< Package* > >();
auto watcher = new QFutureWatcher< QList< Package* > >();
watcher->setProperty("__Akabei_Query_Uuid", uuid.toString());
connect(watcher, SIGNAL(finished()), d, SLOT(packageQueryFinished()));
d->queryPackageFuturePool.insert(uuid, watcher);
......@@ -653,7 +653,7 @@ QUuid Backend::orphanPackages()
QUuid uuid = QUuid::createUuid();
QFutureWatcher< QList< Package* > >* watcher = new QFutureWatcher< QList< Package* > >();
auto watcher = new QFutureWatcher< QList< Package* > >();
watcher->setProperty("__Akabei_Query_Uuid", uuid.toString());
connect(watcher, SIGNAL(finished()), d, SLOT(orphanQueryFinished()));
d->orphanPackageFuturePool.insert(uuid, watcher);
......@@ -741,7 +741,7 @@ Package* Backend::loadPackageFromFile(const QString& path)
Q_D(Backend);
if (!QFile::exists(path)) {
return 0;
return nullptr;
}
std::unique_ptr<Package> retpackage(new Package);
......@@ -861,11 +861,11 @@ Package* Backend::loadPackageFromFile(const QString& path)
} catch (ArchiveException& e) {
akabeiDebug() << "Error during access in archive: " << e.what();
return 0;
return nullptr;
}
if (retpackage->name().isEmpty()) {
return 0;
return nullptr;
}
// Now add md5sum and filename, of course
......@@ -886,7 +886,7 @@ Package* Backend::loadPackageFromFile(const QString& path)
Delta* Backend::loadDeltaFromFile(const QString& path)
{
if (!QFile::exists(path)) {
return 0;
return nullptr;
}
ArchiveHandler delta(path);
......@@ -898,7 +898,7 @@ Delta* Backend::loadDeltaFromFile(const QString& path)
/* It can be only our delta */
foreach (QString const& entry, delta.getEntries()) {
if (entry != ".DELTAINFO" && entry != "." && entry != path.split('/').last().remove(".tar.xz")) {
return 0;
return nullptr;
}
}
......@@ -939,11 +939,11 @@ Delta* Backend::loadDeltaFromFile(const QString& path)
}
} catch (ArchiveException const& e) {
akabeiDebug() << "Error during access to archive: " << e.what();
return 0;
return nullptr;
}
if (retdelta->targetName().isEmpty()) {
return 0;
return nullptr;
}
// Now add md5sum and filename, of course
......@@ -961,7 +961,7 @@ Group* Backend::loadGroupFromFile(const QString &path)
{
Q_D(Backend);
Group* group( 0 );
Group* group( nullptr );
QFile file( path );
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
......@@ -978,9 +978,9 @@ Group* Backend::loadGroupFromFile(const QString &path)
if (split.first() == "Name") {
group = d->groupPool->group(split.last());
} else if (group != 0 && split.first() == "Description") {
} else if (group != nullptr && split.first() == "Description") {
group->d_ptr->setDescription(split.last());
} else if (group != 0 && split.first() == "Iconname") {
} else if (group != nullptr && split.first() == "Iconname") {
group->d_ptr->setIcon(split.last());
}
}
......@@ -992,7 +992,7 @@ Hook* Backend::loadHookFromFile(const QString& path, QList<Package*> pkgs)
QFile file(path);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
return 0;
return nullptr;
}
QString name( path.split('/').last().remove(".hook") );
......
......@@ -96,7 +96,7 @@ class AKABEICORESHARED_EXPORT Backend : public QObject
* @param cO this object gets called when the status change from WaitingForLock to OnTransaction
* @param cS this function gets called when the status changes from WaitingForLock to OnTransaction
*/
void setStatus(Backend::Status status, QObject * cO = 0, const char *cS = 0);
void setStatus(Backend::Status status, QObject * cO = nullptr, const char *cS = nullptr);
/**
* @returns the status of the backend
......@@ -242,7 +242,7 @@ class AKABEICORESHARED_EXPORT Backend : public QObject
void queryGroupsCompleted(const QUuid &id, const QList<Akabei::Group*> &result);
private:
Backend(QObject* parent = 0);
Backend(QObject* parent = nullptr);
BackendPrivate * const d_ptr;
......
......@@ -59,12 +59,12 @@ class BackendPrivate : public QObject
, q_ptr(p)
, status(Backend::StatusBare)
, mutex(new QReadWriteLock(QReadWriteLock::Recursive))
, localDatabase(0)
, lockFileHandle(0)
, localDatabase(nullptr)
, lockFileHandle(nullptr)
, fsWatcher(new QFileSystemWatcher(p))
, groupPool(new GroupPool)
, runner(new OperationRunner(p))
, iface(0) {}
, iface(nullptr) {}
~BackendPrivate() {
delete lockFileHandle;
qDeleteAll(databases);
......
......@@ -61,7 +61,7 @@ class Config::Private
class ConfigHelper
{
public:
ConfigHelper() : q(0) {}
ConfigHelper() : q(nullptr) {}
~ConfigHelper() {
delete q;
}
......
......@@ -60,7 +60,7 @@ class ErrorQueueHelper
{
public:
ErrorQueueHelper()
: q( 0 )
: q( nullptr )
{}
virtual ~ErrorQueueHelper()
......@@ -103,7 +103,7 @@ void ErrorQueue::registerForErrorType(Error::Type t, QObject* receiver, const ch
void ErrorQueue::registerForAllErrors(QObject* receiver, const char* slot)
{
QWriteLocker locker(d->mutex);
ErrorHandler* h = new ErrorHandler(receiver, slot);
auto h = new ErrorHandler(receiver, slot);
for (int t = Error::UnknownError; t <= Error::FilesystemError; t++) {
d->errorSlots.insertMulti((Error::Type)t, h);
......
......@@ -71,7 +71,7 @@ class Error
* @param description the description of the error
* @param op the operation associated with the error
*/
explicit Error(Type type = UnknownError, const QString& description = QString(), Operation* operation = 0);
explicit Error(Type type = UnknownError, const QString& description = QString(), Operation* operation = nullptr);
Error(const Error &error);
virtual ~Error();
......
......@@ -340,7 +340,7 @@ QStringList stringlistFromDb(const QString &dbstr)
Package* latestVersionOfPackage(const QString& pkgName)
{
Package::Version latestVersion;
Package *latestPkg = NULL;
Package *latestPkg = nullptr;
foreach (Akabei::Database *db, Akabei::Backend::instance()->databases()) {
foreach (Akabei::Package *pkg, db->searchPackages(pkgName, SearchNameEqual)) {
......
......@@ -138,7 +138,7 @@ class PackageEventLoop : public QEventLoop
Q_OBJECT
Q_DISABLE_COPY(PackageEventLoop)
public:
PackageEventLoop(QObject *parent = 0);
PackageEventLoop(QObject *parent = nullptr);
virtual ~PackageEventLoop();
void setUuid(const QUuid &uuid);
......
......@@ -30,7 +30,7 @@ class AuthorityLoop : public QEventLoop
Q_OBJECT
Q_DISABLE_COPY(AuthorityLoop)
public:
AuthorityLoop(QObject* parent = 0);
AuthorityLoop(QObject* parent = nullptr);
virtual ~AuthorityLoop();
PolkitQt1::Authority::Result result();
......
......@@ -25,7 +25,7 @@ class HookPrivate {
: name(n)
, content(c)
, packages(pkgs)
, file(0)
, file(nullptr)
, mutex(new QReadWriteLock())
{}
......
......@@ -68,7 +68,7 @@ void OperationPrivate::setProcessingOptions(ProcessingOptions options)
}
Operation::Operation(const QString &targetName)
: QObject(0), d_ptr(new OperationPrivate(this, targetName))
: QObject(nullptr), d_ptr(new OperationPrivate(this, targetName))
{
}
......
......@@ -168,7 +168,7 @@ void OperationRunner::remove(Operation *operation)
Q_D(OperationRunner);
QMutexLocker locker(d->mutex);
d->operations[operation->phase()].removeOne(operation);
operation->d_func()->runner = 0;
operation->d_func()->runner = nullptr;
}
void OperationRunner::clear()
......
......@@ -190,7 +190,7 @@ Q_SIGNALS:
void finished(bool result);
private:
explicit OperationRunner(QObject *parent = 0);
explicit OperationRunner(QObject *parent = nullptr);
OperationRunnerPrivate * const d_ptr;
......
......@@ -255,7 +255,7 @@ Package * PackagePrivate::containsProviderFor(Package::List packages, const QStr
}
}
}
return 0;
return nullptr;
}
Package::Version::Version()
......@@ -448,7 +448,7 @@ Package::Package(Database *db, int databaseId, const QString &name)
}
Package::Package()
: d_ptr(new PackagePrivate(0, -1, QString()))
: d_ptr(new PackagePrivate(nullptr, -1, QString()))
{
}
......@@ -650,7 +650,7 @@ QStringList Package::retrieveFiles(FilepathMode mode)
if (d->files.isEmpty()) {
// We should cache the files here.
if (d->database != 0 && d->databaseId >= 0) {
if (d->database != nullptr && d->databaseId >= 0) {
// Ok, query the db
// Add files
QString sql = QString( Queries::packageProperty("*", "files", d->databaseId) );
......@@ -859,7 +859,7 @@ QString Package::retrieveScriptlet()
QWriteLocker locker(d->mutex);
if (d->scriptlet.isEmpty() && d->hasScriptlet) {
// We should cache the files here.
if (d->database != 0 && d->databaseId >= 0) {
if (d->database != nullptr && d->databaseId >= 0) {
// Ok, query the db
// Add files
QString sql = Queries::packageProperty("*", "scriptlets", d->databaseId);
......@@ -886,7 +886,7 @@ QList< Delta* > Package::retrieveDeltas()
Q_D(Package);
QWriteLocker locker(d->mutex);
if (d->deltaCache.isEmpty()) {
if (d->database != 0 && d->databaseId >= 0) {
if (d->database != nullptr && d->databaseId >= 0) {
QString sql = Queries::packageProperty("*", "deltas", d->databaseId);
QList<Delta*> deltas = d->database->queryDeltas(sql);
foreach (Delta* del, deltas)
......@@ -907,7 +907,7 @@ Delta* Package::retrieveDeltaFrom(const Version &version)
if (Version(del->versionFrom()) == version)
return del;
}
return 0;
return nullptr;
}
Delta* Package::retrieveDeltaTo(const Akabei::Package::Version& version)
......@@ -1087,7 +1087,7 @@ Package* Package::generateInstalledPackage(Package::InstallReason ireason, const
retrieveFiles();
retrieveScriptlet();
// Create a new package from this one
Package *p = new Package(0, -1, d->name);
auto p = new Package(nullptr, -1, d->name);
p->d_func()->arch = d->arch;
p->d_func()->pathToArchive = d->pathToArchive;
p->d_func()->backup = d->backup;
......
......@@ -168,7 +168,7 @@ Akabei::Error::List RunnerWorker::runConcurrent(const QList< Operation* >& ops)
if (errors.isEmpty())
errors << Akabei::Error(Akabei::Error::UnknownError,
tr("An error occurred, but no further information was given."),
0);
nullptr);
return errors;
}
......@@ -211,7 +211,7 @@ void RunnerWorker::run()
RunnerRunnable::RunnerRunnable(const QHash<Operation::Phase, QList< Operation* > > &ops, ProcessingOptions processingOptions, QObject* parent)
: QObject(parent)
, m_operations(ops)
, m_worker(0)
, m_worker(nullptr)
, m_thread(new QThread())
{
s_options = processingOptions;
......
......@@ -24,7 +24,7 @@ class RunnerWorker : public QObject
{
Q_OBJECT
public:
explicit RunnerWorker(const OpsHash &ops, QObject* parent = 0);
explicit RunnerWorker(const OpsHash &ops, QObject* parent = nullptr);
virtual ~RunnerWorker();
Q_SIGNALS:
......@@ -57,7 +57,7 @@ class RunnerRunnable : public QObject
{
Q_OBJECT
public:
RunnerRunnable(const OpsHash &ops, ProcessingOptions processingOptions, QObject* parent = 0);
RunnerRunnable(const OpsHash &ops, ProcessingOptions processingOptions, QObject* parent = nullptr);
virtual ~RunnerRunnable();
RunnerWorker * worker();
......
......@@ -261,7 +261,7 @@ void ValidatorWorker::processNextPhase()
&loop, SLOT(requestQuit(QUuid,QList<Akabei::Package*>)));
loop.setUuid(Backend::instance()->queryPackages(queryFromName(dependency.first)));
loop.exec();
Package *package = 0;
Package *package = nullptr;
// Ok, we just need to install it. Let's loop the result and add the best target
foreach (Package *p, loop.result()) {
// Version constraint?
......@@ -435,7 +435,7 @@ ValidatorRunnable::ValidatorRunnable(const QHash<Operation::Phase, QList< Operat
: QObject()
, QRunnable()
, m_operations(ops)
, m_worker(0)
, m_worker(nullptr)
, m_thread(new QThread())
{
s_options = processingOptions;
......
......@@ -26,7 +26,7 @@ class ValidatorWorker : public QObject
{
Q_OBJECT
public:
explicit ValidatorWorker(const OpsHash &ops, QObject* parent = 0);
explicit ValidatorWorker(const OpsHash &ops, QObject* parent = nullptr);
virtual ~ValidatorWorker();
static OperationPrivate *operationPrivateProxy(Operation *op);
......@@ -69,7 +69,7 @@ class ValidatorRunnable : public QObject, public QRunnable
ValidatorWorker * worker();
void requestCancel();
void run();
void run() override;
Q_SIGNALS:
void ready();
......
......@@ -22,7 +22,7 @@ class GroupEventLoop : public QEventLoop
{
Q_OBJECT
public:
GroupEventLoop(QObject *parent = 0) : QEventLoop(parent) {}
GroupEventLoop(QObject *parent = nullptr) : QEventLoop(parent) {}
virtual ~GroupEventLoop() {}
void setUuid(const QUuid &uuid) {
......
......@@ -26,7 +26,7 @@
ArchiveEntry::ArchiveEntry(archive_entry *e)
: entry(archive_entry_clone(e))
{
if (entry == 0) {
if (entry == nullptr) {
throw ArchiveException("archive_entry_new() failed");
}
......@@ -41,14 +41,14 @@ ArchiveEntry::ArchiveEntry(ArchiveEntry const& other)
, fileSize( other.fileSize )
, fileName( other.fileName )
{
if (entry == 0) {
if (entry == nullptr) {
throw ArchiveException("archive_entry_clone() failed");
}
}
ArchiveEntry::~ArchiveEntry()
{
if (entry != 0) {
if (entry != nullptr) {
archive_entry_free(entry);
}
}
......@@ -262,7 +262,7 @@ QString ArchiveHandler::readTextFile(const QString& textFile)
*/
void ArchiveHandler::extractAll(const QString& pathPrefix, bool overwrite)
{
Akabei::ExtractAllFunctor extractor(pathPrefix, overwrite, 0, (*this));
Akabei::ExtractAllFunctor extractor(pathPrefix, overwrite, nullptr, (*this));
handleEntries(extractor);
}
......@@ -443,7 +443,7 @@ QByteArray ArchiveHandler::md5(const QString& file)
*/
QList< QByteArray > ArchiveHandler::md5(const QStringList& files)
{
Akabei::Md5Functor hasher(files, 0, (*this));
Akabei::Md5Functor hasher(files, nullptr, (*this));
handleEntries(hasher);
if (!hasher.skipped().isEmpty()) {
......@@ -474,7 +474,7 @@ struct archive *ArchiveHandler::getArchive()
*/
void ArchiveHandler::checkForErrors()
{
if (archive == NULL) {
if (archive == nullptr) {
throw ArchiveException("Error creating archive object for operations");
}
}
......
......@@ -179,7 +179,7 @@ public:
{
}
virtual const char *what() const throw() {
virtual const char *what() const throw() override {
return message;
}
};
......
......@@ -47,7 +47,7 @@ class InstallFunctor : public EntryHandlerFunctor
{
public:
InstallFunctor(QMap<QString, QString> &, const QStringList &, Akabei::Operation *, ArchiveHandler &);
bool operator() (const ArchiveEntry &);
bool operator() (const ArchiveEntry &) override;
private:
QMap<QString, QString> &backupFiles;
......@@ -64,7 +64,7 @@ class ReinstallUpgradeFunctor : public EntryHandlerFunctor
{
public:
ReinstallUpgradeFunctor(QMap<QString, QString> &, const QStringList &, Akabei::Operation *, ArchiveHandler &);
bool operator() (const ArchiveEntry &);
bool operator() (const ArchiveEntry &) override;
private:
QMap<QString, QString> &backupFiles;
......@@ -81,7 +81,7 @@ class ExtractAllFunctor : public EntryHandlerFunctor
{
public:
ExtractAllFunctor(QString, bool, Akabei::Operation *, ArchiveHandler &);
bool operator() (const ArchiveEntry &);
bool operator() (const ArchiveEntry &) override;
private:
QString pathPrefix;
......@@ -97,7 +97,7 @@ class Md5Functor : public EntryHandlerFunctor
{
public:
Md5Functor(QStringList, Akabei::Operation *, ArchiveHandler &);
bool operator() (const ArchiveEntry &);
bool operator() (const ArchiveEntry &) override;
QList<QByteArray> result();
QStringList skipped();
......
......@@ -27,7 +27,7 @@
class PolKitArchiveHandler::Private
{
public:
Private(const QString &file, PolKitArchiveHandler * parent) : filename(file), readLocally(true), handler(0), q(parent) {
Private(const QString &file, PolKitArchiveHandler * parent) : filename(file), readLocally(true), handler(nullptr), q(parent) {
readLocally = Akabei::Helpers::permissionsOfPath(file).testFlag(Akabei::Helpers::ReadPermission);//We check whether we have at least read access to the archive
handler = new ArchiveHandler(file);
......
......@@ -28,7 +28,7 @@ public:
* @param path the archive pathname.
* @throw ArchiveException if something goes wrong while reading the archive.
*/
PolKitArchiveHandler(const QString &, QObject * parent = 0);
PolKitArchiveHandler(const QString &, QObject * parent = nullptr);
virtual ~PolKitArchiveHandler();
QString filename() const;
......
......@@ -23,7 +23,7 @@ namespace Akabei {
class PlainHookOperation::Private
{
public:
Private(PlainHookOperation * op) : q(op), pro(0) {}
Private(PlainHookOperation * op) : q(op), pro(nullptr) {}
~Private() {}