Q_OBJECT
public:
- AbstractUi(QObject *parent = 0) : QObject(parent) {}
+ AbstractUi(QObject *parent = nullptr) : QObject(parent) {}
virtual ~AbstractUi() {}
virtual void init() = 0; // called after the client is initialized
virtual MessageModel *createMessageModel(QObject *parent) = 0;
Q_OBJECT
public:
- BufferModel(NetworkModel *parent = 0);
+ BufferModel(NetworkModel *parent = nullptr);
bool filterAcceptsRow(int sourceRow, const QModelIndex &parent) const;
_bufferViewIds.remove(viewId);
BufferViewConfig *config = Client::bufferViewManager()->bufferViewConfig(viewId);
if (config)
- disconnect(config, 0, this, 0);
+ disconnect(config, nullptr, this, nullptr);
// update initialized State:
bool wasInitialized = isInitialized();
QSet<BufferId> tempRemovedBuffers;
if (Client::bufferViewManager()) {
- BufferViewConfig *config = 0;
+ BufferViewConfig *config = nullptr;
QSet<int>::const_iterator viewIter;
for (viewIter = _bufferViewIds.constBegin(); viewIter != _bufferViewIds.constEnd(); ++viewIter) {
config = Client::bufferViewManager()->bufferViewConfig(*viewIter);
Q_OBJECT
public:
- BufferViewOverlay(QObject *parent = 0);
+ BufferViewOverlay(QObject *parent = nullptr);
inline const QSet<int> &bufferViewIds() { return _bufferViewIds; }
bool allNetworks();
_mainUi(std::move(ui)),
_networkModel(new NetworkModel(this)),
_bufferModel(new BufferModel(_networkModel)),
- _bufferSyncer(0),
- _aliasManager(0),
+ _bufferSyncer(nullptr),
+ _aliasManager(nullptr),
_backlogManager(new ClientBacklogManager(this)),
- _bufferViewManager(0),
+ _bufferViewManager(nullptr),
_bufferViewOverlay(new BufferViewOverlay(this)),
_coreInfo(new CoreInfo(this)),
- _dccConfig(0),
+ _dccConfig(nullptr),
_ircListHelper(new ClientIrcListHelper(this)),
_inputHandler(new ClientUserInputHandler(this)),
- _networkConfig(0),
- _ignoreListManager(0),
- _highlightRuleManager(0),
- _transferManager(0),
+ _networkConfig(nullptr),
+ _ignoreListManager(nullptr),
+ _highlightRuleManager(nullptr),
+ _transferManager(nullptr),
_transferModel(new TransferModel(this)),
_messageModel(_mainUi->createMessageModel(this)),
_messageProcessor(_mainUi->createMessageProcessor(this)),
const Network *Client::network(NetworkId networkid)
{
if (instance()->_networks.contains(networkid)) return instance()->_networks[networkid];
- else return 0;
+ else return nullptr;
}
const Identity *Client::identity(IdentityId id)
{
if (instance()->_identities.contains(id)) return instance()->_identities[id];
- else return 0;
+ else return nullptr;
}
if (_bufferSyncer) {
_bufferSyncer->deleteLater();
- _bufferSyncer = 0;
+ _bufferSyncer = nullptr;
}
_coreInfo->reset();
if (_bufferViewManager) {
_bufferViewManager->deleteLater();
- _bufferViewManager = 0;
+ _bufferViewManager = nullptr;
}
_bufferViewOverlay->reset();
if (_aliasManager) {
_aliasManager->deleteLater();
- _aliasManager = 0;
+ _aliasManager = nullptr;
}
if (_ignoreListManager) {
_ignoreListManager->deleteLater();
- _ignoreListManager = 0;
+ _ignoreListManager = nullptr;
}
if (_highlightRuleManager) {
while (netIter != _networks.end()) {
Network *net = netIter.value();
emit networkRemoved(net->networkId());
- disconnect(net, SIGNAL(destroyed()), this, 0);
+ disconnect(net, SIGNAL(destroyed()), this, nullptr);
netIter = _networks.erase(netIter);
net->deleteLater();
}
if (_networkConfig) {
_networkConfig->deleteLater();
- _networkConfig = 0;
+ _networkConfig = nullptr;
}
}
Q_OBJECT
public:
- explicit ClientAliasManager(QObject *parent = 0);
+ explicit ClientAliasManager(QObject *parent = nullptr);
protected:
const Network *network(NetworkId) const;
void ClientAuthHandler::handle(const SessionState &msg)
{
- disconnect(socket(), 0, this, 0); // this is the last message we shall ever get
+ disconnect(socket(), nullptr, this, nullptr); // this is the last message we shall ever get
// give up ownership of the peer; CoreSession takes responsibility now
- _peer->setParent(0);
+ _peer->setParent(nullptr);
emit handshakeComplete(_peer, msg);
}
Latest=Sha2_512
};
- ClientAuthHandler(CoreAccount account, QObject *parent = 0);
+ ClientAuthHandler(CoreAccount account, QObject *parent = nullptr);
Peer *peer() const;
ClientBacklogManager::ClientBacklogManager(QObject *parent)
: BacklogManager(parent),
- _requester(0),
+ _requester(nullptr),
_initBacklogRequested(false)
{
}
void ClientBacklogManager::reset()
{
delete _requester;
- _requester = 0;
+ _requester = nullptr;
_initBacklogRequested = false;
_buffersRequested.clear();
}
Q_OBJECT
public:
- ClientBacklogManager(QObject *parent = 0);
+ ClientBacklogManager(QObject *parent = nullptr);
// helper for the backlogRequester, as it isn't a QObject and can't emit itself
inline void emitMessagesRequested(const QString &msg) const { emit messagesRequested(msg); }
Q_OBJECT
public:
- ClientBufferViewConfig(int bufferViewId, QObject *parent = 0);
+ ClientBufferViewConfig(int bufferViewId, QObject *parent = nullptr);
inline bool isLocked() { return _locked || sortAlphabetically(); }
inline void setLocked(bool locked) { _locked = locked; }
Q_OBJECT
public:
- ClientBufferViewManager(SignalProxy *proxy, QObject *parent = 0);
+ ClientBufferViewManager(SignalProxy *proxy, QObject *parent = nullptr);
QList<ClientBufferViewConfig *> clientBufferViewConfigs() const;
ClientBufferViewConfig *clientBufferViewConfig(int bufferViewId) const;
CertIdentity::CertIdentity(IdentityId id, QObject *parent)
: Identity(id, parent)
#ifdef HAVE_SSL
- , _certManager(0),
+ , _certManager(nullptr),
_isDirty(false)
#endif
{
CertIdentity::CertIdentity(const Identity &other, QObject *parent)
: Identity(other, parent)
#ifdef HAVE_SSL
- , _certManager(0),
+ , _certManager(nullptr),
_isDirty(false)
#endif
{
CertIdentity::CertIdentity(const CertIdentity &other, QObject *parent)
: Identity(other, parent)
#ifdef HAVE_SSL
- , _certManager(0),
+ , _certManager(nullptr),
_isDirty(other._isDirty),
_sslKey(other._sslKey),
_sslCert(other._sslCert)
Q_OBJECT
public:
- CertIdentity(IdentityId id = 0, QObject *parent = 0);
- CertIdentity(const Identity &other, QObject *parent = 0);
- CertIdentity(const CertIdentity &other, QObject *parent = 0);
+ CertIdentity(IdentityId id = 0, QObject *parent = nullptr);
+ CertIdentity(const Identity &other, QObject *parent = nullptr);
+ CertIdentity(const CertIdentity &other, QObject *parent = nullptr);
#ifdef HAVE_SSL
inline bool isDirty() const { return _isDirty; }
Q_OBJECT
public:
- explicit ClientIgnoreListManager(QObject *parent = 0);
+ explicit ClientIgnoreListManager(QObject *parent = nullptr);
//! Fetch all matching ignore rules for a given hostmask
/** \param hostmask The hostmask of the user
Q_OBJECT
public:
- inline ClientIrcListHelper(QObject *object = 0) : IrcListHelper(object) {};
+ inline ClientIrcListHelper(QObject *object = nullptr) : IrcListHelper(object) {};
public slots:
virtual QVariantList requestChannelList(const NetworkId &netId, const QStringList &channelFilters);
ClientTransfer::ClientTransfer(const QUuid &uuid, QObject *parent)
: Transfer(uuid, parent),
- _file(0)
+ _file(nullptr)
{
connect(this, SIGNAL(statusChanged(Transfer::Status)), SLOT(onStatusChanged(Transfer::Status)));
}
if (_file) {
_file->close();
_file->deleteLater();
- _file = 0;
+ _file = nullptr;
}
}
void ClientTransfer::accept(const QString &savePath) const
{
_savePath = savePath;
- PeerPtr ptr = 0;
+ PeerPtr ptr = nullptr;
REQUEST_OTHER(requestAccepted, ARG(ptr));
emit accepted();
}
void ClientTransfer::reject() const
{
- PeerPtr ptr = 0;
+ PeerPtr ptr = nullptr;
REQUEST_OTHER(requestRejected, ARG(ptr));
emit rejected();
}
Q_OBJECT
public:
- ClientTransfer(const QUuid &uuid, QObject *parent = 0);
+ ClientTransfer(const QUuid &uuid, QObject *parent = nullptr);
QString savePath() const;
if (!msg.startsWith('/')) {
if (_nickRx.indexIn(msg) == 0) {
const Network *net = Client::network(bufferInfo.networkId());
- IrcUser *user = net ? net->ircUser(_nickRx.cap(1)) : 0;
+ IrcUser *user = net ? net->ircUser(_nickRx.cap(1)) : nullptr;
if (user)
user->setLastSpokenTo(bufferInfo.bufferId(), QDateTime::currentDateTime().toUTC());
}
Q_OBJECT
public:
- ClientUserInputHandler(QObject *parent = 0);
+ ClientUserInputHandler(QObject *parent = nullptr);
public slots:
void handleUserInput(const BufferInfo &bufferInfo, const QString &msg);
UuidRole
};
- CoreAccountModel(QObject *parent = 0);
- CoreAccountModel(const CoreAccountModel *other, QObject *parent = 0);
+ CoreAccountModel(QObject *parent = nullptr);
+ CoreAccountModel(const CoreAccountModel *other, QObject *parent = nullptr);
inline int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
CoreConnection::CoreConnection(QObject *parent)
: QObject(parent),
- _authHandler(0),
+ _authHandler(nullptr),
_state(Disconnected),
_wantReconnect(false),
_wasReconnect(false),
_wantReconnect = wantReconnect;
if (_authHandler) {
- disconnect(_authHandler, 0, this, 0);
+ disconnect(_authHandler, nullptr, this, nullptr);
_authHandler->close();
_authHandler->deleteLater();
- _authHandler = 0;
+ _authHandler = nullptr;
}
if (_peer) {
- disconnect(_peer, 0, this, 0);
+ disconnect(_peer, nullptr, this, nullptr);
// peer belongs to the sigproxy and thus gets deleted by it
_peer->close();
- _peer = 0;
+ _peer = nullptr;
}
_netsToSync.clear();
{
updateProgress(100, 100);
- disconnect(_authHandler, 0, this, 0);
+ disconnect(_authHandler, nullptr, this, nullptr);
_authHandler->deleteLater();
- _authHandler = 0;
+ _authHandler = nullptr;
_peer = peer;
connect(peer, SIGNAL(disconnected()), SLOT(coreSocketDisconnected()));
{
QObject *net = sender();
Q_ASSERT(net);
- disconnect(net, 0, this, 0);
+ disconnect(net, nullptr, this, nullptr);
_netsToSync.remove(net);
updateProgress(_numNetsToSync - _netsToSync.count(), _numNetsToSync);
checkSyncState();
Synchronized
};
- CoreConnection(QObject *parent = 0);
+ CoreConnection(QObject *parent = nullptr);
void init();
Q_OBJECT
public:
- ExecWrapper(QObject *parent = 0);
+ ExecWrapper(QObject *parent = nullptr);
public slots:
void start(const BufferInfo &info, const QString &command);
Q_OBJECT
public:
- IrcListModel(QObject *parent = 0);
+ IrcListModel(QObject *parent = nullptr);
virtual QVariant data(const QModelIndex &index, int role) const;
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
Q_OBJECT
protected:
- MessageFilter(QAbstractItemModel *source, QObject *parent = 0);
+ MessageFilter(QAbstractItemModel *source, QObject *parent = nullptr);
public:
- MessageFilter(MessageModel *, const QList<BufferId> &buffers = QList<BufferId>(), QObject *parent = 0);
+ MessageFilter(MessageModel *, const QList<BufferId> &buffers = QList<BufferId>(), QObject *parent = nullptr);
virtual QString idString() const;
NetworkItem::NetworkItem(const NetworkId &netid, AbstractTreeItem *parent)
: PropertyMapItem(parent),
_networkId(netid),
- _statusBufferItem(0)
+ _statusBufferItem(nullptr)
{
// DO NOT EMIT dataChanged() DIRECTLY IN NetworkItem
// use networkDataChanged() instead. Otherwise you will end up in a infinite loop
// FIXME shouldn't we check the bufferItemCache here?
BufferItem *NetworkItem::findBufferItem(BufferId bufferId)
{
- BufferItem *bufferItem = 0;
+ BufferItem *bufferItem = nullptr;
for (int i = 0; i < childCount(); i++) {
bufferItem = qobject_cast<BufferItem *>(child(i));
if (bufferItem->bufferId() == bufferId)
return bufferItem;
}
- return 0;
+ return nullptr;
}
void NetworkItem::attachIrcUser(IrcUser *ircUser)
{
- QueryBufferItem *queryItem = 0;
+ QueryBufferItem *queryItem = nullptr;
for (int i = 0; i < childCount(); i++) {
queryItem = qobject_cast<QueryBufferItem *>(child(i));
if (!queryItem)
for (int i = start; i <= end; i++) {
StatusBufferItem *statusBufferItem = qobject_cast<StatusBufferItem *>(child(i));
if (statusBufferItem) {
- _statusBufferItem = 0;
+ _statusBufferItem = nullptr;
break;
}
}
void NetworkItem::onNetworkDestroyed()
{
- _network = 0;
+ _network = nullptr;
emit networkDataChanged();
removeAllChilds();
}
*****************************************/
QueryBufferItem::QueryBufferItem(const BufferInfo &bufferInfo, NetworkItem *parent)
: BufferItem(bufferInfo, parent),
- _ircUser(0)
+ _ircUser(nullptr)
{
setFlags(flags() | Qt::ItemIsDropEnabled | Qt::ItemIsEditable);
return;
if (_ircUser) {
- disconnect(_ircUser, 0, this, 0);
+ disconnect(_ircUser, nullptr, this, nullptr);
}
if (ircUser) {
// SIGNAL destroyed(QObject*) to SLOT removeIrcUser().
// This fixes removing an active IrcUser if the user had quit then rejoined in a nonstandard
// manner (e.g. updateNickFromHost calling newIrcUser, triggered by an away-notify message).
- disconnect(_ircUser, 0, this, 0);
+ disconnect(_ircUser, nullptr, this, nullptr);
// Clear IrcUser (only set to 0 if not already 0)
- _ircUser = 0;
+ _ircUser = nullptr;
// Only emit dataChanged() if data actually changed. This might serve as a small
// optimization, but it can be moved outside the if statement if other behavior depends on
*****************************************/
ChannelBufferItem::ChannelBufferItem(const BufferInfo &bufferInfo, AbstractTreeItem *parent)
: BufferItem(bufferInfo, parent),
- _ircChannel(0)
+ _ircChannel(nullptr)
{
setFlags(flags() | Qt::ItemIsDropEnabled);
}
{
if (_ircChannel) {
qWarning() << Q_FUNC_INFO << "IrcChannel already set; cleanup failed!?";
- disconnect(_ircChannel, 0, this, 0);
+ disconnect(_ircChannel, nullptr, this, nullptr);
}
_ircChannel = ircChannel;
void ChannelBufferItem::ircChannelParted()
{
Q_CHECK_PTR(_ircChannel);
- disconnect(_ircChannel, 0, this, 0);
- _ircChannel = 0;
+ disconnect(_ircChannel, nullptr, this, nullptr);
+ _ircChannel = nullptr;
emit dataChanged();
removeAllChilds();
}
void ChannelBufferItem::ircChannelDestroyed()
{
if (_ircChannel) {
- _ircChannel = 0;
+ _ircChannel = nullptr;
emit dataChanged();
removeAllChilds();
}
UserCategoryItem *ChannelBufferItem::findCategoryItem(int categoryId)
{
- UserCategoryItem *categoryItem = 0;
+ UserCategoryItem *categoryItem = nullptr;
for (int i = 0; i < childCount(); i++) {
categoryItem = qobject_cast<UserCategoryItem *>(child(i));
if (categoryItem->categoryId() == categoryId)
return categoryItem;
}
- return 0;
+ return nullptr;
}
QHash<UserCategoryItem *, QList<IrcUser *> > categories;
int categoryId = -1;
- UserCategoryItem *categoryItem = 0;
+ UserCategoryItem *categoryItem = nullptr;
foreach(IrcUser *ircUser, ircUsers) {
categoryId = UserCategoryItem::categoryFromModes(_ircChannel->userModes(ircUser));
return;
}
- disconnect(ircUser, 0, this, 0);
+ disconnect(ircUser, nullptr, this, nullptr);
removeUserFromCategory(ircUser);
emit dataChanged(2);
}
return;
}
- UserCategoryItem *categoryItem = 0;
+ UserCategoryItem *categoryItem = nullptr;
for (int i = 0; i < childCount(); i++) {
categoryItem = qobject_cast<UserCategoryItem *>(child(i));
if (categoryItem->removeUser(ircUser)) {
}
// find the item that needs reparenting
- IrcUserItem *ircUserItem = 0;
+ IrcUserItem *ircUserItem = nullptr;
for (int i = 0; i < childCount(); i++) {
UserCategoryItem *oldCategoryItem = qobject_cast<UserCategoryItem *>(child(i));
Q_ASSERT(oldCategoryItem);
int n = childCount();
switch (_category) {
case 0:
- return tr("%n Owner(s)", 0, n);
+ return tr("%n Owner(s)", "", n);
case 1:
- return tr("%n Admin(s)", 0, n);
+ return tr("%n Admin(s)", "", n);
case 2:
- return tr("%n Operator(s)", 0, n);
+ return tr("%n Operator(s)", "", n);
case 3:
- return tr("%n Half-Op(s)", 0, n);
+ return tr("%n Half-Op(s)", "", n);
case 4:
- return tr("%n Voiced", 0, n);
+ return tr("%n Voiced", "", n);
default:
- return tr("%n User(s)", 0, n);
+ return tr("%n User(s)", "", n);
}
}
IrcUserItem *UserCategoryItem::findIrcUser(IrcUser *ircUser)
{
- IrcUserItem *userItem = 0;
+ IrcUserItem *userItem = nullptr;
for (int i = 0; i < childCount(); i++) {
userItem = qobject_cast<IrcUserItem *>(child(i));
if (userItem->ircUser() == ircUser)
return userItem;
}
- return 0;
+ return nullptr;
}
int NetworkModel::networkRow(NetworkId networkId) const
{
- NetworkItem *netItem = 0;
+ NetworkItem *netItem = nullptr;
for (int i = 0; i < rootItem->childCount(); i++) {
netItem = qobject_cast<NetworkItem *>(rootItem->child(i));
if (!netItem)
{
int netRow = networkRow(networkId);
if (netRow == -1)
- return 0;
+ return nullptr;
else
return qobject_cast<NetworkItem *>(rootItem->child(netRow));
}
{
NetworkItem *netItem = findNetworkItem(networkId);
- if (netItem == 0) {
+ if (netItem == nullptr) {
netItem = new NetworkItem(networkId, rootItem);
rootItem->newChild(netItem);
}
if (_bufferItemCache.contains(bufferId))
return _bufferItemCache[bufferId];
else
- return 0;
+ return nullptr;
}
case Message::Action:
if (bufferType(msg.bufferId()) == BufferInfo::ChannelBuffer) {
const Network *net = Client::network(msg.bufferInfo().networkId());
- IrcUser *user = net ? net->ircUser(nickFromMask(msg.sender())) : 0;
+ IrcUser *user = net ? net->ircUser(nickFromMask(msg.sender())) : nullptr;
if (user)
user->setLastChannelActivity(msg.bufferId(), msg.timestamp());
}
{
QVariant netVariant = index.data(NetworkIdRole);
if (!netVariant.isValid())
- return 0;
+ return nullptr;
NetworkId networkId = netVariant.value<NetworkId>();
return Client::network(networkId);
Q_PROPERTY(int nickCount READ nickCount)
public :
- NetworkItem(const NetworkId &netid, AbstractTreeItem *parent = 0);
+ NetworkItem(const NetworkId &netid, AbstractTreeItem *parent = nullptr);
virtual QStringList propertyOrder() const;
Q_PROPERTY(int nickCount READ nickCount)
public :
- BufferItem(const BufferInfo &bufferInfo, AbstractTreeItem *parent = 0);
+ BufferItem(const BufferInfo &bufferInfo, AbstractTreeItem *parent = nullptr);
virtual QStringList propertyOrder() const;
};
Q_DECLARE_FLAGS(ItemTypes, ItemType)
- NetworkModel(QObject *parent = 0);
+ NetworkModel(QObject *parent = nullptr);
static QList<QVariant> defaultHeader();
static bool mimeContainsBufferList(const QMimeData *mimeData);
return false;
const QAbstractItemModel *baseModel = selectionModel->model();
- const QAbstractProxyModel *proxyModel = 0;
- while ((proxyModel = qobject_cast<const QAbstractProxyModel *>(baseModel)) != 0) {
+ const QAbstractProxyModel *proxyModel = nullptr;
+ while ((proxyModel = qobject_cast<const QAbstractProxyModel *>(baseModel)) != nullptr) {
baseModel = proxyModel->sourceModel();
if (baseModel == model())
break;
void SelectionModelSynchronizer::removeSelectionModel(QItemSelectionModel *model)
{
- disconnect(model, 0, this, 0);
- disconnect(this, 0, model, 0);
+ disconnect(model, nullptr, this, nullptr);
+ disconnect(this, nullptr, model, nullptr);
selectionModelDestroyed(model);
}
// make a list of all involved proxies, wie have to traverse backwards
QList<const QAbstractProxyModel *> proxyModels;
const QAbstractItemModel *baseModel = selectionModel->model();
- const QAbstractProxyModel *proxyModel = 0;
- while ((proxyModel = qobject_cast<const QAbstractProxyModel *>(baseModel)) != 0) {
+ const QAbstractProxyModel *proxyModel = nullptr;
+ while ((proxyModel = qobject_cast<const QAbstractProxyModel *>(baseModel)) != nullptr) {
if (baseModel == model())
break;
proxyModels << proxyModel;
// make a list of all involved proxies, wie have to traverse backwards
QList<const QAbstractProxyModel *> proxyModels;
const QAbstractItemModel *baseModel = selectionModel->model();
- const QAbstractProxyModel *proxyModel = 0;
- while ((proxyModel = qobject_cast<const QAbstractProxyModel *>(baseModel)) != 0) {
+ const QAbstractProxyModel *proxyModel = nullptr;
+ while ((proxyModel = qobject_cast<const QAbstractProxyModel *>(baseModel)) != nullptr) {
if (baseModel == model())
break;
proxyModels << proxyModel;
QModelIndex sourceIndex = index;
const QAbstractItemModel *baseModel = selectionModel->model();
- const QAbstractProxyModel *proxyModel = 0;
- while ((proxyModel = qobject_cast<const QAbstractProxyModel *>(baseModel)) != 0) {
+ const QAbstractProxyModel *proxyModel = nullptr;
+ while ((proxyModel = qobject_cast<const QAbstractProxyModel *>(baseModel)) != nullptr) {
sourceIndex = proxyModel->mapToSource(sourceIndex);
baseModel = proxyModel->sourceModel();
if (baseModel == model())
QItemSelection sourceSelection = selection;
const QAbstractItemModel *baseModel = selectionModel->model();
- const QAbstractProxyModel *proxyModel = 0;
- while ((proxyModel = qobject_cast<const QAbstractProxyModel *>(baseModel)) != 0) {
+ const QAbstractProxyModel *proxyModel = nullptr;
+ while ((proxyModel = qobject_cast<const QAbstractProxyModel *>(baseModel)) != nullptr) {
sourceSelection = proxyModel->mapSelectionToSource(sourceSelection);
baseModel = proxyModel->sourceModel();
if (baseModel == model())
Q_OBJECT
public:
- SelectionModelSynchronizer(QAbstractItemModel *parent = 0);
+ SelectionModelSynchronizer(QAbstractItemModel *parent = nullptr);
void synchronizeSelectionModel(QItemSelectionModel *selectionModel);
void removeSelectionModel(QItemSelectionModel *selectionModel);
void TransferModel::setManager(const TransferManager *manager)
{
if (_manager) {
- disconnect(_manager, 0, this, 0);
+ disconnect(_manager, nullptr, this, nullptr);
beginResetModel();
_transferIds.clear();
endResetModel();
// Check if the transfer object still exists, which means we still should disconnect
auto transfer = _manager->transfer(transferId);
if (transfer)
- disconnect(transfer, 0, this, 0);
+ disconnect(transfer, nullptr, this, nullptr);
for (auto row = 0; row < _transferIds.size(); ++row) {
if (_transferIds[row] == transferId) {
AbstractTreeItem::AbstractTreeItem(AbstractTreeItem *parent)
: QObject(parent),
_flags(Qt::ItemIsSelectable | Qt::ItemIsEnabled),
- _treeItemFlags(0)
+ _treeItemFlags(nullptr)
{
}
childIter = _childItems.begin();
while (childIter != _childItems.end()) {
child = *childIter;
- child->setTreeItemFlags(0); // disable self deletion, as this would only fuck up consitency and the child gets deleted anyways
+ child->setTreeItemFlags(nullptr); // disable self deletion, as this would only fuck up consitency and the child gets deleted anyways
child->removeAllChilds();
++childIter;
}
AbstractTreeItem *AbstractTreeItem::child(int row) const
{
if (childCount() <= row)
- return 0;
+ return nullptr;
else
return _childItems[row];
}
_childStatus(QModelIndex(), 0, 0, 0),
_aboutToRemoveOrInsert(false)
{
- rootItem = new SimpleTreeItem(data, 0);
+ rootItem = new SimpleTreeItem(data, nullptr);
connectItem(rootItem);
if (Quassel::isOptionSet("debugmodel")) {
QModelIndex TreeModel::indexByItem(AbstractTreeItem *item) const
{
- if (item == 0) {
+ if (item == nullptr) {
qWarning() << "TreeModel::indexByItem(AbstractTreeItem *item) received NULL-Pointer";
return QModelIndex();
}
}
for (int i = firstRow; i <= lastRow; i++) {
- disconnect(parentItem->child(i), 0, this, 0);
+ disconnect(parentItem->child(i), nullptr, this, nullptr);
}
// consitency checks
};
Q_DECLARE_FLAGS(TreeItemFlags, TreeItemFlag)
- AbstractTreeItem(AbstractTreeItem *parent = 0);
+ AbstractTreeItem(AbstractTreeItem *parent = nullptr);
bool newChild(AbstractTreeItem *child);
bool newChilds(const QList<AbstractTreeItem *> &items);
Q_OBJECT
public:
- SimpleTreeItem(const QList<QVariant> &data, AbstractTreeItem *parent = 0);
+ SimpleTreeItem(const QList<QVariant> &data, AbstractTreeItem *parent = nullptr);
virtual ~SimpleTreeItem();
virtual QVariant data(int column, int role) const;
Q_OBJECT
public:
- PropertyMapItem(AbstractTreeItem *parent = 0);
+ PropertyMapItem(AbstractTreeItem *parent = nullptr);
virtual QStringList propertyOrder() const = 0;
UserRole
};
- TreeModel(const QList<QVariant> &, QObject *parent = 0);
+ TreeModel(const QList<QVariant> &, QObject *parent = nullptr);
virtual ~TreeModel();
AbstractTreeItem *root() const;
SYNCABLE_OBJECT
public:
- inline AliasManager(QObject *parent = 0) : SyncableObject(parent) { setAllowClientUpdates(true); }
+ inline AliasManager(QObject *parent = nullptr) : SyncableObject(parent) { setAllowClientUpdates(true); }
AliasManager &operator=(const AliasManager &other);
struct Alias {
AuthHandler::AuthHandler(QObject *parent)
: QObject(parent),
- _socket(0),
+ _socket(nullptr),
_disconnectedSent(false)
{
Q_OBJECT
public:
- AuthHandler(QObject *parent = 0);
+ AuthHandler(QObject *parent = nullptr);
QTcpSocket *socket() const;
SYNCABLE_OBJECT
public:
- BacklogManager(QObject *parent = 0) : SyncableObject(parent) {}
+ BacklogManager(QObject *parent = nullptr) : SyncableObject(parent) {}
public slots:
virtual QVariantList requestBacklog(BufferId bufferId, MsgId first = -1, MsgId last = -1, int limit = -1, int additional = 0);
return;
}
else {
- void *param[] = { 0, Q_ARG(QString, member).data(), val0.data(), val1.data(), val2.data(), val3.data(), val4.data(),
+ void *param[] = { nullptr, Q_ARG(QString, member).data(), val0.data(), val1.data(), val2.data(), val3.data(), val4.data(),
val5.data(), val6.data(), val7.data(), val8.data(), val8.data() };
qt_metacall(QMetaObject::InvokeMetaMethod, _defaultHandler, param);
return;
}
}
- void *param[] = { 0, val0.data(), val1.data(), val2.data(), val3.data(), val4.data(),
- val5.data(), val6.data(), val7.data(), val8.data(), val8.data(), 0 };
+ void *param[] = { nullptr, val0.data(), val1.data(), val2.data(), val3.data(), val4.data(),
+ val5.data(), val6.data(), val7.data(), val8.data(), val8.data(), nullptr };
qt_metacall(QMetaObject::InvokeMetaMethod, handlerHash()[handler], param);
}
Q_OBJECT
public:
- BasicHandler(QObject *parent = 0);
- BasicHandler(const QString &methodPrefix, QObject *parent = 0);
+ BasicHandler(QObject *parent = nullptr);
+ BasicHandler(const QString &methodPrefix, QObject *parent = nullptr);
QStringList providesHandlers();
protected:
- virtual void handle(const QString &member, QGenericArgument val0 = QGenericArgument(0),
+ virtual void handle(const QString &member, QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(),
QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(),
Q_PROPERTY(bool showSearch READ showSearch WRITE setShowSearch)
public :
- BufferViewConfig(int bufferViewId, QObject *parent = 0);
- BufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = 0);
+ BufferViewConfig(int bufferViewId, QObject *parent = nullptr);
+ BufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = nullptr);
public slots:
inline int bufferViewId() const { return _bufferViewId; }
if (_bufferViewConfigs.contains(bufferViewId))
return _bufferViewConfigs[bufferViewId];
else
- return 0;
+ return nullptr;
}
SYNCABLE_OBJECT
public:
- BufferViewManager(SignalProxy *proxy, QObject *parent = 0);
+ BufferViewManager(SignalProxy *proxy, QObject *parent = nullptr);
inline QList<BufferViewConfig *> bufferViewConfigs() const { return _bufferViewConfigs.values(); }
BufferViewConfig *bufferViewConfig(int bufferViewId) const;
: QObject(parent),
_socket(socket),
_level(level),
- _inflater(0),
- _deflater(0)
+ _inflater(nullptr),
+ _deflater(nullptr)
{
connect(socket, SIGNAL(readyRead()), SLOT(readData()));
Flush
};
- Compressor(QTcpSocket *socket, CompressionLevel level, QObject *parent = 0);
+ Compressor(QTcpSocket *socket, CompressionLevel level, QObject *parent = nullptr);
~Compressor();
CompressionLevel compressionLevel() const { return _level; }
if (type == EventManager::CtcpEvent || type == EventManager::CtcpEventFlush)
return new CtcpEvent(type, map, network);
- return 0;
+ return nullptr;
}
// sanity check if we have a valid enum value
if (EventManager::enumName(inttype).isEmpty()) {
qWarning() << "Received a serialized event with unknown type" << inttype;
- return 0;
+ return nullptr;
}
EventManager::EventType type = static_cast<EventManager::EventType>(inttype);
if (type == EventManager::Invalid || type == EventManager::GenericEvent)
- return 0;
+ return nullptr;
EventManager::EventType group = static_cast<EventManager::EventType>(type & EventManager::EventGroupMask);
- Event *e = 0;
+ Event *e = nullptr;
// we use static create() functions to keep group-specific special cases in the files they belong
// e.g. IrcEventRawMessage
if (!e) {
qWarning() << "Can't create event of type" << type;
- return 0;
+ return nullptr;
}
if (!map.isEmpty()) {
}
// finally, deliverance!
- void *param[] = { 0, Q_ARG(Event *, event).data() };
+ void *param[] = { nullptr, Q_ARG(Event *, event).data() };
obj->qt_metacall(QMetaObject::InvokeMetaMethod, it->methodIndex, param);
}
KeyEvent = 0x00060000
};
- EventManager(QObject *parent = 0);
+ EventManager(QObject *parent = nullptr);
static EventType eventTypeByName(const QString &name);
static EventType eventGroupByName(const QString &name);
int methodIndex;
Priority priority;
- explicit Handler(QObject *obj = 0, int method = 0, Priority prio = NormalPriority)
+ explicit Handler(QObject *obj = nullptr, int method = 0, Priority prio = NormalPriority)
{
object = obj;
methodIndex = method;
Q_PROPERTY(QString quitReason READ quitReason WRITE setQuitReason)
public :
- Identity(IdentityId id = 0, QObject *parent = 0);
- Identity(const Identity &other, QObject *parent = 0);
+ Identity(IdentityId id = 0, QObject *parent = nullptr);
+ Identity(const Identity &other, QObject *parent = nullptr);
void setToDefaults();
Q_PROPERTY(QByteArray sslCert READ sslCertPem WRITE setSslCert)
public :
- CertManager(IdentityId id, QObject *parent = 0) : SyncableObject(QString::number(id.toInt()), parent) {}
+ CertManager(IdentityId id, QObject *parent = nullptr) : SyncableObject(QString::number(id.toInt()), parent) {}
virtual const QSslKey &sslKey() const = 0;
inline QByteArray sslKeyPem() const { return sslKey().toPem(); }
SYNCABLE_OBJECT
public:
- inline IgnoreListManager(QObject *parent = 0) : SyncableObject(parent) { setAllowClientUpdates(true); }
+ inline IgnoreListManager(QObject *parent = nullptr) : SyncableObject(parent) { setAllowClientUpdates(true); }
IgnoreListManager &operator=(const IgnoreListManager &other);
enum IgnoreType {
_topic(QString()),
_encrypted(false),
_network(network),
- _codecForEncoding(0),
- _codecForDecoding(0)
+ _codecForEncoding(nullptr),
+ _codecForDecoding(nullptr)
{
setObjectName(QString::number(network->networkId().toInt()) + "/" + channelname);
}
// ====================
bool IrcChannel::isKnownUser(IrcUser *ircuser) const
{
- if (ircuser == 0) {
+ if (ircuser == nullptr) {
qWarning() << "Channel" << name() << "received IrcUser Nullpointer!";
return false;
}
ircuser->partChannel(this);
// If you wonder why there is no counterpart to ircUserParted:
// the joins are propagted by the ircuser. The signal ircUserParted is only for convenience
- disconnect(ircuser, 0, this, 0);
+ disconnect(ircuser, nullptr, this, nullptr);
emit ircUserParted(ircuser);
if (network()->isMe(ircuser) || _userModes.isEmpty()) {
QList<IrcUser *> users = _userModes.keys();
_userModes.clear();
foreach(IrcUser *user, users) {
- disconnect(user, 0, this, 0);
+ disconnect(user, nullptr, this, nullptr);
user->partChannel(this);
}
emit parted();
return new IrcEventNumeric(type, map, network);
if ((type & EventManager::EventGroupMask) != EventManager::IrcEvent)
- return 0;
+ return nullptr;
switch (type) {
case EventManager::IrcEventRawPrivmsg:
SYNCABLE_OBJECT
public:
- inline IrcListHelper(QObject *parent = 0) : SyncableObject(parent) { setInitialized(); };
+ inline IrcListHelper(QObject *parent = nullptr) : SyncableObject(parent) { setInitialized(); };
struct ChannelDescription {
QString channelName;
_whoisServiceReply(),
_encrypted(false),
_network(network),
- _codecForEncoding(0),
- _codecForDecoding(0)
+ _codecForEncoding(nullptr),
+ _codecForDecoding(nullptr)
{
updateObjectName();
_lastAwayMessageTime.setTimeSpec(Qt::UTC);
{
if (_channels.contains(channel)) {
_channels.remove(channel);
- disconnect(channel, 0, this, 0);
+ disconnect(channel, nullptr, this, nullptr);
channel->part(this);
QString channelName = channel->name();
SYNC_OTHER(partChannel, ARG(channelName))
void IrcUser::partChannel(const QString &channelname)
{
IrcChannel *channel = network()->ircChannel(channelname);
- if (channel == 0) {
+ if (channel == nullptr) {
qWarning() << "IrcUser::partChannel(): received part for unknown Channel" << channelname;
}
else {
QList<IrcChannel *> channels = _channels.toList();
_channels.clear();
foreach(IrcChannel *channel, channels) {
- disconnect(channel, 0, this, 0);
+ disconnect(channel, nullptr, this, nullptr);
channel->part(this);
}
network()->removeIrcUser(this);
QString funcName;
if (info.dli_sname) {
- char *func = abi::__cxa_demangle(info.dli_sname, 0, 0, 0);
+ char *func = abi::__cxa_demangle(info.dli_sname, nullptr, nullptr, nullptr);
if (func) {
funcName = QString(func);
free(func);
if (type == EventManager::MessageEvent)
return new MessageEvent(type, map, network);
- return 0;
+ return nullptr;
}
#include "network.h"
#include "peer.h"
-QTextCodec *Network::_defaultCodecForServer = 0;
-QTextCodec *Network::_defaultCodecForEncoding = 0;
-QTextCodec *Network::_defaultCodecForDecoding = 0;
+QTextCodec *Network::_defaultCodecForServer = nullptr;
+QTextCodec *Network::_defaultCodecForEncoding = nullptr;
+QTextCodec *Network::_defaultCodecForDecoding = nullptr;
// ====================
// Public:
Network::Network(const NetworkId &networkid, QObject *parent)
: SyncableObject(parent),
- _proxy(0),
+ _proxy(nullptr),
_networkId(networkid),
_identity(0),
_myNick(QString()),
_messageRateBurstSize(5),
_messageRateDelay(2200),
_unlimitedMessageRate(false),
- _codecForServer(0),
- _codecForEncoding(0),
- _codecForDecoding(0),
+ _codecForServer(nullptr),
+ _codecForEncoding(nullptr),
+ _codecForDecoding(nullptr),
_autoAwayActive(false)
{
setObjectName(QString::number(networkid.toInt()));
if (_ircUsers.contains(nickname))
return _ircUsers[nickname];
else
- return 0;
+ return nullptr;
}
return;
_ircUsers.remove(nick);
- disconnect(ircuser, 0, this, 0);
+ disconnect(ircuser, nullptr, this, nullptr);
ircuser->deleteLater();
}
return;
_ircChannels.remove(chanName);
- disconnect(channel, 0, this, 0);
+ disconnect(channel, nullptr, this, nullptr);
channel->deleteLater();
}
if (_ircChannels.contains(channelname))
return _ircChannels[channelname];
else
- return 0;
+ return nullptr;
}
};
typedef QList<Server> ServerList;
- Network(const NetworkId &networkid, QObject *parent = 0);
+ Network(const NetworkId &networkid, QObject *parent = nullptr);
~Network();
inline NetworkId networkId() const { return _networkId; }
Q_PROPERTY(bool standardCtcp READ standardCtcp WRITE setStandardCtcp)
public :
- NetworkConfig(const QString &objectName = "GlobalNetworkConfig", QObject *parent = 0);
+ NetworkConfig(const QString &objectName = "GlobalNetworkConfig", QObject *parent = nullptr);
public slots:
inline bool pingTimeoutEnabled() const { return _pingTimeoutEnabled; }
return new NetworkSplitEvent(type, map, network);
default:
- return 0;
+ return nullptr;
}
}
Q_OBJECT
public:
- explicit Peer(AuthHandler *authHandler, QObject *parent = 0);
+ explicit Peer(AuthHandler *authHandler, QObject *parent = nullptr);
virtual Protocol::Type protocol() const = 0;
virtual QString description() const = 0;
static ProtoList supportedProtocols();
- static RemotePeer *createPeer(const ProtoDescriptor &protocol, AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = 0);
- static RemotePeer *createPeer(const ProtoList &protocols, AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = 0);
+ static RemotePeer *createPeer(const ProtoDescriptor &protocol, AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = nullptr);
+ static RemotePeer *createPeer(const ProtoList &protocols, AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = nullptr);
};
HeartBeatReply
};
- DataStreamPeer(AuthHandler *authHandler, QTcpSocket *socket, quint16 features, Compressor::CompressionLevel level, QObject *parent = 0);
+ DataStreamPeer(AuthHandler *authHandler, QTcpSocket *socket, quint16 features, Compressor::CompressionLevel level, QObject *parent = nullptr);
Protocol::Type protocol() const { return Protocol::DataStreamProtocol; }
QString protocolName() const { return "the DataStream protocol"; }
HeartBeatReply
};
- LegacyPeer(AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = 0);
+ LegacyPeer(AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = nullptr);
Protocol::Type protocol() const { return Protocol::LegacyProtocol; }
QString protocolName() const { return "the legacy protocol"; }
: Peer(authHandler, parent),
_socket(socket),
_compressor(new Compressor(socket, level, this)),
- _signalProxy(0),
+ _signalProxy(nullptr),
_heartBeatTimer(new QTimer(this)),
_heartBeatCount(0),
_lag(0),
if (!proxy) {
_heartBeatTimer->stop();
- disconnect(signalProxy(), 0, this, 0);
- _signalProxy = 0;
+ disconnect(signalProxy(), nullptr, this, nullptr);
+ _signalProxy = nullptr;
if (isOpen())
close();
}
using Peer::handle;
using Peer::dispatch;
- RemotePeer(AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = 0);
+ RemotePeer(AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = nullptr);
void setSignalProxy(SignalProxy *proxy);
int signalId;
QByteArray signature;
Signal(QObject *sender, int sigId, const QByteArray &signature) : sender(sender), signalId(sigId), signature(signature) {}
- Signal() : sender(0), signalId(-1) {}
+ Signal() : sender(nullptr), signalId(-1) {}
};
SignalProxy *_proxy;
return;
}
- disconnect(peer, 0, this, 0);
- peer->setSignalProxy(0);
+ disconnect(peer, nullptr, this, nullptr);
+ peer->setSignalProxy(nullptr);
_peerMap.remove(peer->id());
emit peerRemoved(peer);
if (_extendedMetaObjects.contains(meta))
return _extendedMetaObjects[meta];
else
- return 0;
+ return nullptr;
}
return false;
}
- void *_a[] = { 0, // return type...
- 0, 0, 0, 0, 0, // and 10 args - that's the max size qt can handle with signals and slots
- 0, 0, 0, 0, 0 };
+ void *_a[] = { nullptr, // return type...
+ nullptr, nullptr, nullptr, nullptr, nullptr, // and 10 args - that's the max size qt can handle with signals and slots
+ nullptr, nullptr, nullptr, nullptr, nullptr };
// check for argument compatibility and build params array
for (int i = 0; i < numArgs; i++) {
template<class T>
void handle(Peer *, T) { Q_ASSERT(0); }
- bool invokeSlot(QObject *receiver, int methodId, const QVariantList ¶ms, QVariant &returnValue, Peer *peer = 0);
- bool invokeSlot(QObject *receiver, int methodId, const QVariantList ¶ms = QVariantList(), Peer *peer = 0);
+ bool invokeSlot(QObject *receiver, int methodId, const QVariantList ¶ms, QVariant &returnValue, Peer *peer = nullptr);
+ bool invokeSlot(QObject *receiver, int methodId, const QVariantList ¶ms = QVariantList(), Peer *peer = nullptr);
void requestInit(SyncableObject *obj);
QVariantMap initData(SyncableObject *obj) const;
continue;
}
- QVariant value(variantType, (const void *)0);
+ QVariant value(variantType, (const void *)nullptr);
QGenericReturnArgument genericvalue = QGenericReturnArgument(method.typeName(), value.data());
QMetaObject::invokeMethod(this, methodname.toLatin1(), genericvalue);
Q_OBJECT
public:
- SyncableObject(QObject *parent = 0);
- SyncableObject(const QString &objectName, QObject *parent = 0);
- SyncableObject(const SyncableObject &other, QObject *parent = 0);
+ SyncableObject(QObject *parent = nullptr);
+ SyncableObject(const QString &objectName, QObject *parent = nullptr);
+ SyncableObject(const SyncableObject &other, QObject *parent = nullptr);
~SyncableObject() override;
//! Stores the object's state into a QVariantMap.
};
Q_ENUMS(Direction)
- Transfer(const QUuid &uuid, QObject *parent = 0); // for creating a syncable object client-side
- Transfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size = 0, QObject *parent = 0);
+ Transfer(const QUuid &uuid, QObject *parent = nullptr); // for creating a syncable object client-side
+ Transfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size = 0, QObject *parent = nullptr);
QUuid uuid() const;
Status status() const;
void error(const QString &errorString);
- void accepted(PeerPtr peer = 0) const;
- void rejected(PeerPtr peer = 0) const;
+ void accepted(PeerPtr peer = nullptr) const;
+ void rejected(PeerPtr peer = nullptr) const;
protected slots:
void setStatus(Transfer::Status status);
* \param codec The text codec we use if the input is not utf8
* \return The decoded string.
*/
-COMMON_EXPORT QString decodeString(const QByteArray &input, QTextCodec *codec = 0);
+COMMON_EXPORT QString decodeString(const QByteArray &input, QTextCodec *codec = nullptr);
COMMON_EXPORT uint editingDistance(const QString &s1, const QString &s2);
QHash<QThread *, Connection *>::iterator conIter;
for (conIter = _connectionPool.begin(); conIter != _connectionPool.end(); ++conIter) {
QSqlDatabase::removeDatabase(conIter.value()->name());
- disconnect(conIter.value(), 0, this, 0);
+ disconnect(conIter.value(), nullptr, this, nullptr);
}
}
// AbstractSqlMigrator
// ========================================
AbstractSqlMigrator::AbstractSqlMigrator()
- : _query(0)
+ : _query(nullptr)
{
}
void AbstractSqlMigrator::resetQuery()
{
delete _query;
- _query = 0;
+ _query = nullptr;
}
// ========================================
AbstractSqlMigrationReader::AbstractSqlMigrationReader()
: AbstractSqlMigrator(),
- _writer(0)
+ _writer(nullptr)
{
}
rollback();
_writer->rollback();
- _writer = 0;
+ _writer = nullptr;
}
commit();
if (!_writer->commit()) {
- _writer = 0;
+ _writer = nullptr;
return false;
}
- _writer = 0;
+ _writer = nullptr;
return true;
}
Q_OBJECT
public:
- AbstractSqlStorage(QObject *parent = 0);
+ AbstractSqlStorage(QObject *parent = nullptr);
virtual ~AbstractSqlStorage();
virtual std::unique_ptr<AbstractSqlMigrationReader> createMigrationReader() { return {}; }
Q_OBJECT
public:
- Connection(const QString &name, QObject *parent = 0);
+ Connection(const QString &name, QObject *parent = nullptr);
~Connection();
inline QLatin1String name() const { return QLatin1String(_name); }
Q_ASSERT(handler);
// From now on everything is handled by the client session
- disconnect(handler, 0, this, 0);
+ disconnect(handler, nullptr, this, nullptr);
_connectingClients.remove(handler);
handler->deleteLater();
CoreAuthHandler::CoreAuthHandler(QTcpSocket *socket, QObject *parent)
: AuthHandler(parent),
- _peer(0),
+ _peer(nullptr),
_magicReceived(false),
_legacy(false),
_clientRegistered(false),
quInfo() << qPrintable(tr("Client supports unknown features: %1").arg(clientFeatures.unknownFeatures().join(", ")));
}
- disconnect(socket(), 0, this, 0);
- disconnect(_peer, 0, this, 0);
- _peer->setParent(0); // Core needs to take care of this one now!
+ disconnect(socket(), nullptr, this, nullptr);
+ disconnect(_peer, nullptr, this, nullptr);
+ _peer->setParent(nullptr); // Core needs to take care of this one now!
socket()->flush(); // Make sure all data is sent before handing over the peer (and socket) to the session thread (bug 682)
emit handshakeComplete(_peer, uid);
Q_OBJECT
public:
- CoreAuthHandler(QTcpSocket *socket, QObject *parent = 0);
+ CoreAuthHandler(QTcpSocket *socket, QObject *parent = nullptr);
signals:
void handshakeComplete(RemotePeer *peer, UserId uid);
Q_OBJECT
public:
- CoreBacklogManager(CoreSession *coreSession = 0);
+ CoreBacklogManager(CoreSession *coreSession = nullptr);
CoreSession *coreSession() { return _coreSession; }
Q_OBJECT
public:
- CoreBasicHandler(CoreNetwork *parent = 0);
+ CoreBasicHandler(CoreNetwork *parent = nullptr);
QString serverDecode(const QByteArray &string);
QStringList serverDecode(const QList<QByteArray> &stringlist);
Q_OBJECT
public:
- CoreBufferViewConfig(int bufferViewId, QObject *parent = 0);
- CoreBufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = 0);
+ CoreBufferViewConfig(int bufferViewId, QObject *parent = nullptr);
+ CoreBufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = nullptr);
public slots:
virtual inline void requestSetBufferViewName(const QString &bufferViewName) { setBufferViewName(bufferViewName); }
QVariantMap views = Core::getUserSetting(_coreSession->user(), "BufferViews").toMap();
QVariantMap::iterator iter = views.begin();
QVariantMap::iterator iterEnd = views.end();
- CoreBufferViewConfig *config = 0;
+ CoreBufferViewConfig *config = nullptr;
while (iter != iterEnd) {
config = new CoreBufferViewConfig(iter.key().toInt(), iter.value().toMap(), this);
addBufferViewConfig(config);
Q_OBJECT
public:
- CoreIdentity(IdentityId id, QObject *parent = 0);
- CoreIdentity(const Identity &other, QObject *parent = 0);
- CoreIdentity(const CoreIdentity &other, QObject *parent = 0);
+ CoreIdentity(IdentityId id, QObject *parent = nullptr);
+ CoreIdentity(const Identity &other, QObject *parent = nullptr);
+ CoreIdentity(const CoreIdentity &other, QObject *parent = nullptr);
void synchronize(SignalProxy *proxy);
_receivedWelcomeMsg(false)
{
#ifdef HAVE_QCA2
- _cipher = 0;
+ _cipher = nullptr;
// Get the cipher key from CoreNetwork if present
CoreNetwork *coreNetwork = qobject_cast<CoreNetwork *>(network);
CoreIrcUser::CoreIrcUser(const QString &hostmask, Network *network) : IrcUser(hostmask, network)
{
#ifdef HAVE_QCA2
- _cipher = 0;
+ _cipher = nullptr;
// Get the cipher key from CoreNetwork if present
CoreNetwork *coreNetwork = qobject_cast<CoreNetwork *>(network);
Cipher *CoreNetwork::cipher(const QString &target)
{
if (target.isEmpty())
- return 0;
+ return nullptr;
if (!Cipher::neededFeaturesAvailable())
- return 0;
+ return nullptr;
CoreIrcChannel *channel = qobject_cast<CoreIrcChannel *>(ircChannel(target));
if (channel) {
} else if (!isChannelName(target)) {
return qobject_cast<CoreIrcUser*>(newIrcUser(target))->cipher();
}
- return 0;
+ return nullptr;
}
CoreNetwork *CoreSession::network(NetworkId id) const
{
if (_networks.contains(id)) return _networks[id];
- return 0;
+ return nullptr;
}
CoreIdentity *CoreSession::identity(IdentityId id) const
{
if (_identities.contains(id)) return _identities[id];
- return 0;
+ return nullptr;
}
void CoreSession::restoreSessionState()
{
QList<NetworkId> nets = Core::connectedNetworks(user());
- CoreNetwork *net = 0;
+ CoreNetwork *net = nullptr;
foreach(NetworkId id, nets) {
net = network(id);
Q_ASSERT(net);
if (net->connectionState() != Network::Disconnected) {
// make sure we no longer receive data from the tcp buffer
- disconnect(net, SIGNAL(displayMsg(NetworkId, Message::Type, BufferInfo::Type, const QString &, const QString &, const QString &, Message::Flags)), this, 0);
- disconnect(net, SIGNAL(displayStatusMsg(QString)), this, 0);
+ disconnect(net, SIGNAL(displayMsg(NetworkId, Message::Type, BufferInfo::Type, const QString &, const QString &, const QString &, Message::Flags)), this, nullptr);
+ disconnect(net, SIGNAL(displayStatusMsg(QString)), this, nullptr);
connect(net, SIGNAL(disconnected(NetworkId)), this, SLOT(destroyNetwork(NetworkId)));
net->disconnectFromIrc();
}
void CoreSession::clientsConnected()
{
QHash<NetworkId, CoreNetwork *>::iterator netIter = _networks.begin();
- Identity *identity = 0;
- CoreNetwork *net = 0;
- IrcUser *me = 0;
+ Identity *identity = nullptr;
+ CoreNetwork *net = nullptr;
+ IrcUser *me = nullptr;
while (netIter != _networks.end()) {
net = *netIter;
++netIter;
void CoreSession::clientsDisconnected()
{
QHash<NetworkId, CoreNetwork *>::iterator netIter = _networks.begin();
- Identity *identity = 0;
- CoreNetwork *net = 0;
- IrcUser *me = 0;
+ Identity *identity = nullptr;
+ CoreNetwork *net = nullptr;
+ IrcUser *me = nullptr;
QString awayReason;
while (netIter != _networks.end()) {
net = *netIter;
void CoreSession::globalAway(const QString &msg, const bool skipFormatting)
{
QHash<NetworkId, CoreNetwork *>::iterator netIter = _networks.begin();
- CoreNetwork *net = 0;
+ CoreNetwork *net = nullptr;
while (netIter != _networks.end()) {
net = *netIter;
++netIter;
Q_OBJECT
public:
- CoreSession(UserId, bool restoreState, bool strictIdentEnabled, QObject *parent = 0);
+ CoreSession(UserId, bool restoreState, bool strictIdentEnabled, QObject *parent = nullptr);
QList<BufferInfo> buffers() const;
inline UserId user() const { return _user; }
CoreTransfer::CoreTransfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 fileSize, QObject *parent)
: Transfer(direction, nick, fileName, address, port, fileSize, parent),
- _socket(0),
+ _socket(nullptr),
_pos(0),
_reading(false)
{
if (_socket) {
_socket->close();
_socket->deleteLater();
- _socket = 0;
+ _socket = nullptr;
}
_buffer.clear();
Q_OBJECT
public:
- CoreTransfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size = 0, QObject *parent = 0);
+ CoreTransfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size = 0, QObject *parent = nullptr);
quint64 transferred() const override;
Q_OBJECT
public:
- CoreUserInputHandler(CoreNetwork *parent = 0);
+ CoreUserInputHandler(CoreNetwork *parent = nullptr);
inline CoreNetwork *coreNetwork() const { return qobject_cast<CoreNetwork *>(parent()); }
void handleUserInput(const BufferInfo &bufferInfo, const QString &text);
private:
void doMode(const BufferInfo& bufferInfo, const QChar &addOrRemove, const QChar &mode, const QString &nickList);
void banOrUnban(const BufferInfo &bufferInfo, const QString &text, bool ban);
- void putPrivmsg(const QString &target, const QString &message, std::function<QByteArray(const QString &, const QString &)> encodeFunc, Cipher *cipher = 0);
+ void putPrivmsg(const QString &target, const QString &message, std::function<QByteArray(const QString &, const QString &)> encodeFunc, Cipher *cipher = nullptr);
#ifdef HAVE_QCA2
- QByteArray encrypt(const QString &target, const QByteArray &message, bool *didEncrypt = 0) const;
+ QByteArray encrypt(const QString &target, const QByteArray &message, bool *didEncrypt = nullptr) const;
#endif
struct Command {
Q_OBJECT
public:
- CtcpParser(CoreSession *coreSession, QObject *parent = 0);
+ CtcpParser(CoreSession *coreSession, QObject *parent = nullptr);
inline CoreSession *coreSession() const { return _coreSession; }
QString bufferName;
QList<QByteArray> replies;
- CtcpReply() : network(0) {}
+ CtcpReply() : network(nullptr) {}
CtcpReply(CoreNetwork *net, const QString &buf) : network(net), bufferName(buf) {}
};
if (type == EventManager::KeyEvent)
return new KeyEvent(type, map, network);
- return 0;
+ return nullptr;
}
LdapAuthenticator::LdapAuthenticator(QObject *parent)
: Authenticator(parent),
- _connection(0)
+ _connection(nullptr)
{
}
LdapAuthenticator::~LdapAuthenticator()
{
- if (_connection != 0) {
- ldap_unbind_ext(_connection, 0, 0);
+ if (_connection != nullptr) {
+ ldap_unbind_ext(_connection, nullptr, nullptr);
}
}
// Method based on abustany LDAP quassel patch.
bool LdapAuthenticator::ldapConnect()
{
- if (_connection != 0) {
+ if (_connection != nullptr) {
ldapDisconnect();
}
if (res != LDAP_SUCCESS) {
qWarning() << "Could not set LDAP protocol version to v3:" << ldap_err2string(res);
- ldap_unbind_ext(_connection, 0, 0);
- _connection = 0;
+ ldap_unbind_ext(_connection, nullptr, nullptr);
+ _connection = nullptr;
return false;
}
void LdapAuthenticator::ldapDisconnect()
{
- if (_connection == 0) {
+ if (_connection == nullptr) {
return;
}
- ldap_unbind_ext(_connection, 0, 0);
- _connection = 0;
+ ldap_unbind_ext(_connection, nullptr, nullptr);
+ _connection = nullptr;
}
int res;
// Attempt to establish a connection.
- if (_connection == 0) {
+ if (_connection == nullptr) {
if (!ldapConnect()) {
return false;
}
QByteArray baseDN = _baseDN.toLocal8Bit();
QByteArray uidAttribute = _uidAttribute.toLocal8Bit();
- cred.bv_val = (bindPassword.size() > 0 ? bindPassword.data() : NULL);
+ cred.bv_val = (bindPassword.size() > 0 ? bindPassword.data() : nullptr);
cred.bv_len = bindPassword.size();
- res = ldap_sasl_bind_s(_connection, bindDN.size() > 0 ? bindDN.constData() : 0, LDAP_SASL_SIMPLE, &cred, 0, 0, 0);
+ res = ldap_sasl_bind_s(_connection, bindDN.size() > 0 ? bindDN.constData() : nullptr, LDAP_SASL_SIMPLE, &cred, nullptr, nullptr, nullptr);
if (res != LDAP_SUCCESS) {
qWarning() << "Refusing connection from" << username << "(LDAP bind failed:" << ldap_err2string(res) << ")";
return false;
}
- LDAPMessage *msg = NULL, *entry = NULL;
+ LDAPMessage *msg = nullptr, *entry = nullptr;
const QByteArray ldapQuery = "(&(" + uidAttribute + '=' + username.toLocal8Bit() + ")" + _filter.toLocal8Bit() + ")";
- res = ldap_search_ext_s(_connection, baseDN.constData(), LDAP_SCOPE_SUBTREE, ldapQuery.constData(), 0, 0, 0, 0, 0, 0, &msg);
+ res = ldap_search_ext_s(_connection, baseDN.constData(), LDAP_SCOPE_SUBTREE, ldapQuery.constData(), nullptr, 0, nullptr, nullptr, nullptr, 0, &msg);
if (res != LDAP_SUCCESS) {
qWarning() << "Refusing connection from" << username << "(LDAP search failed:" << ldap_err2string(res) << ")";
entry = ldap_first_entry(_connection, msg);
- if (entry == 0) {
+ if (entry == nullptr) {
qWarning() << "Refusing connection from" << username << "(LDAP search returned no results)";
ldap_msgfree(msg);
return false;
char *userDN = ldap_get_dn(_connection, entry);
- res = ldap_sasl_bind_s(_connection, userDN, LDAP_SASL_SIMPLE, &cred, 0, 0, 0);
+ res = ldap_sasl_bind_s(_connection, userDN, LDAP_SASL_SIMPLE, &cred, nullptr, nullptr, nullptr);
if (res != LDAP_SUCCESS) {
qWarning() << "Refusing connection from" << username << "(LDAP authentication failed)";
Q_OBJECT
public:
- LdapAuthenticator(QObject *parent = 0);
+ LdapAuthenticator(QObject *parent = nullptr);
~LdapAuthenticator() override;
public slots:
{
Q_OBJECT
public:
- Netsplit(Network *network, QObject *parent = 0);
+ Netsplit(Network *network, QObject *parent = nullptr);
inline Network *network() const { return _network; }
{
Q_OBJECT
public:
- explicit OidentdConfigGenerator(QObject *parent = 0);
+ explicit OidentdConfigGenerator(QObject *parent = nullptr);
~OidentdConfigGenerator();
public slots:
query.bindValue(":lastseenmsgid", lastSeenMsgId.toQint64());
safeExec(query);
watchQuery(query);
- Message::Types result = Message::Types(0);
+ Message::Types result = Message::Types(nullptr);
if (query.first())
result = Message::Types(query.value(0).toInt());
return result;
Q_OBJECT
public:
- PostgreSqlStorage(QObject *parent = 0);
+ PostgreSqlStorage(QObject *parent = nullptr);
~PostgreSqlStorage() override;
std::unique_ptr<AbstractSqlMigrationWriter> createMigrationWriter() override;
Q_OBJECT
public:
- SessionThread(UserId user, bool restoreState, bool strictIdentEnabled, QObject *parent = 0);
+ SessionThread(UserId user, bool restoreState, bool strictIdentEnabled, QObject *parent = nullptr);
~SessionThread();
public slots:
Q_OBJECT
public:
- SqlAuthenticator(QObject *parent = 0);
+ SqlAuthenticator(QObject *parent = nullptr);
virtual ~SqlAuthenticator();
public slots:
QSqlDatabase db = logDb();
db.transaction();
- Message::Types result = Message::Types(0);
+ Message::Types result = Message::Types(nullptr);
{
QSqlQuery query(db);
query.prepare(queryString("select_buffer_bufferactivity"));
Q_OBJECT
public:
- SqliteStorage(QObject *parent = 0);
+ SqliteStorage(QObject *parent = nullptr);
~SqliteStorage() override;
std::unique_ptr<AbstractSqlMigrationReader> createMigrationReader() override;
QTcpSocket *SslServer::nextPendingConnection()
{
if (_pendingConnections.isEmpty())
- return 0;
+ return nullptr;
else
return _pendingConnections.takeFirst();
}
Q_OBJECT
public:
- SslServer(QObject *parent = 0);
+ SslServer(QObject *parent = nullptr);
bool hasPendingConnections() const override { return !_pendingConnections.isEmpty(); }
QTcpSocket *nextPendingConnection() override;
Q_OBJECT
public:
- Storage(QObject *parent = 0);
+ Storage(QObject *parent = nullptr);
virtual ~Storage() {};
enum State {
Q_OBJECT
public:
- AboutDlg(QWidget *parent = 0);
+ AboutDlg(QWidget *parent = nullptr);
private:
Ui::AboutDlg ui;
Q_OBJECT
public:
- AwayLogFilter(MessageModel *model, QObject *parent = 0);
+ AwayLogFilter(MessageModel *model, QObject *parent = nullptr);
virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
virtual QString idString() const { return "AwayLog"; }
Q_OBJECT
public:
- AwayLogView(AwayLogFilter *filter, QWidget *parent = 0);
+ AwayLogView(AwayLogFilter *filter, QWidget *parent = nullptr);
virtual void addActionsToMenu(QMenu *menu, const QPointF &pos);
};
BufferWidget::~BufferWidget()
{
delete _chatViewSearchController;
- _chatViewSearchController = 0;
+ _chatViewSearchController = nullptr;
}
virtual inline bool autoMarkerLineOnLostFocus() const { return _autoMarkerLineOnLostFocus; }
public slots:
- virtual void setMarkerLine(ChatView *view = 0, bool allowGoingBack = true);
- virtual void jumpToMarkerLine(ChatView *view = 0, bool requestBacklog = true);
+ virtual void setMarkerLine(ChatView *view = nullptr, bool allowGoingBack = true);
+ virtual void jumpToMarkerLine(ChatView *view = nullptr, bool requestBacklog = true);
protected:
virtual AbstractChatView *createChatView(BufferId);
_listFinished(true),
_ircListModel(this),
_sortFilter(this),
- _simpleModeSpacer(0),
+ _simpleModeSpacer(nullptr),
_advancedMode(false)
{
_sortFilter.setSourceModel(&_ircListModel);
if (_simpleModeSpacer) {
ui.searchLayout->removeItem(_simpleModeSpacer);
delete _simpleModeSpacer;
- _simpleModeSpacer = 0;
+ _simpleModeSpacer = nullptr;
}
ui.advancedModeLabel->setPixmap(icon::get("edit-clear-locationbar-rtl").pixmap(16));
}
Q_OBJECT
public:
- ChannelListDlg(QWidget *parent = 0);
+ ChannelListDlg(QWidget *parent = nullptr);
void setNetwork(NetworkId netId);
_boundingRect(boundingRect),
_selectionMode(NoSelection),
_selectionStart(-1),
- _cachedLayout(0)
+ _cachedLayout(nullptr)
{
}
void ChatItem::clearCache()
{
delete _cachedLayout;
- _cachedLayout = 0;
+ _cachedLayout = nullptr;
}
ContentsChatItem::ContentsChatItem(const QPointF &pos, const qreal &width, ChatLine *parent)
: ChatItem(QRectF(pos, QSizeF(width, 0)), parent),
- _data(0)
+ _data(nullptr)
{
setPos(pos);
setGeometryByWidth(width);
void ContentsChatItem::clearCache()
{
delete _data;
- _data = 0;
+ _data = nullptr;
ChatItem::clearCache();
}
qreal spacing = qMax(fontMetrics()->lineSpacing(), fontMetrics()->height()); // cope with negative leading()
qreal h = lines * spacing;
delete _data;
- _data = 0;
+ _data = nullptr;
if (w != width() || h != height())
setGeometry(w, h);
QPointF mapToScene(const QPointF &) const;
QPointF mapFromScene(const QPointF &) const;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr);
virtual inline int type() const { return ChatScene::ChatItemType; }
QVariant data(int role) const;
virtual void handleClick(const QPointF &pos, ChatScene::ClickMode clickMode);
protected:
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr);
virtual inline int type() const { return ChatScene::SenderChatItemType; }
virtual void initLayout(QTextLayout *layout) const;
};
_width(width),
_height(_contentsItem.height()),
_selection(0),
- _mouseGrabberItem(0),
- _hoverItem(0)
+ _mouseGrabberItem(nullptr),
+ _hoverItem(nullptr)
{
Q_ASSERT(model);
QModelIndex index = model->index(row, ChatLineModel::ContentsColumn);
case ChatLineModel::ContentsColumn:
return &_contentsItem;
default:
- return 0;
+ return nullptr;
}
}
return &_senderItem;
if (_timestampItem.boundingRect().contains(pos))
return &_timestampItem;
- return 0;
+ return nullptr;
}
setMouseGrabberItem(itemAt(linePos));
}
else if (event->type() == QEvent::UngrabMouse) {
- setMouseGrabberItem(0);
+ setMouseGrabberItem(nullptr);
}
return QGraphicsItem::sceneEvent(event);
}
{
if (_hoverItem) {
_hoverItem->hoverLeaveEvent(event);
- _hoverItem = 0;
+ _hoverItem = nullptr;
}
}
const qreal &width,
const qreal ×tampWidth, const qreal &senderWidth, const qreal &contentsWidth,
const QPointF &senderPos, const QPointF &contentsPos,
- QGraphicsItem *parent = 0);
+ QGraphicsItem *parent = nullptr);
virtual ~ChatLine();
inline const QAbstractItemModel *model() const { return _model; }
inline ChatScene *chatScene() const { return qobject_cast<ChatScene *>(scene()); }
- inline ChatView *chatView() const { return chatScene() ? chatScene()->chatView() : 0; }
+ inline ChatView *chatView() const { return chatScene() ? chatScene()->chatView() : nullptr; }
inline qreal width() const { return _width; }
inline qreal height() const { return _height; }
inline ChatItem *senderItem() { return &_senderItem; }
inline ContentsChatItem *contentsItem() { return &_contentsItem; }
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr);
enum { Type = ChatScene::ChatLineType };
virtual inline int type() const { return Type; }
SelectedBackgroundRole
};
- ChatLineModel(QObject *parent = 0);
+ ChatLineModel(QObject *parent = nullptr);
typedef ChatLineModelItem::Word Word;
typedef ChatLineModelItem::WrapList WrapList;
AllFields = 0xff
};
- ChatMonitorFilter(MessageModel *model, QObject *parent = 0);
+ ChatMonitorFilter(MessageModel *model, QObject *parent = nullptr);
virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
virtual QString idString() const { return "ChatMonitor"; }
_markerLineJumpPending(false),
_cutoffMode(CutoffRight),
_alwaysBracketSender(false),
- _selectingItem(0),
+ _selectingItem(nullptr),
_selectionStart(-1),
_isSelecting(false),
_clickMode(NoClick),
ChatLine *ChatScene::chatLine(MsgId msgId, bool matchExact, bool ignoreDayChange) const
{
if (!_lines.count())
- return 0;
+ return nullptr;
QList<ChatLine *>::ConstIterator start = _lines.begin();
QList<ChatLine *>::ConstIterator end = _lines.end();
return *start;
if (matchExact)
- return 0;
+ return nullptr;
if (start == _lines.begin()) // not (yet?) in our scene
- return 0;
+ return nullptr;
// if we didn't find the exact msgId, take the next-lower one (this makes sense for lastSeen)
if (_lines.at(i)->msgType() != Message::DayChange)
return _lines.at(i);
}
- return 0;
+ return nullptr;
}
// return the next-lower line
return *start;
}
while (start != _lines.begin());
- return 0;
+ return nullptr;
}
if (line)
return line->itemAt(line->mapFromScene(scenePos));
}
- return 0;
+ return nullptr;
}
// neither pre- or append means we have to do dirty work: move items...
if (!(atTop || atBottom)) {
- ChatLine *line = 0;
+ ChatLine *line = nullptr;
for (int i = 0; i <= end; i++) {
line = _lines.at(i);
line->setPos(0, line->pos().y() - h);
if (_selectingItem) {
int row = _selectingItem->row();
if (row >= start && row <= end)
- setSelectingItem(0);
+ setSelectingItem(nullptr);
}
// remove items from scene
int lineCount = start;
while (lineIter != _lines.end() && lineCount <= end) {
if ((*lineIter) == markerLine()->chatLine())
- markerLine()->setChatLine(0);
+ markerLine()->setChatLine(nullptr);
h += (*lineIter)->height();
delete *lineIter;
lineIter = _lines.erase(lineIter);
moveStart = start;
offset = -offset;
}
- ChatLine *line = 0;
+ ChatLine *line = nullptr;
for (int i = moveStart; i <= moveEnd; i++) {
line = _lines.at(i);
line->setPos(0, line->pos().y() + offset);
if (webPreview.previewItem->scene())
removeItem(webPreview.previewItem);
delete webPreview.previewItem;
- webPreview.previewItem = 0;
+ webPreview.previewItem = nullptr;
}
webPreview.previewState = WebPreview::NoPreview;
}
case WebPreview::HidePreview:
if (webPreview.previewItem) {
delete webPreview.previewItem;
- webPreview.previewItem = 0;
+ webPreview.previewItem = nullptr;
}
- webPreview.parentItem = 0;
+ webPreview.parentItem = nullptr;
webPreview.url = QUrl();
webPreview.urlRect = QRectF();
webPreview.previewState = WebPreview::NoPreview;
webPreview.previewState = WebPreview::NoPreview; // we haven't loaded anything yet
break;
case WebPreview::ShowPreview:
- if (parentItem == 0 || webPreview.parentItem == parentItem) {
+ if (parentItem == nullptr || webPreview.parentItem == parentItem) {
if (webPreview.previewItem && webPreview.previewItem->scene())
removeItem(webPreview.previewItem);
}
#if defined HAVE_WEBKIT || defined HAVE_WEBENGINE
void loadWebPreview(ChatItem *parentItem, const QUrl &url, const QRectF &urlRect);
- void clearWebPreview(ChatItem *parentItem = 0);
+ void clearWebPreview(ChatItem *parentItem = nullptr);
#endif
signals:
QRectF urlRect;
PreviewState previewState;
QTimer timer;
- WebPreview() : parentItem(0), previewItem(0), previewState(NoPreview) {}
+ WebPreview() : parentItem(nullptr), previewItem(nullptr), previewState(NoPreview) {}
};
WebPreview webPreview;
#endif // HAVE_WEBKIT || HAVE_WEBENGINE
void ChatView::init(MessageFilter *filter)
{
- _bufferContainer = 0;
+ _bufferContainer = nullptr;
_currentScaleFactor = 1;
_invalidateFilter = false;
ChatLine *ChatView::lastVisibleChatLine(bool ignoreDayChange) const
{
if (!scene())
- return 0;
+ return nullptr;
QAbstractItemModel *model = scene()->model();
if (!model || model->rowCount() == 0)
- return 0;
+ return nullptr;
int row = -1;
if (row >= 0)
return scene()->chatLine(row);
- return 0;
+ return nullptr;
}
Q_OBJECT
public:
- ChatView(MessageFilter *, QWidget *parent = 0);
- ChatView(BufferId bufferId, QWidget *parent = 0);
+ ChatView(MessageFilter *, QWidget *parent = nullptr);
+ ChatView(BufferId bufferId, QWidget *parent = nullptr);
virtual MsgId lastMsgId() const;
virtual MsgId lastVisibleMsgId() const;
Q_OBJECT
public:
- ChatViewSearchBar(QWidget *parent = 0);
+ ChatViewSearchBar(QWidget *parent = nullptr);
inline QLineEdit *searchEditLine() const { return ui.searchEditLine; }
inline QCheckBox *caseSensitiveBox() const { return ui.caseSensitiveBox; }
ChatViewSearchController::ChatViewSearchController(QObject *parent)
: QObject(parent),
- _scene(0),
+ _scene(nullptr),
_currentHighlight(0),
_caseSensitive(false),
_searchSenders(false),
return;
if (_scene) {
- disconnect(_scene, 0, this, 0);
- disconnect(Client::messageModel(), 0, this, 0);
+ disconnect(_scene, nullptr, this, nullptr);
+ disconnect(Client::messageModel(), nullptr, this, nullptr);
qDeleteAll(_highlightItems);
_highlightItems.clear();
}
void ChatViewSearchController::sceneDestroyed()
{
// WARNING: don't call any methods on scene!
- _scene = 0;
+ _scene = nullptr;
// the items will be automatically deleted when the scene is destroyed
// so we just have to clear the list;
_highlightItems.clear();
Q_OBJECT
public:
- ChatViewSearchController(QObject *parent = 0);
+ ChatViewSearchController(QObject *parent = nullptr);
inline const QString &searchString() const { return _searchString; }
Q_INTERFACES(QGraphicsItem)
public:
- SearchHighlightItem(QRectF wordRect, QGraphicsItem *parent = 0);
+ SearchHighlightItem(QRectF wordRect, QGraphicsItem *parent = nullptr);
virtual inline QRectF boundingRect() const { return _boundingRect; }
void updateGeometry(qreal width, qreal height);
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr);
enum { Type = ChatScene::SearchHighlightType };
virtual inline int type() const { return Type; }
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
public :
- ColumnHandleItem(qreal width, QGraphicsItem *parent = 0);
+ ColumnHandleItem(qreal width, QGraphicsItem *parent = nullptr);
virtual inline int type() const { return ChatScene::ColumnHandleType; }
inline qreal width() const { return _width; }
void setXPos(qreal xpos);
void setXLimits(qreal min, qreal max);
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr);
public slots:
void sceneRectChanged(const QRectF &);
ConclusionPage
};
- CoreConfigWizard(CoreConnection *connection, const QVariantList &backendInfos, const QVariantList &authInfos, QWidget *parent = 0);
+ CoreConfigWizard(CoreConnection *connection, const QVariantList &backendInfos, const QVariantList &authInfos, QWidget *parent = nullptr);
inline CoreConnection *coreConnection() const { return _connection; }
Q_OBJECT
public:
- IntroPage(QWidget *parent = 0);
+ IntroPage(QWidget *parent = nullptr);
int nextId() const;
private:
Ui::CoreConfigWizardIntroPage ui;
Q_OBJECT
public:
- AdminUserPage(QWidget *parent = 0);
+ AdminUserPage(QWidget *parent = nullptr);
int nextId() const;
bool isComplete() const;
private:
using FieldInfo = std::tuple<QString, QString, QVariant>;
public:
- AuthenticationSelectionPage(const QVariantList &authInfos, QWidget *parent = 0);
+ AuthenticationSelectionPage(const QVariantList &authInfos, QWidget *parent = nullptr);
int nextId() const;
QString displayName() const;
QString authenticator() const;
using FieldInfo = std::tuple<QString, QString, QVariant>;
public:
- StorageSelectionPage(const QVariantList &backendInfos, QWidget *parent = 0);
+ StorageSelectionPage(const QVariantList &backendInfos, QWidget *parent = nullptr);
int nextId() const;
QString displayName() const;
QString backend() const;
Q_OBJECT
public:
- SyncPage(QWidget *parent = 0);
+ SyncPage(QWidget *parent = nullptr);
void initializePage();
int nextId() const;
bool isComplete() const;
Q_OBJECT
public:
- SyncRelayPage(QWidget *parent = 0);
+ SyncRelayPage(QWidget *parent = nullptr);
int nextId() const;
enum Mode { Success, Error };
Q_OBJECT
public:
- CoreConnectDlg(QWidget *parent = 0);
+ CoreConnectDlg(QWidget *parent = nullptr);
AccountId selectedAccount() const;
void accept();
Q_OBJECT
public:
- CoreConnectAuthDlg(CoreAccount *account, QWidget *parent = 0);
+ CoreConnectAuthDlg(CoreAccount *account, QWidget *parent = nullptr);
void accept();
Q_OBJECT
public:
- CoreConnectionStatusWidget(CoreConnection *connection, QWidget *parent = 0);
+ CoreConnectionStatusWidget(CoreConnection *connection, QWidget *parent = nullptr);
inline CoreConnection *coreConnection() const { return _coreConnection; }
Q_OBJECT
public:
- DebugBufferViewOverlay(QWidget *parent = 0);
+ DebugBufferViewOverlay(QWidget *parent = nullptr);
private slots:
void update();
Q_OBJECT
public:
- DebugConsole(QWidget *parent = 0);
+ DebugConsole(QWidget *parent = nullptr);
virtual ~DebugConsole();
public slots:
Q_OBJECT
public:
- DebugLogDlg(QWidget *parent = 0);
+ DebugLogDlg(QWidget *parent = nullptr);
private slots:
void logUpdated(const Logger::LogEntry &msg);
Q_OBJECT
public:
- DebugMessageModelFilter(QObject *parent = 0);
+ DebugMessageModelFilter(QObject *parent = nullptr);
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
virtual QVariant data(const QModelIndex &index, int role) const;
};
#include "clientbacklogmanager.h"
DockManagerNotificationBackend::DockManagerNotificationBackend(QObject *parent)
- : AbstractNotificationBackend(parent), _bus(QDBusConnection::sessionBus()), _dock(0), _item(0), _count(0)
+ : AbstractNotificationBackend(parent), _bus(QDBusConnection::sessionBus()), _dock(nullptr), _item(nullptr), _count(0)
{
NotificationSettings notificationSettings;
_enabled = notificationSettings.value("DockManager/Enabled", false).toBool();
int perc = 0;
if (done == total) {
- disconnect(Client::backlogManager(), 0, this, 0);
+ disconnect(Client::backlogManager(), nullptr, this, nullptr);
perc = -1;
} else
perc = (done * 100) / total;
Q_OBJECT
public:
- DockManagerNotificationBackend(QObject *parent = 0);
+ DockManagerNotificationBackend(QObject *parent = nullptr);
void notify(const Notification &);
void close(uint notificationId);
Q_OBJECT
public:
- ConfigWidget(bool enabled, QWidget *parent = 0);
+ ConfigWidget(bool enabled, QWidget *parent = nullptr);
void save();
void load();
const Network *previousNet = Client::network(_networkId);
if (previousNet) {
- disconnect(previousNet, 0, this, 0);
+ disconnect(previousNet, nullptr, this, nullptr);
if (previousNet->me())
- disconnect(previousNet->me(), 0, this, 0);
+ disconnect(previousNet->me(), nullptr, this, nullptr);
}
_networkId = networkId;
const Identity *previousIdentity = Client::identity(_identityId);
if (previousIdentity)
- disconnect(previousIdentity, 0, this, 0);
+ disconnect(previousIdentity, nullptr, this, nullptr);
_identityId = identityId;
Q_OBJECT
public:
- InputWidget(QWidget *parent = 0);
+ InputWidget(QWidget *parent = nullptr);
virtual ~InputWidget();
const Network *currentNetwork() const;
Q_OBJECT
public:
- MouseWheelFilter(QObject *parent = 0);
+ MouseWheelFilter(QObject *parent = nullptr);
virtual bool eventFilter(QObject *obj, QEvent *event);
};
IrcConnectionWizard::IrcConnectionWizard(QWidget *parent, Qt::WindowFlags flags)
: QWizard(parent, flags),
- _introductionPage(0),
- _identityPage(0),
- _networkPage(0)
+ _introductionPage(nullptr),
+ _identityPage(nullptr),
+ _networkPage(nullptr)
{
_introductionPage = createIntroductionPage(this);
_identityPage = new IdentityPage(this);
IdentityPage::IdentityPage(QWidget *parent)
: QWizardPage(parent),
_identityEditWidget(new IdentityEditWidget(this)),
- _identity(0)
+ _identity(nullptr)
{
setTitle(tr("Setup Identity"));
Q_OBJECT
public:
- IrcConnectionWizard(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ IrcConnectionWizard(QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr);
- static QWizardPage *createIntroductionPage(QWidget *parent = 0);
+ static QWizardPage *createIntroductionPage(QWidget *parent = nullptr);
private slots:
void finishClicked();
Q_OBJECT
public:
- IdentityPage(QWidget *parent = 0);
+ IdentityPage(QWidget *parent = nullptr);
CertIdentity *identity();
Q_OBJECT
public:
- NetworkPage(QWidget *parent = 0);
+ NetworkPage(QWidget *parent = nullptr);
NetworkInfo networkInfo();
QStringList channelList();
Q_OBJECT
public:
- KNotificationBackend(QObject *parent = 0);
+ KNotificationBackend(QObject *parent = nullptr);
void notify(const Notification &);
void close(uint notificationId);
Q_OBJECT
public:
- ConfigWidget(QWidget *parent = 0);
+ ConfigWidget(QWidget *parent = nullptr);
void save();
void load();
Q_OBJECT
public:
- MainPage(QWidget *parent = 0);
+ MainPage(QWidget *parent = nullptr);
private slots:
void showCoreConnectionDlg();
_msgProcessorStatusWidget(new MsgProcessorStatusWidget(this)),
_coreConnectionStatusWidget(new CoreConnectionStatusWidget(Client::coreConnection(), this)),
_titleSetter(this),
- _awayLog(0),
+ _awayLog(nullptr),
_layoutLoaded(false),
_activeBufferViewIndex(-1),
_aboutToQuit(false)
connect(lockAct, SIGNAL(toggled(bool)), SLOT(on_actionLockLayout_toggled(bool)));
coll->addAction("ToggleSearchBar", new Action(icon::get("edit-find"), tr("Show &Search Bar"), coll,
- 0, 0, QKeySequence::Find))->setCheckable(true);
+ nullptr, nullptr, QKeySequence::Find))->setCheckable(true);
coll->addAction("ShowAwayLog", new Action(tr("Show Away Log"), coll,
this, SLOT(showAwayLog())));
coll->addAction("ToggleMenuBar", new Action(icon::get("show-menu"), tr("Show &Menubar"), coll,
- 0, 0))->setCheckable(true);
+ nullptr, nullptr))->setCheckable(true);
coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll,
- 0, 0))->setCheckable(true);
+ nullptr, nullptr))->setCheckable(true);
#ifdef HAVE_KDE
_fullScreenAction = KStandardAction::fullScreen(this, SLOT(onFullScreenToggled()), this, coll);
// "All Buffers" is always the first dock created
if (_bufferViews.count() > 0)
return _bufferViews[0]->bufferView();
- return 0;
+ return nullptr;
}
BufferView *MainWin::activeBufferView() const
{
if (_activeBufferViewIndex < 0 || _activeBufferViewIndex >= _bufferViews.count())
- return 0;
+ return nullptr;
BufferViewDock *dock = _bufferViews.at(_activeBufferViewIndex);
- return dock->isActive() ? dock->bufferView() : 0;
+ return dock->isActive() ? dock->bufferView() : nullptr;
}
if (_awayLog)
return;
AwayLogFilter *filter = new AwayLogFilter(Client::messageModel());
- _awayLog = new AwayLogView(filter, 0);
+ _awayLog = new AwayLogView(filter, nullptr);
filter->setParent(_awayLog);
connect(_awayLog, SIGNAL(destroyed()), this, SLOT(awayLogDestroyed()));
_awayLog->setAttribute(Qt::WA_DeleteOnClose);
void MainWin::awayLogDestroyed()
{
- _awayLog = 0;
+ _awayLog = nullptr;
}
{
Q_UNUSED(parent);
- bool hasFocus = QApplication::activeWindow() != 0;
+ bool hasFocus = QApplication::activeWindow() != nullptr;
for (int i = start; i <= end; i++) {
QModelIndex idx = Client::messageModel()->index(i, ChatLineModel::ContentsColumn);
connect(net, SIGNAL(updatedRemotely()), this, SLOT(clientNetworkUpdated()));
connect(act, SIGNAL(triggered()), this, SLOT(connectOrDisconnectFromNet()));
- QAction *beforeAction = 0;
+ QAction *beforeAction = nullptr;
foreach(QAction *action, _networksMenu->actions()) {
if (!action->data().isValid()) // ignore stock actions
continue;
void MainWin::on_actionDebugBufferViewOverlay_triggered()
{
- DebugBufferViewOverlay *overlay = new DebugBufferViewOverlay(0);
+ DebugBufferViewOverlay *overlay = new DebugBufferViewOverlay(nullptr);
overlay->setAttribute(Qt::WA_DeleteOnClose);
overlay->show();
}
void MainWin::on_actionDebugMessageModel_triggered()
{
- QTableView *view = new QTableView(0);
+ QTableView *view = new QTableView(nullptr);
DebugMessageModelFilter *filter = new DebugMessageModelFilter(view);
filter->setSourceModel(Client::messageModel());
view->setModel(filter);
Q_OBJECT
public:
- MainWin(QWidget *parent = 0);
+ MainWin(QWidget *parent = nullptr);
void init();
MarkerLineItem::MarkerLineItem(qreal sceneWidth, QGraphicsItem *parent)
: QGraphicsObject(parent),
_boundingRect(0, 0, sceneWidth, 1),
- _chatLine(0)
+ _chatLine(nullptr)
{
setVisible(false);
setZValue(8);
Q_OBJECT
public:
- MarkerLineItem(qreal sceneWidth, QGraphicsItem *parent = 0);
+ MarkerLineItem(qreal sceneWidth, QGraphicsItem *parent = nullptr);
virtual inline int type() const { return ChatScene::MarkerLineType; }
inline QRectF boundingRect() const { return _boundingRect; }
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr);
inline ChatLine *chatLine() const { return _chatLine; }
Q_OBJECT
public:
- MsgProcessorStatusWidget(QWidget *parent = 0);
+ MsgProcessorStatusWidget(QWidget *parent = nullptr);
public slots:
void setProgress(int value, int max);
if (dock)
return dock;
else
- return 0;
+ return nullptr;
}
iter = nickViews.erase(iter);
ui.stackedWidget->removeWidget(nickView);
QAbstractItemModel *model = nickView->model();
- nickView->setModel(0);
+ nickView->setModel(nullptr);
if (QSortFilterProxyModel *filter = qobject_cast<QSortFilterProxyModel *>(model))
- filter->setSourceModel(0);
+ filter->setSourceModel(nullptr);
model->deleteLater();
nickView->deleteLater();
}
NickView *view = nickViews.take(bufferId);
ui.stackedWidget->removeWidget(view);
QAbstractItemModel *model = view->model();
- view->setModel(0);
+ view->setModel(nullptr);
if (QSortFilterProxyModel *filter = qobject_cast<QSortFilterProxyModel *>(model))
- filter->setSourceModel(0);
+ filter->setSourceModel(nullptr);
model->deleteLater();
view->deleteLater();
}
void NickListDock::setLocked(bool locked) {
if (locked) {
- setFeatures(0);
+ setFeatures(nullptr);
}
else {
setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
Q_OBJECT
public:
- NickListWidget(QWidget *parent = 0);
+ NickListWidget(QWidget *parent = nullptr);
public slots:
void showWidget(bool visible);
Q_OBJECT
public:
- NickListDock(const QString &title, QWidget *parent = 0);
+ NickListDock(const QString &title, QWidget *parent = nullptr);
// ~NickListDock();
void setLocked(bool locked);
Q_OBJECT
public:
- QtMultimediaNotificationBackend(QObject *parent = 0);
+ QtMultimediaNotificationBackend(QObject *parent = nullptr);
void notify(const Notification &) override;
void close(uint notificationId) override;
Q_OBJECT
public:
- ConfigWidget(QWidget *parent = 0);
+ ConfigWidget(QWidget *parent = nullptr);
void save() override;
void load() override;
Q_OBJECT
public:
- QtUiStyle(QObject *parent = 0);
+ QtUiStyle(QObject *parent = nullptr);
virtual ~QtUiStyle();
virtual inline qreal firstColumnSeparator() const { return 6; }
Q_OBJECT
public:
- ReceiveFileDlg(const Transfer *transfer, QWidget *parent = 0);
+ ReceiveFileDlg(const Transfer *transfer, QWidget *parent = nullptr);
private slots:
void on_buttonBox_clicked(QAbstractButton *button);
SettingsDlg::SettingsDlg(QWidget *parent)
: QDialog(parent),
- _currentPage(0)
+ _currentPage(nullptr)
{
ui.setupUi(this);
setModal(true);
void SettingsDlg::selectPage(SettingsPage *sp)
{
if (!sp) {
- _currentPage = 0;
+ _currentPage = nullptr;
ui.settingsStack->setCurrentIndex(0);
ui.pageTitle->setText(tr("Settings"));
return;
pageIsLoaded[sp] = true;
}
- if (sp != currentPage() && currentPage() != 0 && currentPage()->hasChanged()) {
+ if (sp != currentPage() && currentPage() != nullptr && currentPage()->hasChanged()) {
int ret = QMessageBox::warning(this, tr("Save changes"),
tr("There are unsaved changes on the current configuration page. Would you like to apply your changes now?"),
QMessageBox::Discard|QMessageBox::Save|QMessageBox::Cancel, QMessageBox::Cancel);
void SettingsDlg::itemSelected()
{
QList<QTreeWidgetItem *> items = ui.settingsTree->selectedItems();
- SettingsPage *sp = 0;
+ SettingsPage *sp = nullptr;
if (!items.isEmpty()) {
sp = qobject_cast<SettingsPage *>(items[0]->data(0, SettingsPageRole).value<QObject *>());
}
Q_OBJECT
public:
- SettingsDlg(QWidget *parent = 0);
+ SettingsDlg(QWidget *parent = nullptr);
void registerSettingsPage(SettingsPage *);
void unregisterSettingsPage(SettingsPage *);
{
Q_OBJECT
public:
- SettingsPageDlg(SettingsPage *page, QWidget *parent = 0);
+ SettingsPageDlg(SettingsPage *page, QWidget *parent = nullptr);
SettingsPage *currentPage() const;
Q_OBJECT
public:
- AliasesModel(QObject *parent = 0);
+ AliasesModel(QObject *parent = nullptr);
virtual QVariant data(const QModelIndex &index, int role) const;
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
Q_OBJECT
public:
- AliasesSettingsPage(QWidget *parent = 0);
+ AliasesSettingsPage(QWidget *parent = nullptr);
virtual inline bool hasDefaults() const { return true; }
virtual inline bool needsCoreConnection() const { return true; }
Q_OBJECT
public:
- AppearanceSettingsPage(QWidget *parent = 0);
+ AppearanceSettingsPage(QWidget *parent = nullptr);
inline bool hasDefaults() const { return true; }
Q_OBJECT
public:
- BacklogSettingsPage(QWidget *parent = 0);
+ BacklogSettingsPage(QWidget *parent = nullptr);
inline QString settingsKey() const { return "Backlog"; }
bool hasDefaults() const;
return qobject_cast<BufferViewConfig *>(obj);
}
else {
- return 0;
+ return nullptr;
}
}
Q_OBJECT
public:
- BufferViewSettingsPage(QWidget *parent = 0);
+ BufferViewSettingsPage(QWidget *parent = nullptr);
~BufferViewSettingsPage();
public slots:
Q_OBJECT
public:
- BufferViewEditDlg(const QString &old, const QStringList &existing = QStringList(), QWidget *parent = 0);
+ BufferViewEditDlg(const QString &old, const QStringList &existing = QStringList(), QWidget *parent = nullptr);
inline QString bufferViewName() const { return ui.bufferViewEdit->text(); }
This can probably be removed whenever BufferViewConfig::bulkAdd or something
like that is available.
*/
- qobject_cast<BufferViewFilter *>(outView->model())->setConfig(0);
- qobject_cast<BufferViewFilter *>(inView->model())->setConfig(0);
+ qobject_cast<BufferViewFilter *>(outView->model())->setConfig(nullptr);
+ qobject_cast<BufferViewFilter *>(inView->model())->setConfig(nullptr);
// actually move the ids
foreach(QList<BufferId> list, selectedBuffers) {
Q_OBJECT
public:
- ChatMonitorSettingsPage(QWidget *parent = 0);
+ ChatMonitorSettingsPage(QWidget *parent = nullptr);
bool hasDefaults() const;
public slots:
*
* @param parent Parent QWidget object, such as the settings dialog
*/
- explicit ChatViewColorSettingsPage(QWidget *parent = 0);
+ explicit ChatViewColorSettingsPage(QWidget *parent = nullptr);
/**
* Gets whether or not this settings page has defaults
Q_OBJECT
public:
- ChatViewSettingsPage(QWidget *parent = 0);
+ ChatViewSettingsPage(QWidget *parent = nullptr);
inline bool hasDefaults() const { return true; }
Q_OBJECT
public:
- ConnectionSettingsPage(QWidget *parent = 0);
+ ConnectionSettingsPage(QWidget *parent = nullptr);
bool hasDefaults() const;
bool needsCoreConnection() const { return true; }
Q_OBJECT
public:
- CoreAccountSettingsPage(QWidget *parent = 0);
+ CoreAccountSettingsPage(QWidget *parent = nullptr);
inline bool hasDefaults() const { return false; }
inline bool isStandAlone() const { return _standalone; }
Q_OBJECT
public:
- CoreAccountEditDlg(const CoreAccount &account, QWidget *parent = 0);
+ CoreAccountEditDlg(const CoreAccount &account, QWidget *parent = nullptr);
CoreAccount account();
Q_OBJECT
public:
- FilteredCoreAccountModel(CoreAccountModel *model, QObject *parent = 0);
+ FilteredCoreAccountModel(CoreAccountModel *model, QObject *parent = nullptr);
protected:
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
Q_OBJECT
public:
- CoreConnectionSettingsPage(QWidget *parent = 0);
+ CoreConnectionSettingsPage(QWidget *parent = nullptr);
inline bool hasDefaults() const { return true; }
void DccSettingsPage::setClientConfig(DccConfig *config)
{
if (_clientConfig) {
- disconnect(_clientConfig, 0, this, 0);
+ disconnect(_clientConfig, nullptr, this, nullptr);
}
if (config && !isClientConfigValid()) {
qWarning() << "Client DCC config is not valid/synchronized!";
Q_OBJECT
public:
- HighlightSettingsPage(QWidget *parent = 0);
+ HighlightSettingsPage(QWidget *parent = nullptr);
bool hasDefaults() const;
void IdentitiesSettingsPage::on_identityList_currentIndexChanged(int index)
{
- CertIdentity *previousIdentity = 0;
+ CertIdentity *previousIdentity = nullptr;
if (currentId != 0 && identities.contains(currentId))
previousIdentity = identities[currentId];
if (index < 0) {
//ui.identityList->setEditable(false);
- ui.identityEditor->displayIdentity(0, previousIdentity);
+ ui.identityEditor->displayIdentity(nullptr, previousIdentity);
currentId = 0;
}
else {
Q_OBJECT
public:
- IdentitiesSettingsPage(QWidget *parent = 0);
+ IdentitiesSettingsPage(QWidget *parent = nullptr);
virtual inline bool needsCoreConnection() const { return true; }
Q_OBJECT
public:
- CreateIdentityDlg(QAbstractItemModel *model, QWidget *parent = 0);
+ CreateIdentityDlg(QAbstractItemModel *model, QWidget *parent = nullptr);
QString identityName() const;
IdentityId duplicateId() const;
Q_OBJECT
public:
- SaveIdentitiesDlg(const QList<CertIdentity *> &toCreate, const QList<CertIdentity *> &toUpdate, const QList<IdentityId> &toRemove, QWidget *parent = 0);
+ SaveIdentitiesDlg(const QList<CertIdentity *> &toCreate, const QList<CertIdentity *> &toUpdate, const QList<IdentityId> &toRemove, QWidget *parent = nullptr);
private slots:
void clientEvent();
Q_OBJECT
public:
- IdentityEditWidget(QWidget *parent = 0);
+ IdentityEditWidget(QWidget *parent = nullptr);
enum SslState {
NoSsl,
AllowSsl
};
- void displayIdentity(CertIdentity *id, CertIdentity *saveId = 0);
+ void displayIdentity(CertIdentity *id, CertIdentity *saveId = nullptr);
void saveToIdentity(CertIdentity *id);
public slots:
Q_OBJECT
public:
- NickEditDlg(const QString &oldnick, const QStringList &existing = QStringList(), QWidget *parent = 0);
+ NickEditDlg(const QString &oldnick, const QStringList &existing = QStringList(), QWidget *parent = nullptr);
QString nick() const;
Q_OBJECT
public:
- IgnoreListModel(QObject *parent = 0);
+ IgnoreListModel(QObject *parent = nullptr);
virtual QVariant data(const QModelIndex &index, int role) const;
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
Q_OBJECT
public:
- IgnoreListDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent) {}
+ IgnoreListDelegate(QWidget *parent = nullptr) : QStyledItemDelegate(parent) {}
void paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option,
Q_OBJECT
public:
- IgnoreListEditDlg(const IgnoreListManager::IgnoreListItem &item, QWidget *parent = 0, bool enabled = false);
+ IgnoreListEditDlg(const IgnoreListManager::IgnoreListItem &item, QWidget *parent = nullptr, bool enabled = false);
inline IgnoreListManager::IgnoreListItem ignoreListItem() { return _ignoreListItem; }
void enableOkButton(bool state);
Q_OBJECT
public:
- IgnoreListSettingsPage(QWidget *parent = 0);
+ IgnoreListSettingsPage(QWidget *parent = nullptr);
~IgnoreListSettingsPage();
virtual inline bool hasDefaults() const { return false; }
virtual inline bool needsCoreConnection() const { return true; }
Q_OBJECT
public:
- InputWidgetSettingsPage(QWidget *parent = 0);
+ InputWidgetSettingsPage(QWidget *parent = nullptr);
inline bool hasDefaults() const { return true; }
Q_OBJECT
public:
- ItemViewSettingsPage(QWidget *parent = 0);
+ ItemViewSettingsPage(QWidget *parent = nullptr);
inline bool hasDefaults() const { return true; }
KeySequenceWidget::KeySequenceWidget(QWidget *parent)
: QWidget(parent),
- _shortcutsModel(0),
+ _shortcutsModel(nullptr),
_isRecording(false),
_modifierKeys(0)
{
{
Q_OBJECT
public:
- KeySequenceWidget(QWidget *parent = 0);
+ KeySequenceWidget(QWidget *parent = nullptr);
void setModel(ShortcutsModel *model);
{
Q_OBJECT
public:
- explicit KeySequenceButton(KeySequenceWidget *d, QWidget *parent = 0);
+ explicit KeySequenceButton(KeySequenceWidget *d, QWidget *parent = nullptr);
protected:
virtual bool event(QEvent *event);
NetworksSettingsPage::NetworksSettingsPage(QWidget *parent)
: SettingsPage(tr("IRC"), tr("Networks"), parent)
#ifdef HAVE_SSL
- , _cid(0)
+ , _cid(nullptr)
#endif
{
ui.setupUi(this);
QListWidgetItem *item = ui.networkList->item(i);
if (item->data(Qt::UserRole).value<NetworkId>() == id) return item;
}
- return 0;
+ return nullptr;
}
QListWidgetItem *NetworksSettingsPage::insertNetwork(const NetworkInfo &info)
{
- QListWidgetItem *item = 0;
+ QListWidgetItem *item = nullptr;
QList<QListWidgetItem *> items = ui.networkList->findItems(info.networkName, Qt::MatchExactly);
if (!items.count()) item = new QListWidgetItem(disconnectedIcon, info.networkName, ui.networkList);
else {
Q_OBJECT
public:
- NetworksSettingsPage(QWidget *parent = 0);
+ NetworksSettingsPage(QWidget *parent = nullptr);
virtual inline bool needsCoreConnection() const { return true; }
void networkConnectionError(const QString &msg);
void displayNetwork(NetworkId);
- void setItemState(NetworkId, QListWidgetItem *item = 0);
+ void setItemState(NetworkId, QListWidgetItem *item = nullptr);
/**
* Reset the capability-dependent settings to the default unknown states
Q_OBJECT
public:
- NetworkAddDlg(const QStringList &existing = QStringList(), QWidget *parent = 0);
+ NetworkAddDlg(const QStringList &existing = QStringList(), QWidget *parent = nullptr);
NetworkInfo networkInfo() const;
Q_OBJECT
public:
- NetworkEditDlg(const QString &old, const QStringList &existing = QStringList(), QWidget *parent = 0);
+ NetworkEditDlg(const QString &old, const QStringList &existing = QStringList(), QWidget *parent = nullptr);
QString networkName() const;
Q_OBJECT
public:
- ServerEditDlg(const Network::Server &server = Network::Server(), QWidget *parent = 0);
+ ServerEditDlg(const Network::Server &server = Network::Server(), QWidget *parent = nullptr);
Network::Server serverData() const;
Q_OBJECT
public:
- SaveNetworksDlg(const QList<NetworkInfo> &toCreate, const QList<NetworkInfo> &toUpdate, const QList<NetworkId> &toRemove, QWidget *parent = 0);
+ SaveNetworksDlg(const QList<NetworkInfo> &toCreate, const QList<NetworkInfo> &toUpdate, const QList<NetworkId> &toRemove, QWidget *parent = nullptr);
private slots:
void clientEvent();
Q_OBJECT
public:
- NotificationsSettingsPage(QWidget *parent = 0);
+ NotificationsSettingsPage(QWidget *parent = nullptr);
bool hasDefaults() const;
Q_OBJECT
public:
- PreviewBufferView(QWidget *parent = 0) : BufferView(parent) {}
+ PreviewBufferView(QWidget *parent = nullptr) : BufferView(parent) {}
protected:
virtual void keyPressEvent(QKeyEvent *event) { QTreeView::keyPressEvent(event); }
IsConfigurableRole
};
- ShortcutsModel(const QHash<QString, ActionCollection *> &actionCollections, QObject *parent = 0);
+ ShortcutsModel(const QHash<QString, ActionCollection *> &actionCollections, QObject *parent = nullptr);
~ShortcutsModel();
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
private:
struct Item {
- inline Item() { parentItem = 0; collection = 0; action = 0; }
+ inline Item() { parentItem = nullptr; collection = nullptr; action = nullptr; }
inline ~Item() { qDeleteAll(actionItems); }
int row;
Item *parentItem;
{
Q_OBJECT
public:
- ShortcutsFilter(QObject *parent = 0);
+ ShortcutsFilter(QObject *parent = nullptr);
public slots:
void setFilterString(const QString &filterString);
{
Q_OBJECT
public:
- ShortcutsSettingsPage(const QHash<QString, ActionCollection *> &actionCollections, QWidget *parent = 0);
+ ShortcutsSettingsPage(const QHash<QString, ActionCollection *> &actionCollections, QWidget *parent = nullptr);
inline bool hasDefaults() const { return true; }
Q_OBJECT
public:
- SonnetSettingsPage(QWidget *parent = 0);
+ SonnetSettingsPage(QWidget *parent = nullptr);
bool hasDefaults() const;
Q_OBJECT
public:
- TopicWidgetSettingsPage(QWidget *parent = 0);
+ TopicWidgetSettingsPage(QWidget *parent = nullptr);
inline bool hasDefaults() const { return true; }
Q_OBJECT
public:
- SimpleNetworkEditor(QWidget *parent = 0);
+ SimpleNetworkEditor(QWidget *parent = nullptr);
void displayNetworkInfo(const NetworkInfo &networkInfo);
void saveToNetworkInfo(NetworkInfo &networkInfo);
Q_OBJECT
public:
- SslInfoDlg(const QSslSocket *socket, QWidget *parent = 0);
+ SslInfoDlg(const QSslSocket *socket, QWidget *parent = nullptr);
inline const QSslSocket *socket() const { return _socket; }
private slots:
Q_OBJECT
public:
- SystrayNotificationBackend(QObject *parent = 0);
+ SystrayNotificationBackend(QObject *parent = nullptr);
void notify(const Notification &);
void close(uint notificationId);
Q_OBJECT
public:
- ConfigWidget(QWidget *parent = 0);
+ ConfigWidget(QWidget *parent = nullptr);
void save();
void load();
bool hasDefaults() const;
Q_OBJECT
public:
- TaskbarNotificationBackend(QObject *parent = 0);
+ TaskbarNotificationBackend(QObject *parent = nullptr);
void notify(const Notification &);
void close(uint notificationId);
Q_OBJECT
public:
- ConfigWidget(QWidget *parent = 0);
+ ConfigWidget(QWidget *parent = nullptr);
void save();
void load();
bool hasDefaults() const;
Q_OBJECT
public:
- TopicWidget(QWidget *parent = 0);
+ TopicWidget(QWidget *parent = nullptr);
void setTopic(const QModelIndex &index);
void setCustomFont(const QFont &);
void VerticalDock::showTitle(bool show)
{
QWidget *oldDockTitle = titleBarWidget();
- QWidget *newDockTitle = 0;
+ QWidget *newDockTitle = nullptr;
if (show)
newDockTitle = new VerticalDockTitle(this);
Q_OBJECT
public:
- VerticalDock(const QString &title, QWidget *parent = 0, Qt::WindowFlags flags = 0);
- VerticalDock(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ VerticalDock(const QString &title, QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr);
+ VerticalDock(QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr);
void showTitle(bool show);
void setDefaultTitleWidget();
#endif
WebPreviewItem::WebPreviewItem(const QUrl &url)
- : QGraphicsItem(0), // needs to be a top level item as we otherwise cannot guarantee that it's on top of other chatlines
+ : QGraphicsItem(nullptr), // needs to be a top level item as we otherwise cannot guarantee that it's on top of other chatlines
_boundingRect(0, 0, 400, 300)
{
qreal frameWidth = 5;
{
public:
WebPreviewItem(const QUrl &url);
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr);
virtual inline QRectF boundingRect() const { return _boundingRect; }
private:
AbstractItemView::AbstractItemView(QWidget *parent)
: QWidget(parent),
- _model(0),
- _selectionModel(0)
+ _model(nullptr),
+ _selectionModel(nullptr)
{
}
void AbstractItemView::setModel(QAbstractItemModel *model)
{
if (_model) {
- disconnect(_model, 0, this, 0);
+ disconnect(_model, nullptr, this, nullptr);
}
_model = model;
connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)),
void AbstractItemView::setSelectionModel(QItemSelectionModel *selectionModel)
{
if (_selectionModel) {
- disconnect(_selectionModel, 0, this, 0);
+ disconnect(_selectionModel, nullptr, this, nullptr);
}
_selectionModel = selectionModel;
connect(selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)),
Q_OBJECT
public:
- AbstractItemView(QWidget *parent = 0);
+ AbstractItemView(QWidget *parent = nullptr);
inline QAbstractItemModel *model() { return _model; }
void setModel(QAbstractItemModel *model);
Q_DECLARE_FLAGS(ShortcutTypes, ShortcutType)
explicit Action(QObject *parent);
- Action(const QString &text, QObject *parent, const QObject *receiver = 0, const char *slot = 0, const QKeySequence &shortcut = 0);
- Action(const QIcon &icon, const QString &text, QObject *parent, const QObject *receiver = 0, const char *slot = 0, const QKeySequence &shortcut = 0);
+ Action(const QString &text, QObject *parent, const QObject *receiver = nullptr, const char *slot = nullptr, const QKeySequence &shortcut = 0);
+ Action(const QIcon &icon, const QString &text, QObject *parent, const QObject *receiver = nullptr, const char *slot = nullptr, const QKeySequence &shortcut = 0);
QKeySequence shortcut(ShortcutTypes types = ActiveShortcut) const;
void setShortcut(const QShortcut &shortcut, ShortcutTypes type = ShortcutTypes(ActiveShortcut | DefaultShortcut));
QAction *ActionCollection::takeAction(QAction *action)
{
if (!unlistAction(action))
- return 0;
+ return nullptr;
foreach(QWidget *widget, _associatedWidgets) {
widget->removeAction(action);
QAction *addAction(const QString &name, QAction *action);
Action *addAction(const QString &name, Action *action);
- Action *addAction(const QString &name, const QObject *receiver = 0, const char *member = 0);
+ Action *addAction(const QString &name, const QObject *receiver = nullptr, const char *member = nullptr);
void removeAction(QAction *action);
QAction *takeAction(QAction *action);
/// Create new action under the given name, add it to the collection and connect its triggered(bool) signal to the specified receiver.
template<class ActionType>
- ActionType *add(const QString &name, const QObject *receiver = 0, const char *member = 0)
+ ActionType *add(const QString &name, const QObject *receiver = nullptr, const char *member = nullptr)
{
ActionType *a = new ActionType(this);
if (receiver && member)
Q_OBJECT
public:
- BufferHotListFilter(QAbstractItemModel *source, QObject *parent = 0);
+ BufferHotListFilter(QAbstractItemModel *source, QObject *parent = nullptr);
virtual inline int columnCount(const QModelIndex &) const { return 1; }
BufferId hottestBuffer();
}
if (model()) {
- disconnect(this, 0, model(), 0);
- disconnect(model(), 0, this, 0);
+ disconnect(this, nullptr, model(), nullptr);
+ disconnect(model(), nullptr, this, nullptr);
}
if (!model_) {
return;
if (_config) {
- disconnect(_config, 0, this, 0);
+ disconnect(_config, nullptr, this, nullptr);
}
_config = config;
return TreeViewTouch::dropEvent(event);
// Confirm that the user really wants to merge the buffers before doing so
- int res = QMessageBox::question(0, tr("Merge buffers permanently?"),
+ int res = QMessageBox::question(nullptr, tr("Merge buffers permanently?"),
tr("Do you want to merge the buffer \"%1\" permanently into buffer \"%2\"?\n This cannot be reversed!").arg(Client::networkModel()->bufferName(bufferId2)).arg(Client::networkModel()->bufferName(bufferId1)),
QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
if (res == QMessageBox::Yes) {
// ==============================
BufferViewDock::BufferViewDock(BufferViewConfig *config, QWidget *parent)
: QDockWidget(parent),
- _childWidget(0),
+ _childWidget(nullptr),
_widget(new QWidget(parent)),
_filterEdit(new QLineEdit(parent)),
_active(false),
void BufferViewDock::setLocked(bool locked) {
if (locked) {
- setFeatures(0);
+ setFeatures(nullptr);
}
else {
setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
{
if (_oldFocusItem) {
_oldFocusItem->setFocus();
- _oldFocusItem = 0;
+ _oldFocusItem = nullptr;
}
if (!config()->showSearch()) {
{
BufferView *view = bufferView();
if (!view)
- return 0;
+ return nullptr;
else
return view->config();
}
Backward = -1
};
- BufferView(QWidget *parent = 0);
+ BufferView(QWidget *parent = nullptr);
void init();
void setModel(QAbstractItemModel *model);
Q_OBJECT
public:
- BufferViewDelegate(QObject *parent = 0);
+ BufferViewDelegate(QObject *parent = nullptr);
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override;
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
*****************************************/
BufferViewFilter::BufferViewFilter(QAbstractItemModel *model, BufferViewConfig *config)
: QSortFilterProxyModel(model),
- _config(0),
+ _config(nullptr),
_sortOrder(Qt::AscendingOrder),
_showServerQueries(false),
_editMode(false),
return;
if (_config) {
- disconnect(_config, 0, this, 0);
+ disconnect(_config, nullptr, this, nullptr);
}
_config = config;
};
Q_DECLARE_FLAGS(Modes, Mode)
- BufferViewFilter(QAbstractItemModel *model, BufferViewConfig *config = 0);
+ BufferViewFilter(QAbstractItemModel *model, BufferViewConfig *config = nullptr);
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
BufferViewOverlayFilter::BufferViewOverlayFilter(QAbstractItemModel *model, BufferViewOverlay *overlay)
: QSortFilterProxyModel(model),
- _overlay(0)
+ _overlay(nullptr)
{
setOverlay(overlay);
setSourceModel(model);
return;
if (_overlay) {
- disconnect(_overlay, 0, this, 0);
+ disconnect(_overlay, nullptr, this, nullptr);
}
_overlay = overlay;
void BufferViewOverlayFilter::overlayDestroyed()
{
- setOverlay(0);
+ setOverlay(nullptr);
}
Q_OBJECT
public:
- BufferViewOverlayFilter(QAbstractItemModel *model, BufferViewOverlay *overlay = 0);
+ BufferViewOverlayFilter(QAbstractItemModel *model, BufferViewOverlay *overlay = nullptr);
void setOverlay(BufferViewOverlay *overlay);
Q_OBJECT
public:
- ClearableLineEdit(QWidget *parent = 0);
+ ClearableLineEdit(QWidget *parent = nullptr);
protected:
void resizeEvent(QResizeEvent *event);
Q_OBJECT
public:
- ClickableLabel(QWidget *parent = 0);
+ ClickableLabel(QWidget *parent = nullptr);
signals:
void clicked();
Q_PROPERTY(QColor color READ color WRITE setColor USER true)
public :
- explicit ColorButton(QWidget *parent = 0);
- explicit ColorButton(const QColor &c, QWidget *parent = 0);
+ explicit ColorButton(QWidget *parent = nullptr);
+ explicit ColorButton(const QColor &c, QWidget *parent = nullptr);
void setColor(const QColor &color);
QColor color() const;
hideEventsMenu->addSeparator();
hideEventsMenu->addAction(action(HideApplyToAll));
hideEventsMenu->addAction(action(HideUseDefaults));
- _hideEventsMenuAction = new Action(tr("Hide Events"), 0);
+ _hideEventsMenuAction = new Action(tr("Hide Events"), nullptr);
_hideEventsMenuAction->setMenu(hideEventsMenu);
QMenu *nickCtcpMenu = new QMenu();
nickCtcpMenu->addAction(action(NickCtcpVersion));
nickCtcpMenu->addAction(action(NickCtcpTime));
nickCtcpMenu->addAction(action(NickCtcpClientinfo));
- _nickCtcpMenuAction = new Action(tr("CTCP"), 0);
+ _nickCtcpMenuAction = new Action(tr("CTCP"), nullptr);
_nickCtcpMenuAction->setMenu(nickCtcpMenu);
QMenu *nickModeMenu = new QMenu();
nickModeMenu->addAction(action(NickKick));
nickModeMenu->addAction(action(NickBan));
nickModeMenu->addAction(action(NickKickBan));
- _nickModeMenuAction = new Action(tr("Actions"), 0);
+ _nickModeMenuAction = new Action(tr("Actions"), nullptr);
_nickModeMenuAction->setMenu(nickModeMenu);
QMenu *ignoreMenu = new QMenu();
- _nickIgnoreMenuAction = new Action(tr("Ignore"), 0);
+ _nickIgnoreMenuAction = new Action(tr("Ignore"), nullptr);
_nickIgnoreMenuAction->setMenu(ignoreMenu);
// These are disabled actions used as descriptions
{
if (!index.isValid())
return;
- addActions(menu, QList<QModelIndex>() << index, 0, QString(), receiver, method, isCustomBufferView);
+ addActions(menu, QList<QModelIndex>() << index, nullptr, QString(), receiver, method, isCustomBufferView);
}
void ContextMenuActionProvider::addActions(QMenu *menu, const QList<QModelIndex> &indexList, QObject *receiver, const char *method, bool isCustomBufferView)
{
- addActions(menu, indexList, 0, QString(), receiver, method, isCustomBufferView);
+ addActions(menu, indexList, nullptr, QString(), receiver, method, isCustomBufferView);
}
Q_OBJECT
public:
- ContextMenuActionProvider(QObject *parent = 0);
+ ContextMenuActionProvider(QObject *parent = nullptr);
virtual ~ContextMenuActionProvider();
//! Provide a list of actions applying to the given item
* @param slot The receiving slot name; should be "mySlot" rather than SLOT(mySlot(QAction *))
* @return A list of actions applying to the given item
*/
- void addActions(QMenu *, const QModelIndex &index, QObject *receiver = 0, const char *slot = 0, bool allowBufferHide = false);
- void addActions(QMenu *, const QList<QModelIndex> &indexList, QObject *receiver = 0, const char *slot = 0, bool allowBufferHide = false);
- void addActions(QMenu *, BufferId id, QObject *receiver = 0, const char *slot = 0);
- void addActions(QMenu *, MessageFilter *filter, BufferId msgBuffer, QObject *receiver = 0, const char *slot = 0);
- void addActions(QMenu *, MessageFilter *filter, BufferId msgBuffer, const QString &chanOrNick, QObject *receiver = 0, const char *slot = 0);
+ void addActions(QMenu *, const QModelIndex &index, QObject *receiver = nullptr, const char *slot = nullptr, bool allowBufferHide = false);
+ void addActions(QMenu *, const QList<QModelIndex> &indexList, QObject *receiver = nullptr, const char *slot = nullptr, bool allowBufferHide = false);
+ void addActions(QMenu *, BufferId id, QObject *receiver = nullptr, const char *slot = nullptr);
+ void addActions(QMenu *, MessageFilter *filter, BufferId msgBuffer, QObject *receiver = nullptr, const char *slot = nullptr);
+ void addActions(QMenu *, MessageFilter *filter, BufferId msgBuffer, const QString &chanOrNick, QObject *receiver = nullptr, const char *slot = nullptr);
private:
FlatProxyModel::FlatProxyModel(QObject *parent)
: QAbstractProxyModel(parent),
- _rootSourceItem(0)
+ _rootSourceItem(nullptr)
{
}
QModelIndex currentParent = currentRange.topLeft().parent();
Q_ASSERT(currentParent == currentRange.bottomRight().parent());
- SourceItem *parentItem = 0;
+ SourceItem *parentItem = nullptr;
if (!itemLookup.contains(currentParent)) {
parentItem = sourceToInternal(currentParent);
itemLookup[currentParent] = parentItem;
for (int i = 0; i < proxySelection.count(); i++) {
const QItemSelectionRange &range = proxySelection[i];
- SourceItem *topLeftItem = 0;
- SourceItem *bottomRightItem = 0;
+ SourceItem *topLeftItem = nullptr;
+ SourceItem *bottomRightItem = nullptr;
SourceItem *currentItem = static_cast<SourceItem *>(range.topLeft().internalPointer());
int row = range.topLeft().row();
int left = range.topLeft().column();
else {
Q_ASSERT(topLeftItem && bottomRightItem);
sourceSelection << QItemSelectionRange(mapToSource(createIndex(topLeftItem->pos(), left, topLeftItem)), mapToSource(createIndex(bottomRightItem->pos(), right, bottomRightItem)));
- topLeftItem = 0;
- bottomRightItem = 0;
+ topLeftItem = nullptr;
+ bottomRightItem = nullptr;
}
// update loop vars
void FlatProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
{
if (QAbstractProxyModel::sourceModel()) {
- disconnect(QAbstractProxyModel::sourceModel(), 0, this, 0);
+ disconnect(QAbstractProxyModel::sourceModel(), nullptr, this, nullptr);
}
QAbstractProxyModel::setSourceModel(sourceModel);
SourceItem *lastItem = insertSubTreeHelper(newSubTree, newSubTree, source_idx);
Q_ASSERT(lastItem);
- Q_ASSERT(lastItem->next() == 0);
+ Q_ASSERT(lastItem->next() == nullptr);
if (emitInsert)
beginInsertRows(QModelIndex(), newSubTree->pos(), lastItem->pos());
FlatProxyModel::SourceItem *FlatProxyModel::insertSubTreeHelper(SourceItem *parentItem, SourceItem *lastItem_, const QModelIndex &source_idx)
{
SourceItem *lastItem = lastItem_;
- SourceItem *newItem = 0;
+ SourceItem *newItem = nullptr;
for (int row = 0; row < sourceModel()->rowCount(source_idx); row++) {
newItem = new SourceItem(row, parentItem);
newItem->setPos(lastItem->pos() + 1);
SourceItem *nextItem = prevItem->next();
- SourceItem *newItem = 0;
+ SourceItem *newItem = nullptr;
int newPos = prevItem->pos() + 1;
for (int row = start; row <= end; row++) {
newItem = new SourceItem(row, sourceItem);
FlatProxyModel::SourceItem::SourceItem(int row, SourceItem *parent)
: _parent(parent),
_pos(-1),
- _next(0)
+ _next(nullptr)
{
if (parent) {
parent->_childs.insert(row, this);
Q_OBJECT
public:
- FlatProxyModel(QObject *parent = 0);
+ FlatProxyModel(QObject *parent = nullptr);
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const;
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const;
class FlatProxyModel::SourceItem
{
public:
- SourceItem(int row = 0, SourceItem *parent = 0);
+ SourceItem(int row = 0, SourceItem *parent = nullptr);
~SourceItem();
inline SourceItem *parent() const { return _parent; }
Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
public :
- FontSelector(QWidget *parent = 0);
+ FontSelector(QWidget *parent = nullptr);
inline const QFont &selectedFont() const { return _font; }
# include <QX11Info>
#endif
-QWidget *GraphicalUi::_mainWidget = 0;
+QWidget *GraphicalUi::_mainWidget = nullptr;
QHash<QString, ActionCollection *> GraphicalUi::_actionCollections;
-ContextMenuActionProvider *GraphicalUi::_contextMenuActionProvider = 0;
-ToolBarActionProvider *GraphicalUi::_toolBarActionProvider = 0;
-UiStyle *GraphicalUi::_uiStyle = 0;
+ContextMenuActionProvider *GraphicalUi::_contextMenuActionProvider = nullptr;
+ToolBarActionProvider *GraphicalUi::_toolBarActionProvider = nullptr;
+UiStyle *GraphicalUi::_uiStyle = nullptr;
GraphicalUi::GraphicalUi(QObject *parent) : AbstractUi(parent), Singleton<GraphicalUi>(this)
static bool isMainWidgetVisible();
protected:
- GraphicalUi(QObject *parent = 0);
+ GraphicalUi(QObject *parent = nullptr);
virtual void init();
//! This is the widget we associate global actions with, typically the main window
MultiLine
};
- MultiLineEdit(QWidget *parent = 0);
+ MultiLineEdit(QWidget *parent = nullptr);
~MultiLineEdit();
void setCustomFont(const QFont &); // should be used instead setFont(), so we can set our size correctly
void setMaxHeight(int numLines);
void setEmacsMode(bool enable = true);
void setScrollBarsEnabled(bool enable = true);
- void setPasteProtectionEnabled(bool enable = true, QWidget *msgBoxParent = 0);
+ void setPasteProtectionEnabled(bool enable = true, QWidget *msgBoxParent = nullptr);
void setLineWrapEnabled(bool enable = false);
inline void setHistory(QStringList history) { _history = history; }
NetworkModelController::NetworkModelController(QObject *parent)
: QObject(parent),
_actionCollection(new ActionCollection(this)),
- _messageFilter(0),
- _receiver(0)
+ _messageFilter(nullptr),
+ _receiver(nullptr)
{
connect(_actionCollection, SIGNAL(actionTriggered(QAction *)), SLOT(actionTriggered(QAction *)));
}
}
QString msg;
if (inactive.count()) {
- msg = tr("Do you want to delete the following buffer(s) permanently?", 0, inactive.count());
+ msg = tr("Do you want to delete the following buffer(s) permanently?", "", inactive.count());
msg += "<ul>";
int count = 0;
foreach(BufferInfo info, inactive) {
if (inactive.count() != indexList.count())
msg += tr("<br>Active channel buffers cannot be deleted, please part the channel first.");
- if (QMessageBox::question(0, tr("Remove buffers permanently?"), msg, QMessageBox::Yes|QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) {
+ if (QMessageBox::question(nullptr, tr("Remove buffers permanently?"), msg, QMessageBox::Yes|QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) {
foreach(BufferInfo info, inactive)
Client::removeBuffer(info.bufferId());
}
void NetworkModelController::handleNetworkAction(ActionType type, QAction *)
{
if (type == NetworkConnectAllWithDropdown || type == NetworkDisconnectAllWithDropdown || type == NetworkConnectAll || type == NetworkDisconnectAll) {
- if (type == NetworkConnectAllWithDropdown && QMessageBox::question(0, tr("Question"), tr("Really Connect to all IRC Networks?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No)
+ if (type == NetworkConnectAllWithDropdown && QMessageBox::question(nullptr, tr("Question"), tr("Really Connect to all IRC Networks?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No)
return;
- if (type == NetworkDisconnectAllWithDropdown && QMessageBox::question(0, tr("Question"), tr("Really disconnect from all IRC Networks?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No)
+ if (type == NetworkDisconnectAllWithDropdown && QMessageBox::question(nullptr, tr("Question"), tr("Really disconnect from all IRC Networks?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No)
return;
foreach(NetworkId id, Client::networkIds()) {
const Network *net = Client::network(id);
Q_OBJECT
public:
- NetworkModelController(QObject *parent = 0);
+ NetworkModelController(QObject *parent = nullptr);
virtual ~NetworkModelController();
// don't change enums without doublechecking masks etc. in code
Q_OBJECT
public:
- JoinDlg(const QModelIndex &index, QWidget *parent = 0);
+ JoinDlg(const QModelIndex &index, QWidget *parent = nullptr);
QString channelName() const;
QString channelPassword() const;
void NickView::setModel(QAbstractItemModel *model_)
{
if (model())
- disconnect(model(), 0, this, 0);
+ disconnect(model(), nullptr, this, nullptr);
TreeViewTouch::setModel(model_);
init();
Q_OBJECT
public:
- NickView(QWidget *parent = 0);
+ NickView(QWidget *parent = nullptr);
protected:
virtual void rowsInserted(const QModelIndex &parent, int start, int end);
Q_OBJECT
public:
- NickViewFilter(const BufferId &bufferId, NetworkModel *parent = 0);
+ NickViewFilter(const BufferId &bufferId, NetworkModel *parent = nullptr);
virtual QVariant data(const QModelIndex &index, int role) const;
QVariant icon(const QModelIndex &index) const;
Q_OBJECT
public:
- ResizingStackedWidget(QWidget *parent = 0);
+ ResizingStackedWidget(QWidget *parent = nullptr);
virtual QSize sizeHint() const;
Q_OBJECT
public:
- SettingsPage(const QString &category, const QString &name, QWidget *parent = 0);
+ SettingsPage(const QString &category, const QString &name, QWidget *parent = nullptr);
virtual ~SettingsPage() {};
//! The category of this settings page.
ResizeOnHover
};
- StyledLabel(QWidget *parent = 0);
+ StyledLabel(QWidget *parent = nullptr);
void setText(const QString &text);
void setCustomFont(const QFont &font);
Q_OBJECT
public:
- ToolBarActionProvider(QObject *parent = 0);
+ ToolBarActionProvider(QObject *parent = nullptr);
virtual ~ToolBarActionProvider();
enum ToolBarType {
private slots:
void networkCreated(NetworkId id);
void networkRemoved(NetworkId id);
- void networkUpdated(const Network *net = 0);
+ void networkUpdated(const Network *net = nullptr);
void connectOrDisconnectNet();
void currentBufferChanged(const QModelIndex &);
Q_OBJECT
public:
- explicit TreeViewTouch(QWidget *parent = 0);
+ explicit TreeViewTouch(QWidget *parent = nullptr);
protected:
Q_ENUMS(SenderPrefixModes)
public:
- UiStyle(QObject *parent = 0);
+ UiStyle(QObject *parent = nullptr);
virtual ~UiStyle();
//! This enumerates the possible formats a text element may have. */