Verified Commit a1519ed8 authored by Jonah Brüchert's avatar Jonah Brüchert 🌳
Browse files

Use nullptr everywhere


Reviewed-by: Alexander Akulich's avatarAlexander Akulich <akulichalexander@gmail.com>
parent aaabe232
......@@ -23,7 +23,7 @@
ContactPin::ContactPin(QObject *parent)
: QObject(parent)
, m_model(0)
, m_model(nullptr)
{
}
......
......@@ -33,7 +33,7 @@ class ContactPin : public QObject
Q_PROPERTY(bool pinned READ isPinned NOTIFY pinnedChanged)
public:
explicit ContactPin(QObject *parent = 0);
explicit ContactPin(QObject *parent = nullptr);
KTp::ContactPtr contact() const;
Tp::AccountPtr account() const;
......
......@@ -35,7 +35,7 @@ class Conversation::ConversationPrivate
public:
ConversationPrivate()
{
messages = 0;
messages = nullptr;
delegated = false;
valid = false;
isGroupChat = false;
......@@ -201,7 +201,7 @@ Tp::Account* Conversation::accountObject() const
return d->account.data();
}
return 0;
return nullptr;
}
bool Conversation::isValid() const
......
......@@ -48,8 +48,8 @@ class Conversation : public QObject
Q_PROPERTY(bool canSendMessages READ canSendMessages NOTIFY canSendMessagesChanged)
public:
Conversation(const Tp::TextChannelPtr &channel, const Tp::AccountPtr &account, QObject *parent = 0);
Conversation(const QString &contactId, const Tp::AccountPtr &account, QObject *parent = 0);
Conversation(const Tp::TextChannelPtr &channel, const Tp::AccountPtr &account, QObject *parent = nullptr);
Conversation(const QString &contactId, const Tp::AccountPtr &account, QObject *parent = nullptr);
~Conversation() override;
void setTextChannel(const Tp::TextChannelPtr &channel);
......
......@@ -34,7 +34,7 @@ class ConversationsModel : public QAbstractListModel, public Tp::AbstractClientH
Q_PROPERTY(int activeChatIndex READ activeChatIndex NOTIFY activeChatIndexChanged)
public:
explicit ConversationsModel(QObject *parent = 0);
explicit ConversationsModel(QObject *parent = nullptr);
~ConversationsModel() override;
QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
......
......@@ -26,7 +26,7 @@ class FilteredPinnedContactsProxyModel : public QSortFilterProxyModel
Q_OBJECT
Q_PROPERTY(QAbstractItemModel* sourceModel READ sourceModel WRITE setSourceModel)
public:
FilteredPinnedContactsProxyModel(QObject* parent = 0);
FilteredPinnedContactsProxyModel(QObject* parent = nullptr);
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override;
};
......
......@@ -92,7 +92,7 @@ public:
};
Q_ENUMS(Role)
MainLogModel(QObject *parent = 0);
MainLogModel(QObject *parent = nullptr);
~MainLogModel() override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
......
......@@ -37,7 +37,7 @@ class MessagesModel : public QAbstractListModel
Q_PROPERTY(bool shouldStartOpened READ shouldStartOpened CONSTANT)
public:
MessagesModel(const Tp::AccountPtr &account, QObject *parent = 0);
MessagesModel(const Tp::AccountPtr &account, QObject *parent = nullptr);
~MessagesModel() override;
enum Roles {
......
......@@ -38,7 +38,7 @@
class PinnedContactsModelPrivate {
public:
PinnedContactsModelPrivate() {
conversations = 0;
conversations = nullptr;
}
QList<KTp::PersistentContactPtr> m_pins;
......
......@@ -37,7 +37,7 @@ class PinnedContactsModel : public QAbstractListModel
Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
public:
explicit PinnedContactsModel(QObject *parent = 0);
explicit PinnedContactsModel(QObject *parent = nullptr);
~PinnedContactsModel() override;
enum role {
......
......@@ -47,7 +47,7 @@ class TelepathyManager : public QObject
Q_PROPERTY(bool ready READ isReady NOTIFY ready)
public:
TelepathyManager(QObject *parent=0);
TelepathyManager(QObject *parent=nullptr);
~TelepathyManager() override;
/** Returns the account manager*/
......
......@@ -48,7 +48,7 @@ class KTPCOMMONINTERNALS_EXPORT AbstractLoggerPlugin : public QObject
/**
* Constructor.
*/
explicit AbstractLoggerPlugin(QObject *parent = 0);
explicit AbstractLoggerPlugin(QObject *parent = nullptr);
/**
* Destructor.
......
......@@ -37,7 +37,7 @@ using namespace KTp;
#define KTP_LOGGER_PLUGIN_VERSION "1"
LogManager* LogManager::Private::s_logManagerInstance = 0;
LogManager* LogManager::Private::s_logManagerInstance = nullptr;
void LogManager::Private::loadPlugins()
{
......@@ -71,7 +71,7 @@ LogManager::Private::Private(LogManager *parent):
LogManager* LogManager::instance()
{
if (Private::s_logManagerInstance == 0) {
if (Private::s_logManagerInstance == nullptr) {
Private::s_logManagerInstance = new LogManager();
}
......
......@@ -29,7 +29,7 @@ class PendingLoggerDatesImpl : public KTp::PendingLoggerDates
public:
explicit PendingLoggerDatesImpl(const Tp::AccountPtr &account,
const KTp::LogEntity &entity,
QObject* parent = 0);
QObject* parent = nullptr);
~PendingLoggerDatesImpl() override;
private Q_SLOTS:
......
......@@ -69,7 +69,7 @@ class KTPCOMMONINTERNALS_EXPORT PendingLoggerDates : public KTp::PendingLoggerOp
protected:
explicit PendingLoggerDates(const Tp::AccountPtr &account,
const KTp::LogEntity &entity,
QObject *parent = 0);
QObject *parent = nullptr);
void setDates(const QList<QDate> &dates);
......
......@@ -28,7 +28,7 @@ class PendingLoggerEntitiesImpl: public KTp::PendingLoggerEntities
public:
explicit PendingLoggerEntitiesImpl(const Tp::AccountPtr &account,
QObject *parent = 0);
QObject *parent = nullptr);
~PendingLoggerEntitiesImpl() override;
private Q_SLOTS:
......
......@@ -60,7 +60,7 @@ class KTPCOMMONINTERNALS_EXPORT PendingLoggerEntities : public KTp::PendingLogge
QList<KTp::LogEntity> entities() const;
protected:
explicit PendingLoggerEntities(const Tp::AccountPtr &account, QObject* parent = 0);
explicit PendingLoggerEntities(const Tp::AccountPtr &account, QObject* parent = nullptr);
void appendEntities(const QList<KTp::LogEntity> &entities);
void appendEntity(const KTp::LogEntity &entity);
......
......@@ -30,7 +30,7 @@ class PendingLoggerLogsImpl : public KTp::PendingLoggerLogs
explicit PendingLoggerLogsImpl(const Tp::AccountPtr &account,
const KTp::LogEntity &entity,
const QDate &date,
QObject *parent = 0);
QObject *parent = nullptr);
~PendingLoggerLogsImpl() override;
private Q_SLOTS:
......
......@@ -74,7 +74,7 @@ class KTPCOMMONINTERNALS_EXPORT PendingLoggerLogs : public KTp::PendingLoggerOpe
explicit PendingLoggerLogs(const Tp::AccountPtr &account,
const KTp::LogEntity &entity,
const QDate &date,
QObject* parent = 0);
QObject* parent = nullptr);
void appendLogs(const QList<KTp::LogMessage> &logs);
......
......@@ -42,7 +42,7 @@ class KTPCOMMONINTERNALS_EXPORT PendingLoggerOperation : public QObject
void finished(KTp::PendingLoggerOperation *self);
protected:
explicit PendingLoggerOperation(QObject *parent = 0);
explicit PendingLoggerOperation(QObject *parent = nullptr);
void setError(const QString &error);
void emitFinished();
......
......@@ -31,7 +31,7 @@ class PendingLoggerSearchImpl : public KTp::PendingLoggerSearch
Q_OBJECT
public:
explicit PendingLoggerSearchImpl(const QString& term, QObject* parent = 0);
explicit PendingLoggerSearchImpl(const QString& term, QObject* parent = nullptr);
~PendingLoggerSearchImpl() override;
......
......@@ -60,7 +60,7 @@ class KTPCOMMONINTERNALS_EXPORT PendingLoggerSearch : public KTp::PendingLogger
protected:
explicit PendingLoggerSearch(const QString &term,
QObject *parent = 0);
QObject *parent = nullptr);
void appendSearchHits(const QList<KTp::LogSearchHit> &searchHits);
void appendSearchHit(const KTp::LogSearchHit &searchHit);
......
......@@ -33,7 +33,7 @@ class PendingTpLoggerDates : public KTp::PendingLoggerDates
public:
explicit PendingTpLoggerDates(const Tp::AccountPtr &account,
const KTp::LogEntity &entity,
QObject *parent = 0);
QObject *parent = nullptr);
~PendingTpLoggerDates() override;
private Q_SLOTS:
......
......@@ -32,7 +32,7 @@ class PendingTpLoggerEntities : public KTp::PendingLoggerEntities
public:
explicit PendingTpLoggerEntities(const Tp::AccountPtr &account,
QObject *parent = 0);
QObject *parent = nullptr);
~PendingTpLoggerEntities() override;
private Q_SLOTS:
......
......@@ -34,7 +34,7 @@ class PendingTpLoggerLogs : public KTp::PendingLoggerLogs
explicit PendingTpLoggerLogs(const Tp::AccountPtr &account,
const KTp::LogEntity &entity,
const QDate &date,
QObject *parent = 0);
QObject *parent = nullptr);
~PendingTpLoggerLogs() override;
private Q_SLOTS:
......
......@@ -31,7 +31,7 @@ class PendingTpLoggerSearch : public KTp::PendingLoggerSearch
Q_OBJECT
public:
explicit PendingTpLoggerSearch(const QString& term, QObject* parent = 0);
explicit PendingTpLoggerSearch(const QString& term, QObject* parent = nullptr);
~PendingTpLoggerSearch() override;
private Q_SLOTS:
......
......@@ -25,7 +25,7 @@ Tpl::EntityPtr Utils::toTplEntity(const KTp::LogEntity &entity)
entity.entityType() == Tp::HandleTypeContact ?
Tpl::EntityTypeContact : Tpl::EntityTypeRoom,
entity.alias().toLatin1().constData(),
0);
nullptr);
}
KTp::LogEntity Utils::fromTplEntity(const Tpl::EntityPtr& entity)
......
......@@ -32,7 +32,7 @@ class KTPCOMMONINTERNALS_EXPORT ScrollbackManager : public QObject
Q_OBJECT
public:
explicit ScrollbackManager(QObject *parent = 0);
explicit ScrollbackManager(QObject *parent = nullptr);
~ScrollbackManager() override;
bool exists() const;
......
......@@ -244,7 +244,7 @@ void KTp::AbstractGroupingProxyModel::removeProxyNodes(const QModelIndex &source
d->proxyMap.remove(sourceIndex, proxy);
//if the parent item to this proxy node is now empty, and is a top level item
if (parentItem->rowCount() == 0 && parentItem->parent() == 0 ) {
if (parentItem->rowCount() == 0 && parentItem->parent() == nullptr ) {
GroupNode* groupNode = dynamic_cast<GroupNode*>(parentItem);
//do not delete forced groups
......
......@@ -52,7 +52,7 @@ public:
AccountRole
};
explicit AccountsListModel(QObject *parent = 0);
explicit AccountsListModel(QObject *parent = nullptr);
~AccountsListModel() override;
QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
......
......@@ -202,7 +202,7 @@ public:
};
Q_DECLARE_FLAGS(SubscriptionStateFilterFlags, SubscriptionStateFilterFlag)
ContactsFilterModel(QObject *parent = 0);
ContactsFilterModel(QObject *parent = nullptr);
~ContactsFilterModel() override;
QVariant data(const QModelIndex &index, int role) const override;
......
......@@ -49,7 +49,7 @@ KTp::ContactsListModel::ContactsListModel(QObject *parent) :
QAbstractListModel(parent),
d(new KTp::ContactsListModel::Private())
{
d->contactManager = 0;
d->contactManager = nullptr;
}
KTp::ContactsListModel::~ContactsListModel()
......
......@@ -32,7 +32,7 @@ class KTPMODELS_EXPORT ContactsListModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit ContactsListModel(QObject *parent = 0);
explicit ContactsListModel(QObject *parent = nullptr);
~ContactsListModel() override;
void setAccountManager(const Tp::AccountManagerPtr &accountManager);
......
......@@ -170,7 +170,7 @@ void KTp::ContactsModel::updateGroupProxyModels()
d->channelWatcherProxy.reset();
}
QAbstractItemModel *modelToGroup = 0;
QAbstractItemModel *modelToGroup = nullptr;
if (d->trackUnread) {
modelToGroup = d->channelWatcherProxy.data();
} else {
......@@ -188,7 +188,7 @@ void KTp::ContactsModel::updateGroupProxyModels()
//part of the proxy chain, and is now used in the view directly
//
//do not disable until you have tested on Qt in debug mode
setSourceModel(0);
setSourceModel(nullptr);
setSourceModel(modelToGroup);
break;
case AccountGrouping:
......
......@@ -52,7 +52,7 @@ public:
GroupGrouping
};
ContactsModel(QObject *parent=0);
ContactsModel(QObject *parent=nullptr);
~ContactsModel() override;
......
......@@ -30,7 +30,7 @@ class KTPMODELS_EXPORT KPeopleTranslationProxy : public QSortFilterProxyModel
Q_OBJECT
public:
KPeopleTranslationProxy(QObject *parent = 0);
KPeopleTranslationProxy(QObject *parent = nullptr);
~KPeopleTranslationProxy() override;
QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const override;
......
......@@ -39,7 +39,7 @@ class KTPMODELS_EXPORT PresenceModel : public QAbstractListModel
Q_PROPERTY(int count READ rowCount)
public:
explicit PresenceModel(QObject *parent = 0);
explicit PresenceModel(QObject *parent = nullptr);
~PresenceModel() override;
enum Roles {
......
......@@ -44,7 +44,7 @@ public:
HandleNameRole = Qt::UserRole
};
explicit RoomsModel(QObject *parent = 0);
explicit RoomsModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
......@@ -84,7 +84,7 @@ public:
FavoriteRoomRole
};
explicit FavoriteRoomsModel(QObject *parent = 0);
explicit FavoriteRoomsModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
......
......@@ -37,7 +37,7 @@ class ChannelWatcher : public QObject, public Tp::RefCounted
{
Q_OBJECT
public:
ChannelWatcher(const QPersistentModelIndex &index, const Tp::TextChannelPtr &channel, QObject *parent=0);
ChannelWatcher(const QPersistentModelIndex &index, const Tp::TextChannelPtr &channel, QObject *parent=nullptr);
int unreadMessageCount() const;
QString lastMessage() const;
KTp::Message::MessageDirection lastMessageDirection() const;
......
......@@ -34,7 +34,7 @@ class KTPMODELS_EXPORT TextChannelWatcherProxyModel : public QIdentityProxyModel
{
Q_OBJECT
public:
explicit TextChannelWatcherProxyModel(QObject *parent=0);
explicit TextChannelWatcherProxyModel(QObject *parent=nullptr);
~TextChannelWatcherProxyModel() override;
void observeChannels(const Tp::MethodInvocationContextPtr<> &context,
......
......@@ -32,7 +32,7 @@ typedef QSharedPointer<KTp::Client::ChannelProxyInterfaceOTRInterface> OTRProxyP
static int getId(const Tp::ReceivedMessage &recvMes)
{
return recvMes.header()[QLatin1String("pending-message-id")].variant().toUInt(NULL);
return recvMes.header()[QLatin1String("pending-message-id")].variant().toUInt(nullptr);
}
class OTRMessage : public Tp::ReceivedMessage
......@@ -209,7 +209,7 @@ void ChannelAdapter::onTrustLevelPropertyGet(Tp::PendingOperation *op)
return;
}
Tp::PendingVariant *pv = dynamic_cast<Tp::PendingVariant*>(op);
d->trustLevel = static_cast<KTp::OTRTrustLevel>(pv->result().toUInt(NULL));
d->trustLevel = static_cast<KTp::OTRTrustLevel>(pv->result().toUInt(nullptr));
Q_EMIT otrTrustLevelChanged(d->trustLevel, KTp::OTRTrustLevelNotPrivate);
}
......
......@@ -37,7 +37,7 @@ class KTPOTR_EXPORT ChannelAdapter : public QObject, public Tp::RefCounted
Q_OBJECT
public:
ChannelAdapter(const Tp::TextChannelPtr &textChannel, QObject *parent = 0);
ChannelAdapter(const Tp::TextChannelPtr &textChannel, QObject *parent = nullptr);
~ChannelAdapter() override;
Tp::TextChannelPtr textChannel();
......@@ -61,7 +61,7 @@ class KTPOTR_EXPORT ChannelAdapter : public QObject, public Tp::RefCounted
void acknowledge(const QList<Tp::ReceivedMessage> &messages);
void send(const QString& text,
Tp::ChannelTextMessageType type = Tp::ChannelTextMessageTypeNormal,
Tp::MessageSendingFlags flags = 0);
Tp::MessageSendingFlags flags = nullptr);
bool supportsMessageType(Tp::ChannelTextMessageType messageType) const;
QList<Tp::ChannelTextMessageType> supportedMessageTypes() const;
......
......@@ -34,17 +34,17 @@ ChannelProxyInterfaceOTRInterface::ChannelProxyInterfaceOTRInterface(const Tp::A
void ChannelProxyInterfaceOTRInterface::invalidate(Tp::DBusProxy *proxy,
const QString &error, const QString &message)
{
disconnect(this, SIGNAL(MessageSent(const Tp::MessagePartList&, uint, const QString&)), NULL, NULL);
disconnect(this, SIGNAL(MessageReceived(const Tp::MessagePartList&)), NULL, NULL);
disconnect(this, SIGNAL(PendingMessagesRemoved(const Tp::UIntList&)), NULL, NULL);
disconnect(this, SIGNAL(PeerAuthenticationRequested(const QString&)), NULL, NULL);
disconnect(this, SIGNAL(PeerAuthenticationConcluded(bool)), NULL, NULL);
disconnect(this, SIGNAL(PeerAuthenticationInProgress()), NULL, NULL);
disconnect(this, SIGNAL(PeerAuthenticationAborted()), NULL, NULL);
disconnect(this, SIGNAL(PeerAuthenticationError()), NULL, NULL);
disconnect(this, SIGNAL(PeerAuthenticationCheated()), NULL, NULL);
disconnect(this, SIGNAL(SessionRefreshed()), NULL, NULL);
disconnect(this, SIGNAL(TrustLevelChanged(uint)), NULL, NULL);
disconnect(this, SIGNAL(MessageSent(const Tp::MessagePartList&, uint, const QString&)), nullptr, nullptr);
disconnect(this, SIGNAL(MessageReceived(const Tp::MessagePartList&)), nullptr, nullptr);
disconnect(this, SIGNAL(PendingMessagesRemoved(const Tp::UIntList&)), nullptr, nullptr);
disconnect(this, SIGNAL(PeerAuthenticationRequested(const QString&)), nullptr, nullptr);
disconnect(this, SIGNAL(PeerAuthenticationConcluded(bool)), nullptr, nullptr);
disconnect(this, SIGNAL(PeerAuthenticationInProgress()), nullptr, nullptr);
disconnect(this, SIGNAL(PeerAuthenticationAborted()), nullptr, nullptr);
disconnect(this, SIGNAL(PeerAuthenticationError()), nullptr, nullptr);
disconnect(this, SIGNAL(PeerAuthenticationCheated()), nullptr, nullptr);
disconnect(this, SIGNAL(SessionRefreshed()), nullptr, nullptr);
disconnect(this, SIGNAL(TrustLevelChanged(uint)), nullptr, nullptr);
Tp::AbstractInterface::invalidate(proxy, error, message);
}
......
......@@ -67,7 +67,7 @@ public:
ChannelProxyInterfaceOTRInterface(
const QString& busName,
const QString& objectPath,
QObject* parent = 0
QObject* parent = nullptr
);
/**
......@@ -82,7 +82,7 @@ public:
const QDBusConnection& connection,
const QString& busName,
const QString& objectPath,
QObject* parent = 0
QObject* parent = nullptr
);
/**
......
......@@ -34,10 +34,10 @@ ProxyServiceInterface::ProxyServiceInterface(const Tp::AbstractInterface& mainIn
void ProxyServiceInterface::invalidate(Tp::DBusProxy *proxy,
const QString &error, const QString &message)
{
disconnect(this, SIGNAL(ProxyConnected(const QDBusObjectPath&)), NULL, NULL);
disconnect(this, SIGNAL(ProxyDisconnected(const QDBusObjectPath&)), NULL, NULL);
disconnect(this, SIGNAL(KeyGenerationStarted(const QDBusObjectPath&)), NULL, NULL);
disconnect(this, SIGNAL(KeyGenerationFinished(const QDBusObjectPath&, bool)), NULL, NULL);
disconnect(this, SIGNAL(ProxyConnected(const QDBusObjectPath&)), nullptr, nullptr);
disconnect(this, SIGNAL(ProxyDisconnected(const QDBusObjectPath&)), nullptr, nullptr);
disconnect(this, SIGNAL(KeyGenerationStarted(const QDBusObjectPath&)), nullptr, nullptr);
disconnect(this, SIGNAL(KeyGenerationFinished(const QDBusObjectPath&, bool)), nullptr, nullptr);
Tp::AbstractInterface::invalidate(proxy, error, message);
}
......
......@@ -71,7 +71,7 @@ public:
ProxyServiceInterface(
const QString& busName,
const QString& objectPath,
QObject* parent = 0
QObject* parent = nullptr
);
/**
......@@ -86,7 +86,7 @@ public:
const QDBusConnection& connection,
const QString& busName,
const QString& objectPath,
QObject* parent = 0
QObject* parent = nullptr
);
/**
......
......@@ -36,7 +36,7 @@ namespace Utils {
}
uint getId(const Tp::MessagePartList &message) {
return message.first()[QLatin1String("pending-message-id")].variant().toUInt(NULL);
return message.first()[QLatin1String("pending-message-id")].variant().toUInt(nullptr);
}
QString getOtrProxyObjectPathFor(const Tp::TextChannelPtr &textChannel)
......@@ -67,7 +67,7 @@ namespace Utils {
{
Tp::MessagePart messagePart = message.part(0);