Commit ce2dec62 authored by Laurent Montel's avatar Laurent Montel 😁 Committed by Pali Rohár

Port to nullptr

parent d79d43d4
......@@ -44,7 +44,7 @@ public:
Private()
: accountPage(0)
, proto(0)
, identity(0L)
, identity(nullptr)
{
}
......
......@@ -111,7 +111,7 @@ class ChatMessagePart::Private
{
public:
Private()
: /*tt(0L),*/ scrollPressed(false)
: /*tt(nullptr),*/ scrollPressed(false)
, scrollToEndDelayed(false)
, manager(0)
, copyAction(0)
......
......@@ -84,7 +84,7 @@ public:
};
ChatView::ChatView(Kopete::ChatSession *mgr, ChatWindowPlugin *parent)
: KVBox(0l)
: KVBox(nullptr)
, KopeteView(mgr, parent)
, d(new KopeteChatViewPrivate)
{
......
......@@ -210,7 +210,7 @@ KopeteChatWindow::KopeteChatWindow(Kopete::ChatSession::Form form, QWidget *pare
m_participantsWidget = new QDockWidget(i18n("Participants"), this);
m_participantsWidget->setAllowedAreas(Qt::RightDockWidgetArea | Qt::LeftDockWidgetArea);
m_participantsWidget->setFeatures(QDockWidget::DockWidgetClosable);
m_participantsWidget->setTitleBarWidget(0L);
m_participantsWidget->setTitleBarWidget(nullptr);
m_participantsWidget->setObjectName(QStringLiteral("Participants")); //object name is required for automatic position and settings save.
ChatSessionMembersListModel *members_model = new ChatSessionMembersListModel(this);
......@@ -876,7 +876,7 @@ void KopeteChatWindow::slotDetachChat(QAction *action)
}
//if we don't do this, we might crash
// createGUI(0L);
// createGUI(nullptr);
guiFactory()->removeClient(detachedView->msgManager());
if (!action) {
......
......@@ -44,7 +44,7 @@ class KopeteEmoticonAction::KopeteEmoticonActionPrivate
public:
KopeteEmoticonActionPrivate()
{
m_popup = new QMenu(0L);
m_popup = new QMenu(nullptr);
emoticonSelector = new EmoticonSelector(m_popup);
emoticonSelector->setObjectName(QStringLiteral("KopeteEmoticonActionPrivate::emoticonSelector"));
//FIXME do it the kde4 way
......
......@@ -71,7 +71,7 @@ class AppearanceConfig::Private
{
public:
Private()
: mAppearanceTabCtl(0L)
: mAppearanceTabCtl(nullptr)
{
}
......
......@@ -22,6 +22,8 @@
#include "emoticonthemeitem.h"
#include "kopetebehaviorsettings.h"
#include <QFileDialog>
#include <QCheckBox>
#include <QDir>
#include <QUrl>
......@@ -47,7 +49,6 @@
#include <kstandarddirs.h>
#include <kurlrequesterdialog.h>
#include <krun.h>
#include <kfiledialog.h>
#include <kemoticons.h>
#include <KGlobal>
#include <KCMultiDialog>
......@@ -97,7 +98,7 @@ public:
Kopete::ChatSession *manager(Kopete::Contact::CanCreateFlags /*c*/) Q_DECL_OVERRIDE
{
return 0L;
return nullptr;
}
void slotUserInfo() Q_DECL_OVERRIDE
......@@ -115,17 +116,17 @@ public:
Kopete::Account *createNewAccount(const QString & /*accountId*/) Q_DECL_OVERRIDE
{
return 0L;
return nullptr;
}
AddContactPage *createAddContactWidget(QWidget */*parent*/, Kopete::Account */*account*/) Q_DECL_OVERRIDE
{
return 0L;
return nullptr;
}
KopeteEditAccountWidget *createEditAccountWidget(Kopete::Account */*account*/, QWidget */*parent */) Q_DECL_OVERRIDE
{
return 0L;
return nullptr;
}
};
......@@ -185,13 +186,13 @@ private:
ChatWindowConfig::ChatWindowConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
, m_currentStyle(0L)
, m_currentStyle(nullptr)
, m_loading(false)
, m_previewProtocol(0L)
, m_previewAccount(0L)
, m_jackMetaContact(0L)
, m_myself(0L)
, m_jack(0L)
, m_previewProtocol(nullptr)
, m_previewAccount(nullptr)
, m_jackMetaContact(nullptr)
, m_myself(nullptr)
, m_jack(nullptr)
{
KConfigGroup config(KSharedConfig::openConfig(), "ChatWindowSettings");
......@@ -441,7 +442,7 @@ void ChatWindowConfig::slotChatStyleVariantSelected(const QString &variantName)
void ChatWindowConfig::slotInstallChatStyle()
{
QUrl styleUrl
= KFileDialog::getOpenUrl(QUrl(), QStringLiteral("application/zip application/x-compressed-tar application/x-bzip-compressed-tar"), this, i18n("Choose Chat Window Style to Install"));
= QFileDialog::getOpenFileUrl(this, i18n("Choose Chat Window Style to Install"), QUrl(), QStringLiteral("application/zip application/x-compressed-tar application/x-bzip-compressed-tar"));
if (styleUrl.isEmpty()) { // dialog got canceled
return;
......
......@@ -154,17 +154,17 @@ Kopete::Contact *ChatSessionMembersListModel::contactAt(const QModelIndex &index
qCDebug(LIBKOPETE_LOG) << "memberslistmodel contactat";
if (d->session) {
if (!index.isValid()) {
return 0L;
return nullptr;
}
if (index.row() >= d->contacts.size()) {
return 0L;
return nullptr;
}
return d->contacts.at(index.row());
}
return 0L;
return nullptr;
}
int ChatSessionMembersListModel::rowCount(const QModelIndex &parent) const
......
......@@ -69,7 +69,7 @@ Kopete::Group *ContactListStorage::group(unsigned int groupId) const
return group;
}
}
return 0L;
return nullptr;
}
Kopete::Group *ContactListStorage::findGroup(const QString &displayName, int type)
......
......@@ -397,7 +397,7 @@ Kopete::MetaContact *Account::addContact(const QString &contactId, const QString
} else {
if (!createContact(contactId, parentContact)) {
delete parentContact;
return 0L;
return nullptr;
}
}
......@@ -418,7 +418,7 @@ bool Account::addContact(const QString &contactId, MetaContact *parent, AddMode
<< "to account" << accountId() << "will not take place.";
}
return 0L;
return false;
}
const bool isTemporary = parent->isTemporary();
......
......@@ -254,7 +254,7 @@ Account *AccountManager::registerAccount(Account *account)
if (account->accountId().isEmpty()) {
account->deleteLater();
return 0L;
return nullptr;
}
// If this account already exists, do nothing
......@@ -264,7 +264,7 @@ Account *AccountManager::registerAccount(Account *account)
Account *curracc = it.next();
if ((account->protocol() == curracc->protocol()) && (account->accountId() == curracc->accountId())) {
account->deleteLater();
return 0L;
return nullptr;
}
}
......@@ -327,7 +327,7 @@ Account *AccountManager::findAccount(const QString &protocolId, const QString &a
return a;
}
}
return 0L;
return nullptr;
}
void AccountManager::removeAccount(Account *account)
......
......@@ -109,7 +109,7 @@ void AddedInfoEvent::activate(uint actionId)
MetaContact *AddedInfoEvent::addContact() const
{
if (!d->addDialog) {
return 0L;
return nullptr;
}
return d->addDialog->addContact();
......
......@@ -152,7 +152,7 @@ KopeteView *ChatSessionManager::createView(ChatSession *kmm, const QString &requ
KopeteView *newView = KopeteViewManager::viewManager()->view(kmm, requestedPlugin);
if (!newView) {
qCDebug(LIBKOPETE_LOG) << "View not successfuly created";
return 0L;
return nullptr;
}
QObject *viewObject = dynamic_cast<QObject *>(newView);
......
......@@ -558,7 +558,7 @@ void Contact::setIcon(const QString &icon)
QList<QAction *> *Contact::customContextMenuActions()
{
return 0L;
return nullptr;
}
QList<QAction *> *Contact::customContextMenuActions(ChatSession * /* manager */)
......
......@@ -130,7 +130,7 @@ MetaContact *ContactList::metaContact(const QString &metaContactId) const
}
}
return 0L;
return nullptr;
}
Group *ContactList::group(unsigned int groupId) const
......@@ -148,7 +148,7 @@ Group *ContactList::group(unsigned int groupId) const
return curr;
}
}
return 0L;
return nullptr;
}
Contact *ContactList::findContact(const QString &protocolId, const QString &accountId, const QString &contactId) const
......@@ -157,7 +157,7 @@ Contact *ContactList::findContact(const QString &protocolId, const QString &acco
Account *i = AccountManager::self()->findAccount(protocolId, accountId);
if (!i) {
qCDebug(LIBKOPETE_LOG) << "Account not found";
return 0L;
return nullptr;
}
return i->contacts().value(contactId);
}
......@@ -184,7 +184,7 @@ MetaContact *ContactList::findMetaContactByContactId(const QString &contactId) c
return c->metaContact();
}
}
return 0L;
return nullptr;
}
Group *ContactList::findGroup(const QString &displayName, int type)
......
......@@ -84,7 +84,7 @@ Identity *IdentityManager::registerIdentity(Identity *identity)
foreach (Identity *currident, d->identities) {
if (identity->id() == currident->id()) {
identity->deleteLater();
return 0L;
return nullptr;
}
}
......@@ -121,12 +121,12 @@ Identity *IdentityManager::findIdentity(const QString &id)
return identity;
}
}
return 0L;
return nullptr;
}
Identity *IdentityManager::defaultIdentity()
{
Identity *ident = 0;
Identity *ident = nullptr;
if (d->defaultIdentity) {
ident = findIdentity(d->defaultIdentity->id());
......
......@@ -170,10 +170,10 @@ void MetaContact::removeContact(Contact *c, bool deleted)
// if the contact was a source of property data, clean
if (displayNameSourceContact() == c) {
setDisplayNameSourceContact(0L);
setDisplayNameSourceContact(nullptr);
}
if (photoSourceContact() == c) {
setPhotoSourceContact(0L);
setPhotoSourceContact(nullptr);
}
if (wasTrackingName) {
......@@ -258,7 +258,7 @@ Contact *MetaContact::findContact(const QString &protocolId, const QString &acco
}
// Contact not found
return 0L;
return nullptr;
}
void MetaContact::setDisplayNameSource(PropertySource source)
......@@ -320,7 +320,7 @@ Contact *MetaContact::sendMessage()
c->sendMessage();
return c;
}
return 0L;
return nullptr;
}
Contact *MetaContact::startChat()
......@@ -335,7 +335,7 @@ Contact *MetaContact::startChat()
c->startChat();
return c;
}
return 0L;
return nullptr;
}
Contact *MetaContact::preferredContact()
......@@ -407,7 +407,7 @@ Contact *MetaContact::execute()
return c;
}
return 0L;
return nullptr;
}
quint32 MetaContact::idleTime() const
......
......@@ -339,7 +339,7 @@ Plugin *PluginManager::loadPlugin(const QString &_pluginId, PluginLoadMode mode
} else {
_kpmp->pluginsToLoad.push(pluginId);
QTimer::singleShot(0, this, SLOT(slotLoadNextPlugin()));
return 0L;
return nullptr;
}
}
......@@ -350,7 +350,7 @@ Plugin *PluginManager::loadPluginInternal(const QString &pluginId)
KPluginInfo info = infoForPluginId(pluginId);
if (!info.isValid()) {
qCWarning(LIBKOPETE_LOG) << "Unable to find a plugin named '" << pluginId << "'!";
return 0L;
return nullptr;
}
if (_kpmp->loadedPlugins.contains(info)) {
......@@ -429,13 +429,13 @@ Plugin *PluginManager::plugin(const QString &_pluginId) const
KPluginInfo info = infoForPluginId(pluginId);
if (!info.isValid()) {
return 0L;
return nullptr;
}
if (_kpmp->loadedPlugins.contains(info)) {
return _kpmp->loadedPlugins[ info ];
} else {
return 0L;
return nullptr;
}
}
......
......@@ -49,7 +49,7 @@ MessageHandler *SimpleMessageHandlerFactory::create(ChatSession *manager, Messag
{
Q_UNUSED(manager)
if (direction != d->direction) {
return 0;
return nullptr;
}
MessageHandler *handler = new SimpleMessageHandler;
QObject::connect(handler, SIGNAL(handle(Kopete::Message&)), d->target, d->slot);
......
......@@ -359,7 +359,7 @@ Kopete::ChatSession *Kopete::Transfer::chatSession() const
Kopete::TransferManager *Kopete::TransferManager::transferManager()
{
static TransferManager s(0L);
static TransferManager s(nullptr);
return &s;
}
......
......@@ -213,7 +213,7 @@ KopeteView *KopeteViewManager::view(Kopete::ChatSession *session, const QString
return newView;
} else {
kError(14000) << "Could not create a view, no plugins available!" << endl;
return 0L;
return nullptr;
}
}
}
......
......@@ -146,12 +146,12 @@ Group *ContactAddedNotifyDialog::group() const
MetaContact *ContactAddedNotifyDialog::addContact() const
{
if (!added() || !d->account) {
return 0L;
return nullptr;
}
MetaContact *metacontact = d->account->addContact(d->contactId, displayName(), group());
if (!metacontact) {
return 0L;
return nullptr;
}
metacontact->setKabcId(d->addressbookId);
......
......@@ -70,7 +70,7 @@ Component *ComponentBase::component(uint n)
if (n < components()) {
return d->components.at(n);
}
return 0l;
return nullptr;
}
Component *ComponentBase::componentAt(const QPoint &pt)
......
......@@ -49,7 +49,7 @@ public:
*/
virtual KopeteView *createView(ChatSession * /*session*/)
{
return 0L;
return nullptr;
}
/**
......
......@@ -228,7 +228,7 @@ Kopete::MetaContact *MetaContactSelectorWidget::metaContact()
return item->metaContact();
}
return 0L;
return nullptr;
}
void MetaContactSelectorWidget::selectMetaContact(Kopete::MetaContact *mc)
......
......@@ -257,7 +257,7 @@ Filter *HighlightPreferences::selectedItem()
{
QListWidgetItem *lvi = preferencesDialog.m_list->currentItem();
if (!lvi) {
return 0L;
return nullptr;
}
return qvariant_cast<Filter *>(lvi->data(Qt::UserRole));
}
......
......@@ -56,10 +56,10 @@
class NowListeningPlugin::Private
{
public:
Private() : m_currentMediaPlayer(0L)
, m_currentChatSession(0L)
, m_currentMetaContact(0L)
, advertTimer(0L)
Private() : m_currentMediaPlayer(nullptr)
, m_currentChatSession(nullptr)
, m_currentMetaContact(nullptr)
, advertTimer(nullptr)
{
}
......
......@@ -209,6 +209,7 @@ void JabberAccount::setS5BServerPort ( int port )
void JabberAccount::fillActionMenu( KActionMenu *actionMenu )
{
qDebug() << " void JabberAccount::fillActionMenu( KActionMenu *actionMenu )";
Kopete::Account::fillActionMenu( actionMenu );
actionMenu->addSeparator();
......@@ -218,7 +219,7 @@ void JabberAccount::fillActionMenu( KActionMenu *actionMenu )
action = new QAction( this );
action->setIcon( QIcon::fromTheme(QStringLiteral("jabber_group")) );
action->setText( i18n("Join Groupchat...") );
QObject::connect( action, SIGNAL(triggered(bool)), this, SLOT(slotJoinNewChat()) );
QObject::connect( action, &QAction::triggered, this, &JabberAccount::slotJoinNewChat );
actionMenu->addAction(action);
action->setEnabled( isConnected() );
......@@ -231,20 +232,20 @@ void JabberAccount::fillActionMenu( KActionMenu *actionMenu )
action = new QAction( this );
action->setIcon( QIcon::fromTheme(QStringLiteral("jabber_serv_on")) );
action->setText( i18n ("Services...") );
QObject::connect( action, SIGNAL(triggered(bool)), this, SLOT(slotGetServices()) );
QObject::connect( action, &QAction::triggered, this, &JabberAccount::slotGetServices );
action->setEnabled( isConnected() );
actionMenu->addAction( action );
action = new QAction( this );
action->setIcon( ( QIcon::fromTheme(QStringLiteral("mail-message-new")) ) );
action->setText( i18n ("XML Console") );
QObject::connect( action, SIGNAL(triggered(bool)), this, SLOT(slotXMPPConsole()) );
QObject::connect( action, &QAction::triggered, this, &JabberAccount::slotXMPPConsole );
actionMenu->addAction( action );
action = new QAction( this );
action->setIcon( ( QIcon::fromTheme(QStringLiteral("document-properties")) ) );
action->setText( i18n ("Edit User Info...") );
QObject::connect( action, SIGNAL(triggered(bool)), this, SLOT(slotEditVCard()) );
QObject::connect( action, &QAction::triggered, this, &JabberAccount::slotEditVCard );
action->setEnabled( isConnected() );
actionMenu->addAction( action );
......@@ -254,7 +255,7 @@ void JabberAccount::fillActionMenu( KActionMenu *actionMenu )
action = new QAction(mMoodMenu);
action->setText(MoodManager::self()->getMoodName((Mood::Type)i));
action->setData(QVariant(i));
QObject::connect( action, SIGNAL(triggered(bool)), this, SLOT(slotSetMood()) );
QObject::connect( action, &QAction::triggered, this, &JabberAccount::slotSetMood );
mMoodMenu->addAction( action );
}
actionMenu->addAction( mMoodMenu );
......
......@@ -51,8 +51,8 @@ class JabberClient::Private
{
public:
Private()
: jabberClient(0L), jabberClientStream(0L), jabberClientConnector(0L), jabberTLS(0L),
jabberTLSHandler(0L), privacyManager(0L)
: jabberClient(nullptr), jabberClientStream(nullptr), jabberClientConnector(nullptr), jabberTLS(nullptr),
jabberTLSHandler(nullptr), privacyManager(nullptr)
{}
~Private()
{
......@@ -589,7 +589,7 @@ XMPP::Task *JabberClient::rootTask () const
}
else
{
return 0l;
return nullptr;
}
}
......@@ -603,7 +603,7 @@ XMPP::FileTransferManager *JabberClient::fileTransferManager () const
}
else
{
return 0L;
return nullptr;
}
}
......
......@@ -70,7 +70,7 @@
* JabberContact constructor
*/
JabberContact::JabberContact (const XMPP::RosterItem &rosterItem, Kopete::Account *_account, Kopete::MetaContact * mc, const QString &legacyId)
: JabberBaseContact ( rosterItem, _account, mc, legacyId) , mDiscoDone(false), m_syncTimer(0L)
: JabberBaseContact ( rosterItem, _account, mc, legacyId) , mDiscoDone(false), m_syncTimer(nullptr)
{
///*account()->client()->clientStream()->*/XMPP::setDebug((Debug*) new TD());
qCDebug(JABBER_PROTOCOL_LOG) << contactId() << " is created - " << this;
......
......@@ -117,7 +117,7 @@ JabberBaseContact *JabberContactPool::addGroupContact(const XMPP::RosterItem &co
mContactItem->setDirty(dirty);
//we must tell to the originating function that no new contact has been added
return 0L;//mContactItem->contact ();
return nullptr;//mContactItem->contact ();
} else {
//this happen if we receive a MUC invitaiton: when the invitaiton is received, it's from the muc itself
//and then kopete will create a temporary contact for it. but it will not be a good contact.
......@@ -256,7 +256,7 @@ JabberBaseContact *JabberContactPool::findExactMatch(const XMPP::Jid &jid)
}
}
return 0L;
return nullptr;
}
JabberBaseContact *JabberContactPool::findRelevantRecipient(const XMPP::Jid &jid)
......@@ -267,7 +267,7 @@ JabberBaseContact *JabberContactPool::findRelevantRecipient(const XMPP::Jid &jid
}
}
return 0L;
return nullptr;
}
QList<JabberBaseContact *> JabberContactPool::findRelevantSources(const XMPP::Jid &jid)
......
......@@ -163,11 +163,11 @@ KopeteEditAccountWidget *JabberProtocol::createEditAccountWidget (Kopete::Accoun
{
JabberTransport *transport = dynamic_cast < JabberTransport * >(account);
if(!transport || !transport->account()->client() )
return 0L;
return nullptr;
dlgRegister *registerDialog = new dlgRegister (transport->account(), transport->myself()->contactId());
registerDialog->show ();
registerDialog->raise ();
return 0l; //we make ourself our own dialog, not an editAccountWidget.
return nullptr; //we make ourself our own dialog, not an editAccountWidget.
}
}
......@@ -175,7 +175,7 @@ Kopete::Account *JabberProtocol::createNewAccount (const QString & accountId)
{
qDebug (JABBER_PROTOCOL_LOG) << "Create New Account. ID: " << accountId;
if( Kopete::AccountManager::self()->findAccount( pluginId() , accountId ) )
return 0L; //the account may already exist if greated just above
return nullptr; //the account may already exist if greated just above
int slash=accountId.indexOf('/');
if(slash>=0)
......@@ -186,10 +186,10 @@ Kopete::Account *JabberProtocol::createNewAccount (const QString & accountId)
{
realAccount = new JabberAccount( this, realAccountId );
if(!Kopete::AccountManager::self()->registerAccount( realAccount ) )
return 0L;
return nullptr;
}
if(!realAccount)
return 0L;
return nullptr;
return new JabberTransport( realAccount , accountId );
}
else
......
......@@ -248,7 +248,7 @@ JabberResource *JabberResourcePool::lockedJabberResource(const XMPP::Jid &jid)
qCDebug(JABBER_PROTOCOL_LOG) << "WARNING: No resource found in pool, returning as offline.";
return 0L;
return nullptr;
}
// see if we have a locked resource
......@@ -262,7 +262,7 @@ JabberResource *JabberResourcePool::lockedJabberResource(const XMPP::Jid &jid)
qCDebug(JABBER_PROTOCOL_LOG) << "No lock available for " << jid.bare();
// there's no locked resource, return an empty resource
return 0L;
return nullptr;
}
const XMPP::Resource &JabberResourcePool::lockedResource(const XMPP::Jid &jid)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment