Commit 963a09fa authored by Luca Giambonini's avatar Luca Giambonini
parents 63e495fa d90f945c
project(akabeicore)
cmake_minimum_required(VERSION 2.6.0)
cmake_minimum_required(VERSION 3.0.0)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
# Compiles with debugging symbols (Debug mode)
......@@ -8,25 +8,31 @@ if (CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS_DEBUG "-ggdb")
endif(CMAKE_COMPILER_IS_GNUCC)
# https://cmake.org/cmake/help/v3.0/policy/CMP0003.html
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
# KF5 global definitions, use them to be compatible with KF5 applications
add_definitions(#-DQT_NO_CAST_TO_ASCII
#-DQT_NO_CAST_FROM_ASCII
-DQT_NO_URL_CAST_FROM_STRING
-DQT_NO_CAST_FROM_BYTEARRAY
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
-DQT_USE_FAST_OPERATOR_PLUS
-DQT_USE_QSTRINGBUILDER
)
set(MAJOR_AKABEI_VERSION 0 CACHE INT "Akabei’s major version number" FORCE)
set(MINOR_AKABEI_VERSION 0 CACHE INT "Akabei’s minor version number" FORCE)
set(PATCH_AKABEI_VERSION 1 CACHE INT "Akabei’s patch version number" FORCE)
set(FIX_AKABEI_VERSION 0 CACHE INT "Akabei’s fix version number" FORCE)
set(AKABEI_VERSION_STRING "${MAJOR_AKABEI_VERSION}.${MINOR_AKABEI_VERSION}.${PATCH_AKABEI_VERSION}.${FIX_AKABEI_VERSION}")
# requires minimal Qt 4.4
set(QT_MIN_VERSION "4.4.0")
find_package(Qt4 REQUIRED)
find_package(Qt5 5.2.0 REQUIRED CONFIG COMPONENTS Core Test Network Concurrent DBus Widgets)
find_package(LibArchive REQUIRED)
find_package(Sqlite REQUIRED)
find_package(PolkitQt-1 REQUIRED)
INCLUDE(${QT_USE_FILE})
find_package(PolkitQt5-1 REQUIRED)
add_definitions(${QT_DEFINITIONS} -W -Wall)
add_definitions(-Werror)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -167,8 +167,7 @@ if(DOXYGEN_FOUND AND DOXYFILE_IN_FOUND)
configure_file("${DOXYFILE_IN}" "${DOXYFILE}" @ONLY)
get_target_property(DOC_TARGET doc TYPE)
if(NOT DOC_TARGET)
if(NOT TARGET doc)
add_custom_target(doc)
endif()
......
......@@ -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;
}
......
......@@ -92,26 +92,19 @@ operations/akabeiplainhookoperation.h
operations/akabeioperationutils.h
)
qt4_automoc(${AKABEI_CORE_SRCS})
qt4_automoc(${AKABEI_OPERATION_SRCS})
# There are some files which are not detected by automoc, add them
qt4_wrap_cpp(AKABEI_MISSING_MOCS
akabeibackend_p.h
akabeihelpers_p.h
operations/akabeiplainscriptletoperation_p.h
)
add_library(akabeicore SHARED ${AKABEI_CORE_SRCS} ${AKABEI_OPERATION_SRCS} ${AKABEI_MISSING_MOCS})
set_target_properties(akabeicore PROPERTIES AUTOMOC TRUE)
set_target_properties(akabeicore PROPERTIES VERSION ${MAJOR_AKABEI_VERSION}.${MINOR_AKABEI_VERSION}.${PATCH_AKABEI_VERSION}
SOVERSION ${MAJOR_AKABEI_VERSION})
target_link_libraries(akabeicore
${QT_QTCORE_LIBRARY}
${LIBARCHIVE_LIBRARY}
${SQLITE_LIBRARIES}
${QT_QTDBUS_LIBRARY}
${POLKITQT-1_LIBRARIES})
target_link_libraries(akabeicore Qt5::Core
Qt5::DBus
Qt5::Concurrent
${LIBARCHIVE_LIBRARY}
${SQLITE_LIBRARIES}
${POLKITQT-1_LIBRARIES})
install(TARGETS akabeicore DESTINATION ${LIB_INSTALL_DIR})
install(FILES ${AKABEI_CORE_HDRS} DESTINATION ${INCLUDES_INSTALL_DIR})
......
......@@ -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,13 +213,13 @@ 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)) {
case SQLITE_TEXT:
ptr = sqlite3_column_text(statement, i);
record.setValue(QString::fromAscii(reinterpret_cast<const char *>(ptr)));
record.setValue(QString::fromLatin1(reinterpret_cast<const char *>(ptr)));
break;
case SQLITE_INTEGER:
......
......@@ -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 )
{
}
......@@ -532,7 +532,7 @@ Backend::Backend(QObject* parent)
qRegisterMetaType< Akabei::Backend::Status >();
qDBusRegisterMetaType< QList< QVariantMap > >();
qInstallMsgHandler(akabeiDebug);
qInstallMessageHandler(akabeiDebug);
// We need at least 2 threads in QThreadPool to make everything work correctly.
if (QThreadPool::globalInstance()->maxThreadCount() < 2) {
......@@ -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") );
......@@ -1003,4 +1003,4 @@ Hook* Backend::loadHookFromFile(const QString& path, QList<Package*> pkgs)
}
#include "akabeibackend.moc"
#include "moc_akabeibackend.cpp"
......@@ -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);
......@@ -109,7 +109,7 @@ class BackendPrivate : public QObject
QDBusInterface * iface;
public slots:
public Q_SLOTS:
void packageQueryFinished();
void groupQueryFinished();
void orphanQueryFinished();
......
......@@ -61,7 +61,7 @@ class Config::Private
class ConfigHelper
{
public:
ConfigHelper() : q(0) {}
ConfigHelper() : q(nullptr) {}
~ConfigHelper() {
delete q;
}
......
......@@ -13,6 +13,7 @@
#include <qglobal.h>
#include <QUrl>
#include <QString>
#if defined(AKABEICORE_LIBRARY)
# define AKABEICORESHARED_EXPORT Q_DECL_EXPORT
......@@ -125,12 +126,12 @@ namespace Hooks {
}
const QUrl DEFAULT_DATABASE_DIR("/var/lib/akabei");
const QUrl DEFAULT_CACHE_DIR("/var/cache/akabei/pkg");
const QUrl DEFAULT_DATABASE_DIR(QLatin1String("/var/lib/akabei"));
const QUrl DEFAULT_CACHE_DIR(QLatin1String("/var/cache/akabei/pkg"));
const QString errorPrefix = ":: ";
const QString packageExtension = ".tar.xz";
const QString signatureExtension = ".sig";
const QString errorPrefix = QLatin1String(":: ");
const QString packageExtension = QLatin1String(".tar.xz");
const QString signatureExtension = QLatin1String(".sig");
enum ProcessingOption
{
......
......@@ -15,34 +15,29 @@ QDebug akabeiDebug()
return qDebug();
}
void akabeiDebug(QtMsgType type, const char *msg)
{
void akabeiDebug(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
Q_UNUSED(context);
QTextStream out( stdout );
QTextStream err( stderr );
if (Akabei::Config::instance()->debug()) { /* only prints if the "--debug" option is set */
switch (type) {
case QtDebugMsg: {
case QtDebugMsg:
out << "Akabei - Debug: " << msg << endl;
break;
}
case QtWarningMsg: {
case QtInfoMsg:
out << "Akabei - Info: " << msg << endl;
break;
case QtWarningMsg:
err << "Akabei - Warning: " << msg << endl;
break;
}
case QtCriticalMsg: {
case QtCriticalMsg:
err << "Akabei - Critical: " << msg << endl;
break;
}
case QtFatalMsg: {
case QtFatalMsg:
err << "Akabei - Fatal: " << msg << endl;
break;
}
default:
break;
}
......
......@@ -11,12 +11,13 @@
#define AKABEIDEBUG_H
#include <QDebug>
#include <QMessageLogContext>
#include <akabeicore_global.h>
/**
* Akabei Qt message handler (for qDebug(), qWarning(), ...)
*/
void akabeiDebug(QtMsgType, const char *);
void akabeiDebug(QtMsgType, const QMessageLogContext &, const QString &);
/*
* This is a workaround to avoid changing all the akabeiDebug() calls back into qDebug() calls
......
......@@ -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();
......
......@@ -158,7 +158,7 @@ int compare_versions(QString const& a, QString const& b)
if (!conversion1 || !conversion2) {
for (int i = 0; i != i1->length(); ++i) {
if (i2->length() > i && i1->at(i) != i2->at(i))
return i1->at(i).toAscii() > i2->at(i).toAscii() ? 1 : -1;
return i1->at(i).toLatin1() > i2->at(i).toLatin1() ? 1 : -1;
p1 = i1->mid(i + 1).toInt(&conversion1);
p2 = i2->mid(i + 1).toInt(&conversion2);
......@@ -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)) {
......@@ -918,9 +918,9 @@ int QueryPerformer::insertDelta(AbstractSQLiteConnection& dbConnection, Akabei::
try {
dbConnection.bind(":Package", packageId);
dbConnection.bind(":Filename", delta->filename());
dbConnection.bind(":VersionFrom", QString::fromAscii(delta->versionFrom()));
dbConnection.bind(":VersionTo", QString::fromAscii(delta->versionTo()));
dbConnection.bind(":MD5SUM", QString::fromAscii(delta->md5sum()));
dbConnection.bind(":VersionFrom", QString::fromLatin1(delta->versionFrom()));
dbConnection.bind(":VersionTo", QString::fromLatin1(delta->versionTo()));
dbConnection.bind(":MD5SUM", QString::fromLatin1(delta->md5sum()));
dbConnection.query(QString("INSERT INTO deltas (`package`, `filename`, `versionfrom`, `versionto`, `md5sum`) "
"VALUES (:Package, :Filename, :VersionFrom, :VersionTo, :MD5SUM);"));
} catch (SQLiteException& ex) {
......@@ -1264,5 +1264,4 @@ int QueryPerformer::removeScriptlet(AbstractSQLiteConnection &dbConnection, int
}
}
#include "akabeihelpers.moc"
#include "moc_akabeihelpers.cpp"
......@@ -138,14 +138,14 @@ 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);
QList<Akabei::Package*> result() const;
public slots:
public Q_SLOTS:
void requestQuit(const QUuid &uuid, const QList<Akabei::Package*> &result);
private:
......
......@@ -30,12 +30,12 @@ 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();
public slots:
public Q_SLOTS:
virtual void quit(PolkitQt1::Authority::Result res);
private:
......
......@@ -25,7 +25,7 @@ class HookPrivate {
: name(n)
, content(c)
, packages(pkgs)
, file(0)
, file(nullptr)
, mutex(new QReadWriteLock())
{}
......
......@@ -194,7 +194,7 @@ AkabeiLogLine& AkabeiLogLine::operator<<(bool b)
AkabeiLogLine& AkabeiLogLine::operator<<(char ch)
{
d->data.append( QChar::fromAscii(ch) );
d->data.append( QChar(ch).toLatin1() );
return *this;
}
......
......@@ -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))
{
}
......@@ -331,4 +331,4 @@ void Operation::setEta(int eta)
}
#include "akabeioperation.moc"
#include "moc_akabeioperation.cpp"
......@@ -13,11 +13,11 @@
#include <akabeioperation.h>
#include <QWeakPointer>
#include <QHash>
#include <QMetaObject>
#include <QUuid>
#include <QStringList>
#include <QPointer>
class QEventLoop;
namespace Akabei {
......@@ -59,8 +59,8 @@ public:
Operation::List preOps;
Operation::List postOps;
QWeakPointer<QEventLoop> validateLoop;
QWeakPointer<QEventLoop> runLoop;
QPointer<QEventLoop> validateLoop;