Commit 075989dc authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_NULLPTR when possible

parent 85dd7880
......@@ -91,7 +91,7 @@ public Q_SLOTS:
class InspectableETM: public EntityTreeModel
{
public:
explicit InspectableETM(ChangeRecorder *monitor, QObject *parent = 0)
explicit InspectableETM(ChangeRecorder *monitor, QObject *parent = Q_NULLPTR)
: EntityTreeModel(monitor, parent) {}
EntityTreeModelPrivate *etmPrivate()
{
......
......@@ -31,7 +31,7 @@ class FakeJob : public Job
{
Q_OBJECT
public:
explicit FakeJob(QObject *parent = 0) : Job(parent) {}
explicit FakeJob(QObject *parent = Q_NULLPTR) : Job(parent) {}
void done()
{
emitResult();
......
......@@ -24,7 +24,7 @@ class TagSelectWidgetTest : public QObject
{
Q_OBJECT
public:
explicit TagSelectWidgetTest(QObject *parent = 0);
explicit TagSelectWidgetTest(QObject *parent = Q_NULLPTR);
~TagSelectWidgetTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
......
......@@ -37,7 +37,7 @@ class FakeClient : public QThread
public:
FakeClient(QObject *parent = 0);
FakeClient(QObject *parent = Q_NULLPTR);
~FakeClient();
void setScenarios(const TestScenario::List &scenarios);
......
......@@ -32,8 +32,8 @@ class FakeConnection : public Connection
Q_OBJECT
public:
FakeConnection(quintptr socketDescriptor, QObject *parent = 0);
FakeConnection(QObject *parent = 0);
FakeConnection(quintptr socketDescriptor, QObject *parent = Q_NULLPTR);
FakeConnection(QObject *parent = Q_NULLPTR);
virtual ~FakeConnection();
DataStore *storageBackend() Q_DECL_OVERRIDE;
......
......@@ -91,7 +91,7 @@ public:
virtual void activeCachePolicy(Collection &col) Q_DECL_OVERRIDE;
virtual bool appendMimeType(const QString &mimetype,
qint64 *insertId = 0) Q_DECL_OVERRIDE;
qint64 *insertId = Q_NULLPTR) Q_DECL_OVERRIDE;
virtual bool appendPimItem(QVector<Part> &parts,
const MimeType &mimetype,
const Collection &collection,
......
......@@ -33,7 +33,7 @@ class FakeSearchManager : public SearchManager
Q_OBJECT
public:
explicit FakeSearchManager(QObject *parent = 0);
explicit FakeSearchManager(QObject *parent = Q_NULLPTR);
virtual ~FakeSearchManager();
void registerInstance(const QString &id) Q_DECL_OVERRIDE;
......
......@@ -38,7 +38,7 @@ class AgentServer : public QObject
typedef QPair<QString, qlonglong> ConfigureInfo;
public:
explicit AgentServer(QObject *parent = 0);
explicit AgentServer(QObject *parent = Q_NULLPTR);
~AgentServer();
public Q_SLOTS:
......
......@@ -39,7 +39,7 @@ public:
* @param factory The factory object that creates the agent instance.
* @param parent The parent object.
*/
AgentThread(const QString &identifier, QObject *factory, QObject *parent = 0);
AgentThread(const QString &identifier, QObject *factory, QObject *parent = Q_NULLPTR);
/**
* Configures the agent.
......
......@@ -53,7 +53,7 @@ public:
*
* @param parent The parent object.
*/
AgentManager(bool verbose, QObject *parent = 0);
AgentManager(bool verbose, QObject *parent = Q_NULLPTR);
/**
* Destroys the agent manager.
......
......@@ -34,7 +34,7 @@ public:
/**
* Creates a new control manager.
*/
ControlManager(QObject *parent = 0);
explicit ControlManager(QObject *parent = Q_NULLPTR);
/**
* Destroys the control manager.
......
......@@ -51,7 +51,7 @@ public:
*
* @param parent The parent object.
*/
ProcessControl(QObject *parent = 0);
explicit ProcessControl(QObject *parent = Q_NULLPTR);
/**
* Destroys the process control.
......
......@@ -26,7 +26,7 @@ class AkonadiStarter : public QObject
{
Q_OBJECT
public:
explicit AkonadiStarter(QObject *parent = 0);
explicit AkonadiStarter(QObject *parent = Q_NULLPTR);
bool start(bool verbose);
private Q_SLOTS:
......
......@@ -32,7 +32,7 @@ class Session : public QObject
{
Q_OBJECT
public:
explicit Session(const QString &input, QObject *parent = 0);
explicit Session(const QString &input, QObject *parent = Q_NULLPTR);
~Session();
void printStats() const;
......
......@@ -43,7 +43,7 @@ public:
* @param relation The relation to create.
* @param parent The parent object.
*/
explicit RelationCreateJob(const Relation &relation, QObject *parent = 0);
explicit RelationCreateJob(const Relation &relation, QObject *parent = Q_NULLPTR);
/**
* Returns the relation.
......
......@@ -43,7 +43,7 @@ public:
* @param relation The relation to delete.
* @param parent The parent object.
*/
explicit RelationDeleteJob(const Relation &relation, QObject *parent = 0);
explicit RelationDeleteJob(const Relation &relation, QObject *parent = Q_NULLPTR);
/**
* Returns the relation.
......
......@@ -44,9 +44,9 @@ public:
* @param relation The relation to fetch.
* @param parent The parent object.
*/
explicit RelationFetchJob(const Relation &relation, QObject *parent = 0);
explicit RelationFetchJob(const Relation &relation, QObject *parent = Q_NULLPTR);
explicit RelationFetchJob(const QVector<QByteArray> &types, QObject *parent = 0);
explicit RelationFetchJob(const QVector<QByteArray> &types, QObject *parent = Q_NULLPTR);
void setResource(const QString &identifier);
......
......@@ -54,7 +54,7 @@ public:
explicit PasteHelperJob(Qt::DropAction action, const Akonadi::Item::List &items,
const Akonadi::Collection::List &collections,
const Akonadi::Collection &destination,
QObject *parent = 0);
QObject *parent = Q_NULLPTR);
virtual ~PasteHelperJob();
private Q_SLOTS:
......
......@@ -30,7 +30,7 @@ class AKONADICORE_EXPORT RelationSync : public Akonadi::Job
{
Q_OBJECT
public:
RelationSync(QObject *parent = 0);
RelationSync(QObject *parent = Q_NULLPTR);
virtual ~RelationSync();
void setRemoteRelations(const Akonadi::Relation::List &relations);
......
......@@ -31,7 +31,7 @@ class AKONADICORE_EXPORT TagSync : public Akonadi::Job
{
Q_OBJECT
public:
TagSync(QObject *parent = 0);
TagSync(QObject *parent = Q_NULLPTR);
virtual ~TagSync();
void setFullTagList(const Akonadi::Tag::List &tags);
......
......@@ -60,7 +60,7 @@ public:
{
}
explicit PluginEntry(const QString &identifier, QObject *plugin = 0)
explicit PluginEntry(const QString &identifier, QObject *plugin = Q_NULLPTR)
: mIdentifier(identifier)
, mPlugin(plugin)
{
......
......@@ -60,8 +60,8 @@ class QSQLiteDriver : public QSqlDriver
Q_OBJECT
friend class QSQLiteResult;
public:
explicit QSQLiteDriver(QObject *parent = 0);
explicit QSQLiteDriver(sqlite3 *connection, QObject *parent = 0);
explicit QSQLiteDriver(QObject *parent = Q_NULLPTR);
explicit QSQLiteDriver(sqlite3 *connection, QObject *parent = Q_NULLPTR);
~QSQLiteDriver();
bool hasFeature(DriverFeature f) const;
bool open(const QString & db,
......
......@@ -30,7 +30,7 @@ class BridgeConnection : public QObject
Q_OBJECT
public:
explicit BridgeConnection(QTcpSocket *remoteSocket, QObject *parent = 0);
explicit BridgeConnection(QTcpSocket *remoteSocket, QObject *parent = Q_NULLPTR);
~BridgeConnection();
protected Q_SLOTS:
......@@ -52,7 +52,7 @@ class AkonadiBridgeConnection : public BridgeConnection
Q_OBJECT
public:
explicit AkonadiBridgeConnection(QTcpSocket *remoteSocket, QObject *parent = 0);
explicit AkonadiBridgeConnection(QTcpSocket *remoteSocket, QObject *parent = Q_NULLPTR);
protected:
void connectLocal() Q_DECL_OVERRIDE;
......@@ -63,7 +63,7 @@ class DBusBridgeConnection : public BridgeConnection
Q_OBJECT
public:
explicit DBusBridgeConnection(QTcpSocket *remoteSocket, QObject *parent = 0);
explicit DBusBridgeConnection(QTcpSocket *remoteSocket, QObject *parent = Q_NULLPTR);
protected:
void connectLocal() Q_DECL_OVERRIDE;
......
......@@ -28,7 +28,7 @@ class BridgeServerBase : public QObject
Q_OBJECT
public:
explicit BridgeServerBase(quint16 port, QObject *parent = 0);
explicit BridgeServerBase(quint16 port, QObject *parent = Q_NULLPTR);
protected Q_SLOTS:
virtual void slotNewConnection() = 0;
......@@ -41,7 +41,7 @@ template <typename ConnectionType>
class BridgeServer : public BridgeServerBase
{
public:
explicit BridgeServer(quint16 port, QObject *parent = 0)
explicit BridgeServer(quint16 port, QObject *parent = Q_NULLPTR)
: BridgeServerBase(port, parent)
{
}
......
......@@ -79,7 +79,7 @@ private:
void stopDatabaseProcess();
protected:
AkonadiServer(QObject *parent = 0);
AkonadiServer(QObject *parent = Q_NULLPTR);
CacheCleaner *mCacheCleaner;
IntervalCheck *mIntervalCheck;
......
......@@ -67,7 +67,7 @@ public:
Creates a new cache cleaner thread.
@param parent The parent object.
*/
CacheCleaner(QObject *parent = 0);
CacheCleaner(QObject *parent = Q_NULLPTR);
~CacheCleaner();
protected:
......
......@@ -39,7 +39,7 @@ class PauseableTimer : public QTimer
Q_OBJECT
public:
PauseableTimer(QObject *parent = 0)
PauseableTimer(QObject *parent = Q_NULLPTR)
: QTimer(parent)
{
}
......
......@@ -39,7 +39,7 @@ class CollectionScheduler : public AkThread
Q_OBJECT
public:
CollectionScheduler(QThread::Priority priority, QObject *parent = 0);
CollectionScheduler(QThread::Priority priority, QObject *parent = Q_NULLPTR);
virtual ~CollectionScheduler();
void collectionChanged(qint64 collectionId);
......
......@@ -154,7 +154,7 @@ Connection::~Connection()
void Connection::slotConnectionIdle()
{
Q_ASSERT(m_currentHandler == 0);
Q_ASSERT(m_currentHandler == Q_NULLPTR);
if (m_backend && m_backend->isOpened() ) {
if (m_backend->inTransaction()) {
// This is a programming error, the timer should not have fired.
......
......@@ -49,7 +49,7 @@ class Connection : public AkThread
{
Q_OBJECT
public:
Connection(quintptr socketDescriptor, QObject *parent = 0);
Connection(quintptr socketDescriptor, QObject *parent = Q_NULLPTR);
virtual ~Connection();
virtual DataStore *storageBackend();
......@@ -93,7 +93,7 @@ protected Q_SLOTS:
void slotSendHello();
protected:
Connection(QObject *parent = 0); // used for testing
Connection(QObject *parent = Q_NULLPTR); // used for testing
virtual void init() Q_DECL_OVERRIDE;
virtual void quit() Q_DECL_OVERRIDE;
......
......@@ -34,7 +34,7 @@ class DebugInterface : public QObject
Q_CLASSINFO("D-Bus Interface", "org.freedesktop.Akonadi.DebugInterface")
public:
explicit DebugInterface(QObject *parent = 0);
explicit DebugInterface(QObject *parent = Q_NULLPTR);
public Q_SLOTS:
Q_SCRIPTABLE QString tracer() const;
......
......@@ -36,7 +36,7 @@ class IntervalCheck : public CollectionScheduler
Q_OBJECT
public:
IntervalCheck(QObject *parent = 0);
IntervalCheck(QObject *parent = Q_NULLPTR);
~IntervalCheck();
/**
......
......@@ -37,7 +37,7 @@ public:
static ResourceManager *self();
private:
ResourceManager(QObject *parent = 0);
ResourceManager(QObject *parent = Q_NULLPTR);
public Q_SLOTS:
void addResourceInstance(const QString &name, const QStringList &capabilities);
......
......@@ -53,7 +53,7 @@ class SearchManager : public AkThread
public:
/** Create a new search manager with the given @p searchEngines. */
explicit SearchManager(const QStringList &searchEngines, QObject *parent = 0);
explicit SearchManager(const QStringList &searchEngines, QObject *parent = Q_NULLPTR);
~SearchManager();
......
......@@ -62,7 +62,7 @@ public:
/**
Returns an initializer instance for a given backend.
*/
static DbInitializer::Ptr createInstance(const QSqlDatabase &database, Schema *schema = 0);
static DbInitializer::Ptr createInstance(const QSqlDatabase &database, Schema *schema = Q_NULLPTR);
/**
* Destroys the database initializer.
......
......@@ -44,7 +44,7 @@ class ItemRetrievalManager : public AkThread
{
Q_OBJECT
public:
ItemRetrievalManager(QObject *parent = 0);
ItemRetrievalManager(QObject *parent = Q_NULLPTR);
~ItemRetrievalManager();
void requestItemDelivery(qint64 uid, const QByteArray &remoteId, const QByteArray &mimeType,
......
......@@ -48,7 +48,7 @@ public:
Create a new notification collector that is not attached to
a DataStore and just collects notifications until you emit them manually.
*/
NotificationCollector(QObject *parent = 0);
NotificationCollector(QObject *parent = Q_NULLPTR);
/**
Create a new notification collector for the given DataStore @p db.
......
......@@ -55,7 +55,7 @@ void update(Part *part, const QByteArray &data, qint64 dataSize);
* @p part must not be in the database yet (ie. valid() == false) and must have
* a data size set.
*/
bool insert(Part *part, qint64 *insertId = 0);
bool insert(Part *part, qint64 *insertId = Q_NULLPTR);
/** Deletes @p part from the database and also removes existing filesystem data if needed. */
bool remove(Part *part);
......
......@@ -43,11 +43,11 @@ class PartStreamer : public QObject
Q_OBJECT
public:
explicit PartStreamer(Connection *connection, const PimItem &pimItem, QObject *parent = 0);
explicit PartStreamer(Connection *connection, const PimItem &pimItem, QObject *parent = Q_NULLPTR);
~PartStreamer();
bool stream(bool checkExists, const QByteArray &partName, qint64 &partSize, bool *changed = 0);
bool streamAttribute(bool checkExists, const QByteArray &partName, const QByteArray &value, bool *changed = 0);
bool stream(bool checkExists, const QByteArray &partName, qint64 &partSize, bool *changed = Q_NULLPTR);
bool streamAttribute(bool checkExists, const QByteArray &partName, const QByteArray &value, bool *changed = Q_NULLPTR);
QString error() const;
......
......@@ -38,7 +38,7 @@ class StorageJanitor : public AkThread
Q_CLASSINFO("D-Bus Interface", "org.freedesktop.Akonadi.Janitor")
public:
explicit StorageJanitor(QObject *parent = 0);
explicit StorageJanitor(QObject *parent = Q_NULLPTR);
~StorageJanitor();
public Q_SLOTS:
......
......@@ -39,7 +39,7 @@ namespace Internal
class AgentTypeWidgetDelegate : public QAbstractItemDelegate
{
public:
AgentTypeWidgetDelegate(QObject *parent = 0);
AgentTypeWidgetDelegate(QObject *parent = Q_NULLPTR);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
......
......@@ -84,7 +84,7 @@ public:
*
* @param parent The parent widget.
*/
explicit CollectionDialog(QWidget *parent = 0);
explicit CollectionDialog(QWidget *parent = Q_NULLPTR);
/**
* Creates a new collection dialog with a custom @p model.
......@@ -97,7 +97,7 @@ public:
*
* @since 4.4
*/
explicit CollectionDialog(QAbstractItemModel *model, QWidget *parent = 0);
explicit CollectionDialog(QAbstractItemModel *model, QWidget *parent = Q_NULLPTR);
/**
* Creates a new collection dialog with a custom @p model.
......@@ -112,7 +112,7 @@ public:
* @since 4.6
*/
explicit CollectionDialog(CollectionDialogOptions options, QAbstractItemModel *model = 0, QWidget *parent = 0);
explicit CollectionDialog(CollectionDialogOptions options, QAbstractItemModel *model = 0, QWidget *parent = Q_NULLPTR);
/**
* Destroys the collection dialog.
......
......@@ -42,7 +42,7 @@ namespace Internal
class ControlProgressIndicator : public QFrame
{
public:
ControlProgressIndicator(QWidget *parent = 0)
ControlProgressIndicator(QWidget *parent = Q_NULLPTR)
: QFrame(parent)
{
setWindowModality(Qt::ApplicationModal);
......@@ -96,7 +96,7 @@ public:
delete mProgressIndicator;
}
void setupProgressIndicator(const QString &msg, QWidget *parent = 0)
void setupProgressIndicator(const QString &msg, QWidget *parent = Q_NULLPTR)
{
if (!mProgressIndicator) {
mProgressIndicator = new Internal::ControlProgressIndicator(parent);
......
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