Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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

use nullptr

parent 022861b9
......@@ -756,7 +756,7 @@ void ChatMessagePart::slotRightClick(const QString &, const QPoint &point)
return;
}
QMenu *chatWindowPopup = 0L;
QMenu *chatWindowPopup = nullptr;
if (Kopete::Contact *contact = contactFromNode(d->activeElement)) {
chatWindowPopup = contact->popupMenu();
......
......@@ -94,7 +94,7 @@ ChatView::ChatView(Kopete::ChatSession *mgr, ChatWindowPlugin *parent)
KVBox *vbox = this;
m_mainWindow = 0L;
m_mainWindow = nullptr;
m_tabState = Normal;
d->warnGroupChat = mgr->warnGroupChat();
......
......@@ -108,7 +108,7 @@ KopeteChatWindow *KopeteChatWindow::window(Kopete::ChatSession *manager)
KopeteChatWindow *myWindow = 0;
//Take the first and the first? What else?
Kopete::Group *group = 0L;
Kopete::Group *group = nullptr;
Kopete::ContactPtrList members = manager->members();
Kopete::MetaContact *metaContact = members.first()->metaContact();
......@@ -201,11 +201,11 @@ KopeteChatWindow::KopeteChatWindow(Kopete::ChatSession::Form form, QWidget *pare
QTime chrono;
chrono.start();
#endif
m_activeView = 0L;
m_popupView = 0L;
backgroundFile = 0L;
m_activeView = nullptr;
m_popupView = nullptr;
backgroundFile = nullptr;
updateBg = true;
m_tabBar = 0L;
m_tabBar = nullptr;
m_participantsWidget = new QDockWidget(i18n("Participants"), this);
m_participantsWidget->setAllowedAreas(Qt::RightDockWidgetArea | Qt::LeftDockWidgetArea);
......@@ -254,7 +254,7 @@ KopeteChatWindow::KopeteChatWindow(Kopete::ChatSession::Form form, QWidget *pare
connect(m_button_send, SIGNAL(clicked()), this, SLOT(slotSendMessage()));
statusBar()->addPermanentWidget(m_button_send, 0);
} else {
m_button_send = 0L;
m_button_send = nullptr;
}
m_status_text = new KSqueezedTextLabel(i18nc("@info:status", "Ready."), statusBar());
......@@ -719,7 +719,7 @@ void KopeteChatWindow::slotCloseChat(QWidget *chatView)
void KopeteChatWindow::addTab(ChatView *view)
{
QList<Kopete::Contact *> chatMembers = view->msgManager()->members();
Kopete::Contact *c = 0L;
Kopete::Contact *c = nullptr;
foreach (Kopete::Contact *contact, chatMembers) {
if (!c || c->onlineStatus() < contact->onlineStatus()) {
c = contact;
......@@ -767,7 +767,7 @@ void KopeteChatWindow::deleteTabBar()
}
m_tabBar->deleteLater();
m_tabBar = 0L;
m_tabBar = nullptr;
}
}
......@@ -862,7 +862,7 @@ void KopeteChatWindow::detachChatView(ChatView *view)
void KopeteChatWindow::slotDetachChat(QAction *action)
{
KopeteChatWindow *newWindow = 0L;
KopeteChatWindow *newWindow = nullptr;
ChatView *detachedView;
if (m_popupView) {
......@@ -1043,7 +1043,7 @@ void KopeteChatWindow::slotUpdateCaptionIcons(ChatView *view)
return; //(pas de charité)
}
QList<Kopete::Contact *> chatMembers = view->msgManager()->members();
Kopete::Contact *c = 0L;
Kopete::Contact *c = nullptr;
foreach (Kopete::Contact *contact, chatMembers) {
if (!c || c->onlineStatus() < contact->onlineStatus()) {
c = contact;
......
......@@ -127,9 +127,9 @@ int ChatWindowStyleManager::installStyle(const QString &styleBundlePath)
return StyleNoDirectoryValid;
}
KArchiveEntry *currentEntry = 0L;
KArchiveDirectory *currentDir = 0L;
KArchive *archive = 0L;
KArchiveEntry *currentEntry = nullptr;
KArchiveDirectory *currentDir = nullptr;
KArchive *archive = nullptr;
// Find mimetype for current bundle. ZIP and KTar need separate constructor
QString currentBundleMimeType = KMimeType::findByPath(styleBundlePath, 0, false)->name();
......
......@@ -238,7 +238,7 @@ KopeteMetaLVIProps::KopeteMetaLVIProps(Kopete::MetaContact *metaContact, QWidget
mAddressBookUid = mMetaContact->kabcId();
mExport = 0L;
mExport = nullptr;
if (!mAddressBookUid.isEmpty()) {
//DEPRECATED: KContacts::AddressBook *ab = Kopete::KABCPersistence::self()->addressBook();
......
......@@ -93,7 +93,7 @@ void ContactStalker::messageAppended(Kopete::Message &message, Kopete::ChatSessi
void ContactStalker::slotMetaContactRemoved(Kopete::MetaContact *contact)
{
if (contact == m_contact) {
m_contact = 0L;
m_contact = nullptr;
emit contactChanged(contact->metaContactId().toString());
}
}
......@@ -154,7 +154,7 @@ Kopete::OnlineStatusManager::Categories KopeteDBusInterfacePrivate::status2Value
Kopete::MetaContact *KopeteDBusInterfacePrivate::findContact(
const QString &nameOrId)
{
Kopete::MetaContact *contact = 0L;
Kopete::MetaContact *contact = nullptr;
if (nameOrId.count(':') == 2) {
QStringList tokens = nameOrId.split(':');
......
......@@ -88,7 +88,7 @@ VideoDevicePool::VideoDevicePool()
*/
VideoDevicePool::~VideoDevicePool()
{
s_self = 0L;
s_self = nullptr;
foreach (VideoDevice *vd, m_videodevices) {
delete vd;
}
......
......@@ -104,7 +104,7 @@ ChatSessionMembersListModel::ChatSessionMembersListModel(QObject *parent)
: QAbstractListModel(parent)
{
d = new Private();
d->session = 0L;
d->session = nullptr;
}
ChatSessionMembersListModel::~ChatSessionMembersListModel()
......
......@@ -74,7 +74,7 @@ public:
//static KContacts::AddressBook* s_addressBook;
};
//KContacts::AddressBook* KABCPersistence::Private::s_addressBook = 0L;
//KContacts::AddressBook* KABCPersistence::Private::s_addressBook = nullptr;
KABCPersistence::KABCPersistence(QObject *parent, const char *name)
: QObject(parent)
......@@ -96,7 +96,7 @@ KABCPersistence *KABCPersistence::self()
/*KContacts::AddressBook* KABCPersistence::addressBook()
{
if ( Private::s_addressBook == 0L )
if ( Private::s_addressBook == nullptr )
{
Private::s_addressBook = KContacts::StdAddressBook::self();
KContacts::StdAddressBook::setAutomaticSave( false );
......
......@@ -72,7 +72,7 @@ public:
uint suspendedStatusCategory;
};
AccountManager *AccountManager::s_self = 0L;
AccountManager *AccountManager::s_self = nullptr;
AccountManager *AccountManager::self()
{
......@@ -100,7 +100,7 @@ AccountManager::AccountManager()
AccountManager::~AccountManager()
{
s_self = 0L;
s_self = nullptr;
delete d;
}
......@@ -422,7 +422,7 @@ void AccountManager::slotPluginLoaded(Plugin *plugin)
qCDebug(LIBKOPETE_LOG)
<<"Creating account for '" << accountId << "'" << endl;
Account *account = 0L;
Account *account = nullptr;
account = registerAccount(protocol->createNewAccount(accountId));
if (!account) {
qCWarning(LIBKOPETE_LOG)
......
......@@ -90,7 +90,7 @@ AvatarManager::AvatarManager(QObject *parent)
AvatarManager::~AvatarManager()
{
s_self = 0L;
s_self = nullptr;
delete d;
}
......
......@@ -85,7 +85,7 @@ Kopete::ChatSession::ChatSession(const Kopete::Contact *user, Kopete::ContactPtr
d->isEmpty = others.isEmpty();
d->mCanBeDeleted = true;
d->refcount = 0;
d->view = 0L;
d->view = nullptr;
d->customDisplayName = false;
d->mayInvite = false;
d->form = form;
......@@ -648,7 +648,7 @@ KopeteView *Kopete::ChatSession::view(bool canCreate, const QString &requestedPl
void Kopete::ChatSession::slotViewDestroyed()
{
d->view = 0L;
d->view = nullptr;
if (d->mCanBeDeleted && d->refcount < 1) {
deleteLater();
}
......
......@@ -239,13 +239,13 @@ signals:
* a message will be soon shown in the chatwindow.
* See @ref Kopete::ChatSessionManager::aboutToDisplay() signal
*/
void messageAppended(Kopete::Message &msg, Kopete::ChatSession *kmm = 0L);
void messageAppended(Kopete::Message &msg, Kopete::ChatSession *kmm = nullptr);
/**
* a message will be soon received
* See @ref Kopete::ChatSessionManager::aboutToReceive() signal
*/
void messageReceived(Kopete::Message &msg, Kopete::ChatSession *kmm = 0L);
void messageReceived(Kopete::Message &msg, Kopete::ChatSession *kmm = nullptr);
/**
* @brief a message is going to be sent
......@@ -255,7 +255,7 @@ signals:
* the protocol have also to call @ref appendMessage() and @ref messageSucceeded()
* See also @ref Kopete::ChatSessionManager::aboutToSend() signal
*/
void messageSent(Kopete::Message &msg, Kopete::ChatSession *kmm = 0L);
void messageSent(Kopete::Message &msg, Kopete::ChatSession *kmm = nullptr);
/**
* The last message has finaly successfully been sent
......
......@@ -33,7 +33,7 @@ public:
// UI::ChatView *activeView;
};
ChatSessionManager *ChatSessionManager::s_self = 0L;
ChatSessionManager *ChatSessionManager::s_self = nullptr;
ChatSessionManager *ChatSessionManager::self()
{
......@@ -53,7 +53,7 @@ ChatSessionManager::ChatSessionManager(QObject *parent)
ChatSessionManager::~ChatSessionManager()
{
s_self = 0L;
s_self = nullptr;
QList<ChatSession *>::ConstIterator it;
for (it = d->sessions.constBegin(); it != d->sessions.constEnd(); ++it) {
qCDebug(LIBKOPETE_LOG) << "Unloading KMM: Why this KMM isn't yet unloaded?";
......@@ -64,7 +64,7 @@ ChatSessionManager::~ChatSessionManager()
ChatSession *ChatSessionManager::findChatSession(const Contact *user, ContactPtrList chatContacts, Protocol *protocol)
{
ChatSession *result = 0L;
ChatSession *result = nullptr;
QList<ChatSession *>::ConstIterator it;
int i;
......
......@@ -93,7 +93,7 @@ struct CommandHandlerPrivate
QList<QAction *> m_commands;
};
CommandHandlerPrivate *Kopete::CommandHandler::p = 0L;
CommandHandlerPrivate *Kopete::CommandHandler::p = nullptr;
Kopete::CommandHandler::CommandHandler() : QObject(qApp)
{
......@@ -287,7 +287,7 @@ void Kopete::CommandHandler::slotSayCommand(const QString &args, Kopete::ChatSes
void Kopete::CommandHandler::slotExecCommand(const QString &args, Kopete::ChatSession *manager)
{
if (!args.isEmpty()) {
KProcess *proc = 0L;
KProcess *proc = nullptr;
if (KAuthorized::authorizeKAction(QStringLiteral("shell_access"))) {
proc = new KProcess(manager);
}
......
......@@ -64,7 +64,7 @@ public:
MetaContact *myself;
};
ContactList *ContactList::s_self = 0L;
ContactList *ContactList::s_self = nullptr;
ContactList *ContactList::self()
{
......@@ -83,7 +83,7 @@ ContactList::ContactList()
//the myself metacontact can't be created now, because it will use
//ContactList::self() as parent which will call this constructor -> infinite loop
d->myself = 0L;
d->myself = nullptr;
//no contact list loaded yet, don't save them
d->loaded = false;
......@@ -104,7 +104,7 @@ ContactList::ContactList()
ContactList::~ContactList()
{
s_self = 0L;
s_self = nullptr;
delete d->myself;
delete d;
}
......
......@@ -46,7 +46,7 @@ class KOPETE_EXPORT ContactListElement : public PropertyContainer
Q_OBJECT
protected:
ContactListElement(QObject *parent = 0L);
ContactListElement(QObject *parent = nullptr);
~ContactListElement();
public:
......
......@@ -39,7 +39,7 @@ public:
PropertyTmpl::Map mTemplates;
};
Properties *Properties::mSelf = 0L;
Properties *Properties::mSelf = nullptr;
Properties *Properties::self()
{
......@@ -75,7 +75,7 @@ Properties::Properties()
Properties::~Properties()
{
kDebug(14000);
mSelf = 0L;
mSelf = nullptr;
delete d;
}
......
......@@ -28,9 +28,9 @@
#include <KLocalizedString>
namespace Kopete {
Group *Group::s_topLevel = 0L;
Group *Group::s_temporary = 0L;
Group *Group::s_offline = 0L;
Group *Group::s_topLevel = nullptr;
Group *Group::s_temporary = nullptr;
Group *Group::s_offline = nullptr;
Group *Group::topLevel()
{
if (!s_topLevel) {
......@@ -92,13 +92,13 @@ Group::Group()
Group::~Group()
{
if (d->type == TopLevel) {
s_topLevel = 0L;
s_topLevel = nullptr;
}
if (d->type == Temporary) {
s_temporary = 0L;
s_temporary = nullptr;
}
if (d->type == Offline) {
s_offline = 0L;
s_offline = nullptr;
}
delete d;
}
......
......@@ -40,7 +40,7 @@ public:
Identity *defaultIdentity;
};
IdentityManager *IdentityManager::s_self = 0L;
IdentityManager *IdentityManager::s_self = nullptr;
IdentityManager *IdentityManager::self()
{
......@@ -60,7 +60,7 @@ IdentityManager::IdentityManager()
IdentityManager::~IdentityManager()
{
s_self = 0L;
s_self = nullptr;
delete d;
}
......
......@@ -44,7 +44,7 @@ public:
Kopete::IdlePlatform *platform;
};
Kopete::IdleTimer *Kopete::IdleTimer::instance = 0L;
Kopete::IdleTimer *Kopete::IdleTimer::instance = nullptr;
Kopete::IdleTimer::IdleTimer()
: QObject()
......@@ -80,7 +80,7 @@ Kopete::IdleTimer *Kopete::IdleTimer::self()
Kopete::IdleTimer::~IdleTimer()
{
instance = 0L;
instance = nullptr;
delete d->platform;
......
......@@ -26,7 +26,7 @@ public:
QList<InfoEvent *> eventList;
};
InfoEventManager *InfoEventManager::instance = 0L;
InfoEventManager *InfoEventManager::instance = nullptr;
InfoEventManager::InfoEventManager()
: QObject(qApp)
......@@ -36,7 +36,7 @@ InfoEventManager::InfoEventManager()
InfoEventManager::~InfoEventManager()
{
instance = 0L;
instance = nullptr;
delete d;
}
......
......@@ -545,7 +545,7 @@ public: /* static helpers */
* @return The decoded string
*/
static QString decodeString(const QByteArray &message, const QTextCodec *providedCodec = 0L, bool *success = 0L);
static QString decodeString(const QByteArray &message, const QTextCodec *providedCodec = nullptr, bool *success = nullptr);
#endif
private:
......
......@@ -41,7 +41,7 @@ class KOPETE_EXPORT MessageEvent : public QObject
Q_OBJECT
public:
explicit MessageEvent(const Kopete::Message &, QObject *parent = 0L); /* implicit */
explicit MessageEvent(const Kopete::Message &, QObject *parent = nullptr); /* implicit */
~MessageEvent();
/**
......
......@@ -659,7 +659,7 @@ QString MetaContact::displayName() const
// qCDebug(LIBKOPETE_LOG) << " setting displayname source for " << metaContactId();
}
}
if (displayNameSourceContact() != 0L) {
if (displayNameSourceContact() != nullptr) {
return nameFromContact(displayNameSourceContact());
} else {
// qCDebug(LIBKOPETE_LOG) << " source == SourceContact , but there is no displayNameSourceContact for contact " << metaContactId();
......@@ -740,7 +740,7 @@ QImage MetaContact::photoFromCustom() const
QImage photoFromContact(Kopete::Contact *contact) /*const*/
{
if (contact == 0L) {
if (contact == nullptr) {
return QImage();
}
......@@ -822,7 +822,7 @@ void MetaContact::setPhotoSourceContact(Contact *contact)
d->photoSourceContact = contact;
// Create a cache for the contact photo.
if (d->photoSourceContact != 0L) {
if (d->photoSourceContact != nullptr) {
QVariant photoProp;
if (contact->hasProperty(Kopete::Global::Properties::self()->photo().key())) {
photoProp = contact->property(Kopete::Global::Properties::self()->photo().key()).value();
......@@ -1182,7 +1182,7 @@ void MetaContact::setPhotoSyncedWithKABC(bool b)
case SourceContact:
{
Contact *source = photoSourceContact();
if (source != 0L) {
if (source != nullptr) {
newValue = source->property(Kopete::Global::Properties::self()->photo()).value();
}
break;
......
......@@ -152,7 +152,7 @@ OnlineStatus::OnlineStatus(StatusType status)
d->status = status;
d->internalStatus = 0;
d->weight = 0;
d->protocol = 0L;
d->protocol = nullptr;
d->categories = 0x00;
d->options = 0x00;
......@@ -186,7 +186,7 @@ OnlineStatus::OnlineStatus()
d->status = Unknown;
d->internalStatus = 0;
d->weight = 0;
d->protocol = 0L;
d->protocol = nullptr;
d->overlayIcons = QStringList(QLatin1String("status_unknown"));
d->categories = 0x00;
d->options = 0x00;
......
......@@ -45,7 +45,7 @@
#include "kopeteidletimer.h"
namespace Kopete {
StatusManager *StatusManager::instance = 0L;
StatusManager *StatusManager::instance = nullptr;
class StatusManager::Private
{
......@@ -90,7 +90,7 @@ StatusManager::StatusManager()
StatusManager::~StatusManager()
{
instance = 0L;
instance = nullptr;
delete d->idleTimer;
......
......@@ -173,7 +173,7 @@ void Kopete::WalletManager::closeWallet()
}
delete d->wallet;
d->wallet = 0L;
d->wallet = nullptr;
emit walletLost();
}
......
......@@ -28,7 +28,7 @@
namespace Kopete {
namespace Utils {
NotifyHelper *NotifyHelper::s_self = 0L;
NotifyHelper *NotifyHelper::s_self = nullptr;
NotifyHelper::NotifyHelper() : QObject(qApp)
{
......@@ -36,7 +36,7 @@ NotifyHelper::NotifyHelper() : QObject(qApp)
NotifyHelper::~NotifyHelper()
{
s_self = 0L;
s_self = nullptr;
}
NotifyHelper *NotifyHelper::self()
......
......@@ -122,7 +122,7 @@ struct KopeteViewManagerPrivate
Kopete::ActiveNotifications activeNotifications;
};
KopeteViewManager *KopeteViewManager::s_viewManager = 0L;
KopeteViewManager *KopeteViewManager::s_viewManager = nullptr;
KopeteViewManager *KopeteViewManager::viewManager()
{
......@@ -136,7 +136,7 @@ KopeteViewManager::KopeteViewManager()
{
s_viewManager = this;
d = new KopeteViewManagerPrivate;
d->activeView = 0L;
d->activeView = nullptr;
d->foreignMessage = false;
connect(Kopete::BehaviorSettings::self(), SIGNAL(configChanged()), this, SLOT(slotPrefsChanged()));
......@@ -186,7 +186,7 @@ KopeteView *KopeteViewManager::view(Kopete::ChatSession *session, const QString
return d->sessionMap[ session ];
} else {
Kopete::PluginManager *pluginManager = Kopete::PluginManager::self();
Kopete::ViewPlugin *viewPlugin = 0L;
Kopete::ViewPlugin *viewPlugin = nullptr;
QString pluginName = requestedPlugin.isEmpty() ? Kopete::BehaviorSettings::self()->viewPlugin() : requestedPlugin;
if (!pluginName.isEmpty()) {
......@@ -503,7 +503,7 @@ void KopeteViewManager::slotViewDestroyed(KopeteView *closingView)
}
if (closingView == d->activeView) {
d->activeView = 0L;
d->activeView = nullptr;
}
}
......
......@@ -91,7 +91,7 @@ AddressBookSelectorWidget::~AddressBookSelectorWidget()
KContacts::Addressee AddressBookSelectorWidget::addressee()
{
AddresseeItem *item = 0L;
AddresseeItem *item = nullptr;
item = static_cast<AddresseeItem *>(addresseeListView->currentItem());
if (item) {
......
......@@ -91,7 +91,7 @@ public:
* @param hide a bitmask of HideWidget used to hide some widget. By default, everything is shown.
*
*/
explicit ContactAddedNotifyDialog(const QString &contactId, const QString &contactNick = QString(), Kopete::Account *account = 0L, const HideWidgetOptions &hide = DefaultHide);
explicit ContactAddedNotifyDialog(const QString &contactId, const QString &contactNick = QString(), Kopete::Account *account = nullptr, const HideWidgetOptions &hide = DefaultHide);
/**
* @brief Destructor
......
......@@ -35,7 +35,7 @@
#include "kopeteuiglobal.h"
#include <kactioncollection.h>
KSettings::Dialog *KopetePreferencesAction::s_settingsDialog = 0L;
KSettings::Dialog *KopetePreferencesAction::s_settingsDialog = nullptr;
KopetePreferencesAction::KopetePreferencesAction(KActionCollection *parent, const char *name)
: QAction(QIcon::fromTheme(KStandardGuiItem::configure().iconName()), KStandardGuiItem::configure().text(), parent)
......
......@@ -41,8 +41,8 @@ public:
/**
* @brief Create and initialize the plugin
*/
explicit ViewPlugin(const KAboutData &instance, QObject *parent = 0L);
explicit ViewPlugin(QObject *parent = 0L);
explicit ViewPlugin(const KAboutData &instance, QObject *parent = nullptr);
explicit ViewPlugin(QObject *parent = nullptr);
/**
* @brief Creates a view to be associated with the passed in session
......
......@@ -135,9 +135,9 @@ void MetaContactSelectorWidgetLVI::buildVisualComponents()
delete component(0);
}
d->nameText = 0L;
d->metaContactPhoto = 0L;
d->extraText = 0L;
d->nameText = nullptr;
d->metaContactPhoto = nullptr;
d->extraText = nullptr;
d->contactIconSize = 16;
d->photoSize = 48;
......@@ -221,7 +221,7 @@ MetaContactSelectorWidget::~MetaContactSelectorWidget()
Kopete::MetaContact *MetaContactSelectorWidget::metaContact()
{
MetaContactSelectorWidgetLVI *item = 0L;
MetaContactSelectorWidgetLVI *item = nullptr;
item = static_cast<MetaContactSelectorWidgetLVI *>(d->widget->metaContactListView->currentItem());