From 2703d6a0c228d1af87b6f3b669e3c0fcb5b41d25 Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sun, 8 Nov 2026 08:05:38 -0300
Subject: Replace zero pointer constants in KMail components
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 kmail/aboutdata.cpp                   | 260 +++++++++++++++++-----------------
 kmail/accountcombobox.cpp             |   2 +-
 kmail/accountcombobox.h               |   2 +-
 kmail/accountdialog.cpp               |  26 ++--
 kmail/accountdialog.h                 |   2 +-
 kmail/accountmanager.cpp              |  24 ++--
 kmail/accountwizard.cpp               |  14 +-
 kmail/accountwizard.h                 |   2 +-
 kmail/acljobs.cpp                     |   2 +-
 kmail/actionscheduler.cpp             |  36 ++---
 kmail/actionscheduler.h               |   4 +-
 kmail/antispamconfig.cpp              |   2 +-
 kmail/antispamwizard.cpp              |  16 +--
 kmail/antispamwizard.h                |   2 +-
 kmail/app_octetstream.cpp             |   8 +-
 kmail/archivefolderdialog.h           |   2 +-
 kmail/attachmentlistview.cpp          |   4 +-
 kmail/attachmentlistview.h            |   4 +-
 kmail/attachmentstrategy.cpp          |  12 +-
 kmail/backupjob.cpp                   |  32 ++---
 kmail/backupjob.h                     |   2 +-
 kmail/bodypartformatter.cpp           |   4 +-
 kmail/bodypartformatterfactory.cpp    |  14 +-
 kmail/bodyvisitor.cpp                 |   4 +-
 kmail/cachedimapjob.cpp               |  40 +++---
 kmail/cachedimapjob.h                 |  16 +--
 kmail/colorlistbox.cpp                |   2 +-
 kmail/colorlistbox.h                  |   2 +-
 kmail/compactionjob.cpp               |   8 +-
 kmail/composer.h                      |   4 +-
 kmail/configuredialog.cpp             |  48 +++----
 kmail/configuredialog.h               |   2 +-
 kmail/configuredialog_p.cpp           |   2 +-
 kmail/configuredialog_p.h             |  76 +++++-----
 kmail/copyfolderjob.cpp               |   6 +-
 kmail/copyfolderjob.h                 |   2 +-
 kmail/customtemplates.cpp             |   6 +-
 kmail/customtemplates.h               |   2 +-
 kmail/dictionarycombobox.cpp          |   6 +-
 kmail/dictionarycombobox.h            |   2 +-
 kmail/distributionlistdialog.cpp      |   2 +-
 kmail/editorwatcher.cpp               |   4 +-
 kmail/encodingdetector.cpp            |   6 +-
 kmail/encodingdetector_ja.cpp         |   2 +-
 kmail/expirejob.cpp                   |  10 +-
 kmail/expirejob.h                     |   2 +-
 kmail/expirypropertiesdialog.cpp      |  10 +-
 kmail/favoritefolderview.cpp          |  14 +-
 kmail/favoritefolderview.h            |   4 +-
 kmail/filterimporterexporter.h        |   2 +-
 kmail/filterlogdlg.cpp                |   2 +-
 kmail/folderdiaacltab.cpp             |  10 +-
 kmail/folderdiaacltab.h               |   4 +-
 kmail/folderdiaquotatab.cpp           |   4 +-
 kmail/folderdiaquotatab.h             |   2 +-
 kmail/folderdiaquotatab_p.h           |   2 +-
 kmail/folderjob.cpp                   |   4 +-
 kmail/folderjob.h                     |   4 +-
 kmail/folderrequester.cpp             |   4 +-
 kmail/foldersetselector.h             |   2 +-
 kmail/foldershortcutdialog.h          |   2 +-
 kmail/folderstorage.cpp               |  48 +++----
 kmail/folderstorage.h                 |  20 +--
 kmail/foldertreebase.h                |   4 +-
 kmail/folderutil.cpp                  |   2 +-
 kmail/globalsettings.cpp              |   2 +-
 kmail/headeritem.cpp                  |  12 +-
 kmail/headeritem.h                    |  14 +-
 kmail/headerlistquicksearch.cpp       |   6 +-
 kmail/headerlistquicksearch.h         |   2 +-
 kmail/headerstrategy.cpp              |  12 +-
 kmail/headerstyle.cpp                 |  12 +-
 kmail/htmlstatusbar.h                 |   2 +-
 kmail/identitydialog.h                |   2 +-
 kmail/identitydrag.cpp                |   2 +-
 kmail/identitydrag.h                  |   2 +-
 kmail/identitylistview.cpp            |   2 +-
 kmail/identitylistview.h              |   2 +-
 kmail/imapaccountbase.cpp             |  38 ++---
 kmail/imapaccountbase.h               |  10 +-
 kmail/imapjob.cpp                     |  40 +++---
 kmail/imapjob.h                       |   6 +-
 kmail/importjob.cpp                   |  30 ++--
 kmail/importjob.h                     |   2 +-
 kmail/index.cpp                       |  12 +-
 kmail/jobscheduler.cpp                |  20 +--
 kmail/jobscheduler.h                  |   2 +-
 kmail/keyresolver.cpp                 |  32 ++---
 kmail/kmaccount.cpp                   |  30 ++--
 kmail/kmaccount.h                     |   2 +-
 kmail/kmacctcachedimap.cpp            |   8 +-
 kmail/kmacctfolder.cpp                |   6 +-
 kmail/kmacctimap.cpp                  |  16 +--
 kmail/kmacctlocal.cpp                 |  12 +-
 kmail/kmacctmaildir.cpp               |   6 +-
 kmail/kmacctseldlg.h                  |   2 +-
 kmail/kmail_options.h                 |  30 ++--
 kmail/kmail_part.cpp                  |   2 +-
 kmail/kmailicalifaceimpl.cpp          |  82 +++++------
 kmail/kmailicalifaceimpl.h            |   2 +-
 kmail/kmatmlistview.cpp               |   6 +-
 kmail/kmcommands.cpp                  | 106 +++++++-------
 kmail/kmcommands.h                    |  24 ++--
 kmail/kmcomposewin.cpp                | 142 +++++++++----------
 kmail/kmcomposewin.h                  |   8 +-
 kmail/kmdict.cpp                      |   2 +-
 kmail/kmedit.cpp                      |  38 ++---
 kmail/kmedit.h                        |   8 +-
 kmail/kmfawidgets.h                   |   4 +-
 kmail/kmfilter.cpp                    |   4 +-
 kmail/kmfilter.h                      |   2 +-
 kmail/kmfilteraction.cpp              |   8 +-
 kmail/kmfilterdlg.cpp                 |  36 ++---
 kmail/kmfilterdlg.h                   |  10 +-
 kmail/kmfiltermgr.cpp                 |  12 +-
 kmail/kmfolder.cpp                    |  16 +--
 kmail/kmfolder.h                      |  18 +--
 kmail/kmfoldercachedimap.cpp          |  74 +++++-----
 kmail/kmfoldercachedimap.h            |  12 +-
 kmail/kmfoldercombobox.cpp            |   6 +-
 kmail/kmfoldercombobox.h              |   4 +-
 kmail/kmfolderdia.cpp                 |  22 +--
 kmail/kmfolderdia.h                   |   4 +-
 kmail/kmfolderdir.cpp                 |  10 +-
 kmail/kmfolderdir.h                   |   2 +-
 kmail/kmfolderimap.cpp                |  80 +++++------
 kmail/kmfolderimap.h                  |   6 +-
 kmail/kmfolderindex.cpp               |  36 ++---
 kmail/kmfolderindex.h                 |   4 +-
 kmail/kmfoldermaildir.cpp             |  32 ++---
 kmail/kmfoldermaildir.h               |   6 +-
 kmail/kmfoldermbox.cpp                |  36 ++---
 kmail/kmfoldermbox.h                  |   4 +-
 kmail/kmfoldermgr.cpp                 |  40 +++---
 kmail/kmfoldermgr.h                   |  20 +--
 kmail/kmfoldersearch.cpp              |  64 ++++-----
 kmail/kmfoldersearch.h                |   6 +-
 kmail/kmfoldertree.cpp                |  80 +++++------
 kmail/kmfoldertree.h                  |  10 +-
 kmail/kmheaders.cpp                   | 130 ++++++++---------
 kmail/kmheaders.h                     |   4 +-
 kmail/kmkernel.cpp                    | 154 ++++++++++----------
 kmail/kmkernel.h                      |   2 +-
 kmail/kmlineeditspell.cpp             |   2 +-
 kmail/kmlineeditspell.h               |   8 +-
 kmail/kmmainwidget.cpp                | 110 +++++++-------
 kmail/kmmainwin.cpp                   |   2 +-
 kmail/kmmainwin.h                     |   2 +-
 kmail/kmmessage.cpp                   |  60 ++++----
 kmail/kmmessage.h                     |  38 ++---
 kmail/kmmimeparttree.cpp              |   6 +-
 kmail/kmmimeparttree.h                |   2 +-
 kmail/kmmsgbase.cpp                   |  22 +--
 kmail/kmmsgbase.h                     |   8 +-
 kmail/kmmsgdict.cpp                   |  32 ++---
 kmail/kmmsginfo.cpp                   |   4 +-
 kmail/kmmsginfo.h                     |   2 +-
 kmail/kmmsglist.cpp                   |   8 +-
 kmail/kmmsgpart.cpp                   |   6 +-
 kmail/kmmsgpart.h                     |   2 +-
 kmail/kmmsgpartdlg.cpp                |   2 +-
 kmail/kmmsgpartdlg.h                  |   4 +-
 kmail/kmpopfiltercnfrmdlg.cpp         |   2 +-
 kmail/kmpopfiltercnfrmdlg.h           |   4 +-
 kmail/kmpopheaders.cpp                |   4 +-
 kmail/kmreadermainwin.cpp             |  16 +--
 kmail/kmreadermainwin.h               |   6 +-
 kmail/kmreaderwin.cpp                 | 136 +++++++++---------
 kmail/kmreaderwin.h                   |   8 +-
 kmail/kmsearchpattern.cpp             |  14 +-
 kmail/kmsearchpattern.h               |   8 +-
 kmail/kmsearchpatternedit.cpp         |  12 +-
 kmail/kmsearchpatternedit.h           |   8 +-
 kmail/kmsender.cpp                    | 132 ++++++++---------
 kmail/kmservertest.cpp                |  10 +-
 kmail/kmstartup.cpp                   |   2 +-
 kmail/kmsystemtray.cpp                |  14 +-
 kmail/kmsystemtray.h                  |   2 +-
 kmail/kmtransport.cpp                 |  12 +-
 kmail/kmtransport.h                   |   4 +-
 kmail/listjob.cpp                     |   2 +-
 kmail/listjob.h                       |   4 +-
 kmail/maildirjob.cpp                  |   4 +-
 kmail/maildirjob.h                    |   4 +-
 kmail/mailinglistpropertiesdialog.cpp |   2 +-
 kmail/mailsourceviewer.cpp            |   6 +-
 kmail/mailsourceviewer.h              |   2 +-
 kmail/managesievescriptsdialog.cpp    |  20 +--
 kmail/managesievescriptsdialog.h      |   2 +-
 kmail/managesievescriptsdialog_p.h    |   2 +-
 kmail/mboxjob.h                       |   4 +-
 kmail/messageactions.cpp              |   8 +-
 kmail/messagecomposer.cpp             |  62 ++++----
 kmail/messagecomposer.h               |   4 +-
 kmail/messagecopyhelper.cpp           |   4 +-
 kmail/messagecopyhelper.h             |   2 +-
 kmail/messageproperty.cpp             |   6 +-
 kmail/networkaccount.cpp              |   4 +-
 kmail/newfolderdialog.cpp             |  16 +--
 kmail/newfolderdialog.h               |   2 +-
 kmail/objecttreeparser.cpp            |  40 +++---
 kmail/objecttreeparser.h              |  12 +-
 kmail/objecttreeparser_p.cpp          |  18 +--
 kmail/objecttreeparser_p.h            |   2 +-
 kmail/partNode.cpp                    |  50 +++----
 kmail/partNode.h                      |   4 +-
 kmail/partnodebodypart.h              |   2 +-
 kmail/popaccount.cpp                  |  54 +++----
 kmail/recipientseditor.cpp            |   6 +-
 kmail/recipientspicker.cpp            |   6 +-
 kmail/redirectdialog.h                |   2 +-
 kmail/regexplineedit.cpp              |  12 +-
 kmail/regexplineedit.h                |   6 +-
 kmail/renamejob.cpp                   |  10 +-
 kmail/renamejob.h                     |   2 +-
 kmail/rulewidgethandlermanager.cpp    |  92 ++++++------
 kmail/scalix.cpp                      |   4 +-
 kmail/searchjob.cpp                   |  18 +--
 kmail/searchwindow.cpp                |  36 ++---
 kmail/searchwindow.h                  |   4 +-
 kmail/secondarywindow.cpp             |   2 +-
 kmail/secondarywindow.h               |   2 +-
 kmail/sieveconfig.h                   |   2 +-
 kmail/sievedebugdialog.cpp            |  12 +-
 kmail/sievedebugdialog.h              |   2 +-
 kmail/sievejob.cpp                    |  12 +-
 kmail/sievejob.h                      |   4 +-
 kmail/signatureconfigurator.h         |   2 +-
 kmail/simplefoldertree.h              |   4 +-
 kmail/simplestringlisteditor.cpp      |   6 +-
 kmail/simplestringlisteditor.h        |   2 +-
 kmail/snippetdlg.h                    |   2 +-
 kmail/snippetitem.cpp                 |   4 +-
 kmail/snippetsettings.h               |   4 +-
 kmail/snippetwidget.cpp               |  24 ++--
 kmail/snippetwidget.h                 |   6 +-
 kmail/stl_util.h                      |   4 +-
 kmail/subscriptiondialog.cpp          |  12 +-
 kmail/tdehtmlparthtmlwriter.cpp       |   2 +-
 kmail/tdehtmlparthtmlwriter.h         |   2 +-
 kmail/tdelistboxdialog.h              |   4 +-
 kmail/tdelistviewindexedsearchline.h  |   2 +-
 kmail/teehtmlwriter.h                 |   2 +-
 kmail/templateparser.cpp              |  28 ++--
 kmail/templateparser.h                |   4 +-
 kmail/templatesconfiguration.cpp      |   2 +-
 kmail/templatesconfiguration.h        |   2 +-
 kmail/templatesinsertcommand.h        |   2 +-
 kmail/textsource.cpp                  |   2 +-
 kmail/treebase.cpp                    |  10 +-
 kmail/undostack.cpp                   |   4 +-
 kmail/urlhandlermanager.cpp           |  18 +--
 kmail/urlhandlermanager.h             |  12 +-
 kmail/vacation.cpp                    |  98 ++++++-------
 kmail/vacation.h                      |   2 +-
 kmail/vacationdialog.h                |   4 +-
 kmail/xfaceconfigurator.cpp           |   2 +-
 kmail/xfaceconfigurator.h             |   2 +-
 258 files changed, 2096 insertions(+), 2096 deletions(-)

diff --git a/kmail/aboutdata.cpp b/kmail/aboutdata.cpp
index 89521c09c..aa082eebf 100644
--- a/kmail/aboutdata.cpp
+++ b/kmail/aboutdata.cpp
@@ -51,167 +51,167 @@ namespace KMail {
 
   static const about_data authors[] = {
     { "Ingo Kl\303\266cker", I18N_NOOP("Maintainer"),
-      "kloecker@kde.org", 0 },
+      "kloecker@kde.org", nullptr },
     { "Don Sanders", I18N_NOOP("Adopter and co-maintainer"),
-      "sanders@kde.org", 0 },
+      "sanders@kde.org", nullptr },
     { "Stefan Taferner", I18N_NOOP("Original author"),
-      "taferner@kde.org", 0 },
+      "taferner@kde.org", nullptr },
     { "Michael H\303\244ckel", I18N_NOOP("Former maintainer"),
-      "haeckel@kde.org", 0 },
+      "haeckel@kde.org", nullptr },
 
     { "Till Adam", I18N_NOOP("Core developer"),
-      "adam@kde.org", 0 },
+      "adam@kde.org", nullptr },
     { "Carsten Burghardt", I18N_NOOP("Core developer"),
-      "burghardt@kde.org", 0 },
+      "burghardt@kde.org", nullptr },
     { "Marc Mutz", I18N_NOOP("Core developer"),
-      "mutz@kde.org", 0 },
+      "mutz@kde.org", nullptr },
     { "Daniel Naber", I18N_NOOP("Documentation"),
-      "daniel.naber@t-online.de", 0 },
+      "daniel.naber@t-online.de", nullptr },
     { "Zack Rusin", I18N_NOOP("Core developer"),
-      "zack@kde.org", 0 },
+      "zack@kde.org", nullptr },
 
-    { "Toyohiro Asukai", 0,
-      "toyohiro@ksmplus.com", 0 },
-    { "Waldo Bastian", 0,
-      "bastian@kde.org", 0 },
+    { "Toyohiro Asukai", nullptr,
+      "toyohiro@ksmplus.com", nullptr },
+    { "Waldo Bastian", nullptr,
+      "bastian@kde.org", nullptr },
     { "Ryan Breen", I18N_NOOP("system tray notification"),
-      "ryan@ryanbreen.com", 0 },
-    { "Steven Brown", 0,
-      "swbrown@ucsd.edu", 0 },
-    { "Matthias Kalle Dalheimer", 0,
-      "kalle@kde.org", 0 },
-    { "Matt Douhan", 0,
-      "matt@fruitsalad.org", 0 },
-    { "Cristi Dumitrescu", 0,
-      "cristid@chip.ro", 0 },
-    { "David Faure", 0,
-      "faure@kde.org", 0 },
-    { "Philippe Fremy", 0,
-      "pfremy@chez.com", 0 },
-    { "Kurt Granroth", 0,
-      "granroth@kde.org", 0 },
+      "ryan@ryanbreen.com", nullptr },
+    { "Steven Brown", nullptr,
+      "swbrown@ucsd.edu", nullptr },
+    { "Matthias Kalle Dalheimer", nullptr,
+      "kalle@kde.org", nullptr },
+    { "Matt Douhan", nullptr,
+      "matt@fruitsalad.org", nullptr },
+    { "Cristi Dumitrescu", nullptr,
+      "cristid@chip.ro", nullptr },
+    { "David Faure", nullptr,
+      "faure@kde.org", nullptr },
+    { "Philippe Fremy", nullptr,
+      "pfremy@chez.com", nullptr },
+    { "Kurt Granroth", nullptr,
+      "granroth@kde.org", nullptr },
     { "Andreas Gungl", I18N_NOOP("PGP 6 support and further enhancements of the encryption support"),
-      "a.gungl@gmx.de", 0 },
-    { "Steffen Hansen", 0,
-      "hansen@kde.org", 0 },
-    { "Igor Janssen", 0,
-      "rm@linux.ru.net", 0 },
-    { "Matt Johnston", 0,
-      "matt@caifex.org", 0 },
-    { "Christer Kaivo-oja", 0,
-      "whizkid@telia.com", 0 },
+      "a.gungl@gmx.de", nullptr },
+    { "Steffen Hansen", nullptr,
+      "hansen@kde.org", nullptr },
+    { "Igor Janssen", nullptr,
+      "rm@linux.ru.net", nullptr },
+    { "Matt Johnston", nullptr,
+      "matt@caifex.org", nullptr },
+    { "Christer Kaivo-oja", nullptr,
+      "whizkid@telia.com", nullptr },
     { "Lars Knoll", I18N_NOOP("Original encryption support\n"
                               "PGP 2 and PGP 5 support"),
-      "knoll@kde.org", 0 },
+      "knoll@kde.org", nullptr },
     { "J. Nick Koston", I18N_NOOP("GnuPG support"),
-      "bdraco@darkorb.net", 0 },
-    { "Stephan Kulow", 0,
-      "coolo@kde.org", 0 },
-    { "Guillaume Laurent", 0,
-      "glaurent@telegraph-road.org", 0 },
-    { "Sam Magnuson", 0,
-      "sam@trolltech.com", 0 },
-    { "Laurent Montel", 0,
-      "lmontel@mandrakesoft.com", 0 },
-    { "Matt Newell", 0,
-      "newellm@proaxis.com", 0 },
-    { "Denis Perchine", 0,
-      "dyp@perchine.com", 0 },
-    { "Samuel Penn", 0,
-      "sam@bifrost.demon.co.uk", 0 },
-    { "Carsten Pfeiffer", 0,
-      "pfeiffer@kde.org", 0 },
-    { "Sven Radej", 0,
-      "radej@kde.org", 0 },
-    { "Mark Roberts", 0,
-      "mark@taurine.demon.co.uk", 0 },
-    { "Wolfgang Rohdewald", 0,
-      "wrohdewald@dplanet.ch", 0 },
-    { "Espen Sand", 0,
-      "espen@kde.org", 0 },
-    { "Aaron J. Seigo", 0,
-      "aseigo@olympusproject.org", 0 },
-    { "George Staikos", 0,
-      "staikos@kde.org", 0 },
-    { "Jason Stephenson", 0,
-      "panda@mis.net", 0 },
-    { "Jacek Stolarczyk", 0,
-      "jacek@mer.chemia.polsl.gliwice.pl", 0 },
-    { "Roberto S. Teixeira", 0,
-      "maragato@kde.org", 0 },
-    { "Bo Thorsen", 0,
-      "bo@sonofthor.dk", 0 },
-    { "Ronen Tzur", 0,
-      "rtzur@shani.net", 0 },
-    { "Mario Weilguni", 0,
-      "mweilguni@sime.com", 0 },
-    { "Wynn Wilkes", 0,
-      "wynnw@calderasystems.com", 0 },
-    { "Robert D. Williams", 0,
-      "rwilliams@kde.org", 0 },
-    { "Markus W\303\274bben", 0,
-      "markus.wuebben@kde.org", 0 },
-    { "Karl-Heinz Zimmer", 0,
-      "khz@kde.org", 0 }
+      "bdraco@darkorb.net", nullptr },
+    { "Stephan Kulow", nullptr,
+      "coolo@kde.org", nullptr },
+    { "Guillaume Laurent", nullptr,
+      "glaurent@telegraph-road.org", nullptr },
+    { "Sam Magnuson", nullptr,
+      "sam@trolltech.com", nullptr },
+    { "Laurent Montel", nullptr,
+      "lmontel@mandrakesoft.com", nullptr },
+    { "Matt Newell", nullptr,
+      "newellm@proaxis.com", nullptr },
+    { "Denis Perchine", nullptr,
+      "dyp@perchine.com", nullptr },
+    { "Samuel Penn", nullptr,
+      "sam@bifrost.demon.co.uk", nullptr },
+    { "Carsten Pfeiffer", nullptr,
+      "pfeiffer@kde.org", nullptr },
+    { "Sven Radej", nullptr,
+      "radej@kde.org", nullptr },
+    { "Mark Roberts", nullptr,
+      "mark@taurine.demon.co.uk", nullptr },
+    { "Wolfgang Rohdewald", nullptr,
+      "wrohdewald@dplanet.ch", nullptr },
+    { "Espen Sand", nullptr,
+      "espen@kde.org", nullptr },
+    { "Aaron J. Seigo", nullptr,
+      "aseigo@olympusproject.org", nullptr },
+    { "George Staikos", nullptr,
+      "staikos@kde.org", nullptr },
+    { "Jason Stephenson", nullptr,
+      "panda@mis.net", nullptr },
+    { "Jacek Stolarczyk", nullptr,
+      "jacek@mer.chemia.polsl.gliwice.pl", nullptr },
+    { "Roberto S. Teixeira", nullptr,
+      "maragato@kde.org", nullptr },
+    { "Bo Thorsen", nullptr,
+      "bo@sonofthor.dk", nullptr },
+    { "Ronen Tzur", nullptr,
+      "rtzur@shani.net", nullptr },
+    { "Mario Weilguni", nullptr,
+      "mweilguni@sime.com", nullptr },
+    { "Wynn Wilkes", nullptr,
+      "wynnw@calderasystems.com", nullptr },
+    { "Robert D. Williams", nullptr,
+      "rwilliams@kde.org", nullptr },
+    { "Markus W\303\274bben", nullptr,
+      "markus.wuebben@kde.org", nullptr },
+    { "Karl-Heinz Zimmer", nullptr,
+      "khz@kde.org", nullptr }
   };
 
   static const about_data credits[] = {
-    { "Sam Abed", 0, 0, 0 }, // TDEConfigXT porting, smileys->emoticons replacement
-    { "Joern Ahrens", 0, 0, 0 }, // implement wish 77182 (Add some separators to "Mark Message as" popup menu)
-    { "Tom Albers", 0, 0, 0 }, // small fixes, bugzilla maintenance
-    { "Albert Cervera Areny", 0, 0, 0 }, // implemented wish 88309 (optional compression of attachments)
-    { "Patrick Audley", 0, 0, 0 }, // add optional graphical spam status to fancy headers
-    { "Benjamin Azan", 0, 0, 0 }, // implemented todo status handling
-    { "Albert Astals Cid", 0, 0, 0 }, // fix for bug:95441 (folder tree context menu doesn't show shortcuts assigned to the actions)
-    { "Cornelius Schumacher", 0, "schumacher@kde.org", 0 }, // implemented the new recipients editor and picker
+    { "Sam Abed", nullptr, nullptr, nullptr }, // TDEConfigXT porting, smileys->emoticons replacement
+    { "Joern Ahrens", nullptr, nullptr, nullptr }, // implement wish 77182 (Add some separators to "Mark Message as" popup menu)
+    { "Tom Albers", nullptr, nullptr, nullptr }, // small fixes, bugzilla maintenance
+    { "Albert Cervera Areny", nullptr, nullptr, nullptr }, // implemented wish 88309 (optional compression of attachments)
+    { "Patrick Audley", nullptr, nullptr, nullptr }, // add optional graphical spam status to fancy headers
+    { "Benjamin Azan", nullptr, nullptr, nullptr }, // implemented todo status handling
+    { "Albert Astals Cid", nullptr, nullptr, nullptr }, // fix for bug:95441 (folder tree context menu doesn't show shortcuts assigned to the actions)
+    { "Cornelius Schumacher", nullptr, "schumacher@kde.org", nullptr }, // implemented the new recipients editor and picker
     { "Frederick Emmott", I18N_NOOP("Anti-virus support"),
-      "fred87@users.sf.net", 0 },
-    { "Sandro Giessl", 0, 0, 0 }, // frame width fixes for widget styles
-    { "Severin Greimel", 0, 0, 0 }, // several patches
-    { "Shaheed Haque", 0, 0, 0 }, // fix for bug:69744 (Resource folders: "Journals" should be "Journal")
-    { "Ingo Heeskens", 0, 0, 0 }, // implemented wish 34857 (per folder option for loading external references)
-    { "Kurt Hindenburg", 0, 0, 0 }, // implemented wish 89003 (delete whole thread)
+      "fred87@users.sf.net", nullptr },
+    { "Sandro Giessl", nullptr, nullptr, nullptr }, // frame width fixes for widget styles
+    { "Severin Greimel", nullptr, nullptr, nullptr }, // several patches
+    { "Shaheed Haque", nullptr, nullptr, nullptr }, // fix for bug:69744 (Resource folders: "Journals" should be "Journal")
+    { "Ingo Heeskens", nullptr, nullptr, nullptr }, // implemented wish 34857 (per folder option for loading external references)
+    { "Kurt Hindenburg", nullptr, nullptr, nullptr }, // implemented wish 89003 (delete whole thread)
     { "Heiko Hund", I18N_NOOP("POP filters"),
-      "heiko@ist.eigentlich.net", 0 },
-    { "Torsten Kasch", 0, 0, 0 }, // crash fix for Solaris (cf. bug:68801)
-    { "Jason 'vanRijn' Kasper", 0, 0, 0 }, // implemented wish 79938 (configurable font for new/unread/important messages)
-    { "Martijn Klingens", 0, 0, 0 }, // fix keyboard navigation in the Status combo of the quick search
-    { "Christoph Kl\303\274nter", 0, 0, 0 }, // fix for bug:88216 (drag&drop from KAddressBook to the To: field)
-    { "Martin Koller", 0, 0, 0 }, // optional columns in the message list
-    { "Tobias K\303\266nig", 0, 0, 0 }, // edit recent addresses, store email<->OpenPGP key association in address book
-    { "Volker Krause", 0, 0, 0 }, // implemented TDEWallet support, fixed multiple bugs
-    { "Francois Kritzinger", 0, 0, 0 }, // fix bug in configuration dialog
-    { "Danny Kukawka", 0, 0, 0 }, // DCOP enhancements for better message importing
-    { "Roger Larsson", 0, 0, 0 }, // add name of checked account to status bar message
-    { "Jeffrey McGee", 0, 0, 0 }, // fix for bug:64251
-    { "Dirk M\303\274ller", 0, 0, 0 }, // KURL() fixes and tqt_cast optimizations
-    { "OpenUsability", I18N_NOOP("Usability tests and improvements"), 0, "http://www.openusability.org" },
-    { "Mario Teijeiro Otero", 0, 0, 0 }, // various vendor annotations fixes
-    { "Simon Perreault", 0, 0, 0 }, // make the composer remember its "Use Fixed Font" setting (bug 49481)
+      "heiko@ist.eigentlich.net", nullptr },
+    { "Torsten Kasch", nullptr, nullptr, nullptr }, // crash fix for Solaris (cf. bug:68801)
+    { "Jason 'vanRijn' Kasper", nullptr, nullptr, nullptr }, // implemented wish 79938 (configurable font for new/unread/important messages)
+    { "Martijn Klingens", nullptr, nullptr, nullptr }, // fix keyboard navigation in the Status combo of the quick search
+    { "Christoph Kl\303\274nter", nullptr, nullptr, nullptr }, // fix for bug:88216 (drag&drop from KAddressBook to the To: field)
+    { "Martin Koller", nullptr, nullptr, nullptr }, // optional columns in the message list
+    { "Tobias K\303\266nig", nullptr, nullptr, nullptr }, // edit recent addresses, store email<->OpenPGP key association in address book
+    { "Volker Krause", nullptr, nullptr, nullptr }, // implemented TDEWallet support, fixed multiple bugs
+    { "Francois Kritzinger", nullptr, nullptr, nullptr }, // fix bug in configuration dialog
+    { "Danny Kukawka", nullptr, nullptr, nullptr }, // DCOP enhancements for better message importing
+    { "Roger Larsson", nullptr, nullptr, nullptr }, // add name of checked account to status bar message
+    { "Jeffrey McGee", nullptr, nullptr, nullptr }, // fix for bug:64251
+    { "Dirk M\303\274ller", nullptr, nullptr, nullptr }, // KURL() fixes and tqt_cast optimizations
+    { "OpenUsability", I18N_NOOP("Usability tests and improvements"), nullptr, "http://www.openusability.org" },
+    { "Mario Teijeiro Otero", nullptr, nullptr, nullptr }, // various vendor annotations fixes
+    { "Simon Perreault", nullptr, nullptr, nullptr }, // make the composer remember its "Use Fixed Font" setting (bug 49481)
     { "Bernhard Reiter", I18N_NOOP("\xC3\x84gypten and Kroupware project management"),
-      "bernhard@intevation.de", 0 },
-    { "Edwin Schepers", 0, "yez@home.nl", 0 }, // composition of HTML messages
-    { "Jakob Schr\303\266ter", 0, 0, 0 }, // implemented wish 28319 (X-Face support)
+      "bernhard@intevation.de", nullptr },
+    { "Edwin Schepers", nullptr, "yez@home.nl", nullptr }, // composition of HTML messages
+    { "Jakob Schr\303\266ter", nullptr, nullptr, nullptr }, // implemented wish 28319 (X-Face support)
     { "Jan Simonson", I18N_NOOP("beta testing of PGP 6 support"),
-      "jan@simonson.pp.se", 0 },
-    { "Paul Sprakes", 0, 0, 0 }, // fix for bug:63619 (filter button in toolbar doesn't work), context menu clean up
-    { "Will Stephenson", 0, 0, 0 }, // added IM status indicator
-    { "Hasso Tepper", 0, 0, 0 }, // improve layout of recipients editor
+      "jan@simonson.pp.se", nullptr },
+    { "Paul Sprakes", nullptr, nullptr, nullptr }, // fix for bug:63619 (filter button in toolbar doesn't work), context menu clean up
+    { "Will Stephenson", nullptr, nullptr, nullptr }, // added IM status indicator
+    { "Hasso Tepper", nullptr, nullptr, nullptr }, // improve layout of recipients editor
     { "Patrick S. Vogt", I18N_NOOP("timestamp for 'Transmission completed' status messages"),
-      "patrick.vogt@unibas.ch", 0 },
+      "patrick.vogt@unibas.ch", nullptr },
     { "Jan-Oliver Wagner", I18N_NOOP("\xC3\x84gypten and Kroupware project management"),
-      "jan@intevation.de", 0 },
+      "jan@intevation.de", nullptr },
     { "Wolfgang Westphal", I18N_NOOP("multiple encryption keys per address"),
-      "wolfgang.westphal@gmx.de", 0 },
+      "wolfgang.westphal@gmx.de", nullptr },
     { "Thorsten Zachmann", I18N_NOOP("POP filters"),
-      "t.zachmann@zagge.de", 0 },
-    { "Thomas Zander", 0, 0, 0 }
+      "t.zachmann@zagge.de", nullptr },
+    { "Thomas Zander", nullptr, nullptr, nullptr }
   };
 
   AboutData::AboutData()
     : TDEAboutData( "kmail", I18N_NOOP("KMail"),KMAIL_VERSION,
                   I18N_NOOP("TDE Email Client"), License_GPL,
-                  I18N_NOOP("(c) 1997-2008, The KMail developers"), 0,
+                  I18N_NOOP("(c) 1997-2008, The KMail developers"), nullptr,
                   "http://www.trinitydesktop.org" )
   {
     using KMail::authors;
diff --git a/kmail/accountcombobox.cpp b/kmail/accountcombobox.cpp
index 3f200f666..4d1f36d72 100644
--- a/kmail/accountcombobox.cpp
+++ b/kmail/accountcombobox.cpp
@@ -88,7 +88,7 @@ KMAccount* AccountComboBox::currentAccount() const
   }
   if ( it != lst.end() )
     return *it;
-  return 0;
+  return nullptr;
 }
 
 TQValueList<KMAccount *> KMail::AccountComboBox::applicableAccounts() const
diff --git a/kmail/accountcombobox.h b/kmail/accountcombobox.h
index b0d0df6db..ad7776c4f 100644
--- a/kmail/accountcombobox.h
+++ b/kmail/accountcombobox.h
@@ -45,7 +45,7 @@ class AccountComboBox : public TQComboBox
   
 
 public:
-  AccountComboBox( TQWidget* parent, const char* name = 0 );
+  AccountComboBox( TQWidget* parent, const char* name = nullptr );
 
   void setCurrentAccount( KMAccount* account );
   KMAccount* currentAccount() const;
diff --git a/kmail/accountdialog.cpp b/kmail/accountdialog.cpp
index 2967b87d9..12a7aeffe 100644
--- a/kmail/accountdialog.cpp
+++ b/kmail/accountdialog.cpp
@@ -271,14 +271,14 @@ AccountDialog::AccountDialog( const TQString & caption, KMAccount *account,
 			      TQWidget *parent, const char *name, bool modal )
   : KDialogBase( parent, name, modal, caption, Ok|Cancel|Help, Ok, true ),
     mAccount( account ),
-    mServerTest( 0 ),
+    mServerTest( nullptr ),
     mCurCapa( AllCapa ),
     mCapaNormal( AllCapa ),
     mCapaSSL( AllCapa ),
     mCapaTLS( AllCapa ),
-    mSieveConfigEditor( 0 )
+    mSieveConfigEditor( nullptr )
 {
-  mValidator = new TQRegExpValidator( TQRegExp( "[A-Za-z0-9-_:.]*" ), 0 );
+  mValidator = new TQRegExpValidator( TQRegExp( "[A-Za-z0-9-_:.]*" ), nullptr );
   setHelp("receiving-mail");
 
   TQString accountType = mAccount->type();
@@ -316,9 +316,9 @@ AccountDialog::AccountDialog( const TQString & caption, KMAccount *account,
 AccountDialog::~AccountDialog()
 {
   delete mValidator;
-  mValidator = 0;
+  mValidator = nullptr;
   delete mServerTest;
-  mServerTest = 0;
+  mServerTest = nullptr;
 }
 
 void AccountDialog::makeLocalAccountPage()
@@ -1136,7 +1136,7 @@ void AccountDialog::makeImapAccountPage( bool connected )
 
 void AccountDialog::setupSettings()
 {
-  TQComboBox *folderCombo = 0;
+  TQComboBox *folderCombo = nullptr;
   int interval = mAccount->checkInterval();
 
   TQString accountType = mAccount->type();
@@ -1392,11 +1392,11 @@ void AccountDialog::setupSettings()
 
   KMFolderDir *fdir = (KMFolderDir*)&kmkernel->folderMgr()->dir();
   KMFolder *acctFolder = mAccount->folder();
-  if( acctFolder == 0 )
+  if(!acctFolder)
   {
     acctFolder = (KMFolder*)fdir->first();
   }
-  if( acctFolder == 0 )
+  if(!acctFolder)
   {
     folderCombo->insertItem( i18n("<none>") );
   }
@@ -1620,7 +1620,7 @@ void AccountDialog::slotPopCapabilities( const TQStringList & capaNormal,
   mPop.encryptionTLS->setEnabled( mCapaTLS != 0 );
   checkHighest( mPop.encryptionGroup );
   delete mServerTest;
-  mServerTest = 0;
+  mServerTest = nullptr;
 }
 
 
@@ -1726,7 +1726,7 @@ void AccountDialog::slotImapCapabilities( const TQStringList & capaNormal,
   mImap.encryptionTLS->setEnabled( mCapaTLS != 0 );
   checkHighest( mImap.encryptionGroup );
   delete mServerTest;
-  mServerTest = 0;
+  mServerTest = nullptr;
 }
 
 void AccountDialog::slotLeaveOnServerDaysChanged ( int value )
@@ -1994,7 +1994,7 @@ void AccountDialog::slotLocationChooser()
 {
   static TQString directory( "/" );
 
-  KFileDialog dialog( directory, TQString(), this, 0, true );
+  KFileDialog dialog( directory, TQString(), this, nullptr, true );
   dialog.setCaption( i18n("Choose Location") );
 
   bool result = dialog.exec();
@@ -2010,7 +2010,7 @@ void AccountDialog::slotLocationChooser()
   }
   if( url.isLocalFile() == false )
   {
-    KMessageBox::sorry( 0, i18n( "Only local files are currently supported." ) );
+    KMessageBox::sorry( nullptr, i18n( "Only local files are currently supported." ) );
     return;
   }
 
@@ -2296,7 +2296,7 @@ NamespaceEditDialog::NamespaceEditDialog( TQWidget *parent,
   setCaption( i18n("Edit Namespace '%1'").arg(ns) );
   TQGrid* grid = new TQGrid( 2, page );
 
-  mBg = new TQButtonGroup( 0 );
+  mBg = new TQButtonGroup( nullptr );
   connect( mBg, TQ_SIGNAL( clicked(int) ), this, TQ_SLOT( slotRemoveEntry(int) ) );
   mDelimMap = mNamespaceMap->find( mType ).data();
   ImapAccountBase::namespaceDelim::Iterator it;
diff --git a/kmail/accountdialog.h b/kmail/accountdialog.h
index e80dbb614..b14844818 100644
--- a/kmail/accountdialog.h
+++ b/kmail/accountdialog.h
@@ -59,7 +59,7 @@ class AccountDialog : public KDialogBase
 
   public:
     AccountDialog( const TQString & caption, KMAccount *account,
-		   TQWidget *parent=0, const char *name=0, bool modal=true );
+		   TQWidget *parent=nullptr, const char *name=nullptr, bool modal=true );
     virtual ~AccountDialog();
   private:
     struct LocalWidgets
diff --git a/kmail/accountmanager.cpp b/kmail/accountmanager.cpp
index c4f0f7150..e2c712454 100644
--- a/kmail/accountmanager.cpp
+++ b/kmail/accountmanager.cpp
@@ -166,7 +166,7 @@ void AccountManager::processNextCheck( bool _newMail )
 
   TQString accountHostName;
 
-  KMAccount *curAccount = 0;
+  KMAccount *curAccount = nullptr;
   for ( AccountList::Iterator it ( mAcctTodo.begin() ), last ( mAcctTodo.end() ); it != last; ) {
     KMAccount *acct = *it;
     ++it;
@@ -179,12 +179,12 @@ void AccountManager::processNextCheck( bool _newMail )
   if ( !curAccount ) return; // no account or all of them are already checking
 
   if ( curAccount->type() != "imap" && curAccount->type() != "cachedimap" &&
-       curAccount->folder() == 0 ) {
+       !curAccount->folder() ) {
     TQString tmp = i18n("Account %1 has no mailbox defined:\n"
         "mail checking aborted;\n"
         "check your account settings.")
       .arg(curAccount->name());
-    KMessageBox::information(0,tmp);
+    KMessageBox::information(nullptr,tmp);
     emit checkedMail( false, mInteractive, mTotalNewInFolder );
     mTotalNewMailsArrived = 0;
     mTotalNewInFolder.clear();
@@ -236,7 +236,7 @@ void AccountManager::processNextCheck( bool _newMail )
 //-----------------------------------------------------------------------------
 KMAccount* AccountManager::create( const TQString &aType, const TQString &aName, uint id )
 {
-  KMAccount* act = 0;
+  KMAccount* act = nullptr;
   if ( id == 0 )
     id = createId();
 
@@ -256,7 +256,7 @@ KMAccount* AccountManager::create( const TQString &aType, const TQString &aName,
   }
   if ( !act ) {
       kdWarning(5006) << "Attempt to instantiate a non-existing account type!" << endl;
-      return 0;
+      return nullptr;
   }
   connect( act, TQ_SIGNAL( newMailsProcessed( const TQMap<TQString, int> & ) ),
                 this, TQ_SLOT( addToTotalNewMailCount( const TQMap<TQString, int> & ) ) );
@@ -283,23 +283,23 @@ void AccountManager::add( KMAccount *account )
 //-----------------------------------------------------------------------------
 KMAccount* AccountManager::findByName(const TQString &aName) const
 {
-  if ( aName.isEmpty() ) return 0;
+  if ( aName.isEmpty() ) return nullptr;
 
   for ( AccountList::ConstIterator it( mAcctList.begin() ), end( mAcctList.end() ); it != end; ++it ) {
     if ( (*it)->name() == aName ) return (*it);
   }
-  return 0;
+  return nullptr;
 }
 
 
 //-----------------------------------------------------------------------------
 KMAccount* AccountManager::find( const uint id ) const
 {
-  if (id == 0) return 0;
+  if (id == 0) return nullptr;
   for ( AccountList::ConstIterator it( mAcctList.begin() ), end( mAcctList.end() ); it != end; ++it ) {
     if ( (*it)->id() == id ) return (*it);
   }
-  return 0;
+  return nullptr;
 }
 
 
@@ -310,7 +310,7 @@ KMAccount* AccountManager::first()
     mPtrListInterfaceProxyIterator = mAcctList.begin();
     return *mPtrListInterfaceProxyIterator;
   } else {
-    return 0;
+    return nullptr;
   }
 }
 
@@ -319,7 +319,7 @@ KMAccount* AccountManager::next()
 {
     ++mPtrListInterfaceProxyIterator;
     if ( mPtrListInterfaceProxyIterator == mAcctList.end() )
-        return 0;
+        return nullptr;
     else
         return *mPtrListInterfaceProxyIterator;
 }
@@ -362,7 +362,7 @@ void AccountManager::checkMail( bool _interactive )
   mNewMailArrived = false;
 
   if ( mAcctList.isEmpty() ) {
-    KMessageBox::information( 0,i18n("You need to add an account in the network "
+    KMessageBox::information( nullptr,i18n("You need to add an account in the network "
                     "section of the settings in order to receive mail.") );
     return;
   }
diff --git a/kmail/accountwizard.cpp b/kmail/accountwizard.cpp
index aec50b7cc..1678e2419 100644
--- a/kmail/accountwizard.cpp
+++ b/kmail/accountwizard.cpp
@@ -109,7 +109,7 @@ class AccountTypeBox : public TDEListBox
 
 AccountWizard::AccountWizard( KMKernel *kernel, TQWidget *parent )
   : KWizard( parent, "KWizard" ), mKernel( kernel ),
-    mAccount( 0 ), mTransportInfo( 0 ), mServerTest( 0 )
+    mAccount( nullptr ), mTransportInfo( nullptr ), mServerTest( nullptr )
 {
   setupWelcomePage();
   setupAccountTypePage();
@@ -584,10 +584,10 @@ void AccountWizard::popCapabilities( const TQStringList &capaNormalList,
   account->setPort( useSSL ? 995 : 110 );
 
   mServerTest->deleteLater();
-  mServerTest = 0;
+  mServerTest = nullptr;
 
   delete mAuthInfoLabel;
-  mAuthInfoLabel = 0;
+  mAuthInfoLabel = nullptr;
 
   accountCreated();
 }
@@ -633,10 +633,10 @@ void AccountWizard::imapCapabilities( const TQStringList &capaNormalList,
   account->setPort( useSSL ? 993 : 143 );
 
   mServerTest->deleteLater();
-  mServerTest = 0;
+  mServerTest = nullptr;
 
   delete mAuthInfoLabel;
-  mAuthInfoLabel = 0;
+  mAuthInfoLabel = nullptr;
 
   accountCreated();
 }
@@ -691,10 +691,10 @@ void AccountWizard::smtpCapabilities( const TQStringList &capaNormal,
   mTransportInfo->port = ( !capaSSL.isEmpty() ? "465" : "25" );
 
   mServerTest->deleteLater();
-  mServerTest = 0;
+  mServerTest = nullptr;
 
   delete mAuthInfoLabel;
-  mAuthInfoLabel = 0;
+  mAuthInfoLabel = nullptr;
 
   transportCreated();
 }
diff --git a/kmail/accountwizard.h b/kmail/accountwizard.h
index 0b30ca801..993039b8f 100644
--- a/kmail/accountwizard.h
+++ b/kmail/accountwizard.h
@@ -55,7 +55,7 @@ class AccountWizard : public KWizard
       @param kernel The mail kernel the wizard should work on.
       @param parent The parent widget of the dialog.
      */
-    static void start( KMKernel *kernel, TQWidget *parent = 0 );
+    static void start( KMKernel *kernel, TQWidget *parent = nullptr );
 
     /**
       Reimplemented
diff --git a/kmail/acljobs.cpp b/kmail/acljobs.cpp
index 036ed51d6..818661a5b 100644
--- a/kmail/acljobs.cpp
+++ b/kmail/acljobs.cpp
@@ -228,7 +228,7 @@ void ACLJobs::MultiSetACLJob::slotStart()
   if ( mACLListIterator != mACLList.end() )
   {
     const ACLListEntry& entry = *mACLListIterator;
-    TDEIO::Job* job = 0;
+    TDEIO::Job* job = nullptr;
     if ( entry.permissions > -1 )
       job = setACL( mSlave, mUrl, entry.userId, entry.permissions );
     else
diff --git a/kmail/actionscheduler.cpp b/kmail/actionscheduler.cpp
index e5b0bdf5a..72227ce50 100644
--- a/kmail/actionscheduler.cpp
+++ b/kmail/actionscheduler.cpp
@@ -54,10 +54,10 @@ using namespace KMail;
 typedef TQPtrList<KMMsgBase> KMMessageList;
 
 
-KMFolderMgr* ActionScheduler::tempFolderMgr = 0;
+KMFolderMgr* ActionScheduler::tempFolderMgr = nullptr;
 int ActionScheduler::refCount = 0;
 int ActionScheduler::count = 0;
-TQValueList<ActionScheduler*> *ActionScheduler::schedulerList = 0;
+TQValueList<ActionScheduler*> *ActionScheduler::schedulerList = nullptr;
 bool ActionScheduler::sEnabled = false;
 bool ActionScheduler::sEnabledChecked = false;
 
@@ -79,8 +79,8 @@ ActionScheduler::ActionScheduler(KMFilterMgr::FilterSet set,
   mAlwaysMatch = false;
   mAccountId = 0;
   mAccount = false;
-  lastCommand = 0;
-  lastJob = 0;
+  lastCommand = nullptr;
+  lastJob = nullptr;
   finishTimer = new TQTimer( this, "finishTimer" );
   connect( finishTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(finish()));
   fetchMessageTimer = new TQTimer( this, "fetchMessageTimer" );
@@ -99,7 +99,7 @@ ActionScheduler::ActionScheduler(KMFilterMgr::FilterSet set,
   TQValueList<KMFilter*>::Iterator it = filters.begin();
   for (; it != filters.end(); ++it)
     mFilters.append( **it );
-  mDestFolder = 0;
+  mDestFolder = nullptr;
   if (srcFolder) {
     mDeleteSrcFolder = false;
     setSourceFolder( srcFolder );
@@ -134,7 +134,7 @@ ActionScheduler::~ActionScheduler()
   --refCount;
   if (refCount == 0) {
     delete tempFolderMgr;
-    tempFolderMgr = 0;
+    tempFolderMgr = nullptr;
   }
 }
 
@@ -282,8 +282,8 @@ void ActionScheduler::execFilters(TQ_UINT32 serNum)
 KMMsgBase *ActionScheduler::messageBase(TQ_UINT32 serNum)
 {
   int idx = -1;
-  KMFolder *folder = 0;
-  KMMsgBase *msg = 0;
+  KMFolder *folder = nullptr;
+  KMMsgBase *msg = nullptr;
   KMMsgDict::instance()->getLocation( serNum, &folder, &idx );
   // It's possible that the message has been deleted or moved into a
   // different folder
@@ -302,8 +302,8 @@ KMMsgBase *ActionScheduler::messageBase(TQ_UINT32 serNum)
 KMMessage *ActionScheduler::message(TQ_UINT32 serNum)
 {
   int idx = -1;
-  KMFolder *folder = 0;
-  KMMessage *msg = 0;
+  KMFolder *folder = nullptr;
+  KMMessage *msg = nullptr;
   KMMsgDict::instance()->getLocation( serNum, &folder, &idx );
   // It's possible that the message has been deleted or moved into a
   // different folder
@@ -656,11 +656,11 @@ void ActionScheduler::moveMessage()
     mOriginalSerNum = serNumS.toUInt();
   else
     mOriginalSerNum = 0;
-  MessageProperty::setFilterHandler( *mMessageIt, 0 );
+  MessageProperty::setFilterHandler( *mMessageIt, nullptr );
   MessageProperty::setFiltering( *mMessageIt, false );
   mSerNums.remove( *mMessageIt );
 
-  KMMessage *orgMsg = 0;
+  KMMessage *orgMsg = nullptr;
   ReturnCode mOldReturnCode = mResult;
   if (mOriginalSerNum)
     orgMsg = message( mOriginalSerNum );
@@ -710,7 +710,7 @@ void ActionScheduler::moveMessageFinished( KMCommand *command )
   // in case the message stayed in the current folder TODO optimize
   if ( mHeaders )
     mHeaders->clearSelectableAndAboutToBeDeleted( mOriginalSerNum );
-  KMMessage *msg = 0;
+  KMMessage *msg = nullptr;
   ReturnCode mOldReturnCode = mResult;
   if (mOriginalSerNum) {
     msg = message( mOriginalSerNum );
@@ -718,9 +718,9 @@ void ActionScheduler::moveMessageFinished( KMCommand *command )
   }
 
   mResult = mOldReturnCode; // ignore errors in deleting original message
-  KMCommand *cmd = 0;
+  KMCommand *cmd = nullptr;
   if (msg && msg->parent()) {
-    cmd = new KMMoveCommand( 0, msg );
+    cmd = new KMMoveCommand( nullptr, msg );
 //    cmd->start(); // Note: sensitive logic here.
   }
 
@@ -760,7 +760,7 @@ void ActionScheduler::timeOut()
   // sometimes imap jobs seem to just stall so give up and move on
   disconnect( lastCommand, TQ_SIGNAL( completed( KMCommand * ) ),
 	      this, TQ_SLOT( moveMessageFinished( KMCommand * ) ) );
-  lastCommand = 0;
+  lastCommand = nullptr;
   mExecutingLock = false;
   mExecuting = false;
   finishTimer->start( 0, true );
@@ -776,7 +776,7 @@ void ActionScheduler::fetchTimeOut()
   disconnect( lastJob, TQ_SIGNAL(messageRetrieved( KMMessage* )),
 	      this, TQ_SLOT(messageFetched( KMMessage* )) );
   lastJob->kill();
-  lastJob = 0;
+  lastJob = nullptr;
   fetchMessageTimer->start( 0, true );
 }
 
@@ -796,7 +796,7 @@ TQString ActionScheduler::debug()
 	res.append( TQString( "mExecutingLock %1, " ).arg( (*it)->mExecutingLock ? "true" : "false" ) );
 	res.append( TQString( "mFetchExecuting %1.\n" ).arg( (*it)->mFetchExecuting ? "true" : "false" ) );
 	res.append( TQString( "mOriginalSerNum %1.\n" ).arg( (*it)->mOriginalSerNum ) );
-	res.append( TQString( "mMessageIt %1.\n" ).arg( ((*it)->mMessageIt != 0) ? *(*it)->mMessageIt : 0 ) );
+	res.append( TQString( "mMessageIt %1.\n" ).arg( ((*it)->mMessageIt != (*it)->mSerNums.end()) ? *(*it)->mMessageIt : 0 ) );
 	res.append( TQString( "mSerNums count %1, " ).arg( (*it)->mSerNums.count() ) );
 	res.append( TQString( "mFetchSerNums count %1.\n" ).arg( (*it)->mFetchSerNums.count() ) );
 	res.append( TQString( "mResult " ) );
diff --git a/kmail/actionscheduler.h b/kmail/actionscheduler.h
index b837c450f..ba496a587 100644
--- a/kmail/actionscheduler.h
+++ b/kmail/actionscheduler.h
@@ -56,8 +56,8 @@ public:
 
   ActionScheduler(KMFilterMgr::FilterSet set,
 		  TQValueList<KMFilter*> filters,
-                  KMHeaders *headers = 0,
-		  KMFolder *srcFolder = 0);
+                  KMHeaders *headers = nullptr,
+		  KMFolder *srcFolder = nullptr);
   ~ActionScheduler();
 
   /** The action scheduler will be deleted after the finish signal is emitted
diff --git a/kmail/antispamconfig.cpp b/kmail/antispamconfig.cpp
index e0dbb5bfb..9b563fe06 100644
--- a/kmail/antispamconfig.cpp
+++ b/kmail/antispamconfig.cpp
@@ -38,7 +38,7 @@
 
 using namespace KMail;
 
-AntiSpamConfig * AntiSpamConfig::sSelf = 0;
+AntiSpamConfig * AntiSpamConfig::sSelf = nullptr;
 static KStaticDeleter<AntiSpamConfig> antispamconfig_sd;
 
 AntiSpamConfig * AntiSpamConfig::instance() {
diff --git a/kmail/antispamwizard.cpp b/kmail/antispamwizard.cpp
index 6c5373342..ab0098610 100644
--- a/kmail/antispamwizard.cpp
+++ b/kmail/antispamwizard.cpp
@@ -59,10 +59,10 @@ using namespace KMail;
 AntiSpamWizard::AntiSpamWizard( WizardMode mode,
                                 TQWidget* parent, KMFolderTree * mainFolderTree )
   : KWizard( parent ),
-    mInfoPage( 0 ),
-    mSpamRulesPage( 0 ),
-    mVirusRulesPage( 0 ),
-    mSummaryPage( 0 ),
+    mInfoPage( nullptr ),
+    mSpamRulesPage( nullptr ),
+    mVirusRulesPage( nullptr ),
+    mSummaryPage( nullptr ),
     mMode( mode )
 {
   // read the configuration for the anti-spam tools
@@ -99,7 +99,7 @@ AntiSpamWizard::AntiSpamWizard( WizardMode mode,
 
   setCaption( ( mMode == AntiSpam ) ? i18n( "Anti-Spam Wizard" )
                                     : i18n( "Anti-Virus Wizard" ) );
-  mInfoPage = new ASWizInfoPage( mMode, 0, "" );
+  mInfoPage = new ASWizInfoPage( mMode, nullptr, "" );
   addPage( mInfoPage,
            ( mMode == AntiSpam )
            ? i18n( "Welcome to the KMail Anti-Spam Wizard" )
@@ -108,13 +108,13 @@ AntiSpamWizard::AntiSpamWizard( WizardMode mode,
             this, TQ_SLOT( checkProgramsSelections( void ) ) );
 
   if ( mMode == AntiSpam ) {
-    mSpamRulesPage = new ASWizSpamRulesPage( 0, "", mainFolderTree );
+    mSpamRulesPage = new ASWizSpamRulesPage( nullptr, "", mainFolderTree );
     addPage( mSpamRulesPage, i18n( "Options to fine-tune the handling of spam messages" ));
     connect( mSpamRulesPage, TQ_SIGNAL( selectionChanged( void ) ),
              this, TQ_SLOT( slotBuildSummary( void ) ) );
   }
   else {
-    mVirusRulesPage = new ASWizVirusRulesPage( 0, "", mainFolderTree );
+    mVirusRulesPage = new ASWizVirusRulesPage( nullptr, "", mainFolderTree );
     addPage( mVirusRulesPage, i18n( "Options to fine-tune the handling of virus messages" ));
     connect( mVirusRulesPage, TQ_SIGNAL( selectionChanged( void ) ),
              this, TQ_SLOT( checkVirusRulesSelections( void ) ) );
@@ -126,7 +126,7 @@ AntiSpamWizard::AntiSpamWizard( WizardMode mode,
   setNextEnabled( mInfoPage, false );
 
   if ( mMode == AntiSpam ) {
-    mSummaryPage = new ASWizSummaryPage( 0, "" );
+    mSummaryPage = new ASWizSummaryPage( nullptr, "" );
     addPage( mSummaryPage, i18n( "Summary of changes to be made by this wizard" ) );
     setNextEnabled( mSpamRulesPage, true );
     setFinishEnabled( mSummaryPage, true );
diff --git a/kmail/antispamwizard.h b/kmail/antispamwizard.h
index 3f13ce8e6..8f8affb9b 100644
--- a/kmail/antispamwizard.h
+++ b/kmail/antispamwizard.h
@@ -285,7 +285,7 @@ namespace KMail {
   {
     public:
       ASWizPage( TQWidget *parent, const char *name, 
-                 const TQString *bannerName = 0);
+                 const TQString *bannerName = nullptr);
 
     protected:
       TQBoxLayout *mLayout;
diff --git a/kmail/app_octetstream.cpp b/kmail/app_octetstream.cpp
index 990f1ff38..a211fa2d5 100644
--- a/kmail/app_octetstream.cpp
+++ b/kmail/app_octetstream.cpp
@@ -44,16 +44,16 @@ namespace {
   class Plugin : public KMail::Interface::BodyPartFormatterPlugin {
   public:
     const KMail::Interface::BodyPartFormatter * bodyPartFormatter( int idx ) const {
-      return idx == 0 ? new Formatter() : 0 ;
+      return idx == 0 ? new Formatter() : nullptr ;
     }
     const char * type( int idx ) const {
-      return idx == 0 ? "application" : 0 ;
+      return idx == 0 ? "application" : nullptr ;
     }
     const char * subtype( int idx ) const {
-      return idx == 0 ? "octet-stream" : 0 ;
+      return idx == 0 ? "octet-stream" : nullptr ;
     }
 
-    const KMail::Interface::BodyPartURLHandler * urlHandler( int ) const { return 0; }
+    const KMail::Interface::BodyPartURLHandler * urlHandler( int ) const { return nullptr; }
   };
 
 }
diff --git a/kmail/archivefolderdialog.h b/kmail/archivefolderdialog.h
index 7e5b78539..d531aa1b5 100644
--- a/kmail/archivefolderdialog.h
+++ b/kmail/archivefolderdialog.h
@@ -37,7 +37,7 @@ class ArchiveFolderDialog : public KDialogBase
 
   public:
 
-    ArchiveFolderDialog( TQWidget *parent = 0 );
+    ArchiveFolderDialog( TQWidget *parent = nullptr );
     void setFolder( KMFolder *defaultFolder );
 
   protected slots:
diff --git a/kmail/attachmentlistview.cpp b/kmail/attachmentlistview.cpp
index 9e99e6402..e48370b40 100644
--- a/kmail/attachmentlistview.cpp
+++ b/kmail/attachmentlistview.cpp
@@ -94,11 +94,11 @@ void AttachmentListView::contentsDropEvent( TQDropEvent* e )
     serNumBuffer.open( IO_ReadOnly );
     TQDataStream serNumStream( &serNumBuffer );
     TQ_UINT32 serNum;
-    KMFolder *folder = 0;
+    KMFolder *folder = nullptr;
     int idx;
     TQPtrList<KMMsgBase> messageList;
     while( !serNumStream.atEnd() ) {
-      KMMsgBase *msgBase = 0;
+      KMMsgBase *msgBase = nullptr;
       serNumStream >> serNum;
       KMMsgDict::instance()->getLocation( serNum, &folder, &idx );
       if( folder )
diff --git a/kmail/attachmentlistview.h b/kmail/attachmentlistview.h
index 7a6e13530..e89a80425 100644
--- a/kmail/attachmentlistview.h
+++ b/kmail/attachmentlistview.h
@@ -32,8 +32,8 @@ class AttachmentListView : public TDEListView
   TQ_OBJECT
   
 public:
-  AttachmentListView( KMail::Composer * composer = 0, TQWidget* parent = 0,
-                      const char* name = 0 );
+  AttachmentListView( KMail::Composer * composer = nullptr, TQWidget* parent = nullptr,
+                      const char* name = nullptr );
   virtual ~AttachmentListView();
 
   /** Drag and drop methods */
diff --git a/kmail/attachmentstrategy.cpp b/kmail/attachmentstrategy.cpp
index 2f12f39b2..67bc68ac7 100644
--- a/kmail/attachmentstrategy.cpp
+++ b/kmail/attachmentstrategy.cpp
@@ -200,7 +200,7 @@ static AttachmentStrategy::Display smartDisplay( const partNode *node )
     }
     kdFatal( 5006 ) << "AttachmentStrategy::create(): Unknown attachment startegy ( type == "
 		    << (int)type << " ) requested!" << endl;
-    return 0; // make compiler happy
+    return nullptr; // make compiler happy
   }
 
   const AttachmentStrategy * AttachmentStrategy::create( const TQString & type ) {
@@ -215,11 +215,11 @@ static AttachmentStrategy::Display smartDisplay( const partNode *node )
     return smart();
   }
 
-  static const AttachmentStrategy * iconicStrategy = 0;
-  static const AttachmentStrategy * smartStrategy = 0;
-  static const AttachmentStrategy * inlinedStrategy = 0;
-  static const AttachmentStrategy * hiddenStrategy = 0;
-  static const AttachmentStrategy * headerOnlyStrategy = 0;
+  static const AttachmentStrategy * iconicStrategy = nullptr;
+  static const AttachmentStrategy * smartStrategy = nullptr;
+  static const AttachmentStrategy * inlinedStrategy = nullptr;
+  static const AttachmentStrategy * hiddenStrategy = nullptr;
+  static const AttachmentStrategy * headerOnlyStrategy = nullptr;
 
   const AttachmentStrategy * AttachmentStrategy::iconic() {
     if ( !iconicStrategy )
diff --git a/kmail/backupjob.cpp b/kmail/backupjob.cpp
index b67834c40..e9eccb943 100644
--- a/kmail/backupjob.cpp
+++ b/kmail/backupjob.cpp
@@ -39,18 +39,18 @@ using namespace KMail;
 BackupJob::BackupJob( TQWidget *parent )
   : TQObject( parent ),
     mArchiveType( Zip ),
-    mRootFolder( 0 ),
-    mArchive( 0 ),
+    mRootFolder( nullptr ),
+    mArchive( nullptr ),
     mParentWidget( parent ),
     mCurrentFolderOpen( false ),
     mArchivedMessages( 0 ),
     mArchivedSize( 0 ),
-    mProgressItem( 0 ),
+    mProgressItem( nullptr ),
     mAborted( false ),
     mDeleteFoldersAfterCompletion( false ),
-    mCurrentFolder( 0 ),
-    mCurrentMessage( 0 ),
-    mCurrentJob( 0 )
+    mCurrentFolder( nullptr ),
+    mCurrentMessage( nullptr ),
+    mCurrentJob( nullptr )
 {
 }
 
@@ -59,7 +59,7 @@ BackupJob::~BackupJob()
   mPendingFolders.clear();
   if ( mArchive ) {
     delete mArchive;
-    mArchive = 0;
+    mArchive = nullptr;
   }
 }
 
@@ -133,18 +133,18 @@ void BackupJob::abort( const TQString &errorMessage )
   mAborted = true;
   if ( mCurrentFolderOpen && mCurrentFolder ) {
     mCurrentFolder->close( "BackupJob" );
-    mCurrentFolder = 0;
+    mCurrentFolder = nullptr;
   }
   if ( mArchive && mArchive->isOpened() ) {
     mArchive->close();
   }
   if ( mCurrentJob ) {
     mCurrentJob->kill();
-    mCurrentJob = 0;
+    mCurrentJob = nullptr;
   }
   if ( mProgressItem ) {
     mProgressItem->setComplete();
-    mProgressItem = 0;
+    mProgressItem = nullptr;
     // The progressmanager will delete it
   }
 
@@ -167,7 +167,7 @@ void BackupJob::finish()
 
   mProgressItem->setStatus( i18n( "Archiving finished" ) );
   mProgressItem->setComplete();
-  mProgressItem = 0;
+  mProgressItem = nullptr;
 
   TQFileInfo archiveFileInfo( mMailArchivePath.path() );
   TQString text = i18n( "Archiving folder '%1' successfully completed. "
@@ -196,7 +196,7 @@ void BackupJob::archiveNextMessage()
   if ( mAborted )
     return;
 
-  mCurrentMessage = 0;
+  mCurrentMessage = nullptr;
   if ( mPendingMessages.isEmpty() ) {
     kdDebug(5006) << "===> All messages done in folder " << mCurrentFolder->name() << endl;
     mCurrentFolder->close( "BackupJob" );
@@ -301,9 +301,9 @@ void BackupJob::processCurrentMessage()
     TQString user;
     TQString group;
     mode_t permissions = 0700;
-    time_t creationTime = time( 0 );
-    time_t modificationTime = time( 0 );
-    time_t accessTime = time( 0 );
+    time_t creationTime = time( nullptr );
+    time_t modificationTime = time( nullptr );
+    time_t accessTime = time( nullptr );
     if ( !fileInfo.fileName().isEmpty() ) {
       user = fileInfo.owner();
       group = fileInfo.group();
@@ -352,7 +352,7 @@ void BackupJob::folderJobFinished( KMail::FolderJob *job )
   // The job might finish after it has emitted messageRetrieved(), in which case we have already
   // started a new job. Don't set the current job to 0 in that case.
   if ( job == mCurrentJob ) {
-    mCurrentJob = 0;
+    mCurrentJob = nullptr;
   }
 
   if ( job->error() ) {
diff --git a/kmail/backupjob.h b/kmail/backupjob.h
index 495641a63..da42f071f 100644
--- a/kmail/backupjob.h
+++ b/kmail/backupjob.h
@@ -55,7 +55,7 @@ class BackupJob : public TQObject
     // These enum values have to stay in sync with the format combobox of ArchiveFolderDialog!
     enum ArchiveType { Zip = 0, Tar = 1, TarBz2 = 2, TarGz = 3 };
 
-    explicit BackupJob( TQWidget *parent = 0 );
+    explicit BackupJob( TQWidget *parent = nullptr );
     ~BackupJob();
     void setRootFolder( KMFolder *rootFolder );
     void setSaveLocation( const KURL &savePath );
diff --git a/kmail/bodypartformatter.cpp b/kmail/bodypartformatter.cpp
index 3ee62d970..bab4c620f 100644
--- a/kmail/bodypartformatter.cpp
+++ b/kmail/bodypartformatter.cpp
@@ -69,7 +69,7 @@ namespace {
     }
   };
 
-  const AnyTypeBodyPartFormatter * AnyTypeBodyPartFormatter::self = 0;
+  const AnyTypeBodyPartFormatter * AnyTypeBodyPartFormatter::self = nullptr;
 
 
   class ImageTypeBodyPartFormatter : public KMail::BodyPartFormatter {
@@ -86,7 +86,7 @@ namespace {
     }
   };
 
-  const ImageTypeBodyPartFormatter * ImageTypeBodyPartFormatter::self = 0;
+  const ImageTypeBodyPartFormatter * ImageTypeBodyPartFormatter::self = nullptr;
 
 #define CREATE_BODY_PART_FORMATTER(subtype) \
   class subtype##BodyPartFormatter : public KMail::BodyPartFormatter { \
diff --git a/kmail/bodypartformatterfactory.cpp b/kmail/bodypartformatterfactory.cpp
index fbae5a448..485ee6160 100644
--- a/kmail/bodypartformatterfactory.cpp
+++ b/kmail/bodypartformatterfactory.cpp
@@ -60,7 +60,7 @@ namespace {
 
 }
 
-KMail::BodyPartFormatterFactory * KMail::BodyPartFormatterFactory::mSelf = 0;
+KMail::BodyPartFormatterFactory * KMail::BodyPartFormatterFactory::mSelf = nullptr;
 
 const KMail::BodyPartFormatterFactory * KMail::BodyPartFormatterFactory::instance() {
   if ( !mSelf )
@@ -73,10 +73,10 @@ KMail::BodyPartFormatterFactory::BodyPartFormatterFactory() {
 }
 
 KMail::BodyPartFormatterFactory::~BodyPartFormatterFactory() {
-  mSelf = 0;
+  mSelf = nullptr;
 }
 
-static TypeRegistry * all = 0;
+static TypeRegistry * all = nullptr;
 
 static void insertBodyPartFormatter( const char * type, const char * subtype,
 				     const KMail::Interface::BodyPartFormatter * formatter ) {
@@ -157,23 +157,23 @@ const KMail::Interface::BodyPartFormatter * KMail::BodyPartFormatterFactory::cre
   assert( all );
 
   if ( all->empty() )
-    return 0;
+    return nullptr;
 
   TypeRegistry::const_iterator type_it = all->find( type );
   if ( type_it == all->end() )
     type_it = all->find( "*" );
   if ( type_it == all->end() )
-    return 0;
+    return nullptr;
 
   const SubtypeRegistry & subtype_reg = type_it->second;
   if ( subtype_reg.empty() )
-    return 0;
+    return nullptr;
 
   SubtypeRegistry::const_iterator subtype_it = subtype_reg.find( subtype );
   if ( subtype_it == subtype_reg.end() )
     subtype_it = subtype_reg.find( "*" );
   if ( subtype_it == subtype_reg.end() )
-    return 0;
+    return nullptr;
 
   kdWarning( !(*subtype_it).second, 5006 )
     << "BodyPartFormatterFactory: a null bodypart formatter sneaked in for \""
diff --git a/kmail/bodyvisitor.cpp b/kmail/bodyvisitor.cpp
index 04b7a98b8..3be913184 100644
--- a/kmail/bodyvisitor.cpp
+++ b/kmail/bodyvisitor.cpp
@@ -71,9 +71,9 @@ namespace KMail {
   {
     TQPtrListIterator<KMMessagePart> it( mParts );
     TQPtrList<KMMessagePart> selected;
-    KMMessagePart *part = 0;
+    KMMessagePart *part = nullptr;
     bool headerCheck = false;
-    while ( (part = it.current()) != 0 )
+    while ((part = it.current()) != nullptr)
     {
       ++it;
       // skip this part if the parent part is already loading
diff --git a/kmail/cachedimapjob.cpp b/kmail/cachedimapjob.cpp
index e2be083b9..8cc2f5db5 100644
--- a/kmail/cachedimapjob.cpp
+++ b/kmail/cachedimapjob.cpp
@@ -60,7 +60,7 @@ namespace KMail {
 CachedImapJob::CachedImapJob( const TQValueList<MsgForDownload>& msgs,
                               JobType type, KMFolderCachedImap* folder )
   : FolderJob( type ), mFolder( folder ), mMsgsForDownload( msgs ),
-    mTotalBytes(0), mMsg(0), mParentFolder( 0 )
+    mTotalBytes(0), mMsg(nullptr), mParentFolder( nullptr )
 {
   TQValueList<MsgForDownload>::ConstIterator it = msgs.begin();
   for ( ; it != msgs.end() ; ++it )
@@ -70,33 +70,33 @@ CachedImapJob::CachedImapJob( const TQValueList<MsgForDownload>& msgs,
 // Put messages
 CachedImapJob::CachedImapJob( const TQPtrList<KMMessage>& msgs, JobType type,
                               KMFolderCachedImap* folder )
-  : FolderJob( msgs, TQString(), type, folder?folder->folder():0 ), mFolder( folder ),
+  : FolderJob( msgs, TQString(), type, folder?folder->folder():nullptr ), mFolder( folder ),
     mTotalBytes( msgs.count() ), // we abuse it as "total number of messages"
-    mMsg( 0 ), mParentFolder( 0 )
+    mMsg( nullptr ), mParentFolder( nullptr )
 {
 }
 
 CachedImapJob::CachedImapJob( const TQValueList<unsigned long>& msgs,
 			      JobType type, KMFolderCachedImap* folder )
-  : FolderJob( TQPtrList<KMMessage>(), TQString(), type, folder?folder->folder():0 ),
-    mFolder( folder ), mSerNumMsgList( msgs ), mTotalBytes( msgs.count() ), mMsg( 0 ),
-    mParentFolder ( 0 )
+  : FolderJob( TQPtrList<KMMessage>(), TQString(), type, folder?folder->folder():nullptr ),
+    mFolder( folder ), mSerNumMsgList( msgs ), mTotalBytes( msgs.count() ), mMsg( nullptr ),
+    mParentFolder ( nullptr )
 {
 }
 
 // Add sub folders
 CachedImapJob::CachedImapJob( const TQValueList<KMFolderCachedImap*>& fList,
                               JobType type, KMFolderCachedImap* folder )
-  : FolderJob( type ), mFolder( folder ), mFolderList( fList ), mMsg( 0 ),
-    mParentFolder ( 0 )
+  : FolderJob( type ), mFolder( folder ), mFolderList( fList ), mMsg( nullptr ),
+    mParentFolder ( nullptr )
 {
 }
 
 // Rename folder
 CachedImapJob::CachedImapJob( const TQString& string1, JobType type,
                               KMFolderCachedImap* folder )
-  : FolderJob( type ), mFolder(folder), mMsg( 0 ), mString( string1 ),
-    mParentFolder ( 0 )
+  : FolderJob( type ), mFolder(folder), mMsg( nullptr ), mString( string1 ),
+    mParentFolder ( nullptr )
 {
   assert( folder );
   assert( type != tDeleteMessage ); // moved to another ctor
@@ -106,14 +106,14 @@ CachedImapJob::CachedImapJob( const TQString& string1, JobType type,
 CachedImapJob::CachedImapJob( const TQStringList& foldersOrMsgs, JobType type,
                               KMFolderCachedImap* folder )
   : FolderJob( type ), mFolder( folder ), mFoldersOrMessages( foldersOrMsgs ),
-    mMsg( 0 ), mParentFolder( 0 )
+    mMsg( nullptr ), mParentFolder( nullptr )
 {
   assert( folder );
 }
 
 // Other jobs (list messages,expunge folder, check uid validity)
 CachedImapJob::CachedImapJob( JobType type, KMFolderCachedImap* folder )
-  : FolderJob( type ), mFolder( folder ), mMsg( 0 ), mParentFolder ( 0 )
+  : FolderJob( type ), mFolder( folder ), mMsg( nullptr ), mParentFolder ( nullptr )
 {
   assert( folder );
 }
@@ -134,7 +134,7 @@ void CachedImapJob::execute()
   }
   assert( mFolder );
   mAccount = mFolder->account();
-  assert( mAccount != 0 );
+  assert(mAccount);
   if( mAccount->makeConnection() != ImapAccountBase::Connected ) {
     // No connection to the IMAP server
     kdDebug(5006) << "mAccount->makeConnection() failed" << endl;
@@ -317,9 +317,9 @@ void CachedImapJob::slotGetNextMessage(TDEIO::Job * job)
       emit messageRetrieved( mMsg );
       if ( index > 0 ) mFolder->unGetMsg( index );
     } else {
-      emit messageRetrieved( 0 );
+      emit messageRetrieved( nullptr );
     }
-    mMsg = 0;
+    mMsg = nullptr;
 
     mSentBytes += size;
     emit progress( mSentBytes, mTotalBytes );
@@ -364,7 +364,7 @@ void CachedImapJob::slotProcessedSize(TDEIO::Job *, TDEIO::filesize_t processed)
 
 void CachedImapJob::slotPutNextMessage()
 {
-  mMsg = 0;
+  mMsg = nullptr;
 
   // First try the message list
   if( !mMsgList.isEmpty() ) {
@@ -373,13 +373,13 @@ void CachedImapJob::slotPutNextMessage()
   }
 
   // Now try the serial number list
-  while( mMsg == 0 && !mSerNumMsgList.isEmpty() ) {
+  while( !mMsg && !mSerNumMsgList.isEmpty() ) {
     unsigned long serNum = mSerNumMsgList.first();
     mSerNumMsgList.pop_front();
 
     // Find the message with this serial number
     int i = 0;
-    KMFolder* aFolder = 0;
+    KMFolder* aFolder = nullptr;
     KMMsgDict::instance()->getLocation( serNum, &aFolder, &i );
     if( mFolder->folder() != aFolder )
       // This message was moved or something
@@ -485,7 +485,7 @@ void CachedImapJob::slotPutMessageResult(TDEIO::Job *job)
     if ( !cont ) {
       delete this;
     } else {
-      mMsg = 0;
+      mMsg = nullptr;
       slotPutNextMessage();
     }
     return;
@@ -808,7 +808,7 @@ void CachedImapJob::renameOnDisk()
 
 void CachedImapJob::slotSubscribtionChange1Failed( const TQString &errorMessage )
 {
-  KMessageBox::sorry( 0, i18n( "Error while trying to subscribe to the renamed folder %1.\n"
+  KMessageBox::sorry( nullptr, i18n( "Error while trying to subscribe to the renamed folder %1.\n"
                                "Renaming itself was successful, but the renamed folder might disappear "
                                "from the folder list after the next sync since it is unsubscribed on the server.\n"
                                "You can try to manually subscribe to the folder yourself.\n\n"
diff --git a/kmail/cachedimapjob.h b/kmail/cachedimapjob.h
index aa9094bf1..8efa1f354 100644
--- a/kmail/cachedimapjob.h
+++ b/kmail/cachedimapjob.h
@@ -74,16 +74,16 @@ public:
 
   // Get messages
   CachedImapJob( const TQValueList<MsgForDownload>& msgs,
-                 JobType type = tGetMessage, KMFolderCachedImap* folder = 0 );
+                 JobType type = tGetMessage, KMFolderCachedImap* folder = nullptr );
   // Put messages
   CachedImapJob( const TQPtrList<KMMessage>& msgs,
-                 JobType type, KMFolderCachedImap* folder=0 );
+                 JobType type, KMFolderCachedImap* folder=nullptr );
   CachedImapJob( const TQValueList<unsigned long>& msgs,
-                 JobType type, KMFolderCachedImap* folder=0 );
+                 JobType type, KMFolderCachedImap* folder=nullptr );
   // Add sub folders
   CachedImapJob( const TQValueList<KMFolderCachedImap*>& folders,
                  JobType type = tAddSubfolders,
-                 KMFolderCachedImap* folder = 0 );
+                 KMFolderCachedImap* folder = nullptr );
   // Rename folder
   CachedImapJob( const TQString& string1, JobType type,
                  KMFolderCachedImap* folder );
@@ -109,18 +109,18 @@ protected:
   void listMessages();
 
 protected slots:
-  virtual void slotGetNextMessage( TDEIO::Job *job = 0 );
-  virtual void slotAddNextSubfolder( TDEIO::Job *job = 0 );
+  virtual void slotGetNextMessage( TDEIO::Job *job = nullptr );
+  virtual void slotAddNextSubfolder( TDEIO::Job *job = nullptr );
   virtual void slotPutNextMessage();
   virtual void slotPutMessageDataReq( TDEIO::Job *job, TQByteArray &data );
   virtual void slotPutMessageResult( TDEIO::Job *job );
   virtual void slotPutMessageInfoData(TDEIO::Job *, const TQString &data);
   virtual void slotExpungeResult( TDEIO::Job *job );
-  virtual void slotDeleteNextFolder( TDEIO::Job *job = 0 );
+  virtual void slotDeleteNextFolder( TDEIO::Job *job = nullptr );
   virtual void slotCheckUidValidityResult( TDEIO::Job *job );
   virtual void slotRenameFolderResult( TDEIO::Job *job );
   virtual void slotListMessagesResult( TDEIO::Job * job );
-  void slotDeleteNextMessages( TDEIO::Job* job = 0 );
+  void slotDeleteNextMessages( TDEIO::Job* job = nullptr );
   void slotProcessedSize( TDEIO::Job *, TDEIO::filesize_t processed );
   void slotSubscribtionChange1Done( const TQString&, bool );
   void slotSubscribtionChange2Done( const TQString&, bool );
diff --git a/kmail/colorlistbox.cpp b/kmail/colorlistbox.cpp
index a8610dcd9..7f1ad235d 100644
--- a/kmail/colorlistbox.cpp
+++ b/kmail/colorlistbox.cpp
@@ -126,7 +126,7 @@ void ColorListBox::dragMoveEvent( TQDragMoveEvent *e )
   if( KColorDrag::canDecode(e) && isEnabled() )
   {
     ColorListItem *item = (ColorListItem*)itemAt( e->pos() );
-    if( item != 0 )
+    if(item)
     {
       setCurrentItem ( item );
     }
diff --git a/kmail/colorlistbox.h b/kmail/colorlistbox.h
index b6ae25515..b46ad6579 100644
--- a/kmail/colorlistbox.h
+++ b/kmail/colorlistbox.h
@@ -29,7 +29,7 @@ class ColorListBox : public TDEListBox
   
 
   public:
-    ColorListBox( TQWidget *parent=0, const char * name=0, WFlags f=0 );
+    ColorListBox( TQWidget *parent=nullptr, const char * name=nullptr, WFlags f=0 );
     void setColor( uint index, const TQColor &color );
     TQColor color( uint index ) const;
 signals:
diff --git a/kmail/compactionjob.cpp b/kmail/compactionjob.cpp
index 90d0e9f4b..eb8f209d8 100644
--- a/kmail/compactionjob.cpp
+++ b/kmail/compactionjob.cpp
@@ -51,7 +51,7 @@ using namespace KMail;
 #define COMPACTIONJOB_TIMERINTERVAL 100
 
 MboxCompactionJob::MboxCompactionJob( KMFolder* folder, bool immediate )
- : ScheduledJob( folder, immediate ), mTimer( this, "mTimer" ), mTmpFile( 0 ),
+ : ScheduledJob( folder, immediate ), mTimer( this, "mTimer" ), mTmpFile( nullptr ),
    mCurrentIndex( 0 ), mFolderOpen( false ), mSilent( false )
 {
 }
@@ -69,7 +69,7 @@ void MboxCompactionJob::kill()
 
   if ( mTmpFile )
     fclose( mTmpFile );
-  mTmpFile = 0;
+  mTmpFile = nullptr;
   if ( !mTempName.isEmpty() )
     TQFile::remove( mTempName );
   FolderJob::kill();
@@ -277,7 +277,7 @@ void MaildirCompactionJob::done( int rc )
 ScheduledJob* ScheduledCompactionTask::run()
 {
   if ( !folder() || !folder()->needsCompacting() )
-    return 0;
+    return nullptr;
   switch( folder()->storage()->folderType() ) {
   case KMFolderTypeMbox:
     return new MboxCompactionJob( folder(), isImmediate() );
@@ -285,7 +285,7 @@ ScheduledJob* ScheduledCompactionTask::run()
   case KMFolderTypeMaildir:
     return new MaildirCompactionJob( folder(), isImmediate() );
   default: // imap, search, unknown...
-    return 0;
+    return nullptr;
   }
 }
 
diff --git a/kmail/composer.h b/kmail/composer.h
index ba2ab0351..23cbbd9a0 100644
--- a/kmail/composer.h
+++ b/kmail/composer.h
@@ -31,13 +31,13 @@ namespace KMail {
 
   class Composer;
 
-  Composer * makeComposer( KMMessage * msg=0, uint identity=0 );
+  Composer * makeComposer( KMMessage * msg=nullptr, uint identity=0 );
 
   class Composer : public KMail::SecondaryWindow {
     TQ_OBJECT
   
   protected:
-    Composer( const char * name=0 ) : KMail::SecondaryWindow( name ) {}
+    Composer( const char * name=nullptr ) : KMail::SecondaryWindow( name ) {}
   public: // mailserviceimpl
     /**
      * From MailComposerIface
diff --git a/kmail/configuredialog.cpp b/kmail/configuredialog.cpp
index 2442490c3..742a50e8f 100644
--- a/kmail/configuredialog.cpp
+++ b/kmail/configuredialog.cpp
@@ -217,7 +217,7 @@ namespace {
 ConfigureDialog::ConfigureDialog( TQWidget *parent, const char *name, bool modal )
   : KCMultiDialog( KDialogBase::IconList, KGuiItem( i18n( "&Load Profile..." ) ),
                    KGuiItem(), User2, i18n( "Configure" ), parent, name, modal )
-  , mProfileDialog( 0 )
+  , mProfileDialog( nullptr )
 {
   KWin::setIcons( winId(), tdeApp->icon(), tdeApp->miniIcon() );
   showButton( User1, true );
@@ -286,7 +286,7 @@ TQString IdentityPage::helpAnchor() const {
 
 IdentityPage::IdentityPage( TQWidget * parent, const char * name )
   : ConfigModule( parent, name ),
-    mIdentityDialog( 0 )
+    mIdentityDialog( nullptr )
 {
   TQHBoxLayout * hlay = new TQHBoxLayout( this, 0, KDialog::spacingHint() );
 
@@ -344,7 +344,7 @@ void IdentityPage::load()
   mOldNumberOfIdentities = im->shadowIdentities().count();
   // Fill the list:
   mIdentityList->clear();
-  TQListViewItem * item = 0;
+  TQListViewItem * item = nullptr;
   for ( KPIM::IdentityManager::Iterator it = im->modifyBegin() ; it != im->modifyEnd() ; ++it )
     item = new IdentityListViewItem( mIdentityList, item, *it  );
   mIdentityList->setSelected( mIdentityList->currentItem(), true );
@@ -435,7 +435,7 @@ void IdentityPage::slotModifyIdentity() {
   }
 
   delete mIdentityDialog;
-  mIdentityDialog = 0;
+  mIdentityDialog = nullptr;
 }
 
 void IdentityPage::slotRemoveIdentity()
@@ -975,7 +975,7 @@ void AccountsPage::SendingTab::doLoadOther() {
 
   int numTransports = general.readNumEntry("transports", 0);
 
-  TQListViewItem *top = 0;
+  TQListViewItem *top = nullptr;
   mTransportInfoList.clear();
   mTransportList->clear();
   TQStringList transportNames;
@@ -1213,7 +1213,7 @@ void AccountsPage::ReceivingTab::slotAddAccount() {
   KMAcctSelDlg accountSelectorDialog( this );
   if( accountSelectorDialog.exec() != TQDialog::Accepted ) return;
 
-  const char *accountType = 0;
+  const char *accountType = nullptr;
   switch ( accountSelectorDialog.selected() ) {
     case 0: accountType = "local";      break;
     case 1: accountType = "pop";        break;
@@ -1271,7 +1271,7 @@ void AccountsPage::ReceivingTab::slotModifySelectedAccount()
   TQListViewItem *listItem = mAccountList->selectedItem();
   if( !listItem ) return;
 
-  KMAccount *account = 0;
+  KMAccount *account = nullptr;
   TQValueList<ModifiedAccountsType*>::Iterator j;
   for (j = mModifiedAccounts.begin(); j != mModifiedAccounts.end(); ++j )
     if ( (*j)->newAccount->name() == listItem->text(0) ) {
@@ -1338,7 +1338,7 @@ void AccountsPage::ReceivingTab::slotRemoveSelectedAccount() {
   TQListViewItem *listItem = mAccountList->selectedItem();
   if( !listItem ) return;
 
-  KMAccount *acct = 0;
+  KMAccount *acct = nullptr;
   TQValueList<ModifiedAccountsType*>::Iterator j;
   for ( j = mModifiedAccounts.begin() ; j != mModifiedAccounts.end() ; ++j )
     if ( (*j)->newAccount->name() == listItem->text(0) ) {
@@ -1381,7 +1381,7 @@ void AccountsPage::ReceivingTab::slotRemoveSelectedAccount() {
 void AccountsPage::ReceivingTab::slotEditNotifications()
 {
   if(kmkernel->xmlGuiInstance())
-    KNotifyDialog::configure(this, 0, kmkernel->xmlGuiInstance()->aboutData());
+    KNotifyDialog::configure(this, nullptr, kmkernel->xmlGuiInstance()->aboutData());
   else
     KNotifyDialog::configure(this);
 }
@@ -1394,9 +1394,9 @@ void AccountsPage::ReceivingTab::doLoadOther() {
   TDEConfigGroup general( KMKernel::config(), "General" );
 
   mAccountList->clear();
-  TQListViewItem *top = 0;
+  TQListViewItem *top = nullptr;
 
-  for( KMAccount *a = kmkernel->acctMgr()->first(); a!=0;
+  for( KMAccount *a = kmkernel->acctMgr()->first(); a;
        a = kmkernel->acctMgr()->next() ) {
     TQListViewItem *listItem =
       new TQListViewItem( mAccountList, top, a->name(), a->type() );
@@ -1994,7 +1994,7 @@ static const int numDateDisplayConfig =
 
 AppearancePageHeadersTab::AppearancePageHeadersTab( TQWidget * parent, const char * name )
   : ConfigModuleTab( parent, name ),
-    mCustomDateFormatEdit( 0 )
+    mCustomDateFormatEdit( nullptr )
 {
   // tmp. vars:
   TQButtonGroup * group;
@@ -3196,7 +3196,7 @@ ComposerPageSubjectTab::ComposerPageSubjectTab( TQWidget * parent, const char *
   SimpleStringListEditor::ButtonCode buttonCode =
     static_cast<SimpleStringListEditor::ButtonCode>( SimpleStringListEditor::Add | SimpleStringListEditor::Remove | SimpleStringListEditor::Modify );
   mReplyListEditor =
-    new SimpleStringListEditor( group, 0, buttonCode,
+    new SimpleStringListEditor( group, nullptr, buttonCode,
                                 i18n("A&dd..."), i18n("Re&move"),
                                 i18n("Mod&ify..."),
                                 i18n("Enter new reply prefix:") );
@@ -3223,7 +3223,7 @@ ComposerPageSubjectTab::ComposerPageSubjectTab( TQWidget * parent, const char *
 
   // row 1: string list editor
   mForwardListEditor =
-    new SimpleStringListEditor( group, 0, buttonCode,
+    new SimpleStringListEditor( group, nullptr, buttonCode,
                                 i18n("Add..."),
                                 i18n("Remo&ve"),
                                 i18n("Modify..."),
@@ -3273,7 +3273,7 @@ ComposerPageCharsetTab::ComposerPageCharsetTab( TQWidget * parent, const char *
   vlay->addWidget( label );
 
   mCharsetListEditor =
-    new SimpleStringListEditor( this, 0, SimpleStringListEditor::All,
+    new SimpleStringListEditor( this, nullptr, SimpleStringListEditor::All,
                                 i18n("A&dd..."), i18n("Remo&ve"),
                                 i18n("&Modify..."), i18n("Enter charset:") );
   connect( mCharsetListEditor, TQ_SIGNAL( changed( void ) ),
@@ -3521,7 +3521,7 @@ void ComposerPage::HeadersTab::doLoadOther() {
   mTagNameEdit->clear();
   mTagValueEdit->clear();
 
-  TQListViewItem * item = 0;
+  TQListViewItem * item = nullptr;
 
   int count = general.readNumEntry( "mime-header-count", 0 );
   for( int i = 0 ; i < count ; i++ ) {
@@ -3607,7 +3607,7 @@ ComposerPageAttachmentsTab::ComposerPageAttachmentsTab( TQWidget * parent,
   SimpleStringListEditor::ButtonCode buttonCode =
     static_cast<SimpleStringListEditor::ButtonCode>( SimpleStringListEditor::Add | SimpleStringListEditor::Remove | SimpleStringListEditor::Modify );
   mAttachWordsListEditor =
-    new SimpleStringListEditor( this, 0, buttonCode,
+    new SimpleStringListEditor( this, nullptr, buttonCode,
                                 i18n("A&dd..."), i18n("Re&move"),
                                 i18n("Mod&ify..."),
                                 i18n("Enter new key word:") );
@@ -3652,7 +3652,7 @@ void ComposerPage::AttachmentsTab::save() {
 void ComposerPageAttachmentsTab::slotOutlookCompatibleClicked()
 {
   if (mOutlookCompatibleCheck->isChecked()) {
-    KMessageBox::information(0,i18n("You have chosen to "
+    KMessageBox::information(nullptr,i18n("You have chosen to "
     "encode attachment names containing non-English characters in a way that "
     "is understood by Outlook(tm) and other mail clients that do not "
     "support standard-compliant encoded attachment names.\n"
@@ -4483,11 +4483,11 @@ Kleo::CryptoConfigEntry* SMIMECryptoConfigEntries::configEntry( const char* comp
     Kleo::CryptoConfigEntry* entry = mConfig->entry( componentName, groupName, entryName );
     if ( !entry ) {
         kdWarning(5006) << TQString( "Backend error: gpgconf doesn't seem to know the entry for %1/%2/%3" ).arg( componentName, groupName, entryName ) << endl;
-        return 0;
+        return nullptr;
     }
     if( entry->argType() != argType || entry->isList() != isList ) {
         kdWarning(5006) << TQString( "Backend error: gpgconf has wrong type for %1/%2/%3: %4 %5" ).arg( componentName, groupName, entryName ).arg( entry->argType() ).arg( entry->isList() ) << endl;
-        return 0;
+        return nullptr;
     }
     return entry;
 }
@@ -4944,7 +4944,7 @@ MiscPageGroupwareTab::MiscPageGroupwareTab( TQWidget* parent, const char* name )
   connect( mEnableGwCB, TQ_SIGNAL( stateChanged( int ) ),
            this, TQ_SLOT( slotEmitChanged( void ) ) );
 #endif
-  mEnableGwCB = 0;
+  mEnableGwCB = nullptr;
   mLegacyMangleFromTo = new TQCheckBox( i18n( "Mangle From:/To: headers in replies to invitations" ), gBox );
   TQToolTip::add( mLegacyMangleFromTo, i18n( "Turn this option on in order to make Outlook(tm) understand your answers to invitation replies" ) );
   TQWhatsThis::add( mLegacyMangleFromTo, i18n( GlobalSettings::self()->
@@ -5048,13 +5048,13 @@ void MiscPage::GroupwareTab::doLoadFromGlobalSettings() {
     mFolderCombo->setFolder( i18n( "<Choose a Folder>" ) );
   }
 
-  KMAccount* selectedAccount = 0;
+  KMAccount* selectedAccount = nullptr;
   int accountId = GlobalSettings::self()->theIMAPResourceAccount();
   if ( accountId )
     selectedAccount = kmkernel->acctMgr()->find( accountId );
   else {
     // Fallback: iterate over accounts to select folderId if found (as an inbox folder)
-      for( KMAccount *a = kmkernel->acctMgr()->first(); a!=0;
+      for( KMAccount *a = kmkernel->acctMgr()->first(); a;
          a = kmkernel->acctMgr()->next() ) {
       if( a->folder() && a->folder()->child() ) {
         // Look inside that folder for an INBOX
@@ -5113,7 +5113,7 @@ void MiscPage::GroupwareTab::save() {
     KMFolder* folder = mFolderCombo->folder();
     if (  folder )
       folderId = folder->idString();
-    KMAccount* account = 0;
+    KMAccount* account = nullptr;
     // Didn't find an easy way to find the account for a given folder...
     // Fallback: iterate over accounts to select folderId if found (as an inbox folder)
     for( KMAccount *a = kmkernel->acctMgr()->first();
diff --git a/kmail/configuredialog.h b/kmail/configuredialog.h
index 848871695..9c75ee370 100644
--- a/kmail/configuredialog.h
+++ b/kmail/configuredialog.h
@@ -37,7 +37,7 @@ class ConfigureDialog : public KCMultiDialog
   
 
 public:
-  ConfigureDialog( TQWidget *parent=0, const char *name=0, bool modal=true );
+  ConfigureDialog( TQWidget *parent=nullptr, const char *name=nullptr, bool modal=true );
   ~ConfigureDialog();
 
 signals:
diff --git a/kmail/configuredialog_p.cpp b/kmail/configuredialog_p.cpp
index bd5fdcd15..7b2f1ecb4 100644
--- a/kmail/configuredialog_p.cpp
+++ b/kmail/configuredialog_p.cpp
@@ -330,7 +330,7 @@ void ProfileDialog::setup() {
 		<< " profiles:" << endl;
 
   // build the list and populate the list view:
-  TQListViewItem * listItem = 0;
+  TQListViewItem * listItem = nullptr;
   for ( TQStringList::const_iterator it = mProfileList.begin() ;
 	it != mProfileList.end() ; ++it ) {
     TDEConfig profile( *it, true /* read-only */, false /* no KDE global */ );
diff --git a/kmail/configuredialog_p.h b/kmail/configuredialog_p.h
index 7294c96ef..ae8606508 100644
--- a/kmail/configuredialog_p.h
+++ b/kmail/configuredialog_p.h
@@ -83,7 +83,7 @@ public:
   enum DuplicateMode { Empty, ControlCenter, ExistingEntry };
 
   NewIdentityDialog( const TQStringList & identities,
-                     TQWidget *parent=0, const char *name=0, bool modal=true );
+                     TQWidget *parent=nullptr, const char *name=nullptr, bool modal=true );
 
   TQString identityName() const { return mLineEdit->text(); }
   TQString duplicateIdentity() const { return mComboBox->currentText(); }
@@ -126,8 +126,8 @@ class NewLanguageDialog : public KDialogBase
   
 
   public:
-    NewLanguageDialog( LanguageItemList & suppressedLangs, TQWidget *parent=0,
-                       const char *name=0, bool modal=true );
+    NewLanguageDialog( LanguageItemList & suppressedLangs, TQWidget *parent=nullptr,
+                       const char *name=nullptr, bool modal=true );
     TQString language() const;
 
   private:
@@ -141,7 +141,7 @@ class LanguageComboBox : public TQComboBox
   
 
   public:
-    LanguageComboBox( bool rw, TQWidget *parent=0, const char *name=0 );
+    LanguageComboBox( bool rw, TQWidget *parent=nullptr, const char *name=nullptr );
     int insertLanguage( const TQString & language );
     TQString language() const;
     void setLanguage( const TQString & language );
@@ -157,7 +157,7 @@ class ProfileDialog : public KDialogBase {
   TQ_OBJECT
   
 public:
-  ProfileDialog( TQWidget * parent=0, const char * name=0, bool modal=false );
+  ProfileDialog( TQWidget * parent=nullptr, const char * name=nullptr, bool modal=false );
 
 signals:
   void profileSelected( TDEConfig * profile );
@@ -179,7 +179,7 @@ class ConfigModule : public TDECModule {
   TQ_OBJECT
   
 public:
-  ConfigModule( TQWidget * parent=0, const char * name=0 )
+  ConfigModule( TQWidget * parent=nullptr, const char * name=nullptr )
      : TDECModule ( parent, name )
      {}
   ~ConfigModule() {}
@@ -207,7 +207,7 @@ class ConfigModuleTab : public TQWidget {
   TQ_OBJECT
   
 public:
-   ConfigModuleTab( TQWidget *parent=0, const char* name=0 )
+   ConfigModuleTab( TQWidget *parent=nullptr, const char* name=nullptr )
       :TQWidget( parent, name )
       {}
   ~ConfigModuleTab() {}
@@ -242,7 +242,7 @@ class ConfigModuleWithTabs : public ConfigModule {
   TQ_OBJECT
   
 public:
-  ConfigModuleWithTabs( TQWidget * parent=0, const char * name=0 );
+  ConfigModuleWithTabs( TQWidget * parent=nullptr, const char * name=nullptr );
    ~ConfigModuleWithTabs() {}
 
   // don't reimplement any of those methods
@@ -270,7 +270,7 @@ class TDE_EXPORT IdentityPage : public ConfigModule {
   TQ_OBJECT
   
 public:
-  IdentityPage( TQWidget * parent=0, const char * name=0 );
+  IdentityPage( TQWidget * parent=nullptr, const char * name=nullptr );
   ~IdentityPage() {}
 
   TQString helpAnchor() const;
@@ -321,7 +321,7 @@ class AccountsPageSendingTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  AccountsPageSendingTab( TQWidget * parent=0, const char * name=0 );
+  AccountsPageSendingTab( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
   void save();
 
@@ -359,7 +359,7 @@ class AccountsPageReceivingTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  AccountsPageReceivingTab( TQWidget * parent=0, const char * name=0 );
+  AccountsPageReceivingTab( TQWidget * parent=nullptr, const char * name=nullptr );
   ~AccountsPageReceivingTab();
   TQString helpAnchor() const;
   void save();
@@ -404,7 +404,7 @@ class TDE_EXPORT AccountsPage : public ConfigModuleWithTabs {
   TQ_OBJECT
   
 public:
-  AccountsPage( TQWidget * parent=0, const char * name=0 );
+  AccountsPage( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
 
 
@@ -432,7 +432,7 @@ class AppearancePageFontsTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  AppearancePageFontsTab( TQWidget * parent=0, const char * name=0 );
+  AppearancePageFontsTab( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
   void save();
 
@@ -460,7 +460,7 @@ class AppearancePageColorsTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  AppearancePageColorsTab( TQWidget * parent=0, const char * name=0 );
+  AppearancePageColorsTab( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
   void save();
 
@@ -482,7 +482,7 @@ class AppearancePageLayoutTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  AppearancePageLayoutTab( TQWidget * parent=0, const char * name=0 );
+  AppearancePageLayoutTab( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
 
   void save();
@@ -505,7 +505,7 @@ class AppearancePageHeadersTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  AppearancePageHeadersTab( TQWidget * parent=0, const char * name=0 );
+  AppearancePageHeadersTab( TQWidget * parent=nullptr, const char * name=nullptr );
 
   TQString helpAnchor() const;
 
@@ -532,7 +532,7 @@ class AppearancePageReaderTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  AppearancePageReaderTab( TQWidget * parent=0, const char * name=0 );
+  AppearancePageReaderTab( TQWidget * parent=nullptr, const char * name=nullptr );
 
   TQString helpAnchor() const;
 
@@ -564,7 +564,7 @@ class AppearancePageSystemTrayTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  AppearancePageSystemTrayTab( TQWidget * parent=0, const char * name=0 );
+  AppearancePageSystemTrayTab( TQWidget * parent=nullptr, const char * name=nullptr );
 
   TQString helpAnchor() const;
 
@@ -583,7 +583,7 @@ class TDE_EXPORT AppearancePage : public ConfigModuleWithTabs {
   TQ_OBJECT
   
 public:
-  AppearancePage( TQWidget * parent=0, const char * name=0 );
+  AppearancePage( TQWidget * parent=nullptr, const char * name=nullptr );
 
   TQString helpAnchor() const;
 
@@ -614,7 +614,7 @@ class ComposerPageGeneralTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  ComposerPageGeneralTab( TQWidget * parent=0, const char * name=0 );
+  ComposerPageGeneralTab( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
 
   void save();
@@ -648,7 +648,7 @@ class ComposerPagePhrasesTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  ComposerPagePhrasesTab( TQWidget * parent=0, const char * name=0 );
+  ComposerPagePhrasesTab( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
 
   void save();
@@ -680,7 +680,7 @@ class ComposerPageTemplatesTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  ComposerPageTemplatesTab( TQWidget * parent=0, const char * name=0 );
+  ComposerPageTemplatesTab( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
 
   void save();
@@ -698,7 +698,7 @@ class ComposerPageCustomTemplatesTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  ComposerPageCustomTemplatesTab( TQWidget * parent=0, const char * name=0 );
+  ComposerPageCustomTemplatesTab( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
 
   void save();
@@ -716,7 +716,7 @@ class ComposerPageSubjectTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  ComposerPageSubjectTab( TQWidget * parent=0, const char * name=0 );
+  ComposerPageSubjectTab( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
 
   void save();
@@ -735,7 +735,7 @@ class ComposerPageCharsetTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  ComposerPageCharsetTab( TQWidget * parent=0, const char * name=0 );
+  ComposerPageCharsetTab( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
 
   void save();
@@ -757,7 +757,7 @@ class ComposerPageHeadersTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  ComposerPageHeadersTab( TQWidget * parent=0, const char * name=0 );
+  ComposerPageHeadersTab( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
 
   void save();
@@ -790,7 +790,7 @@ class ComposerPageAttachmentsTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  ComposerPageAttachmentsTab( TQWidget * parent=0, const char * name=0 );
+  ComposerPageAttachmentsTab( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
 
   void save();
@@ -812,7 +812,7 @@ class TDE_EXPORT ComposerPage : public ConfigModuleWithTabs {
   TQ_OBJECT
   
 public:
-  ComposerPage( TQWidget * parent=0, const char * name=0 );
+  ComposerPage( TQWidget * parent=nullptr, const char * name=nullptr );
 
   TQString helpAnchor() const;
 
@@ -847,7 +847,7 @@ class SecurityPageGeneralTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  SecurityPageGeneralTab( TQWidget * parent=0, const char * name=0 );
+  SecurityPageGeneralTab( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
 
   void save();
@@ -873,7 +873,7 @@ class SecurityPageComposerCryptoTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  SecurityPageComposerCryptoTab( TQWidget * parent=0, const char * name=0 );
+  SecurityPageComposerCryptoTab( TQWidget * parent=nullptr, const char * name=nullptr );
 
   TQString helpAnchor() const;
 
@@ -893,7 +893,7 @@ class SecurityPageWarningTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  SecurityPageWarningTab( TQWidget * parent=0, const char * name=0 );
+  SecurityPageWarningTab( TQWidget * parent=nullptr, const char * name=nullptr );
 
   TQString helpAnchor() const;
 
@@ -917,7 +917,7 @@ class SecurityPageSMimeTab : public ConfigModuleTab, public DCOPObject {
   
   K_DCOP
 public:
-  SecurityPageSMimeTab( TQWidget * parent=0, const char * name=0 );
+  SecurityPageSMimeTab( TQWidget * parent=nullptr, const char * name=nullptr );
   ~SecurityPageSMimeTab();
 
   TQString helpAnchor() const;
@@ -944,7 +944,7 @@ class SecurityPageCryptPlugTab : public ConfigModuleTab
   TQ_OBJECT
   
 public:
-  SecurityPageCryptPlugTab( TQWidget * parent = 0, const char* name = 0 );
+  SecurityPageCryptPlugTab( TQWidget * parent = nullptr, const char* name = nullptr );
   ~SecurityPageCryptPlugTab();
 
   TQString helpAnchor() const;
@@ -963,7 +963,7 @@ class TDE_EXPORT SecurityPage : public ConfigModuleWithTabs {
   TQ_OBJECT
   
 public:
-  SecurityPage( TQWidget * parent=0, const char * name=0 );
+  SecurityPage( TQWidget * parent=nullptr, const char * name=nullptr );
 
   TQString helpAnchor() const;
 
@@ -995,7 +995,7 @@ class MiscPageFolderTab : public ConfigModuleTab {
   TQ_OBJECT
   
 public:
-  MiscPageFolderTab( TQWidget * parent=0, const char * name=0 );
+  MiscPageFolderTab( TQWidget * parent=nullptr, const char * name=nullptr );
 
   void save();
  TQString helpAnchor() const;
@@ -1026,7 +1026,7 @@ class MiscPageGroupwareTab : public ConfigModuleTab  {
   TQ_OBJECT
   
 public:
-  MiscPageGroupwareTab( TQWidget * parent=0, const char * name=0 );
+  MiscPageGroupwareTab( TQWidget * parent=nullptr, const char * name=nullptr );
   void save();
   TQString helpAnchor() const;
 
@@ -1068,7 +1068,7 @@ class TDE_EXPORT MiscPage : public ConfigModuleWithTabs {
   TQ_OBJECT
   
 public:
-  MiscPage( TQWidget * parent=0, const char * name=0 );
+  MiscPage( TQWidget * parent=nullptr, const char * name=nullptr );
   TQString helpAnchor() const;
 
   typedef MiscPageFolderTab FolderTab;
@@ -1089,7 +1089,7 @@ class ListView : public TDEListView {
   TQ_OBJECT
   
 public:
-  ListView( TQWidget *parent=0, const char *name=0, int visibleItem=10 );
+  ListView( TQWidget *parent=nullptr, const char *name=nullptr, int visibleItem=10 );
   void resizeColums();
 
   void setVisibleItem( int visibleItem, bool updateSize=true );
diff --git a/kmail/copyfolderjob.cpp b/kmail/copyfolderjob.cpp
index a237db100..3e32fdebd 100644
--- a/kmail/copyfolderjob.cpp
+++ b/kmail/copyfolderjob.cpp
@@ -45,10 +45,10 @@
 using namespace KMail;
 
 CopyFolderJob::CopyFolderJob( FolderStorage* const storage, KMFolderDir* const newParent )
- : FolderJob( 0, tOther, (storage ? storage->folder() : 0) ),
+ : FolderJob( nullptr, tOther, (storage ? storage->folder() : nullptr) ),
    mStorage( storage ), mNewParent( newParent ),
-   mNewFolder( 0 ), mChildFolderNodeIterator( *mStorage->folder()->createChildFolder() ),
-   mNextChildFolder( 0 )
+   mNewFolder( nullptr ), mChildFolderNodeIterator( *mStorage->folder()->createChildFolder() ),
+   mNextChildFolder( nullptr )
 {
   mStorage->open( "copyfolder" );
 }
diff --git a/kmail/copyfolderjob.h b/kmail/copyfolderjob.h
index 43f08ec3e..a10d3d146 100644
--- a/kmail/copyfolderjob.h
+++ b/kmail/copyfolderjob.h
@@ -57,7 +57,7 @@ public:
    * @param storage of the folder that should be copied
    * @param newParent the target parent folder
    */
-  CopyFolderJob( FolderStorage* const storage, KMFolderDir* const newParent = 0 );
+  CopyFolderJob( FolderStorage* const storage, KMFolderDir* const newParent = nullptr );
 
   virtual ~CopyFolderJob();
 
diff --git a/kmail/customtemplates.cpp b/kmail/customtemplates.cpp
index 4d4080ed7..8f97c11a6 100644
--- a/kmail/customtemplates.cpp
+++ b/kmail/customtemplates.cpp
@@ -54,7 +54,7 @@
 
 CustomTemplates::CustomTemplates( TQWidget *parent, const char *name )
   :CustomTemplatesBase( parent, name ),
-   mCurrentItem( 0 ),
+   mCurrentItem( nullptr ),
    mBlockChangeSignal( false )
 {
   TQFont f = TDEGlobalSettings::fixedFont();
@@ -312,7 +312,7 @@ void CustomTemplates::slotRemoveClicked()
     CustomTemplateItem *vitem = mItemList.take( templateName );
     delete vitem;
     delete mCurrentItem;
-    mCurrentItem = 0;
+    mCurrentItem = nullptr;
     if ( !mBlockChangeSignal )
       emit changed();
   }
@@ -353,7 +353,7 @@ void CustomTemplates::slotListSelectionChanged()
     }
   } else {
     mEditFrame->setEnabled( false );
-    mCurrentItem = 0;
+    mCurrentItem = nullptr;
     mEdit->clear();
     mToEdit->clear();
     mCCEdit->clear();
diff --git a/kmail/customtemplates.h b/kmail/customtemplates.h
index e8bca8823..95fe0b115 100644
--- a/kmail/customtemplates.h
+++ b/kmail/customtemplates.h
@@ -43,7 +43,7 @@ class CustomTemplates : public CustomTemplatesBase
 
   public:
 
-    CustomTemplates( TQWidget *parent = 0, const char *name = 0 );
+    CustomTemplates( TQWidget *parent = nullptr, const char *name = nullptr );
     ~CustomTemplates();
 
     void load();
diff --git a/kmail/dictionarycombobox.cpp b/kmail/dictionarycombobox.cpp
index b6da5abfa..be5092f10 100644
--- a/kmail/dictionarycombobox.cpp
+++ b/kmail/dictionarycombobox.cpp
@@ -44,7 +44,7 @@ namespace KMail {
 
   DictionaryComboBox::DictionaryComboBox( TQWidget * parent, const char * name )
     : TQComboBox( false, parent, name ),
-      mSpellConfig( 0 ),
+      mSpellConfig( nullptr ),
       mDefaultDictionary( 0 )
   {
     reloadCombo();
@@ -57,7 +57,7 @@ namespace KMail {
   DictionaryComboBox::~DictionaryComboBox()
   {
     delete mSpellConfig;
-    mSpellConfig = 0;
+    mSpellConfig = nullptr;
   }
 
   TQString DictionaryComboBox::currentDictionaryName() const
@@ -131,7 +131,7 @@ namespace KMail {
   void DictionaryComboBox::reloadCombo()
   {
     delete mSpellConfig;
-    mSpellConfig = new KSpellConfig( 0, 0, 0, false );
+    mSpellConfig = new KSpellConfig( nullptr, nullptr, nullptr, false );
     mSpellConfig->fillDicts( this, &mDictionaries );
     mDefaultDictionary = currentItem();
     mSpellConfig->setDictionary( currentDictionary() );
diff --git a/kmail/dictionarycombobox.h b/kmail/dictionarycombobox.h
index 101b86e7a..1c9500ee6 100644
--- a/kmail/dictionarycombobox.h
+++ b/kmail/dictionarycombobox.h
@@ -49,7 +49,7 @@ namespace KMail {
     TQ_OBJECT
   
   public:
-    DictionaryComboBox( TQWidget * parent=0, const char * name=0 );
+    DictionaryComboBox( TQWidget * parent=nullptr, const char * name=nullptr );
     ~DictionaryComboBox();
 
     TQString currentDictionaryName() const;
diff --git a/kmail/distributionlistdialog.cpp b/kmail/distributionlistdialog.cpp
index 031e9108c..5cb9c5ae1 100644
--- a/kmail/distributionlistdialog.cpp
+++ b/kmail/distributionlistdialog.cpp
@@ -95,7 +95,7 @@ class DistributionListItem : public TQCheckListItem
 
 DistributionListDialog::DistributionListDialog( TQWidget *parent )
   : KDialogBase( Plain, i18n("Save Distribution List"), User1 | Cancel,
-                 User1, parent, 0, false, false, i18n("Save List") )
+                 User1, parent, nullptr, false, false, i18n("Save List") )
 {
   TQFrame *topFrame = plainPage();
   
diff --git a/kmail/editorwatcher.cpp b/kmail/editorwatcher.cpp
index defa47dff..ab6377ac5 100644
--- a/kmail/editorwatcher.cpp
+++ b/kmail/editorwatcher.cpp
@@ -54,7 +54,7 @@ EditorWatcher::EditorWatcher(const KURL & url, const TQString &mimeType, bool op
     mUrl( url ),
     mMimeType( mimeType ),
     mOpenWith( openWith ),
-    mEditor( 0 ),
+    mEditor( nullptr ),
     mParentWidget( parentWidget ),
     mHaveInotify( false ),
     mFileOpen( false ),
@@ -73,7 +73,7 @@ bool EditorWatcher::start()
   list.append( mUrl );
   KService::Ptr offer = KServiceTypeProfile::preferredService( mMimeType, "Application" );
   if ( mOpenWith || !offer ) {
-    KOpenWithDlg dlg( list, i18n("Edit with:"), TQString(), 0 );
+    KOpenWithDlg dlg( list, i18n("Edit with:"), TQString(), nullptr );
     if ( !dlg.exec() )
       return false;
     offer = dlg.service();
diff --git a/kmail/encodingdetector.cpp b/kmail/encodingdetector.cpp
index fe378d733..4be792a60 100644
--- a/kmail/encodingdetector.cpp
+++ b/kmail/encodingdetector.cpp
@@ -941,15 +941,15 @@ bool EncodingDetector::analyze(const char *data, int len)
             if ((nul_count_even==0 && nul_count_odd==5) || (nul_count_even==5 && nul_count_odd==0))
                 autoDetectedEncoding = "ISO-10646-UCS-2";
             else
-                autoDetectedEncoding = 0;
+                autoDetectedEncoding = nullptr;
         }
         else
         {
-            autoDetectedEncoding = 0;
+            autoDetectedEncoding = nullptr;
         }
 
         // If we found a BOM, use the encoding it implies.
-        if (autoDetectedEncoding != 0)
+        if (autoDetectedEncoding)
         {
             d->m_source = BOM;
             d->m_codec = TQTextCodec::codecForName(autoDetectedEncoding);
diff --git a/kmail/encodingdetector_ja.cpp b/kmail/encodingdetector_ja.cpp
index d5eeb1e0e..6f0ba8b01 100644
--- a/kmail/encodingdetector_ja.cpp
+++ b/kmail/encodingdetector_ja.cpp
@@ -305,7 +305,7 @@ guess_arc guess_utf8_ar[11] = {
 enum JapaneseCode::Type JapaneseCode::guess_jp(const char *buf, int buflen)
 {
     int i;
-    guess_dfa *top = 0;
+    guess_dfa *top = nullptr;
 
     for (i=0; i<buflen; i++) {
         int c = (unsigned char)buf[i];
diff --git a/kmail/expirejob.cpp b/kmail/expirejob.cpp
index b38ad2948..f8e554e0d 100644
--- a/kmail/expirejob.cpp
+++ b/kmail/expirejob.cpp
@@ -60,7 +60,7 @@ using namespace KMail;
 
 ExpireJob::ExpireJob( KMFolder* folder, bool immediate )
  : ScheduledJob( folder, immediate ), mTimer( this ), mCurrentIndex( 0 ),
-   mFolderOpen( false ), mMoveToFolder( 0 )
+   mFolderOpen( false ), mMoveToFolder( nullptr )
 {
 }
 
@@ -87,11 +87,11 @@ void ExpireJob::execute()
   mSrcFolder->daysToExpire( unreadDays, readDays );
   if (unreadDays >= 0) {
     kdDebug(5006) << "ExpireJob: deleting unread older than "<< unreadDays << " days" << endl;
-    mMaxUnreadTime = time(0) - unreadDays * 3600 * 24;
+    mMaxUnreadTime = time(nullptr) - unreadDays * 3600 * 24;
   }
   if (readDays >= 0) {
     kdDebug(5006) << "ExpireJob: deleting read older than "<< readDays << " days" << endl;
-    mMaxReadTime = time(0) - readDays * 3600 * 24;
+    mMaxReadTime = time(nullptr) - readDays * 3600 * 24;
   }
 
   if ((mMaxUnreadTime == 0) && (mMaxReadTime == 0)) {
@@ -126,7 +126,7 @@ void ExpireJob::slotDoWork()
 #ifdef DEBUG_SCHEDULER
     kdDebug(5006) << "ExpireJob: checking message " << mCurrentIndex << " existence" << endl;
 #endif
-    if (mb == 0)
+    if (!mb)
       continue;
 #ifdef DEBUG_SCHEDULER
     kdDebug(5006) << "ExpireJob: checking message " << mCurrentIndex << " importance" << endl;
@@ -168,7 +168,7 @@ void ExpireJob::done()
       kdDebug(5006) << "ExpireJob: finished expiring in folder "
                     << mSrcFolder->location()
                     << " " << count << " messages to remove." << endl;
-      KMMoveCommand* cmd = new KMMoveCommand( 0, mRemovedMsgs );
+      KMMoveCommand* cmd = new KMMoveCommand( nullptr, mRemovedMsgs );
       connect( cmd, TQ_SIGNAL( completed( KMCommand * ) ),
                this, TQ_SLOT( slotMessagesMoved( KMCommand * ) ) );
       cmd->start();
diff --git a/kmail/expirejob.h b/kmail/expirejob.h
index 4371ed0fa..5a8d8607f 100644
--- a/kmail/expirejob.h
+++ b/kmail/expirejob.h
@@ -71,7 +71,7 @@ public:
     : ScheduledTask( folder, immediate ) {}
   virtual ~ScheduledExpireTask() {}
   virtual ScheduledJob* run() {
-    return folder() ? new ExpireJob( folder(), isImmediate() ) : 0;
+    return folder() ? new ExpireJob( folder(), isImmediate() ) : nullptr;
   }
   virtual int taskTypeId() const { return 1; }
 };
diff --git a/kmail/expirypropertiesdialog.cpp b/kmail/expirypropertiesdialog.cpp
index 76e8d219e..d46472d85 100644
--- a/kmail/expirypropertiesdialog.cpp
+++ b/kmail/expirypropertiesdialog.cpp
@@ -40,7 +40,7 @@ ExpiryPropertiesDialog::ExpiryPropertiesDialog( KMFolderTree* tree, KMFolder* fo
   globalVBox = new TQVBoxLayout( privateLayoutWidget, 11, 6, "globalVBox");
   globalVBox->setSpacing( 20 );
 
-  readHBox = new TQHBoxLayout( 0, 0, 6, "readHBox");
+  readHBox = new TQHBoxLayout( nullptr, 0, 6, "readHBox");
 
   expireReadMailCB = new TQCheckBox( privateLayoutWidget, "expireReadMailCB" );
   expireReadMailCB->setText( i18n( "Expire read mails after" ) );
@@ -58,7 +58,7 @@ ExpiryPropertiesDialog::ExpiryPropertiesDialog( KMFolderTree* tree, KMFolder* fo
   readHBox->addWidget( labelDays );
   globalVBox->addLayout( readHBox );
 
-  unreadHBox = new TQHBoxLayout( 0, 0, 6, "unreadHBox");
+  unreadHBox = new TQHBoxLayout( nullptr, 0, 6, "unreadHBox");
 
   expireUnreadMailCB = new TQCheckBox( privateLayoutWidget, "expireUnreadMailCB" );
   expireUnreadMailCB->setText( i18n( "Expire unread mails after" ) );
@@ -77,18 +77,18 @@ ExpiryPropertiesDialog::ExpiryPropertiesDialog( KMFolderTree* tree, KMFolder* fo
   unreadHBox->addWidget( labelDays2 );
   globalVBox->addLayout( unreadHBox );
 
-  expiryActionHBox = new TQHBoxLayout( 0, 0, 6, "expiryActionHBox");
+  expiryActionHBox = new TQHBoxLayout( nullptr, 0, 6, "expiryActionHBox");
 
   expiryActionLabel = new TQLabel( privateLayoutWidget, "expiryActionLabel" );
   expiryActionLabel->setText( i18n( "Expiry action:" ) );
   expiryActionLabel->setAlignment( int( TQLabel::AlignVCenter ) );
   expiryActionHBox->addWidget( expiryActionLabel );
 
-  actionsHBox = new TQVBoxLayout( 0, 0, 6, "actionsHBox");
+  actionsHBox = new TQVBoxLayout( nullptr, 0, 6, "actionsHBox");
   actionsGroup = new TQButtonGroup( this );
   actionsGroup->hide(); // for mutual exclusion of the radio buttons
 
-  moveToHBox = new TQHBoxLayout( 0, 0, 6, "moveToHBox");
+  moveToHBox = new TQHBoxLayout( nullptr, 0, 6, "moveToHBox");
 
   moveToRB = new TQRadioButton( privateLayoutWidget, "moveToRB" );
   actionsGroup->insert( moveToRB );
diff --git a/kmail/favoritefolderview.cpp b/kmail/favoritefolderview.cpp
index 6e6c56bf5..c173ee6a2 100644
--- a/kmail/favoritefolderview.cpp
+++ b/kmail/favoritefolderview.cpp
@@ -83,7 +83,7 @@ TQValueList<FavoriteFolderView*> FavoriteFolderView::mInstances;
 
 FavoriteFolderView::FavoriteFolderView( KMMainWidget *mainWidget, TQWidget * parent) :
     FolderTreeBase( mainWidget, parent ),
-    mContextMenuItem( 0 ),
+    mContextMenuItem( nullptr ),
     mReadingConfig( false )
 {
   assert( mainWidget );
@@ -135,7 +135,7 @@ void FavoriteFolderView::readConfig()
   clear();
   TQValueList<int> folderIds = GlobalSettings::self()->favoriteFolderIds();
   TQStringList folderNames = GlobalSettings::self()->favoriteFolderNames();
-  TQListViewItem *afterItem = 0;
+  TQListViewItem *afterItem = nullptr;
   for ( uint i = 0; i < folderIds.count(); ++i ) {
     KMFolder *folder = kmkernel->folderMgr()->findById( folderIds[i] );
     if ( !folder )
@@ -185,7 +185,7 @@ bool FavoriteFolderView::acceptDrag(TQDropEvent * e) const
 KMFolderTreeItem* FavoriteFolderView::addFolder(KMFolder * folder, const TQString &name, TQListViewItem *after)
 {
   if ( !folder )
-    return 0;
+    return nullptr;
   KMFolderTreeItem *item = new FavoriteFolderViewItem( this, name.isEmpty() ? folder->label() : name, folder );
   if ( after )
     item->moveItem( after );
@@ -290,7 +290,7 @@ void FavoriteFolderView::folderRemoved(KMFolder * folder)
     if ( fti->folder() == folder )
       delItems << fti;
     if ( fti == mContextMenuItem )
-      mContextMenuItem = 0;
+      mContextMenuItem = nullptr;
   }
   for ( uint i = 0; i < delItems.count(); ++i )
     delete delItems[i];
@@ -353,11 +353,11 @@ void FavoriteFolderView::contextMenu(TQListViewItem * item, const TQPoint & poin
 void FavoriteFolderView::removeFolder()
 {
   KMFolderTreeItem *fti = mContextMenuItem;
-  KMFolder *folder = 0;
+  KMFolder *folder = nullptr;
   if( fti )
     folder = fti->folder();
   delete mContextMenuItem;
-  mContextMenuItem = 0;
+  mContextMenuItem = nullptr;
   removeFromFolderToItemMap(folder);
   notifyInstancesOnChange();
 }
@@ -482,7 +482,7 @@ KMFolderTreeItem * FavoriteFolderView::findFolderTreeItem(KMFolder * folder) con
     if ( fti->folder() == folder )
       return fti;
   }
-  return 0;
+  return nullptr;
 }
 
 void FavoriteFolderView::checkMail()
diff --git a/kmail/favoritefolderview.h b/kmail/favoritefolderview.h
index 604c5e44b..833ca94f4 100644
--- a/kmail/favoritefolderview.h
+++ b/kmail/favoritefolderview.h
@@ -49,14 +49,14 @@ class FavoriteFolderView : public FolderTreeBase
   
 
   public:
-    FavoriteFolderView( KMMainWidget *mainWidget, TQWidget *parent = 0 );
+    FavoriteFolderView( KMMainWidget *mainWidget, TQWidget *parent = nullptr );
     ~FavoriteFolderView();
 
     void readConfig();
     void writeConfig();
 
     KMFolderTreeItem* addFolder( KMFolder *folder, const TQString &name = TQString(),
-                                 TQListViewItem *after = 0 );
+                                 TQListViewItem *after = nullptr );
     void addFolder( KMFolderTreeItem *fti );
 
   public slots:
diff --git a/kmail/filterimporterexporter.h b/kmail/filterimporterexporter.h
index fcdf17652..d16ae79e6 100644
--- a/kmail/filterimporterexporter.h
+++ b/kmail/filterimporterexporter.h
@@ -70,7 +70,7 @@ class FilterSelectionDialog : public KDialogBase
   TQ_OBJECT
   
 public:
-  FilterSelectionDialog( TQWidget * parent = 0 );
+  FilterSelectionDialog( TQWidget * parent = nullptr );
 
   virtual ~FilterSelectionDialog();
   virtual void slotCancel();
diff --git a/kmail/filterlogdlg.cpp b/kmail/filterlogdlg.cpp
index b862b90f8..726e538b1 100644
--- a/kmail/filterlogdlg.cpp
+++ b/kmail/filterlogdlg.cpp
@@ -237,7 +237,7 @@ void FilterLogDialog::slotUser1()
 void FilterLogDialog::slotUser2()
 {
   TQString fileName;
-  KFileDialog fdlg( TQString(), TQString(), this, 0, true );
+  KFileDialog fdlg( TQString(), TQString(), this, nullptr, true );
 
   fdlg.setMode( KFile::File );
   fdlg.setSelection( "kmail-filter.log" );
diff --git a/kmail/folderdiaacltab.cpp b/kmail/folderdiaacltab.cpp
index 94cf2d480..33dcbeab8 100644
--- a/kmail/folderdiaacltab.cpp
+++ b/kmail/folderdiaacltab.cpp
@@ -129,7 +129,7 @@ KMail::ACLEntryDialog::ACLEntryDialog( IMAPUserIdFormat userIdFormat, const TQSt
 
 void KMail::ACLEntryDialog::slotChanged()
 {
-  enableButtonOK( !mUserIdLineEdit->text().isEmpty() && mButtonGroup->selected() != 0 );
+  enableButtonOK( !mUserIdLineEdit->text().isEmpty() && mButtonGroup->selected() != nullptr );
 }
 
 static TQString addresseeToUserId( const TDEABC::Addressee& addr, IMAPUserIdFormat userIdFormat )
@@ -314,7 +314,7 @@ void KMail::FolderDiaACLTab::ListViewItem::save( ACLList& aclList,
 
 KMail::FolderDiaACLTab::FolderDiaACLTab( KMFolderDialog* dlg, TQWidget* parent, const char* name )
   : FolderDiaTab( parent, name ),
-    mImapAccount( 0 ),
+    mImapAccount( nullptr ),
     mUserRights( 0 ),
     mUserRightsState( KMail::ACLJobs::NotFetchedYet ),
     mDlg( dlg ),
@@ -722,7 +722,7 @@ bool KMail::FolderDiaACLTab::save()
 
   mACLList = aclList;
 
-  KMFolderImap* parentImap = mDlg->parentFolder() ? static_cast<KMFolderImap*>( mDlg->parentFolder()->storage() ) : 0;
+  KMFolderImap* parentImap = mDlg->parentFolder() ? static_cast<KMFolderImap*>( mDlg->parentFolder()->storage() ) : nullptr;
 
   if ( mDlg->isNewFolder() ) {
     // The folder isn't created yet, wait for it
@@ -753,7 +753,7 @@ void KMail::FolderDiaACLTab::slotDirectoryListingFinished(KMFolderImap* f)
 
   TDEIO::Job* job = ACLJobs::multiSetACL( mImapAccount->slave(), imapURL(), mACLList );
   ImapAccountBase::jobData jd;
-  jd.total = 1; jd.done = 0; jd.parent = 0;
+  jd.total = 1; jd.done = 0; jd.parent = nullptr;
   mImapAccount->insertJob(job, jd);
 
   connect(job, TQ_SIGNAL(result(TDEIO::Job *)),
@@ -810,7 +810,7 @@ void KMail::FolderDiaACLTab::slotChanged( bool b )
 
 bool KMail::FolderDiaACLTab::supports( KMFolder* refFolder )
 {
-  ImapAccountBase* imapAccount = 0;
+  ImapAccountBase* imapAccount = nullptr;
   if ( refFolder->folderType() == KMFolderTypeImap )
     imapAccount = static_cast<KMFolderImap*>( refFolder->storage() )->account();
   else
diff --git a/kmail/folderdiaacltab.h b/kmail/folderdiaacltab.h
index 1c65f162b..f86c48f5e 100644
--- a/kmail/folderdiaacltab.h
+++ b/kmail/folderdiaacltab.h
@@ -61,7 +61,7 @@ class ACLEntryDialog :public KDialogBase {
   
 
 public:
-  ACLEntryDialog( IMAPUserIdFormat userIdFormat, const TQString& caption, TQWidget* parent, const char* name = 0 );
+  ACLEntryDialog( IMAPUserIdFormat userIdFormat, const TQString& caption, TQWidget* parent, const char* name = nullptr );
 
   void setValues( const TQString& userId, unsigned int permissions );
 
@@ -89,7 +89,7 @@ class FolderDiaACLTab : public FolderDiaTab
   
 
 public:
-  FolderDiaACLTab( KMFolderDialog* dlg, TQWidget* parent, const char* name = 0 );
+  FolderDiaACLTab( KMFolderDialog* dlg, TQWidget* parent, const char* name = nullptr );
 
   virtual void load();
   virtual bool save();
diff --git a/kmail/folderdiaquotatab.cpp b/kmail/folderdiaquotatab.cpp
index 3afc0905f..385c3d03e 100644
--- a/kmail/folderdiaquotatab.cpp
+++ b/kmail/folderdiaquotatab.cpp
@@ -51,7 +51,7 @@ using namespace KMail;
 
 KMail::FolderDiaQuotaTab::FolderDiaQuotaTab( KMFolderDialog* dlg, TQWidget* parent, const char* name )
   : FolderDiaTab( parent, name ),
-    mImapAccount( 0 ),
+    mImapAccount( nullptr ),
     mDlg( dlg )
 {
   TQVBoxLayout* topLayout = new TQVBoxLayout( this );
@@ -203,7 +203,7 @@ bool KMail::FolderDiaQuotaTab::save()
 
 bool KMail::FolderDiaQuotaTab::supports( KMFolder* refFolder )
 {
-  ImapAccountBase* imapAccount = 0;
+  ImapAccountBase* imapAccount = nullptr;
   if ( refFolder->folderType() == KMFolderTypeImap )
     imapAccount = static_cast<KMFolderImap*>( refFolder->storage() )->account();
   else if ( refFolder->folderType() == KMFolderTypeCachedImap )
diff --git a/kmail/folderdiaquotatab.h b/kmail/folderdiaquotatab.h
index e5aab5ff6..b9fbb05ad 100644
--- a/kmail/folderdiaquotatab.h
+++ b/kmail/folderdiaquotatab.h
@@ -55,7 +55,7 @@ class FolderDiaQuotaTab : public FolderDiaTab
   
 
 public:
-  FolderDiaQuotaTab( KMFolderDialog* dlg, TQWidget* parent, const char* name = 0 );
+  FolderDiaQuotaTab( KMFolderDialog* dlg, TQWidget* parent, const char* name = nullptr );
 
   virtual void load();
   virtual bool save();
diff --git a/kmail/folderdiaquotatab_p.h b/kmail/folderdiaquotatab_p.h
index 428d45979..05a8b309b 100644
--- a/kmail/folderdiaquotatab_p.h
+++ b/kmail/folderdiaquotatab_p.h
@@ -47,7 +47,7 @@ class QuotaWidget : public TQWidget {
  TQ_OBJECT
   
 public:
-    QuotaWidget( TQWidget* parent, const char* name = 0 );
+    QuotaWidget( TQWidget* parent, const char* name = nullptr );
     virtual ~QuotaWidget() { }
     void setQuotaInfo( const KMail::QuotaInfo& info );
 
diff --git a/kmail/folderjob.cpp b/kmail/folderjob.cpp
index 2472df3a3..4d81b0688 100644
--- a/kmail/folderjob.cpp
+++ b/kmail/folderjob.cpp
@@ -45,7 +45,7 @@ namespace KMail {
 //----------------------------------------------------------------------------
 FolderJob::FolderJob( KMMessage *msg, JobType jt, KMFolder* folder,
                           TQString partSpecifier )
-  : mType( jt ), mSrcFolder( 0 ), mDestFolder( folder ), mPartSpecifier( partSpecifier ),
+  : mType( jt ), mSrcFolder( nullptr ), mDestFolder( folder ), mPartSpecifier( partSpecifier ),
     mErrorCode( 0 ),
     mPassiveDestructor( false ), mStarted( false )
 {
@@ -60,7 +60,7 @@ FolderJob::FolderJob( KMMessage *msg, JobType jt, KMFolder* folder,
 FolderJob::FolderJob( const TQPtrList<KMMessage>& msgList, const TQString& sets,
                           JobType jt, KMFolder *folder )
   : mMsgList( msgList ),mType( jt ),
-    mSets( sets ), mSrcFolder( 0 ), mDestFolder( folder ),
+    mSets( sets ), mSrcFolder( nullptr ), mDestFolder( folder ),
     mErrorCode( 0 ),
     mPassiveDestructor( false ), mStarted( false )
 {
diff --git a/kmail/folderjob.h b/kmail/folderjob.h
index 31a6857be..0f24fab25 100644
--- a/kmail/folderjob.h
+++ b/kmail/folderjob.h
@@ -55,7 +55,7 @@ public:
    * Constructs a new job, operating on the message msg, of type
    * @p jt and with a parent folder @p folder.
    */
-  FolderJob( KMMessage *msg, JobType jt = tGetMessage, KMFolder *folder = 0,
+  FolderJob( KMMessage *msg, JobType jt = tGetMessage, KMFolder *folder = nullptr,
         TQString partSpecifier = TQString() );
 
   /**
@@ -64,7 +64,7 @@ public:
    *
    */
   FolderJob( const TQPtrList<KMMessage>& msgList, const TQString& sets,
-	     JobType jt = tGetMessage, KMFolder *folder = 0 );
+	     JobType jt = tGetMessage, KMFolder *folder = nullptr );
   /**
    * This one should ONLY be used in derived folders, when a job
    * does something internal and needs to construct an empty parent
diff --git a/kmail/folderrequester.cpp b/kmail/folderrequester.cpp
index 29c557f99..fcd47470f 100644
--- a/kmail/folderrequester.cpp
+++ b/kmail/folderrequester.cpp
@@ -42,7 +42,7 @@
 namespace KMail {
 
 FolderRequester::FolderRequester( TQWidget *parent, KMFolderTree *tree )
-  : TQWidget( parent ), mFolder( 0 ), mFolderTree( tree ),
+  : TQWidget( parent ), mFolder( nullptr ), mFolderTree( tree ),
     mMustBeReadWrite( true ), mShowOutbox( true ), mShowImapFolders( true )
 {
   TQHBoxLayout * hlay = new TQHBoxLayout( this, 0, KDialog::spacingHint() );
@@ -108,7 +108,7 @@ void FolderRequester::setFolder( const TQString &idString )
     } else {
       edit->setText( i18n( "Please select a folder" ) );
     }
-    mFolder = 0;
+    mFolder = nullptr;
   }
   mFolderId = idString;
 }
diff --git a/kmail/foldersetselector.h b/kmail/foldersetselector.h
index 217e170e3..5b1efe104 100644
--- a/kmail/foldersetselector.h
+++ b/kmail/foldersetselector.h
@@ -32,7 +32,7 @@ class FolderSetSelector : public KDialogBase
   
 
   public:
-    FolderSetSelector( KMFolderTree *ft, TQWidget *parent = 0 );
+    FolderSetSelector( KMFolderTree *ft, TQWidget *parent = nullptr );
 
     TQValueList<int> selectedFolders();
     void setSelectedFolders( const TQValueList<int> &folderIds );
diff --git a/kmail/foldershortcutdialog.h b/kmail/foldershortcutdialog.h
index ccd931250..cb9908038 100644
--- a/kmail/foldershortcutdialog.h
+++ b/kmail/foldershortcutdialog.h
@@ -54,7 +54,7 @@ TQ_OBJECT
   
 public:
 	FolderShortcutDialog( KMFolder *folder, KMMainWidget *mw, 
-                        TQWidget *parent=0, const char *name=0 );
+                        TQWidget *parent=nullptr, const char *name=nullptr );
 	~FolderShortcutDialog();
 
 
diff --git a/kmail/folderstorage.cpp b/kmail/folderstorage.cpp
index eafac543a..67fdfc38e 100644
--- a/kmail/folderstorage.cpp
+++ b/kmail/folderstorage.cpp
@@ -61,7 +61,7 @@ using KMail::ListJob;
 //-----------------------------------------------------------------------------
 
 FolderStorage::FolderStorage( KMFolder* folder, const char* aName )
-  : TQObject( folder, aName ), mFolder( folder ), mEmitChangedTimer( 0L )
+  : TQObject( folder, aName ), mFolder( folder ), mEmitChangedTimer( nullptr )
 {
   mOpenCount = 0;
   mQuiet = 0;
@@ -78,7 +78,7 @@ FolderStorage::FolderStorage( KMFolder* folder, const char* aName )
   mCompactable     = true;
   mNoContent      = false;
   mNoChildren     = false;
-  mRDict = 0;
+  mRDict = nullptr;
   mDirtyTimer = new TQTimer(this, "mDirtyTimer");
   connect(mDirtyTimer, TQ_SIGNAL(timeout()),
 	  this, TQ_SLOT(updateIndex()));
@@ -93,7 +93,7 @@ FolderStorage::FolderStorage( KMFolder* folder, const char* aName )
 FolderStorage::~FolderStorage()
 {
   mJobList.setAutoDelete( true );
-  TQObject::disconnect( TQ_SIGNAL(destroyed(TQObject*)), this, 0 );
+  TQObject::disconnect( TQ_SIGNAL(destroyed(TQObject*)), this, nullptr );
   mJobList.clear();
   KMMsgDict::deleteRentry(mRDict);
 }
@@ -221,7 +221,7 @@ void FolderStorage::quiet(bool beQuiet)
     if (mQuiet <= 0)
     {
       delete mEmitChangedTimer;
-      mEmitChangedTimer=0L;
+      mEmitChangedTimer=nullptr;
 
       mQuiet = 0;
       if (mChanged) {
@@ -258,7 +258,7 @@ int FolderStorage::expungeOldMsg(int days)
   const KMMsgBase* mb;
   TQValueList<int> rmvMsgList;
 
-  maxTime = time(0) - days * 3600 * 24;
+  maxTime = time(nullptr) - days * 3600 * 24;
 
   for (i=count()-1; i>=0; i--) {
     mb = getMsgBase(i);
@@ -344,7 +344,7 @@ void FolderStorage::reallyAddMsg(KMMessage* aMsg)
 void FolderStorage::reallyAddCopyOfMsg(KMMessage* aMsg)
 {
   if ( !aMsg ) return; // messageRetrieved(0) is always possible
-  aMsg->setParent( 0 );
+  aMsg->setParent( nullptr );
   aMsg->setTransferInProgress( false );
   addMsg( aMsg );
   unGetMsg( count() - 1 );
@@ -428,7 +428,7 @@ KMMessage* FolderStorage::take(int idx)
   assert(idx>=0 && idx<=count());
 
   mb = getMsgBase(idx);
-  if (!mb) return 0;
+  if (!mb) return nullptr;
   if (!mb->isMessage()) readMsg(idx);
   TQ_UINT32 serNum = KMMsgDict::instance()->getMsgSerNum( folder(), idx );
   emit msgRemoved( folder(), serNum );
@@ -448,7 +448,7 @@ KMMessage* FolderStorage::take(int idx)
     }
   }
   --mTotalMsgs;
-  msg->setParent(0);
+  msg->setParent(nullptr);
   setDirty( true );
   mSize = -1;
   needsCompact=true; // message is taken from here - needs to be compacted
@@ -478,20 +478,20 @@ KMMessage* FolderStorage::getMsg(int idx)
 {
   if ( mOpenCount <= 0 ) {
     kdWarning(5006) << "FolderStorage::getMsg was called on a closed folder: " << folder()->prettyURL() << endl;
-    return 0;
+    return nullptr;
   }
   if ( idx < 0 || idx >= count() ) {
     kdWarning(5006) << "FolderStorage::getMsg was asked for an invalid index. idx =" << idx << " count()=" << count() << endl;
-    return 0;
+    return nullptr;
   }
 
   KMMsgBase* mb = getMsgBase(idx);
   if (!mb) {
     kdWarning(5006) << "FolderStorage::getMsg, getMsgBase failed for index: " << idx << endl;
-    return 0;
+    return nullptr;
   }
 
-  KMMessage *msg = 0;
+  KMMessage *msg = nullptr;
   bool undo = mb->enableUndo();
   if (mb->isMessage()) {
       msg = ((KMMessage*)mb);
@@ -516,7 +516,7 @@ KMMessage* FolderStorage::getMsg(int idx)
   // an outdated or corrupt IMAP cache.
   if ( msg->getMsgSerNum() == 0 ) {
     kdWarning(5006) << "FolderStorage::getMsg, message has no sernum, index: " << idx << endl;
-    return 0;
+    return nullptr;
   }
   msg->setEnableUndo(undo);
   msg->setComplete( true );
@@ -528,18 +528,18 @@ KMMessage* FolderStorage::readTemporaryMsg(int idx)
 {
   if(!(idx >= 0 && idx <= count())) {
     kdDebug(5006) << k_funcinfo << "Invalid index " << idx << "!" << endl;
-    return 0;
+    return nullptr;
   }
 
   KMMsgBase* mb = getMsgBase(idx);
   if (!mb) {
     kdDebug(5006) << k_funcinfo << "getMsgBase() for " << idx << " failed!" << endl;
-    return 0;
+    return nullptr;
   }
 
   unsigned long sernum = mb->getMsgSerNum();
 
-  KMMessage *msg = 0;
+  KMMessage *msg = nullptr;
   bool undo = mb->enableUndo();
   if (mb->isMessage()) {
     // the caller will delete it, so we must make a copy it
@@ -568,22 +568,22 @@ KMMsgInfo* FolderStorage::unGetMsg(int idx)
   KMMsgBase* mb;
 
   if(!(idx >= 0 && idx <= count()))
-    return 0;
+    return nullptr;
 
   mb = getMsgBase(idx);
-  if (!mb) return 0;
+  if (!mb) return nullptr;
 
 
   if (mb->isMessage()) {
     // Remove this message from all jobs' list it might still be on.
     // setIndexEntry deletes the message.
     KMMessage *msg = static_cast<KMMessage*>(mb);
-    if ( msg->transferInProgress() ) return 0;
+    if ( msg->transferInProgress() ) return nullptr;
     ignoreJobsForMessage( msg );
     return setIndexEntry( idx, msg );
   }
 
-  return 0;
+  return nullptr;
 }
 
 
@@ -620,7 +620,7 @@ FolderJob* FolderStorage::createJob( TQPtrList<KMMessage>& msgList, const TQStri
 //-----------------------------------------------------------------------------
 int FolderStorage::moveMsg(KMMessage* aMsg, int* aIndex_ret)
 {
-  assert(aMsg != 0);
+  assert(aMsg);
   KMFolder* msgParent = aMsg->parent();
 
   if (msgParent)
@@ -640,7 +640,7 @@ int FolderStorage::moveMsg(KMMessage* aMsg, int* aIndex_ret)
 int FolderStorage::moveMsg(TQPtrList<KMMessage> msglist, int* aIndex_ret)
 {
   KMMessage* aMsg = msglist.first();
-  assert(aMsg != 0);
+  assert(aMsg);
   KMFolder* msgParent = aMsg->parent();
 
   if (msgParent)
@@ -709,7 +709,7 @@ int FolderStorage::rename(const TQString& newName, KMFolderDir *newParent)
       ::rename(TQFile::encodeName(oldIdsLoc), TQFile::encodeName(newIdsLoc));
 
     // rename/move the subfolder directory
-    KMFolderDir* child = 0;
+    KMFolderDir* child = nullptr;
     if( folder() )
       child = folder()->child();
 
@@ -1183,7 +1183,7 @@ bool FolderStorage::isMoveable() const
 /*virtual*/
 KMAccount* FolderStorage::account() const
 {
-    return 0;
+    return nullptr;
 }
 
 bool FolderStorage::mailCheckInProgress() const
diff --git a/kmail/folderstorage.h b/kmail/folderstorage.h
index 87d63d002..5be61ab55 100644
--- a/kmail/folderstorage.h
+++ b/kmail/folderstorage.h
@@ -87,7 +87,7 @@ public:
   /** Usually a parent is given. But in some cases there is no
     fitting parent object available. Then the name of the folder
     is used as the absolute path to the folder file. */
-  FolderStorage( KMFolder* folder, const char* name=0 );
+  FolderStorage( KMFolder* folder, const char* name=nullptr );
   virtual ~FolderStorage();
 
   KMFolder* folder() const { return mFolder; }
@@ -159,11 +159,11 @@ public:
    * for each derived KMFolder).
    */
   virtual FolderJob* createJob( KMMessage *msg, FolderJob::JobType jt = FolderJob::tGetMessage,
-                                KMFolder *folder = 0, TQString partSpecifier = TQString(),
-                                const AttachmentStrategy *as = 0 ) const;
+                                KMFolder *folder = nullptr, TQString partSpecifier = TQString(),
+                                const AttachmentStrategy *as = nullptr ) const;
   virtual FolderJob* createJob( TQPtrList<KMMessage>& msgList, const TQString& sets,
                                 FolderJob::JobType jt = FolderJob::tGetMessage,
-                                KMFolder *folder = 0 ) const;
+                                KMFolder *folder = nullptr ) const;
 
   /** Provides access to the basic message fields that are also stored
     in the index. Whenever you only need subject, from, date, status
@@ -189,12 +189,12 @@ public:
     is stored in index_return if given.
     Please note that the message is added as is to the folder and the folder
     takes ownership of the message (deleting it in the destructor).*/
-  virtual int addMsg(KMMessage* msg, int* index_return = 0) = 0;
+  virtual int addMsg(KMMessage* msg, int* index_return = nullptr) = 0;
 
   /** (Note(bo): This needs to be fixed better at a later point.)
       This is overridden by dIMAP because addMsg strips the X-UID
       header from the mail. */
-  virtual int addMsgKeepUID(KMMessage* msg, int* index_return = 0) {
+  virtual int addMsgKeepUID(KMMessage* msg, int* index_return = nullptr) {
     return addMsg(msg, index_return);
   }
 
@@ -225,8 +225,8 @@ public:
     adds it to this folder. Returns zero on success and an errno error
     code on failure. The index of the new message is stored in index_return
     if given. */
-  virtual int moveMsg(KMMessage* msg, int* index_return = 0);
-  virtual int moveMsg(TQPtrList<KMMessage>, int* index_return = 0);
+  virtual int moveMsg(KMMessage* msg, int* index_return = nullptr);
+  virtual int moveMsg(TQPtrList<KMMessage>, int* index_return = nullptr);
 
   /** Returns the index of the given message or -1 if not found. */
   virtual int find(const KMMsgBase* msg) const = 0;
@@ -308,7 +308,7 @@ public:
 
   /** Physically rename the folder. Returns zero on success and an errno
     on failure. */
-  virtual int rename(const TQString& newName, KMFolderDir *aParent = 0);
+  virtual int rename(const TQString& newName, KMFolderDir *aParent = nullptr);
 
   /** Returns true if a table of contents file is automatically created. */
   bool autoCreateIndex() const { return mAutoCreateIndex; }
@@ -384,7 +384,7 @@ public:
    * If this folder has a special trash folder set, return it. Otherwise
    * return 0.
    */
-  virtual KMFolder* trashFolder() const { return 0; }
+  virtual KMFolder* trashFolder() const { return nullptr; }
 
   /**
    * Add job for this folder. This is done automatically by createJob.
diff --git a/kmail/foldertreebase.h b/kmail/foldertreebase.h
index 49441f744..885d09018 100644
--- a/kmail/foldertreebase.h
+++ b/kmail/foldertreebase.h
@@ -31,7 +31,7 @@ class FolderTreeBase : public KFolderTree
   TQ_OBJECT
   
   public:
-    FolderTreeBase( KMMainWidget *mainWidget, TQWidget *parent = 0, const char *name = 0 );
+    FolderTreeBase( KMMainWidget *mainWidget, TQWidget *parent = nullptr, const char *name = nullptr );
 
     /** Returns the main widget that this widget is a child of. */
     KMMainWidget* mainWidget() const { return mMainWidget; }
@@ -42,7 +42,7 @@ class FolderTreeBase : public KFolderTree
        if ( mFolderToItem.contains( folder ) )
          return mFolderToItem[ folder ];
        else
-         return 0;
+         return nullptr;
     }
 
     void insertIntoFolderToItemMap( const KMFolder *folder, TQListViewItem* item )
diff --git a/kmail/folderutil.cpp b/kmail/folderutil.cpp
index 76c12744f..164844111 100644
--- a/kmail/folderutil.cpp
+++ b/kmail/folderutil.cpp
@@ -32,7 +32,7 @@ KMFolder *KMail::FolderUtil::createSubFolder( KMFolder *parentFolder, KMFolderDi
                                               const TQString &folderName, const TQString &namespaceName,
                                               KMFolderType localFolderType )
 {
-  KMFolder *newFolder = 0;
+  KMFolder *newFolder = nullptr;
 
   if ( parentFolder && parentFolder->folderType() == KMFolderTypeImap ) {
     KMFolderImap* selectedStorage = static_cast<KMFolderImap*>( parentFolder->storage() );
diff --git a/kmail/globalsettings.cpp b/kmail/globalsettings.cpp
index 4a33d2cbe..fab177af0 100644
--- a/kmail/globalsettings.cpp
+++ b/kmail/globalsettings.cpp
@@ -25,7 +25,7 @@
 #include <kstaticdeleter.h>
 #include <tqtimer.h>
 
-GlobalSettings *GlobalSettings::mSelf = 0;
+GlobalSettings *GlobalSettings::mSelf = nullptr;
 static KStaticDeleter<GlobalSettings> staticGlobalSettingsDeleter;
 
 GlobalSettings *GlobalSettings::self()
diff --git a/kmail/headeritem.cpp b/kmail/headeritem.cpp
index e3d2d05ca..37d6a0b82 100644
--- a/kmail/headeritem.cpp
+++ b/kmail/headeritem.cpp
@@ -47,7 +47,7 @@ HeaderItem::HeaderItem( TQListView* parent, int msgId, const TQString& key )
   mMsgId( msgId ),
   mKey( key ),
   mAboutToBeDeleted( false ),
-  mSortCacheItem( 0 )
+  mSortCacheItem( nullptr )
 {
   irefresh();
 }
@@ -58,7 +58,7 @@ HeaderItem::HeaderItem( TQListViewItem* parent, int msgId, const TQString& key )
   mMsgId( msgId ),
   mKey( key ),
   mAboutToBeDeleted( false ),
-  mSortCacheItem( 0 )
+  mSortCacheItem( nullptr )
 {
   irefresh();
 }
@@ -254,7 +254,7 @@ const TQPixmap *HeaderItem::cryptoIcon(KMMsgBase *msgBase) const
     case KMMsgPartiallyEncrypted    : return KMHeaders::pixPartiallyEncrypted;
     case KMMsgEncryptionStateUnknown: return KMHeaders::pixUndefinedEncrypted;
     case KMMsgEncryptionProblematic : return KMHeaders::pixEncryptionProblematic;
-    default                         : return 0;
+    default                         : return nullptr;
   }
 }
 
@@ -266,7 +266,7 @@ const TQPixmap *HeaderItem::signatureIcon(KMMsgBase *msgBase) const
     case KMMsgPartiallySigned      : return KMHeaders::pixPartiallySigned;
     case KMMsgSignatureStateUnknown: return KMHeaders::pixUndefinedSigned;
     case KMMsgSignatureProblematic : return KMHeaders::pixSignatureProblematic;
-    default                        : return 0;
+    default                        : return nullptr;
   }
 }
 
@@ -286,7 +286,7 @@ const TQPixmap *HeaderItem::statusIcon(KMMsgBase *msgBase) const
   if ( msgBase->isUnread()                   ) return KMHeaders::pixUns;
   if ( msgBase->isDeleted()                  ) return KMHeaders::pixDel;
 
-  return 0;
+  return nullptr;
 }
 
 const TQPixmap *HeaderItem::pixmap(int col) const
@@ -379,7 +379,7 @@ const TQPixmap *HeaderItem::pixmap(int col) const
   else if ( col == headers->paintInfo()->cryptoCol ) {
     return cryptoIcon(msgBase);
   }
-  return 0;
+  return nullptr;
 }
 
 void HeaderItem::paintCell( TQPainter * p, const TQColorGroup & cg,
diff --git a/kmail/headeritem.h b/kmail/headeritem.h
index afebb8804..3c62b46e6 100644
--- a/kmail/headeritem.h
+++ b/kmail/headeritem.h
@@ -54,13 +54,13 @@ class HeaderItem; // forward declaration
 class SortCacheItem {
 
 public:
-    SortCacheItem() : mItem(0), mParent(0), mId(-1), mSortOffset(-1),
-        mUnsortedCount(0), mUnsortedSize(0), mUnsortedChildren(0),
-        mImperfectlyThreaded (true), mSubjThreadingList(0) { }
+    SortCacheItem() : mItem(nullptr), mParent(nullptr), mId(-1), mSortOffset(-1),
+        mUnsortedCount(0), mUnsortedSize(0), mUnsortedChildren(nullptr),
+        mImperfectlyThreaded (true), mSubjThreadingList(nullptr) { }
     SortCacheItem(int i, TQString k, int o=-1)
-        : mItem(0), mParent(0), mId(i), mSortOffset(o), mKey(k),
-          mUnsortedCount(0), mUnsortedSize(0), mUnsortedChildren(0),
-          mImperfectlyThreaded (true), mSubjThreadingList(0) { }
+        : mItem(nullptr), mParent(nullptr), mId(i), mSortOffset(o), mKey(k),
+          mUnsortedCount(0), mUnsortedSize(0), mUnsortedChildren(nullptr),
+          mImperfectlyThreaded (true), mSubjThreadingList(nullptr) { }
     ~SortCacheItem() { if(mUnsortedChildren) free(mUnsortedChildren); }
 
     /** The parent node of the item in the threading hierarchy. 0 if the item
@@ -108,7 +108,7 @@ public:
     void clearChildren() {
       mSortedChildren.clear();
       free( mUnsortedChildren );
-      mUnsortedChildren = 0;
+      mUnsortedChildren = nullptr;
       mUnsortedCount = mUnsortedSize = 0;
     }
 
diff --git a/kmail/headerlistquicksearch.cpp b/kmail/headerlistquicksearch.cpp
index ab2491aa2..f685fc1b7 100644
--- a/kmail/headerlistquicksearch.cpp
+++ b/kmail/headerlistquicksearch.cpp
@@ -51,7 +51,7 @@ HeaderListQuickSearch::HeaderListQuickSearch( TQWidget *parent,
                                               TDEListView *listView,
                                               TDEActionCollection *actionCollection,
                                               const char *name )
-  : TDEListViewSearchLine(parent, listView, name), mStatusCombo(0), mStatus(0),  statusList()
+  : TDEListViewSearchLine(parent, listView, name), mStatusCombo(nullptr), mStatus(0),  statusList()
 {
   TDEAction *resetQuickSearch = new TDEAction( i18n( "Reset Quick Search" ),
                                            TQApplication::reverseLayout()
@@ -90,7 +90,7 @@ HeaderListQuickSearch::HeaderListQuickSearch( TQWidget *parent,
   label->setBuddy( mStatusCombo );
 
   TDEToolBarButton * btn = new TDEToolBarButton( "mail_find", 0, parent,
-                                            0, i18n( "Open Full Search" ) );
+                                            nullptr, i18n( "Open Full Search" ) );
   connect( btn, TQ_SIGNAL( clicked() ), TQ_SIGNAL( requestFullSearch() ) );
 
   /* Disable the signal connected by TDEListViewSearchLine since it will call
@@ -113,7 +113,7 @@ HeaderListQuickSearch::~HeaderListQuickSearch()
 bool HeaderListQuickSearch::eventFilter( TQObject *watched, TQEvent *event )
 {
   if ( watched == mStatusCombo ) {
-    KMMainWidget *mainWidget = 0;
+    KMMainWidget *mainWidget = nullptr;
 
     // Travel up the parents list until we find the main widget
     for ( TQWidget *curWidget = parentWidget(); curWidget; curWidget = curWidget->parentWidget() ) {
diff --git a/kmail/headerlistquicksearch.h b/kmail/headerlistquicksearch.h
index 56753ed95..34065bc4f 100644
--- a/kmail/headerlistquicksearch.h
+++ b/kmail/headerlistquicksearch.h
@@ -50,7 +50,7 @@ public:
     HeaderListQuickSearch( TQWidget *parent,
                                              TDEListView *listView,
                                              TDEActionCollection *actionCollection,
-                                             const char *name = 0 );
+                                             const char *name = nullptr );
     virtual ~HeaderListQuickSearch();
 
     /**
diff --git a/kmail/headerstrategy.cpp b/kmail/headerstrategy.cpp
index ff2b82ae8..70fa4c82b 100644
--- a/kmail/headerstrategy.cpp
+++ b/kmail/headerstrategy.cpp
@@ -258,7 +258,7 @@ namespace KMail {
     }
     kdFatal( 5006 ) << "HeaderStrategy::create(): Unknown header strategy ( type == "
 		    << (int)type << " ) requested!" << endl;
-    return 0; // make compiler happy
+    return nullptr; // make compiler happy
   }
 
   const HeaderStrategy * HeaderStrategy::create( const TQString & type ) {
@@ -273,11 +273,11 @@ namespace KMail {
     return standard();
   }
 
-  static const HeaderStrategy * allStrategy = 0;
-  static const HeaderStrategy * richStrategy = 0;
-  static const HeaderStrategy * standardStrategy = 0;
-  static const HeaderStrategy * briefStrategy = 0;
-  static const HeaderStrategy * customStrategy = 0;
+  static const HeaderStrategy * allStrategy = nullptr;
+  static const HeaderStrategy * richStrategy = nullptr;
+  static const HeaderStrategy * standardStrategy = nullptr;
+  static const HeaderStrategy * briefStrategy = nullptr;
+  static const HeaderStrategy * customStrategy = nullptr;
 
   const HeaderStrategy * HeaderStrategy::all() {
     if ( !allStrategy )
diff --git a/kmail/headerstyle.cpp b/kmail/headerstyle.cpp
index 8d2890569..01b99fe72 100644
--- a/kmail/headerstyle.cpp
+++ b/kmail/headerstyle.cpp
@@ -624,7 +624,7 @@ namespace KMail {
 				// kdDebug() << "FancyHeaderStyle::format() zone offset (in minutes): " << zone << endl;
 				
 				// copyed from mimelib -- code to determine local timezone
-        time_t t_now = time((time_t*) 0);
+        time_t t_now = time((time_t*) nullptr);
 #if defined(HAVE_GMTIME_R)
         struct tm utc;
         gmtime_r(&t_now, &utc);
@@ -1074,7 +1074,7 @@ namespace KMail {
     }
     kdFatal( 5006 ) << "HeaderStyle::create(): Unknown header style ( type == "
                     << (int)type << " ) requested!" << endl;
-    return 0; // make compiler happy
+    return nullptr; // make compiler happy
   }
 
   const HeaderStyle * HeaderStyle::create( const TQString & type ) {
@@ -1088,10 +1088,10 @@ namespace KMail {
     return fancy();
   }
 
-  static const HeaderStyle * briefStyle = 0;
-  static const HeaderStyle * plainStyle = 0;
-  static const HeaderStyle * fancyStyle = 0;
-  static const HeaderStyle * enterpriseStyle = 0;
+  static const HeaderStyle * briefStyle = nullptr;
+  static const HeaderStyle * plainStyle = nullptr;
+  static const HeaderStyle * fancyStyle = nullptr;
+  static const HeaderStyle * enterpriseStyle = nullptr;
 
   const HeaderStyle * HeaderStyle::brief() {
     if ( !briefStyle )
diff --git a/kmail/htmlstatusbar.h b/kmail/htmlstatusbar.h
index caf01d7db..66679931e 100644
--- a/kmail/htmlstatusbar.h
+++ b/kmail/htmlstatusbar.h
@@ -62,7 +62,7 @@ namespace KMail {
     TQ_OBJECT
   
   public:
-    HtmlStatusBar( TQWidget * parent=0, const char * name=0, WFlags f=0 );
+    HtmlStatusBar( TQWidget * parent=nullptr, const char * name=nullptr, WFlags f=0 );
     virtual ~HtmlStatusBar();
 
     enum Mode {
diff --git a/kmail/identitydialog.h b/kmail/identitydialog.h
index cfa27bd92..6b3a17cab 100644
--- a/kmail/identitydialog.h
+++ b/kmail/identitydialog.h
@@ -63,7 +63,7 @@ namespace KMail {
     TQ_OBJECT
   
   public:
-    IdentityDialog( TQWidget * parent=0, const char * name = 0 );
+    IdentityDialog( TQWidget * parent=nullptr, const char * name = nullptr );
     virtual ~IdentityDialog();
 
     void setIdentity( /*_not_ const*/ KPIM::Identity & ident );
diff --git a/kmail/identitydrag.cpp b/kmail/identitydrag.cpp
index f3c6435dc..357808e84 100644
--- a/kmail/identitydrag.cpp
+++ b/kmail/identitydrag.cpp
@@ -51,7 +51,7 @@ namespace KMail {
     if ( i == 0 )
       return kmailIdentityMimeType;
     else
-      return 0;
+      return nullptr;
   }
 
   TQByteArray IdentityDrag::encodedData( const char * mimetype ) const {
diff --git a/kmail/identitydrag.h b/kmail/identitydrag.h
index b7aa2250d..4069a29d5 100644
--- a/kmail/identitydrag.h
+++ b/kmail/identitydrag.h
@@ -46,7 +46,7 @@ namespace KMail {
   
   public:
     IdentityDrag( const KPIM::Identity & ident,
-		  TQWidget * dragSource=0, const char * name=0 );
+		  TQWidget * dragSource=nullptr, const char * name=nullptr );
 
   public:
     virtual ~IdentityDrag() {}
diff --git a/kmail/identitylistview.cpp b/kmail/identitylistview.cpp
index f10edf7dc..ceb722301 100644
--- a/kmail/identitylistview.cpp
+++ b/kmail/identitylistview.cpp
@@ -133,7 +133,7 @@ namespace KMail {
 
   TQDragObject * IdentityListView::dragObject() {
     IdentityListViewItem * item = dynamic_cast<IdentityListViewItem*>( currentItem() );
-    if ( !item ) return 0;
+    if ( !item ) return nullptr;
 
     IdentityDrag * drag = new IdentityDrag( item->identity(), viewport() );
     drag->setPixmap( SmallIcon("identity") );
diff --git a/kmail/identitylistview.h b/kmail/identitylistview.h
index eabd63d71..ff52d442e 100644
--- a/kmail/identitylistview.h
+++ b/kmail/identitylistview.h
@@ -70,7 +70,7 @@ namespace KMail {
     TQ_OBJECT
   
   public:
-    IdentityListView( TQWidget * parent=0, const char * name=0 );
+    IdentityListView( TQWidget * parent=nullptr, const char * name=nullptr );
     virtual ~IdentityListView() {}
 
   public slots:
diff --git a/kmail/imapaccountbase.cpp b/kmail/imapaccountbase.cpp
index e256037da..a4810c81e 100644
--- a/kmail/imapaccountbase.cpp
+++ b/kmail/imapaccountbase.cpp
@@ -81,8 +81,8 @@ namespace KMail {
 
   ImapAccountBase::ImapAccountBase( AccountManager * parent, const TQString & name, uint id )
     : NetworkAccount( parent, name, id ),
-      mIdleTimer( 0, "mIdleTimer" ),
-      mNoopTimer( 0, "mNoopTimer" ),
+      mIdleTimer( nullptr, "mIdleTimer" ),
+      mNoopTimer( nullptr, "mNoopTimer" ),
       mTotal( 0 ),
       mCountUnread( 0 ),
       mCountLastUnread( 0 ),
@@ -101,7 +101,7 @@ namespace KMail {
       mSlaveConnected( false ),
       mSlaveConnectionError( false ),
       mCheckingSingleFolder( false ),
-      mListDirProgressItem( 0 )
+      mListDirProgressItem( nullptr )
   {
     mPort = imapDefaultPort;
     mBodyPartList.setAutoDelete(true);
@@ -317,7 +317,7 @@ namespace KMail {
     mSlaveConnected = false;
     mSlave = TDEIO::Scheduler::getConnectedSlave( getUrl(), slaveConfig() );
     if ( !mSlave ) {
-      KMessageBox::error(0, i18n("Could not start process for %1.")
+      KMessageBox::error(nullptr, i18n("Could not start process for %1.")
 			 .arg( getUrl().protocol() ) );
       return Error;
     }
@@ -335,7 +335,7 @@ namespace KMail {
     if ( it != jobsEnd() && (*it).progressItem )
     {
       (*it).progressItem->setComplete();
-      (*it).progressItem = 0;
+      (*it).progressItem = nullptr;
     }
     return handleError( job->error(), job->errorText(), job, context, abortSync );
   }
@@ -549,7 +549,7 @@ namespace KMail {
   {
     if ( mSlave ) {
       TDEIO::Scheduler::disconnectSlave(mSlave);
-      mSlave = 0;
+      mSlave = nullptr;
       mSlaveConnected = false;
       /* As for the noop timer, we need to make sure this one is started
          again when a new slave goes up. */
@@ -570,7 +570,7 @@ namespace KMail {
       const TQString &errorMsg)
   {
     if (aSlave != mSlave) return;
-    handleError( errorCode, errorMsg, 0, TQString(), true );
+    handleError( errorCode, errorMsg, nullptr, TQString(), true );
     if ( mAskAgain )
       if ( makeConnection() != ImapAccountBase::Error )
         return;
@@ -581,7 +581,7 @@ namespace KMail {
       if ( mSlave )
       {
         TDEIO::Scheduler::disconnectSlave( slave() );
-        mSlave = 0;
+        mSlave = nullptr;
       }
     }
     emit connectionResult( errorCode, errorMsg );
@@ -864,7 +864,7 @@ namespace KMail {
           // make sure ERR_CONNECTION_BROKEN is properly handled and the slave
           // disconnected even when quiet()
           TDEIO::Scheduler::disconnectSlave( slave() );
-          mSlave = 0;
+          mSlave = nullptr;
         }
         if (job->error() == TDEIO::ERR_SLAVE_DIED)
           slaveDied();
@@ -1006,7 +1006,7 @@ namespace KMail {
         ++it;
         mapJobData.remove( rmit );
         // We killed a job -> this kills the slave
-        mSlave = 0;
+        mSlave = nullptr;
       } else
         ++it;
     }
@@ -1071,7 +1071,7 @@ namespace KMail {
     // first delete old parts as we construct our own
     msg->deleteBodyParts();
     // make the parts and fill the mBodyPartList
-    constructParts( stream, 1, 0, 0, msg->asDwMessage() );
+    constructParts( stream, 1, nullptr, nullptr, msg->asDwMessage() );
     if ( mBodyPartList.count() == 1 ) // we directly set the body later, at partsToLoad below
       msg->deleteBodyParts();
 
@@ -1090,7 +1090,7 @@ namespace KMail {
     KMMessagePart *part;
     int partsToLoad = 0;
     // check how many parts we have to load
-    while ( (part = it.current()) != 0 )
+    while ((part = it.current()) != nullptr)
     {
       ++it;
       if ( part->loadPart() )
@@ -1110,12 +1110,12 @@ namespace KMail {
       // to load the message completely
       kdDebug(5006) << "Falling back to normal mode" << endl;
       FolderJob *job = msg->parent()->createJob(
-          msg, FolderJob::tGetMessage, 0, "TEXT" );
+          msg, FolderJob::tGetMessage, nullptr, "TEXT" );
       job->start();
       return;
     }
     it.toFirst();
-    while ( (part = it.current()) != 0 )
+    while ((part = it.current()) != nullptr)
     {
       ++it;
       kdDebug(5006) << "ImapAccountBase::handleBodyStructure - load " << part->partSpecifier()
@@ -1124,14 +1124,14 @@ namespace KMail {
       {
         kdDebug(5006) << "load HEADER" << endl;
         FolderJob *job = msg->parent()->createJob(
-            msg, FolderJob::tGetMessage, 0, part->partSpecifier()+".MIME" );
+            msg, FolderJob::tGetMessage, nullptr, part->partSpecifier()+".MIME" );
         job->start();
       }
       if ( part->loadPart() )
       {
         kdDebug(5006) << "load Part" << endl;
         FolderJob *job = msg->parent()->createJob(
-            msg, FolderJob::tGetMessage, 0, part->partSpecifier() );
+            msg, FolderJob::tGetMessage, nullptr, part->partSpecifier() );
         job->start();
       }
     }
@@ -1168,7 +1168,7 @@ namespace KMail {
 //        kdDebug(5006) << "constructed dwpart " << dwpart << ",dwmsg " << dwmsg << ",parent " << parent
 //          << ",dwparts msg " << dwpart->Body().Message() <<",id "<<dwpart->ObjectId() << endl;
       } else
-        dwpart = 0;
+        dwpart = nullptr;
 
       if ( !parentKMPart )
         parentKMPart = part;
@@ -1181,7 +1181,7 @@ namespace KMail {
              dwpart->Body().Message() )
         {
           // set the encapsulated message as the new message
-          newparent = 0;
+          newparent = nullptr;
           newmsg = dwpart->Body().Message();
         }
         KMMessagePart* newParentKMPart = part;
@@ -1276,7 +1276,7 @@ namespace KMail {
   {
     if( (*it).progressItem ) {
       (*it).progressItem->setComplete();
-      (*it).progressItem = 0;
+      (*it).progressItem = nullptr;
     }
     mapJobData.remove( it );
   }
diff --git a/kmail/imapaccountbase.h b/kmail/imapaccountbase.h
index 8bb5f097f..4654827e6 100644
--- a/kmail/imapaccountbase.h
+++ b/kmail/imapaccountbase.h
@@ -144,14 +144,14 @@ namespace KMail {
     struct jobData
     {
       // Needed by TQMap, don't use
-      jobData() : url(TQString()), parent(0), current(0), total(1), done(0), offset(0), progressItem(0),
+      jobData() : url(TQString()), parent(nullptr), current(nullptr), total(1), done(0), offset(0), progressItem(nullptr),
                   onlySubscribed(false), quiet(false), cancellable(false) {}
       // Real constructor
-      jobData( const TQString& _url, KMFolder *_parent = 0,
+      jobData( const TQString& _url, KMFolder *_parent = nullptr,
           int _total = 1, int _done = 0, bool _quiet = false,
           bool _cancelable = false )
-        : url(_url), parent(_parent), current(0), total(_total), done(_done), offset(0),
-          progressItem(0), quiet(_quiet), cancellable(_cancelable) {}
+        : url(_url), parent(_parent), current(nullptr), total(_total), done(_done), offset(0),
+          progressItem(nullptr), quiet(_quiet), cancellable(_cancelable) {}
 
       TQString path;
       TQString url;
@@ -244,7 +244,7 @@ namespace KMail {
     /**
      * The TDEIO-Slave died
      */
-    void slaveDied() { mSlave = 0; killAllJobs(); }
+    void slaveDied() { mSlave = nullptr; killAllJobs(); }
 
     /**
      * Kill the slave if any jobs are active
diff --git a/kmail/imapjob.cpp b/kmail/imapjob.cpp
index ecf2b5e78..7a82cd9ee 100644
--- a/kmail/imapjob.cpp
+++ b/kmail/imapjob.cpp
@@ -55,23 +55,23 @@ namespace KMail {
 //-----------------------------------------------------------------------------
 ImapJob::ImapJob( KMMessage *msg, JobType jt, KMFolderImap* folder,
     TQString partSpecifier, const AttachmentStrategy *as )
-  : FolderJob( msg, jt, folder? folder->folder() : 0, partSpecifier ),
-    mAttachmentStrategy( as ), mParentProgressItem(0)
+  : FolderJob( msg, jt, folder? folder->folder() : nullptr, partSpecifier ),
+    mAttachmentStrategy( as ), mParentProgressItem(nullptr)
 {
 }
 
 //-----------------------------------------------------------------------------
 ImapJob::ImapJob( TQPtrList<KMMessage>& msgList, TQString sets, JobType jt,
                   KMFolderImap* folder )
-  : FolderJob( msgList, sets, jt, folder? folder->folder() : 0 ),
-    mAttachmentStrategy ( 0 ), mParentProgressItem(0)
+  : FolderJob( msgList, sets, jt, folder? folder->folder() : nullptr ),
+    mAttachmentStrategy ( nullptr ), mParentProgressItem(nullptr)
 {
 }
 
 void ImapJob::init( JobType jt, TQString sets, KMFolderImap* folder,
                     TQPtrList<KMMessage>& msgList )
 {
-  mJob = 0;
+  mJob = nullptr;
 
   assert(jt == tGetMessage || folder);
   KMMessage* msg = msgList.first();
@@ -81,7 +81,7 @@ void ImapJob::init( JobType jt, TQString sets, KMFolderImap* folder,
     return;
   }
   mType = jt;
-  mDestFolder = folder? folder->folder() : 0;
+  mDestFolder = folder? folder->folder() : nullptr;
   // refcount++
   if (folder) {
     folder->open("imapjobdest");
@@ -95,7 +95,7 @@ void ImapJob::init( JobType jt, TQString sets, KMFolderImap* folder,
   // imap folder, use its account for keeping track of the job. Otherwise,
   // this is a get job and the src folder is an imap one. Use its account
   // then.
-  KMAcctImap *account = 0;
+  KMAcctImap *account = nullptr;
   if (folder) {
     account = folder->account();
   } else {
@@ -113,7 +113,7 @@ void ImapJob::init( JobType jt, TQString sets, KMFolderImap* folder,
     // transfers the complete message to the server
     TQPtrListIterator<KMMessage> it( msgList );
     KMMessage* curMsg;
-    while ( ( curMsg = it.current() ) != 0 )
+    while ((curMsg = it.current()) != nullptr)
     {
       ++it;
       if ( mSrcFolder && !curMsg->isMessage() )
@@ -125,7 +125,7 @@ void ImapJob::init( JobType jt, TQString sets, KMFolderImap* folder,
       TQString flags = KMFolderImap::statusToFlags( curMsg->status(), folder->permanentFlags() );
       url.setPath( folder->imapPath() + ";SECTION=" + flags );
       ImapAccountBase::jobData jd;
-      jd.parent = 0; jd.offset = 0; jd.done = 0;
+      jd.parent = nullptr; jd.offset = 0; jd.done = 0;
       jd.total = ( curMsg->msgSizeServer() > 0 ) ?
         curMsg->msgSizeServer() : curMsg->msgSize();
       jd.msgList.append( curMsg );
@@ -178,7 +178,7 @@ void ImapJob::init( JobType jt, TQString sets, KMFolderImap* folder,
     KMFolderImap *imapDestFolder = static_cast<KMFolderImap*>(msg_parent->storage());
     url.setPath( imapDestFolder->imapPath() + ";UID=" + sets );
     ImapAccountBase::jobData jd;
-    jd.parent = 0; jd.offset = 0;
+    jd.parent = nullptr; jd.offset = 0;
     jd.total = 1; jd.done = 0;
     jd.msgList = msgList;
 
@@ -228,7 +228,7 @@ ImapJob::~ImapJob()
         if ( it != account->jobsEnd() ) {
           if( (*it).progressItem ) {
             (*it).progressItem->setComplete();
-            (*it).progressItem = 0;
+            (*it).progressItem = nullptr;
           }
           if ( !(*it).msgList.isEmpty() ) {
             for ( TQPtrListIterator<KMMessage> mit( (*it).msgList ); mit.current(); ++mit )
@@ -252,7 +252,7 @@ ImapJob::~ImapJob()
           if ( it != account->jobsEnd() ) {
             if( (*it).progressItem ) {
               (*it).progressItem->setComplete();
-              (*it).progressItem = 0;
+              (*it).progressItem = nullptr;
             }
             if ( !(*it).msgList.isEmpty() ) {
               for ( TQPtrListIterator<KMMessage> mit( (*it).msgList ); mit.current(); ++mit )
@@ -273,11 +273,11 @@ ImapJob::~ImapJob()
 void ImapJob::slotGetNextMessage()
 {
   KMMessage *msg = mMsgList.first();
-  KMFolderImap *msgParent = msg ? static_cast<KMFolderImap*>(msg->storage()) : 0;
+  KMFolderImap *msgParent = msg ? static_cast<KMFolderImap*>(msg->storage()) : nullptr;
   if ( !msgParent || !msg || msg->UID() == 0 )
   {
     // broken message
-    emit messageRetrieved( 0 );
+    emit messageRetrieved( nullptr );
     deleteLater();
     return;
   }
@@ -285,7 +285,7 @@ void ImapJob::slotGetNextMessage()
   KURL url = account->getUrl();
   TQString path = msgParent->imapPath() + ";UID=" + TQString::number(msg->UID());
   ImapAccountBase::jobData jd;
-  jd.parent = 0; jd.offset = 0;
+  jd.parent = nullptr; jd.offset = 0;
   jd.total = 1; jd.done = 0;
   jd.msgList.append( msg );
   if ( !mPartSpecifier.isEmpty() )
@@ -348,7 +348,7 @@ void ImapJob::slotGetMessageResult( TDEIO::Job * job )
 {
   KMMessage *msg = mMsgList.first();
   if (!msg || !msg->parent() || !job) {
-    emit messageRetrieved( 0 );
+    emit messageRetrieved( nullptr );
     deleteLater();
     return;
   }
@@ -357,7 +357,7 @@ void ImapJob::slotGetMessageResult( TDEIO::Job * job )
     msg->setTransferInProgress( false );
   KMAcctImap *account = parent->account();
   if ( !account ) {
-    emit messageRetrieved( 0 );
+    emit messageRetrieved( nullptr );
     deleteLater();
     return;
   }
@@ -446,7 +446,7 @@ void ImapJob::slotGetMessageResult( TDEIO::Job * job )
     {
       /* we got an answer but not data
        * this means that the msg is not on the server anymore so delete it */
-      emit messageRetrieved( 0 );
+      emit messageRetrieved( nullptr );
       parent->ignoreJobsForMessage( msg );
       int idx = parent->find( msg );
       if (idx != -1) parent->removeMsg( idx, true );
@@ -674,7 +674,7 @@ void ImapJob::slotCopyMessageResult( TDEIO::Job *job )
 void ImapJob::execute()
 {
   init( mType, mSets, mDestFolder?
-        dynamic_cast<KMFolderImap*>( mDestFolder->storage() ):0, mMsgList );
+        dynamic_cast<KMFolderImap*>( mDestFolder->storage() ):nullptr, mMsgList );
 }
 
 //-----------------------------------------------------------------------------
@@ -690,7 +690,7 @@ void ImapJob::slotProcessedSize(TDEIO::Job * job, TDEIO::filesize_t processed)
   if (!msg || !job) {
     return;
   }
-  KMFolderImap* parent = 0;
+  KMFolderImap* parent = nullptr;
   if ( msg->parent() && msg->parent()->folderType() == KMFolderTypeImap )
     parent = static_cast<KMFolderImap*>(msg->parent()->storage());
   else if (mDestFolder) // put
diff --git a/kmail/imapjob.h b/kmail/imapjob.h
index cd4b9ab76..51adbcdfa 100644
--- a/kmail/imapjob.h
+++ b/kmail/imapjob.h
@@ -58,10 +58,10 @@ class ImapJob : public FolderJob
   friend class ::KMAcctImap;
 
 public:
-  ImapJob( KMMessage *msg, JobType jt = tGetMessage, KMFolderImap *folder = 0,
-           TQString partSpecifier = TQString(), const AttachmentStrategy *as = 0 );
+  ImapJob( KMMessage *msg, JobType jt = tGetMessage, KMFolderImap *folder = nullptr,
+           TQString partSpecifier = TQString(), const AttachmentStrategy *as = nullptr );
   ImapJob( TQPtrList<KMMessage>& msgList, TQString sets,
-           JobType jt = tGetMessage, KMFolderImap *folder = 0 );
+           JobType jt = tGetMessage, KMFolderImap *folder = nullptr );
   virtual ~ImapJob();
 
   void setParentFolder( const KMFolderImap* parent );
diff --git a/kmail/importjob.cpp b/kmail/importjob.cpp
index 9fe9bbbe2..354f80f81 100644
--- a/kmail/importjob.cpp
+++ b/kmail/importjob.cpp
@@ -41,14 +41,14 @@ using namespace KMail;
 
 KMail::ImportJob::ImportJob( TQWidget *parentWidget )
   : TQObject( parentWidget ),
-    mArchive( 0 ),
-    mRootFolder( 0 ),
+    mArchive( nullptr ),
+    mRootFolder( nullptr ),
     mParentWidget( parentWidget ),
     mNumberOfImportedMessages( 0 ),
-    mCurrentFolder( 0 ),
-    mCurrentMessage( 0 ),
-    mCurrentMessageFile( 0 ),
-    mProgressItem( 0 ),
+    mCurrentFolder( nullptr ),
+    mCurrentMessage( nullptr ),
+    mCurrentMessageFile( nullptr ),
+    mProgressItem( nullptr ),
     mAborted( false )
 {
 }
@@ -59,7 +59,7 @@ KMail::ImportJob::~ImportJob()
     mArchive->close();
   }
   delete mArchive;
-  mArchive = 0;
+  mArchive = nullptr;
 }
 
 void KMail::ImportJob::setFile( const KURL &archiveFile )
@@ -76,7 +76,7 @@ void KMail::ImportJob::finish()
 {
   kdDebug(5006) << "Finished import job." << endl;
   mProgressItem->setComplete();
-  mProgressItem = 0;
+  mProgressItem = nullptr;
   TQString text = i18n( "Importing the archive file '%1' into the folder '%2' succeeded." )
                      .arg( mArchiveFile.path() ).arg( mRootFolder->name() );
   text += "\n" + i18n( "1 message was imported.", "%n messages were imported.", mNumberOfImportedMessages );
@@ -99,7 +99,7 @@ void KMail::ImportJob::abort( const TQString &errorMessage )
   text += "\n" + errorMessage;
   if ( mProgressItem ) {
     mProgressItem->setComplete();
-    mProgressItem = 0;
+    mProgressItem = nullptr;
     // The progressmanager will delete it
   }
   KMessageBox::sorry( mParentWidget, text, i18n( "Importing archive failed." ) );
@@ -112,7 +112,7 @@ KMFolder * KMail::ImportJob::createSubFolder( KMFolder *parent, const TQString &
                                                      KMFolderTypeMaildir );
   if ( !newFolder ) {
     abort( i18n( "Unable to create subfolder for folder '%1'." ).arg( parent->name() ) );
-    return 0;
+    return nullptr;
   }
   else {
     newFolder->createChildFolder(); // TODO: Just creating a child folder here is wasteful, only do
@@ -172,8 +172,8 @@ void KMail::ImportJob::messageAdded()
   }
   // TODO: Else?
 
-  mCurrentMessage = 0;
-  mCurrentMessageFile = 0;
+  mCurrentMessage = nullptr;
+  mCurrentMessageFile = nullptr;
   TQTimer::singleShot( 0, this, TQ_SLOT( importNextMessage() ) );
 }
 
@@ -187,7 +187,7 @@ void KMail::ImportJob::importNextMessage()
     if ( mCurrentFolder ) {
       mCurrentFolder->close( "ImportJob" );
     }
-    mCurrentFolder = 0;
+    mCurrentFolder = nullptr;
     importNextDirectory();
     return;
   }
@@ -285,10 +285,10 @@ KMFolder* KMail::ImportJob::getOrCreateSubFolder( KMFolder *parentFolder, const
 {
   if ( !parentFolder->createChildFolder() ) {
     abort( i18n( "Unable to create subfolder for folder '%1'." ).arg( parentFolder->name() ) );
-    return 0;
+    return nullptr;
   }
 
-  KMFolder *subFolder = 0;
+  KMFolder *subFolder = nullptr;
   subFolder = dynamic_cast<KMFolder*>( parentFolder->child()->hasNamedFolder( subFolderName ) );
 
   if ( !subFolder ) {
diff --git a/kmail/importjob.h b/kmail/importjob.h
index e7c88881a..2cc4417f6 100644
--- a/kmail/importjob.h
+++ b/kmail/importjob.h
@@ -56,7 +56,7 @@ class ImportJob : public TQObject
 
   public:
 
-    explicit ImportJob( TQWidget *parentWidget = 0 );
+    explicit ImportJob( TQWidget *parentWidget = nullptr );
     ~ImportJob();
     void start();
     void setFile( const KURL &archiveFile );
diff --git a/kmail/index.cpp b/kmail/index.cpp
index f9b157d2f..560f393c3 100644
--- a/kmail/index.cpp
+++ b/kmail/index.cpp
@@ -82,7 +82,7 @@ KMMsgIndex::KMMsgIndex( TQObject* parent ):
 	mState( s_idle ),
 #ifdef HAVE_INDEXLIB
 	mLockFile( std::string( static_cast<const char*>( TQFile::encodeName( defaultPath() ) + "/lock" ) ) ),
-	mIndex( 0 ),
+	mIndex( nullptr ),
 #endif
 	mIndexPath( TQFile::encodeName( defaultPath() ) ),
 	mTimer( new TQTimer( this, "mTimer" ) ),
@@ -127,7 +127,7 @@ KMMsgIndex::KMMsgIndex( TQObject* parent ):
 			mRemovedMsgs = TQValueListToVector( cfg.readIntListEntry( "removed" ) );
 		}
 	}
-	mIndex = 0;
+	mIndex = nullptr;
 #else
 	mState = s_error;
 #endif
@@ -241,7 +241,7 @@ void KMMsgIndex::clear() {
 #ifdef HAVE_INDEXLIB
 	delete mIndex;
 	mLockFile.force_unlock();
-	mIndex = 0;
+	mIndex = nullptr;
 	indexlib::remove( mIndexPath );
 	mPendingMsgs.clear();
 	mPendingFolders.clear();
@@ -280,7 +280,7 @@ int KMMsgIndex::addMessage( TQ_UINT32 serNum ) {
 	if ( !mExisting.empty() && std::binary_search( mExisting.begin(), mExisting.end(), serNum ) ) return 0;
 
 	int idx = -1;
-	KMFolder* folder = 0;
+	KMFolder* folder = nullptr;
 	KMMsgDict::instance()->getLocation( serNum, &folder, &idx );
 	if ( !folder || idx == -1 ) return -1;
 	if ( !mOpenedFolders.count( folder ) ) {
@@ -473,7 +473,7 @@ bool KMMsgIndex::canHandleQuery( const KMSearchPattern* pat ) const {
 	if ( !pat ) return false;
 	TQPtrListIterator<KMSearchRule> it( *pat );
 	KMSearchRule* rule;
-	while ( (rule = it.current()) != 0 ) {
+	while ((rule = it.current()) != nullptr) {
 		++it;
 		if ( !rule->field().isEmpty() && !rule->contents().isEmpty() &&
 				rule->function() == KMSearchRule::FuncContains &&
@@ -553,7 +553,7 @@ void KMMsgIndex::Search::act() {
 				terms += TQString::fromLatin1( " %1 " ).arg( rule->contents() );
 			}
 
-			mValues = kmkernel->msgIndex()->simpleSearch( terms, 0  );
+			mValues = kmkernel->msgIndex()->simpleSearch( terms, nullptr  );
 			break;
 		 }
 		case s_emitstopped:
diff --git a/kmail/jobscheduler.cpp b/kmail/jobscheduler.cpp
index dc2ef5062..fc4eeb529 100644
--- a/kmail/jobscheduler.cpp
+++ b/kmail/jobscheduler.cpp
@@ -37,7 +37,7 @@ using namespace KMail;
 JobScheduler::JobScheduler( TQObject* parent, const char* name )
   : TQObject( parent, name ), mTimer( this, "mTimer" ),
     mPendingImmediateTasks( 0 ),
-    mCurrentTask( 0 ), mCurrentJob( 0 )
+    mCurrentTask( nullptr ), mCurrentJob( nullptr )
 {
   connect( &mTimer, TQ_SIGNAL( timeout() ), TQ_SLOT( slotRunNextJob() ) );
   // No need to start the internal timer yet, we wait for a task to be scheduled
@@ -124,7 +124,7 @@ void JobScheduler::interruptCurrentTask()
 #endif
   // File it again. This will either delete it or put it in mTaskList.
   registerTask( mCurrentTask );
-  mCurrentTask = 0;
+  mCurrentTask = nullptr;
   mCurrentJob->kill(); // This deletes the job and calls slotJobFinished!
 }
 
@@ -134,13 +134,13 @@ void JobScheduler::slotRunNextJob()
 #ifdef DEBUG_SCHEDULER
     kdDebug(5006) << "JobScheduler: slotRunNextJob" << endl;
 #endif
-    Q_ASSERT( mCurrentTask == 0 );
-    ScheduledTask* task = 0;
+    Q_ASSERT(!mCurrentTask);
+    ScheduledTask* task = nullptr;
     // Find a task suitable for being run
     for( TaskList::Iterator it = mTaskList.begin(); it != mTaskList.end(); ++it ) {
       // Remove if folder died
       KMFolder* folder = (*it)->folder();
-      if ( folder == 0 ) {
+      if (!folder) {
 #ifdef DEBUG_SCHEDULER
         kdDebug(5006) << "   folder for task " << (*it) << " was deleted" << endl;
 #endif
@@ -189,7 +189,7 @@ void JobScheduler::restartTimer()
 
 void JobScheduler::runTaskNow( ScheduledTask* task )
 {
-  Q_ASSERT( mCurrentTask == 0 );
+  Q_ASSERT(!mCurrentTask);
   if ( mCurrentTask ) {
     interruptCurrentTask();
   }
@@ -205,7 +205,7 @@ void JobScheduler::runTaskNow( ScheduledTask* task )
 #endif
   if ( !mCurrentJob ) { // nothing to do, e.g. folder deleted
     delete mCurrentTask;
-    mCurrentTask = 0;
+    mCurrentTask = nullptr;
     if ( !mTaskList.isEmpty() )
       restartTimer();
     return;
@@ -223,8 +223,8 @@ void JobScheduler::slotJobFinished()
   kdDebug(5006) << "JobScheduler: slotJobFinished" << endl;
 #endif
   delete mCurrentTask;
-  mCurrentTask = 0;
-  mCurrentJob = 0;
+  mCurrentTask = nullptr;
+  mCurrentJob = nullptr;
   if ( !mTaskList.isEmpty() )
     restartTimer();
 }
@@ -246,7 +246,7 @@ void JobScheduler::resume()
 ////
 
 KMail::ScheduledJob::ScheduledJob( KMFolder* folder, bool immediate )
-  : FolderJob( 0, tOther, folder ), mImmediate( immediate ),
+  : FolderJob( nullptr, tOther, folder ), mImmediate( immediate ),
     mOpeningFolder( false )
 {
   mCancellable = true;
diff --git a/kmail/jobscheduler.h b/kmail/jobscheduler.h
index 0c649a579..76f267b44 100644
--- a/kmail/jobscheduler.h
+++ b/kmail/jobscheduler.h
@@ -98,7 +98,7 @@ class JobScheduler : public TQObject
   TQ_OBJECT
   
 public:
-  JobScheduler( TQObject* parent, const char* name = 0 );
+  JobScheduler( TQObject* parent, const char* name = nullptr );
   ~JobScheduler();
 
   /// Register a task to be done for a given folder
diff --git a/kmail/keyresolver.cpp b/kmail/keyresolver.cpp
index c0b0cf692..3371ccc08 100644
--- a/kmail/keyresolver.cpp
+++ b/kmail/keyresolver.cpp
@@ -324,7 +324,7 @@ static std::vector<GpgME::Key> trustedOrConfirmed( const std::vector<GpgME::Key>
     msg += keysAsStrings( rewookies ).join(",");
   }
 
-  if( KMessageBox::warningContinueCancel( 0, msg, i18n("Not Fully Trusted Encryption Keys"),
+  if( KMessageBox::warningContinueCancel( nullptr, msg, i18n("Not Fully Trusted Encryption Keys"),
                                               KStdGuiItem::cont(),
                                               "not fully trusted encryption key warning" )
           == KMessageBox::Continue )
@@ -612,7 +612,7 @@ Kleo::KeyResolver::KeyResolver( bool encToSelf, bool showApproval, bool oppEncry
 }
 
 Kleo::KeyResolver::~KeyResolver() {
-  delete d; d = 0;
+  delete d; d = nullptr;
 }
 
 Kpgp::Result Kleo::KeyResolver::checkKeyNearExpiry( const GpgME::Key & key, const char * dontAskAgainName,
@@ -629,7 +629,7 @@ Kpgp::Result Kleo::KeyResolver::checkKeyNearExpiry( const GpgME::Key & key, cons
   if ( subkey.neverExpires() )
     return Kpgp::Ok;
   static const double secsPerDay = 24 * 60 * 60;
-  const double secsTillExpiry = ::difftime( subkey.expirationTime(), time(0) );
+  const double secsTillExpiry = ::difftime( subkey.expirationTime(), time(nullptr) );
   if ( secsTillExpiry <= 0 ) {
       const int daysSinceExpiry = 1 + int( -secsTillExpiry / secsPerDay );
       kdDebug() << "Key 0x" << key.shortKeyID() << " expired less than "
@@ -719,7 +719,7 @@ Kpgp::Result Kleo::KeyResolver::checkKeyNearExpiry( const GpgME::Key & key, cons
                          daysSinceExpiry ) ).arg( Kleo::DN( key.userID(0).id() ).prettyDN(),
                                                  key.issuerSerial() ) );
       d->alreadyWarnedFingerprints.insert( subkey.fingerprint() );
-      if ( KMessageBox::warningContinueCancel( 0, msg,
+      if ( KMessageBox::warningContinueCancel( nullptr, msg,
                                                key.protocol() == GpgME::Context::OpenPGP
                                                ? i18n("OpenPGP Key Expired" )
                                                : i18n("S/MIME Certificate Expired" ),
@@ -827,7 +827,7 @@ Kpgp::Result Kleo::KeyResolver::checkKeyNearExpiry( const GpgME::Key & key, cons
 		     daysTillExpiry ) ).arg( Kleo::DN( key.userID(0).id() ).prettyDN(),
 					     key.issuerSerial() ) );
     d->alreadyWarnedFingerprints.insert( subkey.fingerprint() );
-    if ( KMessageBox::warningContinueCancel( 0, msg,
+    if ( KMessageBox::warningContinueCancel( nullptr, msg,
 					     key.protocol() == GpgME::Context::OpenPGP
 					     ? i18n("OpenPGP Key Expires Soon" )
 					     : i18n("S/MIME Certificate Expires Soon" ),
@@ -872,7 +872,7 @@ Kpgp::Result Kleo::KeyResolver::setEncryptToSelfKeys( const TQStringList & finge
 			     "If you choose to continue, and the keys are needed "
 			     "later on, you will be prompted to specify the keys "
 			     "to use.");
-    return KMessageBox::warningContinueCancel( 0, msg, i18n("Unusable Encryption Keys"),
+    return KMessageBox::warningContinueCancel( nullptr, msg, i18n("Unusable Encryption Keys"),
 					       KStdGuiItem::cont(),
 					       "unusable own encryption key warning" )
       == KMessageBox::Continue ? Kpgp::Ok : Kpgp::Canceled ;
@@ -916,7 +916,7 @@ Kpgp::Result Kleo::KeyResolver::setSigningKeys( const TQStringList & fingerprint
 			     "If you choose to continue, and the keys are needed "
 			     "later on, you will be prompted to specify the keys "
 			     "to use.");
-    return KMessageBox::warningContinueCancel( 0, msg, i18n("Unusable Signing Keys"),
+    return KMessageBox::warningContinueCancel( nullptr, msg, i18n("Unusable Signing Keys"),
 					       KStdGuiItem::cont(),
 					       "unusable signing key warning" )
       == KMessageBox::Continue ? Kpgp::Ok : Kpgp::Canceled ;
@@ -1017,7 +1017,7 @@ Kleo::Action Kleo::KeyResolver::checkEncryptionPreferences( bool encryptionReque
     // try to minimize crypto ops (including key lookups) by only
     // looking up keys when at least one the the encryption
     // preferences needs it:
-    EncryptionPreferenceCounter count( 0, UnknownPreference );
+    EncryptionPreferenceCounter count( nullptr, UnknownPreference );
     count.process( d->mPrimaryEncryptionKeys );
     count.process( d->mSecondaryEncryptionKeys );
     if ( !count.numAlwaysEncrypt() &&
@@ -1200,7 +1200,7 @@ Kpgp::Result Kleo::KeyResolver::resolveEncryptionKeys( bool signingRequested ) {
 			       "You may continue without encrypting to yourself, "
 			       "but be aware that you will not be able to read your "
 			       "own messages if you do so.");
-      if ( KMessageBox::warningContinueCancel( 0, msg,
+      if ( KMessageBox::warningContinueCancel( nullptr, msg,
 					       i18n("Unusable Encryption Keys"),
 					       KStdGuiItem::cont(),
 					       "encrypt-to-self will fail warning" )
@@ -1227,7 +1227,7 @@ Kpgp::Result Kleo::KeyResolver::resolveEncryptionKeys( bool signingRequested ) {
 			       "You may continue without encrypting to yourself, "
 			       "but be aware that you will not be able to read your "
 			       "own messages if you do so.");
-      if ( KMessageBox::warningContinueCancel( 0, msg,
+      if ( KMessageBox::warningContinueCancel( nullptr, msg,
 					       i18n("Unusable Encryption Keys"),
 					       KStdGuiItem::cont(),
 					       "encrypt-to-self will fail warning" )
@@ -1254,7 +1254,7 @@ Kpgp::Result Kleo::KeyResolver::resolveSigningKeysForEncryption() {
 			     "OpenPGP, at least for some recipients;\n"
 			     "however, you have not configured valid "
 			     "OpenPGP signing certificates for this identity.");
-    if ( KMessageBox::warningContinueCancel( 0, msg,
+    if ( KMessageBox::warningContinueCancel( nullptr, msg,
 					     i18n("Unusable Signing Keys"),
 					     i18n("Do Not OpenPGP-Sign"),
 					     "signing will fail warning" )
@@ -1270,7 +1270,7 @@ Kpgp::Result Kleo::KeyResolver::resolveSigningKeysForEncryption() {
 			     "S/MIME, at least for some recipients;\n"
 			     "however, you have not configured valid "
 			     "S/MIME signing certificates for this identity.");
-    if ( KMessageBox::warningContinueCancel( 0, msg,
+    if ( KMessageBox::warningContinueCancel( nullptr, msg,
 					     i18n("Unusable Signing Keys"),
 					     i18n("Do Not S/MIME-Sign"),
 					     "signing will fail warning" )
@@ -1332,7 +1332,7 @@ Kpgp::Result Kleo::KeyResolver::resolveSigningKeysForSigningOnly() {
                            "showed no common type of signature matching your "
                            "available signing keys.\n"
                            "Send message without signing?"  );
-  if ( KMessageBox::warningContinueCancel( 0, msg, i18n("No signing possible"),
+  if ( KMessageBox::warningContinueCancel( nullptr, msg, i18n("No signing possible"),
                                            KStdGuiItem::cont() )
        == KMessageBox::Continue ) {
     d->mFormatInfoMap[OpenPGPMIMEFormat].splitInfos.push_back( SplitInfo( allRecipients() ) );
@@ -1490,7 +1490,7 @@ Kpgp::Result Kleo::KeyResolver::showKeyApprovalDialog() {
     const TQString msg = i18n("You did not select an encryption key for yourself "
 			     "(encrypt to self). You will not be able to decrypt "
 			     "your own message if you encrypt it.");
-    if ( KMessageBox::warningContinueCancel( 0, msg,
+    if ( KMessageBox::warningContinueCancel( nullptr, msg,
 					     i18n("Missing Key Warning"),
 					     i18n("&Encrypt") )
 	 == KMessageBox::Cancel )
@@ -1514,7 +1514,7 @@ Kpgp::Result Kleo::KeyResolver::showKeyApprovalDialog() {
                   : i18n("You did not select an encryption key for any of the "
                          "recipients of this message; therefore, the message "
                          "will not be encrypted.");
-    if ( KMessageBox::warningContinueCancel( 0, msg,
+    if ( KMessageBox::warningContinueCancel( nullptr, msg,
 					     i18n("Missing Key Warning"),
 					     i18n("Send &Unencrypted") )
 	 == KMessageBox::Cancel )
@@ -1528,7 +1528,7 @@ Kpgp::Result Kleo::KeyResolver::showKeyApprovalDialog() {
                          "the recipients: these persons will not be able to "
                          "decrypt the message if you encrypt it." );
     KCursorSaver idle( KBusyPtr::idle() );
-    if ( KMessageBox::warningContinueCancel( 0, msg,
+    if ( KMessageBox::warningContinueCancel( nullptr, msg,
 						 i18n("Missing Key Warning"),
 						 i18n("&Encrypt") )
 	 == KMessageBox::Cancel )
diff --git a/kmail/kmaccount.cpp b/kmail/kmaccount.cpp
index 0d36844af..d11c2f879 100644
--- a/kmail/kmaccount.cpp
+++ b/kmail/kmaccount.cpp
@@ -65,7 +65,7 @@ KMPrecommand::~KMPrecommand()
 bool KMPrecommand::start()
 {
   bool ok = mPrecommandProcess.start( TDEProcess::NotifyOnExit );
-  if (!ok) KMessageBox::error(0, i18n("Could not execute precommand '%1'.")
+  if (!ok) KMessageBox::error(nullptr, i18n("Could not execute precommand '%1'.")
     .arg(mPrecommand));
   return ok;
 }
@@ -76,7 +76,7 @@ void KMPrecommand::precommandExited(TDEProcess *p)
 {
   int exitCode = p->normalExit() ? p->exitStatus() : -1;
   if (exitCode)
-    KMessageBox::error(0, i18n("The precommand exited with code %1:\n%2")
+    KMessageBox::error(nullptr, i18n("The precommand exited with code %1:\n%2")
       .arg(exitCode).arg(strerror(exitCode)));
   emit finished(!exitCode);
 }
@@ -87,17 +87,17 @@ KMAccount::KMAccount(AccountManager* aOwner, const TQString& aName, uint id)
   : KAccount( id, aName ),
     mTrash(KMKernel::self()->trashFolder()->idString()),
     mOwner(aOwner),
-    mFolder(0),
-    mTimer(0),
+    mFolder(nullptr),
+    mTimer(nullptr),
     mInterval(0),
     mExclude(false),
     mCheckingMail(false),
     mPrecommandSuccess(true),
     mHasInbox(false),
-    mMailCheckProgressItem(0),
+    mMailCheckProgressItem(nullptr),
     mIdentityId(0)
 {
-  assert(aOwner != 0);
+  assert(aOwner);
 }
 
 void KMAccount::init() {
@@ -133,7 +133,7 @@ void KMAccount::setFolder(KMFolder* aFolder, bool addAccount)
 {
   if(!aFolder) {
     //kdDebug(5006) << "KMAccount::setFolder() : aFolder == 0" << endl;
-    mFolder = 0;
+    mFolder = nullptr;
     return;
   }
   mFolder = (KMAcctFolder*)aFolder;
@@ -145,7 +145,7 @@ void KMAccount::setFolder(KMFolder* aFolder, bool addAccount)
 void KMAccount::readConfig(TDEConfig& config)
 {
   TQString folderName;
-  mFolder = 0;
+  mFolder = nullptr;
   folderName = config.readEntry("Folder");
   setCheckInterval(config.readNumEntry("check-interval", 0));
   setTrash(config.readEntry("trash", kmkernel->trashFolder()->idString()));
@@ -217,10 +217,10 @@ bool KMAccount::processNewMsg(KMMessage* aMsg)
 {
   int rc, processResult;
 
-  assert(aMsg != 0);
+  assert(aMsg);
 
   // Save this one for readding
-  KMFolderCachedImap* parent = 0;
+  KMFolderCachedImap* parent = nullptr;
   if( type() == "cachedimap" )
     parent = static_cast<KMFolderCachedImap*>( aMsg->storage() );
 
@@ -251,7 +251,7 @@ if( fileD0.open( IO_WriteOnly ) ) {
   processResult = kmkernel->filterMgr()->process(aMsg,KMFilterMgr::Inbound,true,id());
   if (processResult == 2) {
     perror("Critical error: Unable to collect mail (out of space?)");
-    KMessageBox::information(0,(i18n("Critical error: "
+    KMessageBox::information(nullptr,(i18n("Critical error: "
       "Unable to collect mail: ")) + TQString::fromLocal8Bit(strerror(errno)));
     return false;
   }
@@ -274,7 +274,7 @@ if( fileD0.open( IO_WriteOnly ) ) {
 */
       if (rc) {
         perror("failed to add message");
-        KMessageBox::information(0, i18n("Failed to add message:\n") +
+        KMessageBox::information(nullptr, i18n("Failed to add message:\n") +
                                  TQString(strerror(rc)));
         return false;
       }
@@ -350,7 +350,7 @@ void KMAccount::installTimer()
   if (mInterval <= 0) return;
   if(!mTimer)
   {
-    mTimer = new TQTimer(0, "mTimer");
+    mTimer = new TQTimer(nullptr, "mTimer");
     connect(mTimer,TQ_SIGNAL(timeout()),TQ_SLOT(mailCheck()));
   }
   else
@@ -365,7 +365,7 @@ void KMAccount::installTimer()
 void KMAccount::deinstallTimer()
 {
   delete mTimer;
-  mTimer = 0;
+  mTimer = nullptr;
 }
 
 //-----------------------------------------------------------------------------
@@ -481,7 +481,7 @@ void KMAccount::checkDone( bool newmail, CheckStatus status )
     // set mMailCheckProgressItem = 0 before calling setComplete() to prevent
     // a race condition
     ProgressItem *savedMailCheckProgressItem = mMailCheckProgressItem;
-    mMailCheckProgressItem = 0;
+    mMailCheckProgressItem = nullptr;
     savedMailCheckProgressItem->setComplete(); // that will delete it
   }
 
diff --git a/kmail/kmaccount.h b/kmail/kmaccount.h
index 89d33dccc..0cb47104b 100644
--- a/kmail/kmaccount.h
+++ b/kmail/kmaccount.h
@@ -55,7 +55,7 @@ class KMPrecommand : public TQObject
   
 
 public:
-  KMPrecommand(const TQString &precommand, TQObject *parent = 0);
+  KMPrecommand(const TQString &precommand, TQObject *parent = nullptr);
   virtual ~KMPrecommand();
   bool start();
 
diff --git a/kmail/kmacctcachedimap.cpp b/kmail/kmacctcachedimap.cpp
index 07c3eb0a1..541e19747 100644
--- a/kmail/kmacctcachedimap.cpp
+++ b/kmail/kmacctcachedimap.cpp
@@ -57,7 +57,7 @@ using KMail::AccountManager;
 
 KMAcctCachedImap::KMAcctCachedImap( AccountManager* aOwner,
 				    const TQString& aAccountName, uint id )
-  : KMail::ImapAccountBase( aOwner, aAccountName, id ), mFolder( 0 ),
+  : KMail::ImapAccountBase( aOwner, aAccountName, id ), mFolder( nullptr ),
     mAnnotationCheckPassed(false),
     mGroupwareType( GroupwareKolab ),
     mSentCustomLoginCommand(false)
@@ -139,7 +139,7 @@ TQValueList<KMFolderCachedImap*> KMAcctCachedImap::killAllJobsInternal( bool dis
     // Kill the job - except if it's the one that already died and is calling us
     if ( !it.key()->error() && mSlave ) {
       it.key()->kill();
-      mSlave = 0; // killing a job, kills the slave
+      mSlave = nullptr; // killing a job, kills the slave
     }
   }
   mapJobData.clear();
@@ -151,7 +151,7 @@ TQValueList<KMFolderCachedImap*> KMAcctCachedImap::killAllJobsInternal( bool dis
 
   if ( disconnectSlave && mSlave ) {
     TDEIO::Scheduler::disconnectSlave( mSlave );
-    mSlave = 0;
+    mSlave = nullptr;
   }
   return folderList;
 }
@@ -261,7 +261,7 @@ void KMAcctCachedImap::postProcessNewMail( KMFolderCachedImap* folder, bool )
   disconnect(folder, TQ_SIGNAL(folderComplete(KMFolderCachedImap*, bool)),
              this, TQ_SLOT(postProcessNewMail(KMFolderCachedImap*, bool)));
   mMailCheckProgressItem->setComplete();
-  mMailCheckProgressItem = 0;
+  mMailCheckProgressItem = nullptr;
 
   if ( folder == mFolder ) {
     // We remove everything from the deleted folders list after a full sync.
diff --git a/kmail/kmacctfolder.cpp b/kmail/kmacctfolder.cpp
index 3d363e143..bc9a6c00d 100644
--- a/kmail/kmacctfolder.cpp
+++ b/kmail/kmacctfolder.cpp
@@ -11,7 +11,7 @@ KMAccount* KMAcctFolder::account()
 {
   if ( acctList() )
       return acctList()->first();
-  return 0;
+  return nullptr;
 }
 
 //-----------------------------------------------------------------------------
@@ -38,9 +38,9 @@ void KMAcctFolder::removeAccount( KMAccount* aAcct )
   if ( !aAcct || !acctList() ) return;
 
   acctList()->remove( aAcct );
-  aAcct->setFolder( 0 );
+  aAcct->setFolder( nullptr );
   if ( acctList()->count() <= 0 ) {
     delete acctList();
-    setAcctList( 0 );
+    setAcctList( nullptr );
   }
 }
diff --git a/kmail/kmacctimap.cpp b/kmail/kmacctimap.cpp
index 72f7c1837..9fe727363 100644
--- a/kmail/kmacctimap.cpp
+++ b/kmail/kmacctimap.cpp
@@ -58,10 +58,10 @@ using KPIM::ProgressManager;
 KMAcctImap::KMAcctImap(AccountManager* aOwner, const TQString& aAccountName, uint id):
   KMail::ImapAccountBase(aOwner, aAccountName, id),
   mCountRemainChecks( 0 ),
-  mErrorTimer( 0, "mErrorTimer" )
+  mErrorTimer( nullptr, "mErrorTimer" )
 {
-  mFolder = 0;
-  mScheduler = 0;
+  mFolder = nullptr;
+  mScheduler = nullptr;
   mNoopTimer.start( 60000 ); // // send a noop every minute
   mOpenFolders.setAutoDelete(true);
   connect(kmkernel->imapFolderMgr(), TQ_SIGNAL(changed()),
@@ -172,7 +172,7 @@ void KMAcctImap::killAllJobs( bool disconnectSlave )
   if (mSlave && mapJobData.begin() != mapJobData.end())
   {
     mSlave->kill();
-    mSlave = 0;
+    mSlave = nullptr;
   }
   // remove the jobs
   mapJobData.clear();
@@ -194,7 +194,7 @@ void KMAcctImap::killAllJobs( bool disconnectSlave )
   }
   if ( disconnectSlave && slave() ) {
     TDEIO::Scheduler::disconnectSlave( slave() );
-    mSlave = 0;
+    mSlave = nullptr;
   }
 }
 
@@ -428,8 +428,8 @@ void KMAcctImap::postProcessNewMail( KMFolder * folder )
 
   while (filterIt != mFilterSerNums.end()) {
     int idx = -1;
-    KMFolder *folder = 0;
-    KMMessage *msg = 0;
+    KMFolder *folder = nullptr;
+    KMMessage *msg = nullptr;
     KMMsgDict::instance()->getLocation( *filterIt, &folder, &idx );
     // It's possible that the message has been deleted or moved into a
     // different folder, or that the serNum is stale
@@ -609,7 +609,7 @@ int KMAcctImap::slotFilterMsg( KMMessage *msg )
   }
   if (msg->parent()) { // unGet this msg
     int idx = -1;
-    KMFolder * p = 0;
+    KMFolder * p = nullptr;
     KMMsgDict::instance()->getLocation( msg, &p, &idx );
     assert( p == msg->parent() ); assert( idx >= 0 );
     p->unGetMsg( idx );
diff --git a/kmail/kmacctlocal.cpp b/kmail/kmacctlocal.cpp
index fc045a330..26b6f641b 100644
--- a/kmail/kmacctlocal.cpp
+++ b/kmail/kmacctlocal.cpp
@@ -32,7 +32,7 @@ using KPIM::ProgressManager;
 KMAcctLocal::KMAcctLocal(AccountManager* aOwner, const TQString& aAccountName, uint id):
   KMAccount(aOwner, aAccountName, id), mHasNewMail( false ),
   mAddedOk( true ), mNumMsgs( 0 ),
-  mMsgsFetched( 0 ), mMailFolder( 0 )
+  mMsgsFetched( 0 ), mMailFolder( nullptr )
 {
   mLock = procmail_lockfile;
 }
@@ -109,7 +109,7 @@ bool KMAcctLocal::preProcess()
     }
   }
 
-  mMailFolder = new KMFolder( 0, location(), KMFolderTypeMbox,
+  mMailFolder = new KMFolder( nullptr, location(), KMFolderTypeMbox,
                               false /* no index */, false /* don't export sernums */ );
   KMFolderMbox* mboxStorage =
     static_cast<KMFolderMbox*>(mMailFolder->storage());
@@ -151,7 +151,7 @@ bool KMAcctLocal::preProcess()
     TQString aStr;
     aStr = i18n("Cannot open file:");
     aStr += mMailFolder->path()+"/"+mMailFolder->name();
-    KMessageBox::sorry(0, aStr);
+    KMessageBox::sorry(nullptr, aStr);
     kdDebug(5006) << "cannot open file " << mMailFolder->path() << "/"
       << mMailFolder->name() << endl;
     checkDone( mHasNewMail, CheckError );
@@ -241,7 +241,7 @@ void KMAcctLocal::postProcess()
     kmkernel->folderMgr()->syncAllFolders();
     const int rc = mMailFolder->expunge();
     if ( rc != 0 ) {
-      KMessageBox::queuedMessageBox( 0, KMessageBox::Information,
+      KMessageBox::queuedMessageBox( nullptr, KMessageBox::Information,
                                      i18n( "<qt>Cannot remove mail from "
                                            "mailbox <b>%1</b>:<br>%2</qt>" )
                                      .arg( mMailFolder->location() )
@@ -255,13 +255,13 @@ void KMAcctLocal::postProcess()
               "Fetched %n messages from mailbox %1.",
               mNumMsgs ).arg( mMailFolder->location() ) );
       mMailCheckProgressItem->setComplete();
-      mMailCheckProgressItem = 0;
+      mMailCheckProgressItem = nullptr;
     }
   }
   // else warning is written already
 
   mMailFolder->close("acctlocalMail");
-  delete mMailFolder; mMailFolder = 0;
+  delete mMailFolder; mMailFolder = nullptr;
 
   mFolder->close("acctlocalFold");
 
diff --git a/kmail/kmacctmaildir.cpp b/kmail/kmacctmaildir.cpp
index 1770480de..de6017e01 100644
--- a/kmail/kmacctmaildir.cpp
+++ b/kmail/kmacctmaildir.cpp
@@ -91,7 +91,7 @@ void KMAcctMaildir::processNewMail(bool)
     }
   }
 
-  KMFolder mailFolder(0, location(), KMFolderTypeMaildir,
+  KMFolder mailFolder(nullptr, location(), KMFolderTypeMaildir,
                               false /* no index */, false /* don't export sernums */);
 
   long num = 0;
@@ -131,7 +131,7 @@ void KMAcctMaildir::processNewMail(bool)
   if (rc)
   {
     TQString aStr = i18n("<qt>Cannot open folder <b>%1</b>.</qt>").arg( mailFolder.location() );
-    KMessageBox::sorry(0, aStr);
+    KMessageBox::sorry(nullptr, aStr);
     kdDebug(5006) << "cannot open folder " << mailFolder.location() << endl;
     checkDone( hasNewMail, CheckError );
     BroadcastStatus::instance()->setStatusMsg( i18n( "Transmission failed." ));
@@ -195,7 +195,7 @@ void KMAcctMaildir::processNewMail(bool)
             num ).arg(mailFolder.location() ) );
 
     mMailCheckProgressItem->setComplete();
-    mMailCheckProgressItem = 0;
+    mMailCheckProgressItem = nullptr;
   }
   if (addedOk)
   {
diff --git a/kmail/kmacctseldlg.h b/kmail/kmacctseldlg.h
index d3f02b2f3..6797270e4 100644
--- a/kmail/kmacctseldlg.h
+++ b/kmail/kmacctseldlg.h
@@ -33,7 +33,7 @@ class KMAcctSelDlg: public KDialogBase
   
 
   public:
-    KMAcctSelDlg( TQWidget *parent=0, const char *name=0, bool modal=true );
+    KMAcctSelDlg( TQWidget *parent=nullptr, const char *name=nullptr, bool modal=true );
 
     /**
      * Returns selected button from the account selection group:
diff --git a/kmail/kmail_options.h b/kmail/kmail_options.h
index e5b327ec0..b0c08e938 100644
--- a/kmail/kmail_options.h
+++ b/kmail/kmail_options.h
@@ -6,23 +6,23 @@
 
 TDECmdLineOptions kmail_options[] =
 {
-  { "s", 0 , 0 },
-  { "subject <subject>",	I18N_NOOP("Set subject of message"), 0 },
-  { "c", 0 , 0 },
-  { "cc <address>",		I18N_NOOP("Send CC: to 'address'"), 0 },
-  { "b", 0 , 0 },
-  { "bcc <address>",		I18N_NOOP("Send BCC: to 'address'"), 0 },
-  { "h", 0 , 0 },
-  { "header <header>",		I18N_NOOP("Add 'header' to message"), 0 },
-  { "msg <file>",		I18N_NOOP("Read message body from 'file'"), 0 },
-  { "body <text>",              I18N_NOOP("Set body of message"), 0 },
-  { "attach <url>",             I18N_NOOP("Add an attachment to the mail. This can be repeated"), 0 },
-  { "check",			I18N_NOOP("Only check for new mail"), 0 },
-  { "composer",			I18N_NOOP("Only open composer window"), 0 },
-  { "view <url>",               I18N_NOOP("View the given message file" ), 0 },
+  { "s", nullptr , nullptr },
+  { "subject <subject>",	I18N_NOOP("Set subject of message"), nullptr },
+  { "c", nullptr , nullptr },
+  { "cc <address>",		I18N_NOOP("Send CC: to 'address'"), nullptr },
+  { "b", nullptr , nullptr },
+  { "bcc <address>",		I18N_NOOP("Send BCC: to 'address'"), nullptr },
+  { "h", nullptr , nullptr },
+  { "header <header>",		I18N_NOOP("Add 'header' to message"), nullptr },
+  { "msg <file>",		I18N_NOOP("Read message body from 'file'"), nullptr },
+  { "body <text>",              I18N_NOOP("Set body of message"), nullptr },
+  { "attach <url>",             I18N_NOOP("Add an attachment to the mail. This can be repeated"), nullptr },
+  { "check",			I18N_NOOP("Only check for new mail"), nullptr },
+  { "composer",			I18N_NOOP("Only open composer window"), nullptr },
+  { "view <url>",               I18N_NOOP("View the given message file" ), nullptr },
   { "+[address|URL]",		I18N_NOOP("Send message to 'address' resp. "
                                           "attach the file the 'URL' points "
-                                          "to"), 0 },
+                                          "to"), nullptr },
 //  { "+[file]",                  I18N_NOOP("Show message from 'file'"), 0 },
   TDECmdLineLastOption
 };
diff --git a/kmail/kmail_part.cpp b/kmail/kmail_part.cpp
index 1add4e7ae..a7b6f9e5a 100644
--- a/kmail/kmail_part.cpp
+++ b/kmail/kmail_part.cpp
@@ -181,7 +181,7 @@ void KMailPart::exportFolder( KMFolder *folder )
 {
   KMFolderTreeItem* fti = static_cast< KMFolderTreeItem* >( mainWidget->folderTree()->currentItem() );
 
-  if ( folder != 0 )
+  if (folder)
     emit textChanged( folder->label() );
 
   if ( fti )
diff --git a/kmail/kmailicalifaceimpl.cpp b/kmail/kmailicalifaceimpl.cpp
index 451435073..159ed486d 100644
--- a/kmail/kmailicalifaceimpl.cpp
+++ b/kmail/kmailicalifaceimpl.cpp
@@ -155,9 +155,9 @@ ExtraFolder::~ExtraFolder()
 */
 
 KMailICalIfaceImpl::KMailICalIfaceImpl()
-  : DCOPObject( "KMailICalIface" ), TQObject( 0, "KMailICalIfaceImpl" ),
-    mContacts( 0 ), mCalendar( 0 ), mNotes( 0 ), mTasks( 0 ), mJournals( 0 ),
-    mFolderLanguage( 0 ), mFolderParentDir( 0 ), mFolderType( KMFolderTypeUnknown ),
+  : DCOPObject( "KMailICalIface" ), TQObject( nullptr, "KMailICalIfaceImpl" ),
+    mContacts( nullptr ), mCalendar( nullptr ), mNotes( nullptr ), mTasks( nullptr ), mJournals( nullptr ),
+    mFolderLanguage( 0 ), mFolderParentDir( nullptr ), mFolderType( KMFolderTypeUnknown ),
     mUseResourceIMAP( false ), mResourceQuiet( false ), mHideFolders( true )
 {
   // Listen to config changes
@@ -197,7 +197,7 @@ static DwBodyPart* findBodyPartByMimeType( const KMMessage& msg, const char* sTy
     }
     part = part->Next();
   }
-  return 0;
+  return nullptr;
 }
 
 // Helper function to find an attachment with a given filename
@@ -213,7 +213,7 @@ static DwBodyPart* findBodyPart( const KMMessage& msg, const TQString& attachmen
     if ( part->hasHeaders() && attachmentName == part->Headers().ContentType().Name().c_str() )
       return part;
   }
-  return 0;
+  return nullptr;
 }
 
 #if 0
@@ -640,7 +640,7 @@ void KMailICalIfaceImpl::slotMessageRetrieved( KMMessage* msg )
   if ( mTheUnGetMes.contains( sernum ) ) {
     mTheUnGetMes.remove( sernum );
     int i = 0;
-    KMFolder* folder = 0;
+    KMFolder* folder = nullptr;
     KMMsgDict::instance()->getLocation( sernum, &folder, &i );
     folder->unGetMsg( i );
   }
@@ -844,7 +844,7 @@ TQ_UINT32 KMailICalIfaceImpl::update( const TQString& resource,
 
   f->open( "ifaceupdate" );
 
-  KMMessage* msg = 0;
+  KMMessage* msg = nullptr;
   if ( sernum != 0 ) {
     msg = findMessageBySerNum( sernum, f );
     if ( !msg ) return 0;
@@ -855,7 +855,7 @@ TQ_UINT32 KMailICalIfaceImpl::update( const TQString& resource,
     const TQMap<TQCString, TQString>::ConstIterator ithEnd = customHeaders.begin();
     for ( ; ith != ithEnd ; ++ith )
       newMsg->setHeaderField( ith.key(), ith.data() );
-    newMsg->setParent( 0 ); // workaround strange line in KMMsgBase::assign. newMsg is not in any folder yet.
+    newMsg->setParent( nullptr ); // workaround strange line in KMMsgBase::assign. newMsg is not in any folder yet.
     // Note that plainTextBody isn't used in this branch. We assume it's still valid from when the mail was created.
 
     // Delete some attachments according to list
@@ -1093,7 +1093,7 @@ void KMailICalIfaceImpl::slotIncidenceAdded( KMFolder* folder,
   }
   // Get the index of the mail
   int i = 0;
-  KMFolder* aFolder = 0;
+  KMFolder* aFolder = nullptr;
   KMMsgDict::instance()->getLocation( sernum, &aFolder, &i );
   assert( folder == aFolder );
 
@@ -1160,7 +1160,7 @@ void KMailICalIfaceImpl::slotIncidenceDeleted( KMFolder* folder,
   if( !type.isEmpty() ) {
     // Get the index of the mail
     int i = 0;
-    KMFolder* aFolder = 0;
+    KMFolder* aFolder = nullptr;
     KMMsgDict::instance()->getLocation( sernum, &aFolder, &i );
     assert( folder == aFolder );
 
@@ -1229,7 +1229,7 @@ KMFolder* KMailICalIfaceImpl::folderFromType( const TQString& type,
                                               const TQString& folder )
 {
   if( mUseResourceIMAP ) {
-    KMFolder* f = 0;
+    KMFolder* f = nullptr;
     if ( !folder.isEmpty() ) {
       f = extraFolder( type, folder );
       if ( f )
@@ -1248,7 +1248,7 @@ KMFolder* KMailICalIfaceImpl::folderFromType( const TQString& type,
     kdError(5006) << "No folder ( " << type << ", " << folder << " )" << endl;
   }
 
-  return 0;
+  return nullptr;
 }
 
 
@@ -1257,7 +1257,7 @@ KMFolder* KMailICalIfaceImpl::folderFromType( const TQString& type,
 bool KMailICalIfaceImpl::isResourceFolder( KMFolder* folder ) const
 {
   return mUseResourceIMAP && folder &&
-    ( isStandardResourceFolder( folder ) || mExtraFolders.find( folder->location() )!=0 );
+    ( isStandardResourceFolder( folder ) || mExtraFolders.find(folder->location()) );
 }
 
 bool KMailICalIfaceImpl::isStandardResourceFolder( KMFolder* folder ) const
@@ -1352,7 +1352,7 @@ TQString KMailICalIfaceImpl::folderName( KFolderTreeItem::Type type, int languag
 // Find message matching a given UID
 KMMessage *KMailICalIfaceImpl::findMessageByUID( const TQString& uid, KMFolder* folder )
 {
-  if( !folder || !mUIDToSerNum.contains( uid ) ) return 0;
+  if( !folder || !mUIDToSerNum.contains( uid ) ) return nullptr;
   int i;
   KMFolder *aFolder;
   KMMsgDict::instance()->getLocation( mUIDToSerNum[uid], &aFolder, &i );
@@ -1363,10 +1363,10 @@ KMMessage *KMailICalIfaceImpl::findMessageByUID( const TQString& uid, KMFolder*
 // Find message matching a given serial number
 KMMessage *KMailICalIfaceImpl::findMessageBySerNum( TQ_UINT32 serNum, KMFolder* folder )
 {
-  if( !folder ) return 0;
+  if( !folder ) return nullptr;
 
-  KMMessage *message = 0;
-  KMFolder* aFolder = 0;
+  KMMessage *message = nullptr;
+  KMFolder* aFolder = nullptr;
   int index;
   KMMsgDict::instance()->getLocation( serNum, &aFolder, &index );
 
@@ -1467,13 +1467,13 @@ KMFolder* KMailICalIfaceImpl::extraFolder( const TQString& type,
   // use that
   int t = folderContentsType( type );
   if ( t < 1 || t > 5 )
-    return 0;
+    return nullptr;
 
   ExtraFolder* ef = mExtraFolders.find( folder );
   if ( ef && ef->folder && ef->folder->storage()->contentsType() == t )
     return ef->folder;
 
-  return 0;
+  return nullptr;
 }
 
 KMailICalIfaceImpl::StorageFormat KMailICalIfaceImpl::storageFormat( KMFolder* folder ) const
@@ -1650,7 +1650,7 @@ KMFolder* KMailICalIfaceImpl::findResourceFolder( const TQString& resource )
     return ef->folder;
 
   // No luck at all
-  return 0;
+  return nullptr;
 }
 
 void KMailICalIfaceImpl::changeResourceUIName( const TQString &folderPath, const TQString &newName )
@@ -1708,7 +1708,7 @@ void KMailICalIfaceImpl::readConfig()
   KMFolderDir* folderParentDir;
   KMFolderType folderType;
   KMFolder* folderParent = kmkernel->findFolderById( parentName );
-  if( folderParent == 0 ) {
+  if(!folderParent) {
     // Parent folder not found. It was probably deleted. The user will have to
     // configure things again.
     kdDebug(5006) << "Groupware folder " << parentName << " not found. Groupware functionality disabled" << endl;
@@ -1724,11 +1724,11 @@ void KMailICalIfaceImpl::readConfig()
     }
     mUseResourceIMAP = false;
     // We can't really call cleanup(), if those folders were completely deleted.
-    mCalendar = 0;
-    mTasks    = 0;
-    mJournals = 0;
-    mContacts = 0;
-    mNotes    = 0;
+    mCalendar = nullptr;
+    mTasks    = nullptr;
+    mJournals = nullptr;
+    mContacts = nullptr;
+    mNotes    = nullptr;
     return;
   } else {
     folderParentDir = folderParent->createChildFolder();
@@ -1771,7 +1771,7 @@ void KMailICalIfaceImpl::readConfig()
 
     if( noneFound || mustFix ) {
       TQString msg;
-      TQString parentFolderName = folderParent != 0 ? folderParent->name() : folderParentDir->name();
+      TQString parentFolderName = folderParent ? folderParent->name() : folderParentDir->name();
       if ( noneFound ) {
         // No subfolder was found, so ask if we can make them
         msg = i18n("KMail will now create the required groupware folders"
@@ -1798,13 +1798,13 @@ void KMailICalIfaceImpl::readConfig()
 
       }
 
-      if( KMessageBox::questionYesNo( 0, msg,
+      if( KMessageBox::questionYesNo( nullptr, msg,
                                       i18n("Standard Groupware Folders"), KStdGuiItem::cont(), KStdGuiItem::cancel() ) == KMessageBox::No ) {
 
         GlobalSettings::self()->setTheIMAPResourceEnabled( false );
         mUseResourceIMAP = false;
-        mFolderParentDir = 0;
-        mFolderParent = 0;
+        mFolderParentDir = nullptr;
+        mFolderParent = nullptr;
         reloadFolderTree();
         return;
       }
@@ -1888,7 +1888,7 @@ void KMailICalIfaceImpl::readConfig()
     // Set the new folders
     mCalendar = initScalixFolder( KMail::ContentsTypeCalendar );
     mTasks    = initScalixFolder( KMail::ContentsTypeTask );
-    mJournals = 0;
+    mJournals = nullptr;
     mContacts = initScalixFolder( KMail::ContentsTypeContact );
     mNotes    = initScalixFolder( KMail::ContentsTypeNote );
 
@@ -2016,9 +2016,9 @@ KMFolder* KMailICalIfaceImpl::initFolder( KMail::FolderContentsType contentsType
   }
 
   if( folder->canAccess() != 0 ) {
-    KMessageBox::sorry(0, i18n("You do not have read/write permission to your %1 folder.")
+    KMessageBox::sorry(nullptr, i18n("You do not have read/write permission to your %1 folder.")
                        .arg( folderName( itemType ) ) );
-    return 0;
+    return nullptr;
   }
   folder->storage()->setContentsType( contentsType );
   folder->setSystemFolder( true );
@@ -2034,7 +2034,7 @@ KMFolder* KMailICalIfaceImpl::initScalixFolder( KMail::FolderContentsType conten
   KMFolderType type = mFolderType;
   if( type == KMFolderTypeUnknown ) type = KMFolderTypeMaildir;
 
-  KMFolder* folder = 0;
+  KMFolder* folder = nullptr;
 
   // Find all extra folders
   TQStringList folderNames;
@@ -2062,7 +2062,7 @@ KMFolder* KMailICalIfaceImpl::initScalixFolder( KMail::FolderContentsType conten
   }
 
   if ( !folder ) {
-    return 0;
+    return nullptr;
   } else {
     FolderInfo info = readFolderInfo( folder );
     mFolderInfoMap.insert( folder, info );
@@ -2070,8 +2070,8 @@ KMFolder* KMailICalIfaceImpl::initScalixFolder( KMail::FolderContentsType conten
   }
 
   if( folder->canAccess() != 0 ) {
-    KMessageBox::sorry(0, i18n("You do not have read/write permission to your folder.") );
-    return 0;
+    KMessageBox::sorry(nullptr, i18n("You do not have read/write permission to your folder.") );
+    return nullptr;
   }
   folder->storage()->setContentsType( contentsType );
   folder->setSystemFolder( true );
@@ -2130,7 +2130,7 @@ void KMailICalIfaceImpl::cleanup()
   cleanupFolder( mTasks, this );
   cleanupFolder( mJournals, this );
 
-  mContacts = mCalendar = mNotes = mTasks = mJournals = 0;
+  mContacts = mCalendar = mNotes = mTasks = mJournals = nullptr;
 }
 
 TQString KMailICalIfaceImpl::folderPixmap( KFolderTreeItem::Type type ) const
@@ -2229,7 +2229,7 @@ KMailICalIfaceImpl::StandardFolderSearchResult KMailICalIfaceImpl::findStandardR
       return StandardFolderSearchResult( static_cast<KMFolder *>( node ), StandardFolderSearchResult::FoundByName );
 
     kdDebug(5006) << "findStandardResourceFolder: found no resource folder for " << s_folderContentsType[contentsType].annotation << endl;
-    return StandardFolderSearchResult( 0, StandardFolderSearchResult::NotFound );
+    return StandardFolderSearchResult( nullptr, StandardFolderSearchResult::NotFound );
   }
   else // icalvcard: look up standard resource folders by name
   {
@@ -2238,7 +2238,7 @@ KMailICalIfaceImpl::StandardFolderSearchResult KMailICalIfaceImpl::findStandardR
     if( folderLanguage > 3 ) folderLanguage = 0;
     KMFolderNode* node = folderParentDir->hasNamedFolder( folderName( itemType, folderLanguage ) );
     if ( !node || node->isDir() )
-      return StandardFolderSearchResult( 0, StandardFolderSearchResult::NotFound );
+      return StandardFolderSearchResult( nullptr, StandardFolderSearchResult::NotFound );
     return StandardFolderSearchResult( static_cast<KMFolder*>( node ), StandardFolderSearchResult::FoundAndStandard );
   }
 }
@@ -2298,7 +2298,7 @@ bool KMailICalIfaceImpl::addSubresource( const TQString& resource,
 
   TQString msg;
   if ( parentFolderDir->owner() && !parentFolderDir->owner()->isValidName( resource, msg ) ) {
-    KMessageBox::error( 0, msg );
+    KMessageBox::error( nullptr, msg );
     return false;
   }
 
diff --git a/kmail/kmailicalifaceimpl.h b/kmail/kmailicalifaceimpl.h
index b047ed986..d7ae05273 100644
--- a/kmail/kmailicalifaceimpl.h
+++ b/kmail/kmailicalifaceimpl.h
@@ -262,7 +262,7 @@ private:
   struct StandardFolderSearchResult
   {
     enum FoundEnum { FoundAndStandard, NotFound, FoundByType, FoundByName };
-    StandardFolderSearchResult() : folder( 0 ) {}
+    StandardFolderSearchResult() : folder( nullptr ) {}
     StandardFolderSearchResult( KMFolder* f, FoundEnum e ) : folder( f ), found( e ) {}
     StandardFolderSearchResult( const TQValueList<KMFolder*> &f, FoundEnum e ) :
         folder( f.first() ), folders( f ), found( e ) {}
diff --git a/kmail/kmatmlistview.cpp b/kmail/kmatmlistview.cpp
index f8a573ed2..58e536207 100644
--- a/kmail/kmatmlistview.cpp
+++ b/kmail/kmatmlistview.cpp
@@ -29,11 +29,11 @@ KMAtmListViewItem::KMAtmListViewItem( TQListView *parent )
 KMAtmListViewItem::~KMAtmListViewItem()
 {
   delete mCBEncrypt;
-  mCBEncrypt = 0;
+  mCBEncrypt = nullptr;
   delete mCBSign;
-  mCBSign = 0;
+  mCBSign = nullptr;
   delete mCBCompress;
-  mCBCompress = 0;
+  mCBCompress = nullptr;
 }
 
 void KMAtmListViewItem::updateCheckBox( int headerSection, TQCheckBox *cb )
diff --git a/kmail/kmcommands.cpp b/kmail/kmcommands.cpp
index 704783f6d..db537a8c1 100644
--- a/kmail/kmcommands.cpp
+++ b/kmail/kmcommands.cpp
@@ -157,26 +157,26 @@ private:
 
 
 KMCommand::KMCommand( TQWidget *parent )
-  : mProgressDialog( 0 ), mResult( Undefined ), mDeletesItself( false ),
+  : mProgressDialog( nullptr ), mResult( Undefined ), mDeletesItself( false ),
     mEmitsCompletedItself( false ), mParent( parent )
 {
 }
 
 KMCommand::KMCommand( TQWidget *parent, const TQPtrList<KMMsgBase> &msgList )
-  : mProgressDialog( 0 ), mResult( Undefined ), mDeletesItself( false ),
+  : mProgressDialog( nullptr ), mResult( Undefined ), mDeletesItself( false ),
     mEmitsCompletedItself( false ), mParent( parent ), mMsgList( msgList )
 {
 }
 
 KMCommand::KMCommand( TQWidget *parent, KMMsgBase *msgBase )
-  : mProgressDialog( 0 ), mResult( Undefined ), mDeletesItself( false ),
+  : mProgressDialog( nullptr ), mResult( Undefined ), mDeletesItself( false ),
     mEmitsCompletedItself( false ), mParent( parent )
 {
   mMsgList.append( msgBase );
 }
 
 KMCommand::KMCommand( TQWidget *parent, KMMessage *msg )
-  : mProgressDialog( 0 ), mResult( Undefined ), mDeletesItself( false ),
+  : mProgressDialog( nullptr ), mResult( Undefined ), mDeletesItself( false ),
     mEmitsCompletedItself( false ), mParent( parent )
 {
   if (msg)
@@ -229,14 +229,14 @@ void KMCommand::slotStart()
            this, TQ_SLOT( slotPostTransfer( KMCommand::Result ) ) );
   kmkernel->filterMgr()->ref();
 
-  if (mMsgList.find(0) != -1) {
+  if (mMsgList.find(nullptr) != -1) {
       emit messagesTransfered( Failed );
       return;
   }
 
   if ((mMsgList.count() == 1) &&
       (mMsgList.getFirst()->isMessage()) &&
-      (mMsgList.getFirst()->parent() == 0))
+      !mMsgList.getFirst()->parent())
   {
     // Special case of operating on message that isn't in a folder
     mRetrievedMsgs.append((KMMessage*)mMsgList.getFirst());
@@ -268,7 +268,7 @@ void KMCommand::slotPostTransfer( KMCommand::Result result )
   mResult = result;
   TQPtrListIterator<KMMessage> it( mRetrievedMsgs );
   KMMessage* msg;
-  while ( (msg = it.current()) != 0 )
+  while ((msg = it.current()) != nullptr)
   {
     ++it;
     if (msg->parent())
@@ -310,7 +310,7 @@ void KMCommand::transferSelectedMsgs()
   for (KMMsgBase *mb = mMsgList.first(); mb; mb = mMsgList.next())
   {
     // check if all messages are complete
-    KMMessage *thisMsg = 0;
+    KMMessage *thisMsg = nullptr;
     if ( mb->isMessage() )
       thisMsg = static_cast<KMMessage*>(mb);
     else
@@ -358,7 +358,7 @@ void KMCommand::transferSelectedMsgs()
   if (complete)
   {
     delete mProgressDialog;
-    mProgressDialog = 0;
+    mProgressDialog = nullptr;
     emit messagesTransfered( OK );
   } else {
     // wait for the transfer and tell the progressBar the necessary steps
@@ -410,7 +410,7 @@ void KMCommand::slotJobFinished()
   {
     // all done
     delete mProgressDialog;
-    mProgressDialog = 0;
+    mProgressDialog = nullptr;
     emit messagesTransfered( OK );
   }
 }
@@ -434,7 +434,7 @@ void KMCommand::slotTransferCancelled()
   // unget the transfered messages
   TQPtrListIterator<KMMessage> it( mRetrievedMsgs );
   KMMessage* msg;
-  while ( (msg = it.current()) != 0 )
+  while ((msg = it.current()) != nullptr)
   {
     KMFolder *folder = msg->parent();
     ++it;
@@ -638,7 +638,7 @@ KMCommand::Result KMUrlSaveCommand::execute()
     return Canceled;
   if ( TDEIO::NetAccess::exists( saveUrl, false, parentWidget() ) )
   {
-    if (KMessageBox::warningContinueCancel(0,
+    if (KMessageBox::warningContinueCancel(nullptr,
         i18n("<qt>File <b>%1</b> exists.<br>Do you want to replace it?</qt>")
         .arg(saveUrl.prettyURL()), i18n("Save to File"), i18n("&Replace"))
         != KMessageBox::Continue)
@@ -785,7 +785,7 @@ static KURL subjectToUrl( const TQString & subject )
 KMSaveMsgCommand::KMSaveMsgCommand( TQWidget *parent, KMMessage * msg )
   : KMCommand( parent ),
     mMsgListIndex( 0 ),
-    mStandAloneMessage( 0 ),
+    mStandAloneMessage( nullptr ),
     mOffset( 0 ),
     mTotalSize( msg ? msg->msgSize() : 0 )
 {
@@ -810,7 +810,7 @@ KMSaveMsgCommand::KMSaveMsgCommand( TQWidget *parent,
                                     const TQPtrList<KMMsgBase> &msgList )
   : KMCommand( parent ),
     mMsgListIndex( 0 ),
-    mStandAloneMessage( 0 ),
+    mStandAloneMessage( nullptr ),
     mOffset( 0 ),
     mTotalSize( 0 )
 {
@@ -826,7 +826,7 @@ KMSaveMsgCommand::KMSaveMsgCommand( TQWidget *parent,
   while ( it.current() ) {
     mMsgList.append( (*it)->getMsgSerNum() );
     mTotalSize += (*it)->msgSize();
-    if ((*it)->parent() != 0)
+    if ((*it)->parent())
       (*it)->parent()->open("kmcommand");
     ++it;
   }
@@ -869,9 +869,9 @@ void KMSaveMsgCommand::slotSaveDataReq()
   }
   // No leftovers, process next message.
   if ( mMsgListIndex < mMsgList.size() ) {
-    KMMessage *msg = 0;
+    KMMessage *msg = nullptr;
     int idx = -1;
-    KMFolder * p = 0;
+    KMFolder * p = nullptr;
     KMMsgDict::instance()->getLocation( mMsgList[mMsgListIndex], &p, &idx );
     assert( p );
     assert( idx >= 0 );
@@ -912,7 +912,7 @@ void KMSaveMsgCommand::slotSaveDataReq()
     if ( mStandAloneMessage ) {
       // do the special case of a standalone message
       slotMessageRetrievedForSaving( mStandAloneMessage );
-      mStandAloneMessage = 0;
+      mStandAloneMessage = nullptr;
     } else {
       // No more messages. Tell the putjob we are done.
       TQByteArray data = TQByteArray();
@@ -947,7 +947,7 @@ void KMSaveMsgCommand::slotMessageRetrievedForSaving(KMMessage *msg)
   if ( msg && msg->parent() && msg->getMsgSerNum() &&
        mUngetMsgs.contains( msg ) ) {
     int idx = -1;
-    KMFolder * p = 0;
+    KMFolder * p = nullptr;
     KMMsgDict::instance()->getLocation( msg, &p, &idx );
     assert( p == msg->parent() ); assert( idx >= 0 );
     p->unGetMsg( idx );
@@ -961,7 +961,7 @@ void KMSaveMsgCommand::slotSaveResult(TDEIO::Job *job)
   {
     if (job->error() == TDEIO::ERR_FILE_ALREADY_EXIST)
     {
-      if (KMessageBox::warningContinueCancel(0,
+      if (KMessageBox::warningContinueCancel(nullptr,
         i18n("File %1 exists.\nDo you want to replace it?")
         .arg(mUrl.prettyURL()), i18n("Save to File"), i18n("&Replace"))
         == KMessageBox::Continue) {
@@ -1073,7 +1073,7 @@ void KMOpenMsgCommand::slotResult( TDEIO::Job *job )
     if ( dwMsg->Headers().NumFields() == 0 ) {
       KMessageBox::sorry( parentWidget(),
                           i18n( "The file does not contain a message." ) );
-      delete dwMsg; dwMsg = 0;
+      delete dwMsg; dwMsg = nullptr;
       setResult( Failed );
       emit completed( this );
       // Emulate closing of a secondary window (see above).
@@ -1273,7 +1273,7 @@ KMCommand::Result KMForwardInlineCommand::execute()
     for ( KMMessage *msg = linklist.first(); msg; msg = linklist.next() ) {
       TemplateParser parser( fwdMsg, TemplateParser::Forward );
       parser.setSelection( msg->body() ); // FIXME: Why is this needed?
-      parser.process( msg, 0, true );
+      parser.process( msg, nullptr, true );
 
       fwdMsg->link( msg, KMMsgStatusForwarded );
     }
@@ -1573,7 +1573,7 @@ KMCommand::Result KMCustomForwardCommand::execute()
     for ( KMMessage *msg = linklist.first(); msg; msg = linklist.next() ) {
       TemplateParser parser( fwdMsg, TemplateParser::Forward );
       parser.setSelection( msg->body() ); // FIXME: Why is this needed?
-      parser.process( msg, 0, true );
+      parser.process( msg, nullptr, true );
 
       fwdMsg->link( msg, KMMsgStatusForwarded );
     }
@@ -1633,10 +1633,10 @@ void KMPrintCommand::setOverrideFont( const TQFont& font )
 
 KMCommand::Result KMPrintCommand::execute()
 {
-  KMReaderWin printWin( 0, 0, 0 );
+  KMReaderWin printWin( nullptr, nullptr, nullptr );
   printWin.setPrinting( true );
   printWin.readConfig();
-  if ( mHeaderStyle != 0 && mHeaderStrategy != 0 )
+  if ( mHeaderStyle && mHeaderStrategy )
     printWin.setHeaderStyleAndStrategy( mHeaderStyle, mHeaderStrategy );
   printWin.setHtmlOverride( mHtmlOverride );
   printWin.setHtmlLoadExtOverride( mHtmlLoadExtOverride );
@@ -1661,7 +1661,7 @@ KMCommand::Result KMSeStatusCommand::execute()
 {
   TQValueListIterator<TQ_UINT32> it;
   int idx = -1;
-  KMFolder *folder = 0;
+  KMFolder *folder = nullptr;
   bool parenStatus = false;
 
   // Toggle actions on threads toggle the whole thread
@@ -1768,7 +1768,7 @@ KMCommand::Result KMFilterActionCommand::execute()
   }
 
   progressItem->setComplete();
-  progressItem = 0;
+  progressItem = nullptr;
   return OK;
 }
 
@@ -1812,7 +1812,7 @@ void KMMetaFilterActionCommand::start()
 
 FolderShortcutCommand::FolderShortcutCommand( KMMainWidget *mainwidget,
                                               KMFolder *folder )
-    : mMainWidget( mainwidget ), mFolder( folder ), mAction( 0 )
+    : mMainWidget( mainwidget ), mFolder( folder ), mAction( nullptr )
 {
 }
 
@@ -1915,8 +1915,8 @@ void KMMenuCommand::makeFolderMenu(KMFolderNode* node, bool move,
              TQ_SLOT(copySelectedToFolder(int)));
   }
 
-  KMFolder *folder = 0;
-  KMFolderDir *folderDir = 0;
+  KMFolder *folder = nullptr;
+  KMFolderDir *folderDir = nullptr;
   if (node->isDir()) {
     folderDir = static_cast<KMFolderDir*>(node);
   } else {
@@ -2005,7 +2005,7 @@ KMCommand::Result KMCopyCommand::execute()
       assert(idx != -1);
       msg = srcFolder->getMsg(idx);
       // corrupt IMAP cache, see FolderStorage::getMsg()
-      if ( msg == 0 ) {
+      if (!msg) {
         KMessageBox::error( parentWidget(), i18n("Corrupt IMAP cache detected in folder %1. "
             "Copying of messages aborted.").arg( srcFolder->prettyURL() ) );
         deleteLater();
@@ -2136,7 +2136,7 @@ void KMCopyCommand::slotFolderComplete( KMFolderImap*, bool success )
 
 KMMoveCommand::KMMoveCommand( KMFolder* destFolder,
                               const TQPtrList<KMMsgBase> &msgList)
-  : mDestFolder( destFolder ), mProgressItem( 0 )
+  : mDestFolder( destFolder ), mProgressItem( nullptr )
 {
   TQPtrList<KMMsgBase> tmp = msgList;
   for ( KMMsgBase *msgBase = tmp.first(); msgBase; msgBase = tmp.next() )
@@ -2145,20 +2145,20 @@ KMMoveCommand::KMMoveCommand( KMFolder* destFolder,
 
 KMMoveCommand::KMMoveCommand( KMFolder* destFolder,
                               KMMessage *msg )
-  : mDestFolder( destFolder ), mProgressItem( 0 )
+  : mDestFolder( destFolder ), mProgressItem( nullptr )
 {
   mSerNumList.append( msg->getMsgSerNum() );
 }
 
 KMMoveCommand::KMMoveCommand( KMFolder* destFolder,
                               KMMsgBase *msgBase )
-  : mDestFolder( destFolder ), mProgressItem( 0 )
+  : mDestFolder( destFolder ), mProgressItem( nullptr )
 {
   mSerNumList.append( msgBase->getMsgSerNum() );
 }
 
 KMMoveCommand::KMMoveCommand( TQ_UINT32 )
-  : mProgressItem( 0 )
+  : mProgressItem( nullptr )
 {
 }
 
@@ -2203,7 +2203,7 @@ KMCommand::Result KMMoveCommand::execute()
       kdDebug(5006) << k_funcinfo << "serial number == 0!" << endl;
       continue; // invalid message
     }
-    KMFolder *srcFolder = 0;
+    KMFolder *srcFolder = nullptr;
     int idx = -1;
     KMMsgDict::instance()->getLocation( *it, &srcFolder, &idx );
     if (srcFolder == mDestFolder)
@@ -2354,7 +2354,7 @@ void KMMoveCommand::completeMove( Result result )
   }
   if ( mProgressItem ) {
     mProgressItem->setComplete();
-    mProgressItem = 0;
+    mProgressItem = nullptr;
   }
   setResult( result );
   emit completed( this );
@@ -2386,11 +2386,11 @@ KMDeleteMsgCommand::KMDeleteMsgCommand( TQ_UINT32 sernum )
 :KMMoveCommand( sernum )
 {
   if ( !sernum ) {
-    setDestFolder( 0 );
+    setDestFolder( nullptr );
     return;
   }
 
-  KMFolder *srcFolder = 0;
+  KMFolder *srcFolder = nullptr;
   int idx;
   KMMsgDict::instance()->getLocation( sernum, &srcFolder, &idx );
   if ( srcFolder ) {
@@ -2409,7 +2409,7 @@ KMFolder * KMDeleteMsgCommand::findTrashFolder( KMFolder * folder )
     trash = kmkernel->trashFolder();
   if( trash != folder )
     return trash;
-  return 0;
+  return nullptr;
 }
 
 
@@ -2472,7 +2472,7 @@ KMCommand::Result KMUrlClickedCommand::execute()
         mime->name() == "application/x-msdos-program" ||
         mime->name() == "application/x-shellscript" )
     {
-      if (KMessageBox::warningYesNo( 0, i18n( "<qt>Do you really want to execute <b>%1</b>?</qt>" )
+      if (KMessageBox::warningYesNo( nullptr, i18n( "<qt>Do you really want to execute <b>%1</b>?</qt>" )
         .arg( mUrl.prettyURL() ), TQString(), i18n("Execute"), KStdGuiItem::cancel() ) != KMessageBox::Yes)
         return Canceled;
     }
@@ -2555,7 +2555,7 @@ void KMSaveAttachmentsCommand::slotSaveAll()
         ++it;
     }
     if ( mAttachmentMap.isEmpty() ) {
-      KMessageBox::information( 0, i18n("Found no attachments to save.") );
+      KMessageBox::information( nullptr, i18n("Found no attachments to save.") );
       setResult( OK ); // The user has already been informed.
       emit completed( this );
       deleteLater();
@@ -2729,7 +2729,7 @@ KMCommand::Result KMSaveAttachmentsCommand::saveItem( partNode *node,
                 true, false );
           }
 	}else{
-	  ObjectTreeParser otp( 0, 0, false, false, false );
+	  ObjectTreeParser otp( nullptr, nullptr, false, false, false );
 
 	  // process this node and all it's siblings and descendants
 	  dataNode->setProcessed( false, true );
@@ -2830,7 +2830,7 @@ void KMLoadPartsCommand::slotStart()
       if ( curFolder ) {
         FolderJob *job =
           curFolder->createJob( it.data(), FolderJob::tGetMessage,
-                                0, it.key()->msgPart().partSpecifier() );
+                                nullptr, it.key()->msgPart().partSpecifier() );
         job->setCancellable( false );
         connect( job, TQ_SIGNAL(messageUpdated(KMMessage*, TQString)),
                  this, TQ_SLOT(slotPartRetrieved(KMMessage*, TQString)) );
@@ -2893,7 +2893,7 @@ KMCommand::Result KMResendMessageCommand::execute()
    if( newMsg->type() == DwMime::kTypeText) {
      newMsg->setCharset(msg->codec()->mimeName());
    }
-   newMsg->setParent( 0 );
+   newMsg->setParent( nullptr );
 
    // make sure we have an identity set, default, if necessary
    newMsg->setHeaderField("X-KMail-Identity", TQString::number( newMsg->identityUoid() ));
@@ -2917,15 +2917,15 @@ KMCommand::Result KMMailingListCommand::execute()
   TQString handler = ( mFolder->mailingList().handler() == MailingList::KMail )
     ? "mailto" : "https";
 
-  KMCommand *command = 0;
+  KMCommand *command = nullptr;
   for ( KURL::List::Iterator itr = lst.begin(); itr != lst.end(); ++itr ) {
     if ( handler == (*itr).protocol() ) {
-      command = new KMUrlClickedCommand( *itr, mFolder->identity(), 0, false );
+      command = new KMUrlClickedCommand( *itr, mFolder->identity(), nullptr, false );
     }
   }
   if ( !command && !lst.empty() ) {
     command =
-      new KMUrlClickedCommand( lst.first(), mFolder->identity(), 0, false );
+      new KMUrlClickedCommand( lst.first(), mFolder->identity(), nullptr, false );
   }
   if ( command ) {
     connect( command, TQ_SIGNAL( completed( KMCommand * ) ),
@@ -3038,7 +3038,7 @@ KMHandleAttachmentCommand::KMHandleAttachmentCommand( partNode* node,
      KMMessage* msg, int atmId, const TQString& atmName,
      AttachmentAction action, KService::Ptr offer, TQWidget* parent )
 : KMCommand( parent ), mNode( node ), mMsg( msg ), mAtmId( atmId ), mAtmName( atmName ),
-  mAction( action ), mOffer( offer ), mJob( 0 )
+  mAction( action ), mOffer( offer ), mJob( nullptr )
 {
 }
 
@@ -3134,7 +3134,7 @@ KService::Ptr KMHandleAttachmentCommand::getServiceOffer()
 
   if ( contentTypeStr == "text/x-vcard" ) {
     atmView();
-    return 0;
+    return nullptr;
   }
   // determine the MIME type of the attachment
   KMimeType::Ptr mimetype;
@@ -3216,7 +3216,7 @@ void KMHandleAttachmentCommand::atmSave()
 
 void KMHandleAttachmentCommand::atmProperties()
 {
-  KMMsgPartDialogCompat dlg( parentWidget() , 0, true );
+  KMMsgPartDialogCompat dlg( parentWidget() , nullptr, true );
   KMMessagePart& msgPart = mNode->msgPart();
   dlg.setMsgPart( &msgPart );
   dlg.exec();
@@ -3323,7 +3323,7 @@ void KMHandleAttachmentCommand::slotAtmDecryptWithChiasmusResult( const GpgME::E
   if ( mJob != sender() )
     return;
   Kleo::Job * job = mJob;
-  mJob = 0;
+  mJob = nullptr;
   if ( err.isCanceled() )
     return;
   if ( err ) {
@@ -3415,7 +3415,7 @@ void AttachmentModifyCommand::storeChangedMessage(KMMessage * msg)
     connect( f, TQ_SIGNAL(folderComplete(KMFolderImap*,bool)),
              TQ_SLOT(messageStoreResult(KMFolderImap*,bool)) );
   } else {
-    messageStoreResult( 0, res == 0 );
+    messageStoreResult( nullptr, res == 0 );
   }
 }
 
diff --git a/kmail/kmcommands.h b/kmail/kmcommands.h
index 54d4bf14f..ee28e1f82 100644
--- a/kmail/kmcommands.h
+++ b/kmail/kmcommands.h
@@ -56,7 +56,7 @@ public:
   enum Result { Undefined, OK, Canceled, Failed };
 
   // Trival constructor, don't retrieve any messages
-  KMCommand( TQWidget *parent = 0 );
+  KMCommand( TQWidget *parent = nullptr );
   // Retrieve all messages in msgList when start is called.
   KMCommand( TQWidget *parent, const TQPtrList<KMMsgBase> &msgList );
   // Retrieve the single message msgBase when start is called.
@@ -166,7 +166,7 @@ class TDE_EXPORT KMMailtoComposeCommand : public KMCommand
   
 
 public:
-  KMMailtoComposeCommand( const KURL &url, KMMessage *msg=0 );
+  KMMailtoComposeCommand( const KURL &url, KMMessage *msg=nullptr );
 
 private:
   virtual Result execute();
@@ -255,7 +255,7 @@ class TDE_EXPORT KMUrlCopyCommand : public KMCommand
   
 
 public:
-  KMUrlCopyCommand( const KURL &url, KMMainWidget *mainWidget = 0 );
+  KMUrlCopyCommand( const KURL &url, KMMainWidget *mainWidget = nullptr );
 
 private:
   virtual Result execute();
@@ -531,9 +531,9 @@ class TDE_EXPORT KMForwardAttachedCommand : public KMCommand
 
 public:
   KMForwardAttachedCommand( TQWidget *parent, const TQPtrList<KMMsgBase> &msgList,
-			    uint identity = 0, KMail::Composer *win = 0 );
+			    uint identity = 0, KMail::Composer *win = nullptr );
   KMForwardAttachedCommand( TQWidget *parent, KMMessage * msg,
-			    uint identity = 0, KMail::Composer *win = 0 );
+			    uint identity = 0, KMail::Composer *win = nullptr );
 
 private:
   virtual Result execute();
@@ -549,9 +549,9 @@ class TDE_EXPORT KMForwardDigestCommand : public KMCommand
 
 public:
   KMForwardDigestCommand( TQWidget *parent, const TQPtrList<KMMsgBase> &msgList,
-			    uint identity = 0, KMail::Composer *win = 0 );
+			    uint identity = 0, KMail::Composer *win = nullptr );
   KMForwardDigestCommand( TQWidget *parent, KMMessage * msg,
-			    uint identity = 0, KMail::Composer *win = 0 );
+			    uint identity = 0, KMail::Composer *win = nullptr );
 
 private:
   virtual Result execute();
@@ -633,8 +633,8 @@ class TDE_EXPORT KMPrintCommand : public KMCommand
 
 public:
   KMPrintCommand( TQWidget *parent, KMMessage *msg,
-                  const KMail::HeaderStyle *headerStyle = 0,
-                  const KMail::HeaderStrategy *headerStrategy = 0,
+                  const KMail::HeaderStyle *headerStyle = nullptr,
+                  const KMail::HeaderStrategy *headerStrategy = nullptr,
                   bool htmlOverride = false,
                   bool htmlLoadExtOverride = false,
                   bool useFixedFont = false,
@@ -864,7 +864,7 @@ class TDE_EXPORT KMUrlClickedCommand : public KMCommand
 
 public:
   KMUrlClickedCommand( const KURL &url, uint identity,
-    KMReaderWin *readerWin, bool mHtmlPref, KMMainWidget *mainWidget = 0 );
+    KMReaderWin *readerWin, bool mHtmlPref, KMMainWidget *mainWidget = nullptr );
 
 private:
   virtual Result execute();
@@ -908,7 +908,7 @@ class TDE_EXPORT KMResendMessageCommand : public KMCommand
   
 
 public:
-  KMResendMessageCommand( TQWidget *parent, KMMessage *msg=0 );
+  KMResendMessageCommand( TQWidget *parent, KMMessage *msg=nullptr );
 
 private:
   virtual Result execute();
@@ -986,7 +986,7 @@ class TDE_EXPORT KMIMChatCommand : public KMCommand
   
 
 public:
-  KMIMChatCommand( const KURL &url, KMMessage *msg=0 );
+  KMIMChatCommand( const KURL &url, KMMessage *msg=nullptr );
 
 private:
   /**
diff --git a/kmail/kmcomposewin.cpp b/kmail/kmcomposewin.cpp
index 16f94d2e9..9636302b2 100644
--- a/kmail/kmcomposewin.cpp
+++ b/kmail/kmcomposewin.cpp
@@ -156,31 +156,31 @@ KMComposeWin::KMComposeWin( KMMessage *aMsg, uint id  )
     mSpellCheckInProgress( false ),
     mDone( false ),
     mAtmModified( false ),
-    mAtmSelectNew( 0 ),
-    mMsg( 0 ),
-    mAttachMenu( 0 ),
+    mAtmSelectNew( nullptr ),
+    mMsg( nullptr ),
+    mAttachMenu( nullptr ),
     mSigningAndEncryptionExplicitlyDisabled( false ),
-    mFolder( 0 ),
+    mFolder( nullptr ),
     mUseHTMLEditor( false ),
     mId( id ),
-    mAttachPK( 0 ), mAttachMPK( 0 ),
-    mAttachRemoveAction( 0 ), mAttachSaveAction( 0 ), mAttachPropertiesAction( 0 ),
-    mAppendSignatureAction( 0 ), mPrependSignatureAction( 0 ), mInsertSignatureAction( 0 ),
-    mSignAction( 0 ), mEncryptAction( 0 ), mRequestMDNAction( 0 ),
-    mUrgentAction( 0 ), mAllFieldsAction( 0 ), mFromAction( 0 ),
-    mReplyToAction( 0 ), mToAction( 0 ), mCcAction( 0 ), mBccAction( 0 ),
-    mSubjectAction( 0 ),
-    mIdentityAction( 0 ), mTransportAction( 0 ), mFccAction( 0 ),
-    mWordWrapAction( 0 ), mFixedFontAction( 0 ), mAutoSpellCheckingAction( 0 ),
-    mDictionaryAction( 0 ), mSnippetAction( 0 ),
-    mEncodingAction( 0 ),
-    mCryptoModuleAction( 0 ),
-    mEncryptChiasmusAction( 0 ),
+    mAttachPK( nullptr ), mAttachMPK( nullptr ),
+    mAttachRemoveAction( nullptr ), mAttachSaveAction( nullptr ), mAttachPropertiesAction( nullptr ),
+    mAppendSignatureAction( nullptr ), mPrependSignatureAction( nullptr ), mInsertSignatureAction( nullptr ),
+    mSignAction( nullptr ), mEncryptAction( nullptr ), mRequestMDNAction( nullptr ),
+    mUrgentAction( nullptr ), mAllFieldsAction( nullptr ), mFromAction( nullptr ),
+    mReplyToAction( nullptr ), mToAction( nullptr ), mCcAction( nullptr ), mBccAction( nullptr ),
+    mSubjectAction( nullptr ),
+    mIdentityAction( nullptr ), mTransportAction( nullptr ), mFccAction( nullptr ),
+    mWordWrapAction( nullptr ), mFixedFontAction( nullptr ), mAutoSpellCheckingAction( nullptr ),
+    mDictionaryAction( nullptr ), mSnippetAction( nullptr ),
+    mEncodingAction( nullptr ),
+    mCryptoModuleAction( nullptr ),
+    mEncryptChiasmusAction( nullptr ),
     mEncryptWithChiasmus( false ),
-    mComposer( 0 ),
+    mComposer( nullptr ),
     mLabelWidth( 0 ),
-    mAutoSaveTimer( 0 ), mLastAutoSaveErrno( 0 ),
-    mSignatureStateIndicator( 0 ), mEncryptionStateIndicator( 0 ),
+    mAutoSaveTimer( nullptr ), mLastAutoSaveErrno( 0 ),
+    mSignatureStateIndicator( nullptr ), mEncryptionStateIndicator( nullptr ),
     mPreserveUserCursorPosition( false ),
     mPreventFccOverwrite( false ),
     mCheckForRecipients( true ),
@@ -229,7 +229,7 @@ KMComposeWin::KMComposeWin( KMMessage *aMsg, uint id  )
           TQ_SLOT(slotCompletionModeChanged(TDEGlobalSettings::Completion)));
 
   if ( mClassicalRecipients ) {
-    mRecipientsEditor = 0;
+    mRecipientsEditor = nullptr;
 
     mEdtTo = new KMLineEdit(true,mHeadersArea, "toLine");
     mEdtCc = new KMLineEdit(true,mHeadersArea, "ccLine");
@@ -268,17 +268,17 @@ KMComposeWin::KMComposeWin( KMMessage *aMsg, uint id  )
 
     mEdtTo->setFocus();
   } else {
-    mEdtTo = 0;
-    mEdtCc = 0;
-    mEdtBcc = 0;
+    mEdtTo = nullptr;
+    mEdtCc = nullptr;
+    mEdtBcc = nullptr;
 
-    mLblTo = 0;
-    mLblCc = 0;
-    mLblBcc = 0;
+    mLblTo = nullptr;
+    mLblCc = nullptr;
+    mLblBcc = nullptr;
 
-    mBtnTo = 0;
-    mBtnCc = 0;
-    mBtnBcc = 0;
+    mBtnTo = nullptr;
+    mBtnCc = nullptr;
+    mBtnBcc = nullptr;
     //mBtnFrom = 0;
 
     mRecipientsEditor = new RecipientsEditor( mHeadersArea );
@@ -319,16 +319,16 @@ KMComposeWin::KMComposeWin( KMMessage *aMsg, uint id  )
   mHtmlMarkup = GlobalSettings::self()->useHtmlMarkup();
   mShowHeaders = GlobalSettings::self()->headers();
   mDone = false;
-  mGrid = 0;
-  mAtmListView = 0;
+  mGrid = nullptr;
+  mAtmListView = nullptr;
   mAtmList.setAutoDelete(true);
   mAtmTempList.setAutoDelete(true);
   mAtmModified = false;
   mAutoDeleteMsg = false;
-  mFolder = 0;
+  mFolder = nullptr;
   mAutoCharset = true;
-  mFixedFontAction = 0;
-  mTempDir = 0;
+  mFixedFontAction = nullptr;
+  mTempDir = nullptr;
   // the attachment view is separated from the editor by a splitter
   mSplitter = new TQSplitter( TQt::Vertical, mHeadersToEditorSplitter, "mSplitter" );
   mSplitter->setChildrenCollapsible( false );
@@ -427,7 +427,7 @@ KMComposeWin::KMComposeWin( KMMessage *aMsg, uint id  )
   connect( mAtmListView,
            TQ_SIGNAL( dragStarted() ),
            TQ_SLOT( slotAttachmentDragStarted() ) );
-  mAttachMenu = 0;
+  mAttachMenu = nullptr;
 
   readConfig();
   setupStatusBar();
@@ -481,7 +481,7 @@ KMComposeWin::KMComposeWin( KMMessage *aMsg, uint id  )
 
   initAutoSave();
   slotUpdateSignatureActions();
-  mMsg = 0;
+  mMsg = nullptr;
   if (aMsg)
     setMsg(aMsg);
   fontChanged( mEditor->currentFont() ); // set toolbar buttons to correct values
@@ -502,7 +502,7 @@ KMComposeWin::~KMComposeWin()
   }
   if (mAutoDeleteMsg) {
     delete mMsg;
-    mMsg = 0;
+    mMsg = nullptr;
   }
   TQMap<TDEIO::Job*, atmLoadData>::Iterator it = mMapAtmLoadData.begin();
   while ( it != mMapAtmLoadData.end() )
@@ -863,7 +863,7 @@ void KMComposeWin::slotContinueAutoSave()
     autoSaveFile.abort();
     if ( status != mLastAutoSaveErrno ) {
       // don't show the same error message twice
-      KMessageBox::queuedMessageBox( 0, KMessageBox::Sorry,
+      KMessageBox::queuedMessageBox( nullptr, KMessageBox::Sorry,
                                      i18n("Autosaving the message as %1 "
                                           "failed.\n"
                                           "Reason: %2" )
@@ -1029,7 +1029,7 @@ void KMComposeWin::rethinkFields(bool fromSlot)
 
   if (!fromSlot) mReplyToAction->setChecked(abs(mShowHeaders)&HDR_REPLY_TO);
   rethinkHeaderLine(showHeaders,HDR_REPLY_TO,row,
-                  mLblReplyTo, mEdtReplyTo, 0);
+                  mLblReplyTo, mEdtReplyTo, nullptr);
   if ( showHeaders & HDR_REPLY_TO ) {
     prevFocus = connectFocusMoving( prevFocus, mEdtReplyTo );
   }
@@ -1492,7 +1492,7 @@ void KMComposeWin::setupActions(void)
     connect( mEncryptChiasmusAction, TQ_SIGNAL(toggled(bool)),
              this, TQ_SLOT(slotEncryptChiasmusToggled(bool)) );
   } else {
-    mEncryptChiasmusAction = 0;
+    mEncryptChiasmusAction = nullptr;
   }
 
   mEncryptAction = new TDEToggleAction (i18n("&Encrypt Message"),
@@ -2091,7 +2091,7 @@ void KMComposeWin::setMsg(KMMessage* newMsg, bool mayAutoSign,
         if ( mMsg->headerField( "X-KMail-Markup" ) == "true" )
           toggleMarkup( true );
       }
-      delete root; root = 0;
+      delete root; root = nullptr;
     }
     if ( firstAttachment == 0 ) {
         mMsg->bodyPart(0, &bodyPart);
@@ -2246,7 +2246,7 @@ bool KMComposeWin::queryClose ()
     return false;                                            // the user can try to close the window, which destroys mComposer mid-call.
 
   if ( isModified() ) {
-    bool istemplate = ( mFolder!=0 && mFolder->isTemplates() );
+    bool istemplate = ( mFolder != nullptr && mFolder->isTemplates() );
     const TQString savebut = ( istemplate ?
                               i18n("Re&save as Template") :
                               i18n("&Save as Draft") );
@@ -2376,7 +2376,7 @@ void KMComposeWin::slotComposerDone( bool rc )
   mComposedMessages = mComposer->composedMessageList();
   emit applyChangesDone( rc );
   delete mComposer;
-  mComposer = 0;
+  mComposer = nullptr;
 
   // re-enable the composewin, the messsage composition is now done
   setEnabled( true );
@@ -2462,9 +2462,9 @@ void KMComposeWin::addAttach(const KMMessagePart* msgPart)
   mAtmItemList.append(lvi);
 
   // the Attach file job has finished, so the possibly present tmp dir can be deleted now.
-  if ( mTempDir != 0 ) {
+  if (mTempDir) {
     delete mTempDir;
-    mTempDir = 0;
+    mTempDir = nullptr;
   }
 
   connect( lvi, TQ_SIGNAL( compress( int ) ),
@@ -2504,7 +2504,7 @@ TQString KMComposeWin::prettyMimeType( const TQString& type )
 void KMComposeWin::msgPartToItem(const KMMessagePart* msgPart,
                                  KMAtmListViewItem *lvi, bool loadDefaults)
 {
-  assert(msgPart != 0);
+  assert(msgPart);
 
   if (!msgPart->fileName().isEmpty())
     lvi->setText(0, msgPart->fileName());
@@ -2771,7 +2771,7 @@ void KMComposeWin::slotAttachFile()
     recentURL = KURL( TQDir::homeDirPath() );
   }
 
-  KFileDialog fdlg( recentURL.url(), TQString(), this, 0, true );
+  KFileDialog fdlg( recentURL.url(), TQString(), this, nullptr, true );
   fdlg.setOperationMode( KFileDialog::Other );
   fdlg.setCaption( i18n( "Attach File" ) );
   fdlg.okButton()->setGuiItem( KGuiItem( i18n( "&Attach" ),"document-open" ) );
@@ -2933,7 +2933,7 @@ void KMComposeWin::slotAttachFileResult(TDEIO::Job *job)
     dlg.setMsgPart(msgPart);
     if (!dlg.exec()) {
       delete msgPart;
-      msgPart = 0;
+      msgPart = nullptr;
       if (attachURLfound)
         emit attachmentAdded(attachURL, false);
       return;
@@ -2952,12 +2952,12 @@ void KMComposeWin::slotAttachFileResult(TDEIO::Job *job)
 //-----------------------------------------------------------------------------
 void KMComposeWin::slotInsertFile()
 {
-  KFileDialog fdlg(TQString(), TQString(), this, 0, true);
+  KFileDialog fdlg(TQString(), TQString(), this, nullptr, true);
   fdlg.setOperationMode( KFileDialog::Opening );
   fdlg.okButton()->setText(i18n("&Insert"));
   fdlg.setCaption(i18n("Insert File"));
   fdlg.toolBar()->insertCombo(KMMsgBase::supportedEncodings(false), 4711,
-    false, 0, 0, 0);
+    false, nullptr, nullptr, nullptr);
   KComboBox *combo = fdlg.toolBar()->getCombo(4711);
   for (int i = 0; i < combo->count(); i++)
     if (TDEGlobal::charsets()->codecForName(TDEGlobal::charsets()->
@@ -3307,7 +3307,7 @@ void KMComposeWin::compressAttach( int idx )
   KZip zip( &dev );
   TQByteArray decoded = msgPart->bodyDecodedBinary();
   if ( ! zip.open( IO_WriteOnly ) ) {
-    KMessageBox::sorry(0, i18n("KMail could not compress the file.") );
+    KMessageBox::sorry(nullptr, i18n("KMail could not compress the file.") );
     static_cast<KMAtmListViewItem*>( mAtmItemList.at( i ) )->setCompress( false );
     return;
   }
@@ -3315,7 +3315,7 @@ void KMComposeWin::compressAttach( int idx )
   zip.setCompression( KZip::DeflateCompression );
   if ( ! zip.writeFile( msgPart->name(), "", "", decoded.size(),
            decoded.data() ) ) {
-    KMessageBox::sorry(0, i18n("KMail could not compress the file.") );
+    KMessageBox::sorry(nullptr, i18n("KMail could not compress the file.") );
     static_cast<KMAtmListViewItem*>( mAtmItemList.at( i ) )->setCompress( false );
     return;
   }
@@ -3388,7 +3388,7 @@ void KMComposeWin::uncompressAttach( int idx )
 
   decoded = msgPart->bodyDecodedBinary();
   if ( ! zip.open( IO_ReadOnly ) ) {
-    KMessageBox::sorry(0, i18n("KMail could not uncompress the file.") );
+    KMessageBox::sorry(nullptr, i18n("KMail could not uncompress the file.") );
     static_cast<KMAtmListViewItem *>( mAtmItemList.at( i ) )->setCompress( true );
     return;
   }
@@ -3396,7 +3396,7 @@ void KMComposeWin::uncompressAttach( int idx )
 
   KZipFileEntry *entry;
   if ( dir->entries().count() != 1 ) {
-    KMessageBox::sorry(0, i18n("KMail could not uncompress the file.") );
+    KMessageBox::sorry(nullptr, i18n("KMail could not uncompress the file.") );
     static_cast<KMAtmListViewItem *>( mAtmItemList.at( i ) )->setCompress( true );
     return;
   }
@@ -3596,7 +3596,7 @@ void KMComposeWin::slotAttachSave()
   pname = msgPart->name();
   if (pname.isEmpty()) pname="unnamed";
 
-  KURL url = KFileDialog::getSaveURL(pname, TQString(), 0, i18n("Save Attachment As"));
+  KURL url = KFileDialog::getSaveURL(pname, TQString(), nullptr, i18n("Save Attachment As"));
 
   if( url.isEmpty() )
     return;
@@ -3608,7 +3608,7 @@ void KMComposeWin::slotAttachSave()
 //-----------------------------------------------------------------------------
 void KMComposeWin::slotAttachRemove()
 {
-  mAtmSelectNew = 0;
+  mAtmSelectNew = nullptr;
   bool attachmentRemoved = false;
   int i = 0;
   for ( TQPtrListIterator<TQListViewItem> it(mAtmItemList); *it; ) {
@@ -3917,7 +3917,7 @@ void KMComposeWin::slotNewComposer()
 //-----------------------------------------------------------------------------
 void KMComposeWin::slotNewMailReader()
 {
-  KMMainWin *kmmwin = new KMMainWin(0);
+  KMMainWin *kmmwin = new KMMainWin(nullptr);
   kmmwin->show();
   //d->resize(d->size());
 }
@@ -4274,20 +4274,20 @@ void KMComposeWin::doSend( KMail::MessageSender::SendMethod method,
 bool KMComposeWin::saveDraftOrTemplate( const TQString &folderName,
                                         KMMessage *msg )
 {
-  KMFolder *theFolder = 0, *imapTheFolder = 0;
+  KMFolder *theFolder = nullptr, *imapTheFolder = nullptr;
   // get the draftsFolder
   if ( !folderName.isEmpty() ) {
     theFolder = kmkernel->folderMgr()->findIdString( folderName );
-    if ( theFolder == 0 )
+    if (!theFolder)
       // This is *NOT* supposed to be "imapDraftsFolder", because a
       // dIMAP folder works like a normal folder
       theFolder = kmkernel->dimapFolderMgr()->findIdString( folderName );
-    if ( theFolder == 0 )
+    if (!theFolder)
       imapTheFolder = kmkernel->imapFolderMgr()->findIdString( folderName );
     if ( !theFolder && !imapTheFolder ) {
       const KPIM::Identity & id = kmkernel->identityManager()
         ->identityForUoidOrDefault( msg->headerField( "X-KMail-Identity" ).stripWhiteSpace().toUInt() );
-      KMessageBox::information( 0,
+      KMessageBox::information( nullptr,
                                 i18n("The custom drafts or templates folder for "
                                      "identify \"%1\" does not exist (anymore); "
                                      "therefore, the default drafts or templates "
@@ -4296,10 +4296,10 @@ bool KMComposeWin::saveDraftOrTemplate( const TQString &folderName,
     }
   }
   if ( imapTheFolder && imapTheFolder->noContent() )
-    imapTheFolder = 0;
+    imapTheFolder = nullptr;
 
   bool didOpen = false;
-  if ( theFolder == 0 ) {
+  if (!theFolder) {
     theFolder = ( mSaveIn==KMComposeWin::Drafts ?
                   kmkernel->draftsFolder() : kmkernel->templatesFolder() );
   } else {
@@ -4369,7 +4369,7 @@ void KMComposeWin::slotContinueDoSend( bool sentOk )
     if (!sentOk)
       return;
 
-    *it = 0; // don't kill it later...
+    *it = nullptr; // don't kill it later...
   }
 
   RecentAddresses::self( KMKernel::config() )->add( bcc() );
@@ -4378,7 +4378,7 @@ void KMComposeWin::slotContinueDoSend( bool sentOk )
 
   setModified( false );
   mAutoDeleteMsg = false;
-  mFolder = 0;
+  mFolder = nullptr;
   cleanupAutoSave();
   close();
   return;
@@ -4989,7 +4989,7 @@ void KMComposeWin::slotSpellcheckConfig()
 {
   KDialogBase dlg(KDialogBase::Plain, i18n("Spellchecker"),
                   KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok,
-                  this, 0, true, true );
+                  this, nullptr, true, true );
   KWin twin;
   TQTabDialog qtd (this, "tabdialog", true);
   KSpellConfig mKSpellConfig (&qtd);
@@ -5073,7 +5073,7 @@ void KMComposeWin::initAutoSave()
 void KMComposeWin::updateAutoSave()
 {
   if ( autoSaveInterval() == 0 ) {
-    delete mAutoSaveTimer; mAutoSaveTimer = 0;
+    delete mAutoSaveTimer; mAutoSaveTimer = nullptr;
   }
   else {
     if ( !mAutoSaveTimer ) {
@@ -5092,7 +5092,7 @@ void KMComposeWin::setAutoSaveFilename( const TQString & filename )
 
 void KMComposeWin::cleanupAutoSave()
 {
-  delete mAutoSaveTimer; mAutoSaveTimer = 0;
+  delete mAutoSaveTimer; mAutoSaveTimer = nullptr;
   if ( !mAutoSaveFilename.isEmpty() ) {
     kdDebug(5006) << k_funcinfo << "deleting autosave file "
                   << mAutoSaveFilename << endl;
@@ -5137,7 +5137,7 @@ void KMComposeWin::slotFolderRemoved(KMFolder* folder)
     mFolder = kmkernel->draftsFolder();
     kdDebug(5006) << "restoring drafts to " << mFolder->idString() << endl;
   }
-  if (mMsg) mMsg->setParent(0);
+  if (mMsg) mMsg->setParent(nullptr);
 }
 
 
@@ -5282,7 +5282,7 @@ namespace {
       if ( mAction )
         mAction->setChecked( mOn );
     }
-    void disable() { mAction = 0; }
+    void disable() { mAction = nullptr; }
   };
 }
 
diff --git a/kmail/kmcomposewin.h b/kmail/kmcomposewin.h
index 479096cf1..0162ce910 100644
--- a/kmail/kmcomposewin.h
+++ b/kmail/kmcomposewin.h
@@ -103,10 +103,10 @@ class KMComposeWin : public KMail::Composer, public MailComposerIface
   friend class ::MessageComposer;
 
 private: // mailserviceimpl, kmkernel, kmcommands, callback, kmmainwidget
-  KMComposeWin( KMMessage* msg=0, uint identity=0 );
+  KMComposeWin( KMMessage* msg=nullptr, uint identity=0 );
   ~KMComposeWin();
 public:
-  static Composer * create( KMMessage * msg = 0, uint identity = 0 );
+  static Composer * create( KMMessage * msg = nullptr, uint identity = 0 );
 
   MailComposerIface * asMailComposerIFace() { return this; }
   const MailComposerIface * asMailComposerIFace() const { return this; }
@@ -185,7 +185,7 @@ public: // kmkernel, kmcommands, callback
    /**
     * Returns @c true while the message composing is in progress.
     */
-   bool isComposing() const { return mComposer != 0; }
+   bool isComposing() const { return mComposer != nullptr; }
 
 private: // kmedit
   /**
@@ -551,7 +551,7 @@ private:
 
   void rethinkHeaderLine( int aValue, int aMask, int& aRow,
                           TQLabel* aLbl,
-                          TQLineEdit* aEdt, TQPushButton* aBtn = 0,
+                          TQLineEdit* aEdt, TQPushButton* aBtn = nullptr,
                           const TQString &toolTip = TQString(),
                           const TQString &whatsThis = TQString() );
 
diff --git a/kmail/kmdict.cpp b/kmail/kmdict.cpp
index 0ad9367be..7121b5cac 100644
--- a/kmail/kmdict.cpp
+++ b/kmail/kmdict.cpp
@@ -49,7 +49,7 @@ void KMDict::clear()
     }
   }
   delete [] mVecs;
-  mVecs = 0;
+  mVecs = nullptr;
 }
 
 //-----------------------------------------------------------------------------
diff --git a/kmail/kmedit.cpp b/kmail/kmedit.cpp
index 9ef513cd9..19c30881a 100644
--- a/kmail/kmedit.cpp
+++ b/kmail/kmedit.cpp
@@ -148,11 +148,11 @@ void KMEdit::contentsDropEvent(TQDropEvent *e)
         serNumBuffer.open(IO_ReadOnly);
         TQDataStream serNumStream(&serNumBuffer);
         TQ_UINT32 serNum;
-        KMFolder *folder = 0;
+        KMFolder *folder = nullptr;
         int idx;
         TQPtrList<KMMsgBase> messageList;
         while (!serNumStream.atEnd()) {
-            KMMsgBase *msgBase = 0;
+            KMMsgBase *msgBase = nullptr;
             serNumStream >> serNum;
             KMMsgDict::instance()->getLocation(serNum, &folder, &idx);
             if (folder)
@@ -213,16 +213,16 @@ KMEdit::KMEdit(TQWidget *parent, KMComposeWin* composer,
                const char *name)
   : KEdit( parent, name ),
     mComposer( composer ),
-    mKSpellForDialog( 0 ),
-    mSpeller( 0 ),
+    mKSpellForDialog( nullptr ),
+    mSpeller( nullptr ),
     mSpellConfig( autoSpellConfig ),
-    mSpellingFilter( 0 ),
-    mExtEditorTempFile( 0 ),
-    mExtEditorTempFileWatcher( 0 ),
-    mExtEditorProcess( 0 ),
+    mSpellingFilter( nullptr ),
+    mExtEditorTempFile( nullptr ),
+    mExtEditorTempFileWatcher( nullptr ),
+    mExtEditorProcess( nullptr ),
     mUseExtEditor( false ),
     mWasModifiedBeforeSpellCheck( false ),
-    mHighlighter( 0 ),
+    mHighlighter( nullptr ),
     mSpellLineEdit( false ),
     mPasteMode( TQClipboard::Clipboard )
 {
@@ -291,7 +291,7 @@ TQPopupMenu *KMEdit::createPopupMenu( const TQPoint& pos )
 void KMEdit::deleteAutoSpellChecking()
 { // because the highlighter doesn't support RichText, delete its instance.
   delete mHighlighter;
-  mHighlighter =0;
+  mHighlighter =nullptr;
 }
 
 void KMEdit::addSuggestion(const TQString& text, const TQStringList& lst, unsigned int )
@@ -315,12 +315,12 @@ KMEdit::~KMEdit()
     // The speller needs some time to clean up, so trigger cleanup and let it delete itself
     mSpeller->setAutoDelete( true );
     mSpeller->cleanUp();
-    mSpeller = 0;
+    mSpeller = nullptr;
   }
 
   delete mKSpellForDialog;
   delete mHighlighter;
-  mHighlighter = 0;
+  mHighlighter = nullptr;
 }
 
 
@@ -361,7 +361,7 @@ unsigned int KMEdit::lineBreakColumn() const
 }
 
 KMSpell::KMSpell( TQObject *receiver, const char *slot, KSpellConfig *spellConfig )
-  : KSpell( 0, TQString(), receiver, slot, spellConfig )
+  : KSpell( nullptr, TQString(), receiver, slot, spellConfig )
 {
 }
 
@@ -402,7 +402,7 @@ TQStringList KMSyntaxHighter::ignoredWords() const
 
 void KMEdit::spellerDied()
 {
-  mSpeller = 0;
+  mSpeller = nullptr;
 }
 
 void KMEdit::spellerReady( KSpell *spell )
@@ -617,9 +617,9 @@ void KMEdit::slotExternalEditorDone( TDEProcess * proc ) {
 }
 
 void KMEdit::killExternalEditor() {
-  delete mExtEditorTempFileWatcher; mExtEditorTempFileWatcher = 0;
-  delete mExtEditorTempFile; mExtEditorTempFile = 0;
-  delete mExtEditorProcess; mExtEditorProcess = 0;
+  delete mExtEditorTempFileWatcher; mExtEditorTempFileWatcher = nullptr;
+  delete mExtEditorTempFile; mExtEditorTempFile = nullptr;
+  delete mExtEditorProcess; mExtEditorProcess = nullptr;
 }
 
 
@@ -871,11 +871,11 @@ void KMEdit::slotSpellDone()
   kdDebug(5006)<<" void KMEdit::slotSpellDone()" << endl;
   KSpell::spellStatus status = mKSpellForDialog->status();
   delete mKSpellForDialog;
-  mKSpellForDialog = 0;
+  mKSpellForDialog = nullptr;
 
   kdDebug(5006) << "spelling: delete SpellingFilter" << endl;
   delete mSpellingFilter;
-  mSpellingFilter = 0;
+  mSpellingFilter = nullptr;
   mComposer->sujectLineWidget()->deselect();
   if (status == KSpell::Error)
   {
diff --git a/kmail/kmedit.h b/kmail/kmedit.h
index c8a1078ad..04d455346 100644
--- a/kmail/kmedit.h
+++ b/kmail/kmedit.h
@@ -49,7 +49,7 @@ class KMSyntaxHighter : public KDictSpellingHighlighter
                      const TQColor& QuoteColor1 = TQColor( 0x00, 0x80, 0x00 ),
                      const TQColor& QuoteColor2 = TQColor( 0x00, 0x70, 0x00 ),
                      const TQColor& QuoteColor3 = TQColor( 0x00, 0x60, 0x00 ),
-                     KSpellConfig *spellConfig = 0 );
+                     KSpellConfig *spellConfig = nullptr );
 
     /** Reimplemented */
     virtual bool isMisspelled( const TQString &word );
@@ -66,9 +66,9 @@ class KMEdit : public KEdit {
   TQ_OBJECT
   
 public:
-  KMEdit(TQWidget *parent=0,KMComposeWin* composer=0,
-         KSpellConfig* spellConfig = 0,
-	 const char *name=0);
+  KMEdit(TQWidget *parent=nullptr,KMComposeWin* composer=nullptr,
+         KSpellConfig* spellConfig = nullptr,
+	 const char *name=nullptr);
   ~KMEdit();
 
   /**
diff --git a/kmail/kmfawidgets.h b/kmail/kmfawidgets.h
index 90f980e00..5f11337cc 100644
--- a/kmail/kmfawidgets.h
+++ b/kmail/kmfawidgets.h
@@ -20,7 +20,7 @@ class KMFilterActionWithAddressWidget : public TQWidget
   TQ_OBJECT
   
 public:
-  KMFilterActionWithAddressWidget( TQWidget* parent=0, const char* name=0 );
+  KMFilterActionWithAddressWidget( TQWidget* parent=nullptr, const char* name=nullptr );
 
   void clear() { mLineEdit->clear(); }
   TQString text() const { return mLineEdit->text(); }
@@ -43,7 +43,7 @@ class KMSoundTestWidget : public TQWidget
   TQ_OBJECT
   
 public:
-  KMSoundTestWidget( TQWidget * parent, const char * name=0 );
+  KMSoundTestWidget( TQWidget * parent, const char * name=nullptr );
   ~KMSoundTestWidget();
   TQString url() const;
   void setUrl( const TQString & url );
diff --git a/kmail/kmfilter.cpp b/kmail/kmfilter.cpp
index df6a55430..7a0206844 100644
--- a/kmail/kmfilter.cpp
+++ b/kmail/kmfilter.cpp
@@ -262,7 +262,7 @@ void KMFilter::readConfig(TDEConfig* config)
     numActions = config->readNumEntry("actions",0);
     if (numActions > FILTER_MAX_ACTIONS) {
       numActions = FILTER_MAX_ACTIONS ;
-      KMessageBox::information( 0, i18n("<qt>Too many filter actions in filter rule <b>%1</b>.</qt>").arg( mPattern.name() ) );
+      KMessageBox::information( nullptr, i18n("<qt>Too many filter actions in filter rule <b>%1</b>.</qt>").arg( mPattern.name() ) );
     }
 
     for ( i=0 ; i < numActions ; i++ ) {
@@ -285,7 +285,7 @@ void KMFilter::readConfig(TDEConfig* config)
             delete fa;
         }
       } else
-        KMessageBox::information( 0 /* app-global modal dialog box */,
+        KMessageBox::information( nullptr /* app-global modal dialog box */,
                                   i18n("<qt>Unknown filter action <b>%1</b><br>in filter rule <b>%2</b>.<br>Ignoring it.</qt>")
                                        .arg( config->readEntry( actName ) ).arg( mPattern.name() ) );
     }
diff --git a/kmail/kmfilter.h b/kmail/kmfilter.h
index fd993e3c8..c9a6a4eff 100644
--- a/kmail/kmfilter.h
+++ b/kmail/kmfilter.h
@@ -67,7 +67,7 @@ public:
   /** Constructor that initializes from given config file, if given.
     * Filters are stored one by one in config groups, i.e. one filter, one group.
     * The config group has to be preset if config is not 0. */
-  KMFilter( TDEConfig* aConfig=0 , bool popFilter = false);
+  KMFilter( TDEConfig* aConfig=nullptr , bool popFilter = false);
 
   /** Copy constructor. Constructs a deep copy of @p aFilter. */
   KMFilter( const KMFilter & other );
diff --git a/kmail/kmfilteraction.cpp b/kmail/kmfilteraction.cpp
index fb89777fe..d25f91dd8 100644
--- a/kmail/kmfilteraction.cpp
+++ b/kmail/kmfilteraction.cpp
@@ -85,7 +85,7 @@ bool KMFilterAction::requiresBody(KMMsgBase*) const
 
 KMFilterAction* KMFilterAction::newAction()
 {
-  return 0;
+  return nullptr;
 }
 
 TQWidget* KMFilterAction::createParamWidget(TQWidget* parent) const
@@ -295,7 +295,7 @@ void KMFilterActionWithStringList::argsFromString( const TQString argsStr )
 KMFilterActionWithFolder::KMFilterActionWithFolder( const char* aName, const TQString aLabel )
   : KMFilterAction( aName, aLabel )
 {
-  mFolder = 0;
+  mFolder = nullptr;
 }
 
 TQWidget* KMFilterActionWithFolder::createParamWidget( TQWidget* parent ) const
@@ -1699,7 +1699,7 @@ KMFilterAction::ReturnCode KMFilterActionExec::process(KMMessage *aMsg) const
 class PipeJob : public KPIM::ThreadWeaver::Job
 {
   public:
-    PipeJob(TQObject* parent = 0 , const char* name = 0, KMMessage* aMsg = 0, TQString cmd = 0, TQString tempFileName = 0 )
+    PipeJob(TQObject* parent = nullptr , const char* name = nullptr, KMMessage* aMsg = nullptr, TQString cmd = nullptr, TQString tempFileName = nullptr )
       : Job (parent, name),
         mTempFileName(tempFileName),
         mCmd(cmd),
@@ -1815,7 +1815,7 @@ void KMFilterActionExtFilter::processAsync(KMMessage* aMsg) const
       false, false, false );
   inFile->close();
 
-  PipeJob *job = new PipeJob(0, 0, aMsg, commandLine, tempFileName);
+  PipeJob *job = new PipeJob(nullptr, nullptr, aMsg, commandLine, tempFileName);
   TQObject::connect ( job, TQ_SIGNAL( done() ), handler, TQ_SLOT( actionMessage() ) );
   kmkernel->weaver()->enqueue(job);
 }
diff --git a/kmail/kmfilterdlg.cpp b/kmail/kmfilterdlg.cpp
index 51fd8ac9a..f336fb08d 100644
--- a/kmail/kmfilterdlg.cpp
+++ b/kmail/kmfilterdlg.cpp
@@ -147,11 +147,11 @@ KMFilterDlg::KMFilterDlg(TQWidget* parent, const char* name, bool popFilter, boo
   setMainWidget( w );
   TQHBoxLayout *topLayout = new TQHBoxLayout( w, 0, spacingHint(), "topLayout" );
   TQHBoxLayout *hbl = topLayout;
-  TQVBoxLayout *vbl2 = 0;
-  TQWidget *page1 = 0;
-  TQWidget *page2 = 0;
+  TQVBoxLayout *vbl2 = nullptr;
+  TQWidget *page1 = nullptr;
+  TQWidget *page2 = nullptr;
 
-  mFilterList = new KMFilterListBox( i18n("Available Filters"), w, 0, bPopFilter);
+  mFilterList = new KMFilterListBox( i18n("Available Filters"), w, nullptr, bPopFilter);
   topLayout->addWidget( mFilterList, 1 /*stretch*/ );
 
   if(!bPopFilter) {
@@ -199,7 +199,7 @@ KMFilterDlg::KMFilterDlg(TQWidget* parent, const char* name, bool popFilter, boo
       vbl3->addStretch( 1 );
       mApplyOnIn = new TQCheckBox( i18n("Apply this filter to incoming messages:"), adv_w );
       vbl3->addWidget( mApplyOnIn );
-      TQButtonGroup *bg = new TQButtonGroup( 0, "bg" );
+      TQButtonGroup *bg = new TQButtonGroup( nullptr, "bg" );
       bg->setExclusive( true );
       mApplyOnForAll = new TQRadioButton( i18n("from all accounts"), adv_w );
       bg->insert( mApplyOnForAll );
@@ -425,7 +425,7 @@ void KMFilterDlg::slotFilterSelected( KMFilter* aFilter )
 
 void KMFilterDlg::slotReset()
 {
-  mFilter = 0;
+  mFilter = nullptr;
   mPatternEdit->reset();
 
   if(bPopFilter) {
@@ -551,8 +551,8 @@ void KMFilterDlg::slotFilterActionIconChanged( TQString icon )
 void KMFilterDlg::slotUpdateAccountList()
 {
   mAccountList->clear();
-  TQListViewItem *top = 0;
-  for( KMAccount *a = kmkernel->acctMgr()->first(); a!=0;
+  TQListViewItem *top = nullptr;
+  for( KMAccount *a = kmkernel->acctMgr()->first(); a;
        a = kmkernel->acctMgr()->next() ) {
     TQCheckListItem *listItem =
       new TQCheckListItem( mAccountList, top, a->name(), TQCheckListItem::CheckBox );
@@ -679,7 +679,7 @@ void KMFilterListBox::createFilter( const TQCString & field,
 {
   KMSearchRule *newRule = KMSearchRule::createInstance( field, KMSearchRule::FuncContains, value );
 
-  KMFilter *newFilter = new KMFilter(0, bPopFilter);
+  KMFilter *newFilter = new KMFilter(nullptr, bPopFilter);
   newFilter->pattern()->append( newRule );
   newFilter->pattern()->setName( TQString("<%1>:%2").arg( TQString(field) ).arg( TQString(value) ) );
 
@@ -785,7 +785,7 @@ TQValueList<KMFilter*> KMFilterListBox::filtersForSaving() const
         TQString msg = i18n("The following filters have not been saved because they "
                    "were invalid (e.g. containing no actions or no search "
                    "rules).");
-        KMessageBox::informationList( 0, msg, emptyFilters, TQString(),
+        KMessageBox::informationList( nullptr, msg, emptyFilters, TQString(),
                       "ShowInvalidFilterWarning" );
       }
       return filters;
@@ -806,7 +806,7 @@ void KMFilterListBox::slotSelected( int aIdx )
 void KMFilterListBox::slotNew()
 {
   // just insert a new filter.
-  insertFilter( new KMFilter(0, bPopFilter) );
+  insertFilter( new KMFilter(nullptr, bPopFilter) );
   enableControls();
 }
 
@@ -940,14 +940,14 @@ void KMFilterListBox::slotRename()
   assert( filter );
 
   // allow empty names - those will turn auto-naming on again
-  TQValidator *validator = new TQRegExpValidator( TQRegExp( ".*" ), 0 );
+  TQValidator *validator = new TQRegExpValidator( TQRegExp( ".*" ), nullptr );
   TQString newName = KInputDialog::getText
     (
      i18n("Rename Filter"),
      i18n("Rename filter \"%1\" to:\n(leave the field empty for automatic naming)")
         .arg( filter->pattern()->name() ) /*label*/,
      filter->pattern()->name() /* initial value */,
-     &okPressed, topLevelWidget(), 0, validator
+     &okPressed, topLevelWidget(), nullptr, validator
      );
   delete validator;
 
@@ -1008,7 +1008,7 @@ void KMFilterListBox::loadFilterList( bool createDummyFilter )
   mFilterList.clear();
   mListBox->clear();
 
-  const KMFilterMgr *manager = 0;
+  const KMFilterMgr *manager = nullptr;
   if(bPopFilter)
   {
     mShowLater = kmkernel->popFilterMgr()->showLaterMsgs();
@@ -1199,7 +1199,7 @@ KMFilterAction * KMFilterActionWidget::action()
     }
   }
 
-  return 0;
+  return nullptr;
 }
 
 //=============================================================================
@@ -1211,7 +1211,7 @@ KMFilterAction * KMFilterActionWidget::action()
 KMFilterActionWidgetLister::KMFilterActionWidgetLister( TQWidget *parent, const char* name )
   : KWidgetLister( 1, FILTER_MAX_ACTIONS, parent, name )
 {
-  mActionList = 0;
+  mActionList = nullptr;
 }
 
 KMFilterActionWidgetLister::~KMFilterActionWidgetLister()
@@ -1259,7 +1259,7 @@ void KMFilterActionWidgetLister::reset()
   if ( mActionList )
     regenerateActionListFromWidgets();
 
-  mActionList = 0;
+  mActionList = nullptr;
   slotClear();
   ((TQWidget*)parent())->setEnabled(  false  );
 }
@@ -1272,7 +1272,7 @@ TQWidget* KMFilterActionWidgetLister::createWidget( TQWidget *parent )
 void KMFilterActionWidgetLister::clearWidget( TQWidget *aWidget )
 {
   if ( aWidget )
-    ((KMFilterActionWidget*)aWidget)->setAction(0);
+    ((KMFilterActionWidget*)aWidget)->setAction(nullptr);
 }
 
 void KMFilterActionWidgetLister::regenerateActionListFromWidgets()
diff --git a/kmail/kmfilterdlg.h b/kmail/kmfilterdlg.h
index 8e3b62f97..430bbda0a 100644
--- a/kmail/kmfilterdlg.h
+++ b/kmail/kmfilterdlg.h
@@ -63,7 +63,7 @@ class KMFilterListBox : public TQGroupBox
   
 public:
   /** Constuctor. */
-  KMFilterListBox( const TQString & title, TQWidget* parent=0, const char* name=0, bool popFilter = false);
+  KMFilterListBox( const TQString & title, TQWidget* parent=nullptr, const char* name=nullptr, bool popFilter = false);
 
   /** Called from KMFilterDlg. Creates a new filter and presets
       the first rule with "field equals value". It's there mainly to
@@ -200,7 +200,7 @@ class KMFilterActionWidget : public TQHBox
 public:
   /** Constructor. Creates a filter action widget with no type
       selected. */
-  KMFilterActionWidget( TQWidget* parent=0, const char* name=0 );
+  KMFilterActionWidget( TQWidget* parent=nullptr, const char* name=nullptr );
 
   /** Set an action. The action's type is determined and the
       corresponding widget it loaded with @p aAction's parameters and
@@ -232,7 +232,7 @@ class KMPopFilterActionWidget : public TQVButtonGroup
   TQ_OBJECT
   
 public:
-  KMPopFilterActionWidget( const TQString &title, TQWidget* parent=0, const char* name=0 );
+  KMPopFilterActionWidget( const TQString &title, TQWidget* parent=nullptr, const char* name=nullptr );
   void setAction( KMPopFilterAction aAction );
   KMPopFilterAction action();
 
@@ -257,7 +257,7 @@ class KMFilterActionWidgetLister : public KWidgetLister
   TQ_OBJECT
   
 public:
-  KMFilterActionWidgetLister( TQWidget *parent=0, const char* name=0 );
+  KMFilterActionWidgetLister( TQWidget *parent=nullptr, const char* name=nullptr );
 
   virtual ~KMFilterActionWidgetLister();
 
@@ -344,7 +344,7 @@ public:
   /** Create the filter dialog. The only class which should be able to
       do this is KMFilterMgr. This ensures that there is only a
       single filter dialog */
-  KMFilterDlg( TQWidget* parent=0, const char* name=0, bool popFilter=false,
+  KMFilterDlg( TQWidget* parent=nullptr, const char* name=nullptr, bool popFilter=false,
                bool createDummyFilter=true );
 
   /** Called from KMFilterMgr. Creates a new filter and presets
diff --git a/kmail/kmfiltermgr.cpp b/kmail/kmfiltermgr.cpp
index f98a78dd9..f596da6cd 100644
--- a/kmail/kmfiltermgr.cpp
+++ b/kmail/kmfiltermgr.cpp
@@ -34,7 +34,7 @@ using KMail::MessageProperty;
 
 //-----------------------------------------------------------------------------
 KMFilterMgr::KMFilterMgr( bool popFilter )
-  : mEditDialog( 0 ),
+  : mEditDialog( nullptr ),
     bPopFilter( popFilter ),
     mShowLater( false ),
     mDirtyBufferedFolderTarget( true ),
@@ -103,7 +103,7 @@ bool KMFilterMgr::beginFiltering(KMMsgBase *msgBase) const
   if (MessageProperty::filtering( msgBase ))
     return false;
   MessageProperty::setFiltering( msgBase, true );
-  MessageProperty::setFilterFolder( msgBase, 0 );
+  MessageProperty::setFilterFolder( msgBase, nullptr );
   if ( FilterLog::instance()->isLogging() ) {
     FilterLog::instance()->addSeparator();
   }
@@ -182,7 +182,7 @@ int KMFilterMgr::process( TQ_UINT32 serNum, const KMFilter *filter )
     return 1;
 
   if ( isMatching( serNum, filter ) ) {
-    KMFolder *folder = 0;
+    KMFolder *folder = nullptr;
     int idx = -1;
     // get the message with the serNum
     KMMsgDict::instance()->getLocation( serNum, &folder, &idx );
@@ -394,7 +394,7 @@ void KMFilterMgr::openDialog( TQWidget *, bool checkForEmptyFilterList )
     // We can't use the parent as long as the dialog is modeless
     // and there is one shared dialog for all top level windows.
     //
-    mEditDialog = new KMFilterDlg( 0, "filterdialog", bPopFilter,
+    mEditDialog = new KMFilterDlg( nullptr, "filterdialog", bPopFilter,
                                    checkForEmptyFilterList );
   }
   mEditDialog->show();
@@ -404,7 +404,7 @@ void KMFilterMgr::openDialog( TQWidget *, bool checkForEmptyFilterList )
 //-----------------------------------------------------------------------------
 void KMFilterMgr::createFilter( const TQCString & field, const TQString & value )
 {
-  openDialog( 0, false );
+  openDialog( nullptr, false );
   mEditDialog->createFilter( field, value );
 }
 
@@ -468,7 +468,7 @@ void KMFilterMgr::setFilters( const TQValueList<KMFilter*> &filters )
 
 void KMFilterMgr::slotFolderRemoved( KMFolder * aFolder )
 {
-  folderRemoved( aFolder, 0 );
+  folderRemoved( aFolder, nullptr );
 }
 
 //-----------------------------------------------------------------------------
diff --git a/kmail/kmfolder.cpp b/kmail/kmfolder.cpp
index 4bcd4992a..3f9e327be 100644
--- a/kmail/kmfolder.cpp
+++ b/kmail/kmfolder.cpp
@@ -47,8 +47,8 @@
 
 KMFolder::KMFolder( KMFolderDir* aParent, const TQString& aFolderName,
                              KMFolderType aFolderType, bool withIndex, bool exportedSernums )
-  : KMFolderNode( aParent, aFolderName ), mStorage(0),
-    mChild( 0 ),
+  : KMFolderNode( aParent, aFolderName ), mStorage(nullptr),
+    mChild( nullptr ),
     mIsSystemFolder( false ),
     mHasIndex( withIndex ),
     mExportsSernums( exportedSernums ),
@@ -58,7 +58,7 @@ KMFolder::KMFolder( KMFolderDir* aParent, const TQString& aFolderName,
     mReadExpireUnits( expireNever ),
     mExpireAction( ExpireDelete ),
     mUseCustomIcons( false ), mMailingListEnabled( false ),
-    mAcctList( 0 ),
+    mAcctList( nullptr ),
     mIdentity( 0 ), // default identity
     mPutRepliesInSameFolder( false ),
     mIgnoreNewMail( false )
@@ -82,7 +82,7 @@ KMFolder::KMFolder( KMFolderDir* aParent, const TQString& aFolderName,
     int rc = mStorage->create();
     TQString msg = i18n("<qt>Error while creating file <b>%1</b>:<br>%2</qt>").arg(aFolderName).arg(strerror(rc));
     if ( rc ) {
-      KMessageBox::information(0, msg);
+      KMessageBox::information(nullptr, msg);
     }
   }
 
@@ -273,8 +273,8 @@ KMFolderDir* KMFolder::createChildFolder()
     if (mkdir(TQFile::encodeName(childDir), S_IRWXU) != 0
       && chmod(TQFile::encodeName(childDir), S_IRWXU) != 0) {
       TQString wmsg = TQString(" '%1': %2").arg(childDir).arg(strerror(errno));
-      KMessageBox::information(0,i18n("Failed to create folder") + wmsg);
-      return 0;
+      KMessageBox::information(nullptr,i18n("Failed to create folder") + wmsg);
+      return nullptr;
     }
   }
 
@@ -286,7 +286,7 @@ KMFolderDir* KMFolder::createChildFolder()
 
   mChild = new KMFolderDir( this, parent(), childName, newType );
   if( !mChild )
-    return 0;
+    return nullptr;
   mChild->reload();
   parent()->append( mChild );
   return mChild;
@@ -820,7 +820,7 @@ void KMFolder::compact( CompactOptions options )
 
 KMFolder* KMFolder::trashFolder() const
 {
-  return mStorage ? mStorage->trashFolder() : 0;
+  return mStorage ? mStorage->trashFolder() : nullptr;
 }
 
 int KMFolder::writeIndex( bool createEmptyIndex )
diff --git a/kmail/kmfolder.h b/kmail/kmfolder.h
index e1178ee01..cb4830c66 100644
--- a/kmail/kmfolder.h
+++ b/kmail/kmfolder.h
@@ -125,7 +125,7 @@ public:
   AccountList* acctList() { return mAcctList; }
 
   /** Returns true if accounts are associated with this folder. */
-  bool hasAccounts() const { return (mAcctList != 0); }
+  bool hasAccounts() const { return mAcctList != nullptr; }
 
   /** This is used by the storage to read the folder specific configuration */
   void readConfig( TDEConfig* config );
@@ -197,11 +197,11 @@ public:
    * for each derived KMFolder).
    */
   FolderJob* createJob( KMMessage *msg, FolderJob::JobType jt = FolderJob::tGetMessage,
-                        KMFolder *folder = 0, TQString partSpecifier = TQString(),
-                        const AttachmentStrategy *as = 0 ) const;
+                        KMFolder *folder = nullptr, TQString partSpecifier = TQString(),
+                        const AttachmentStrategy *as = nullptr ) const;
   FolderJob* createJob( TQPtrList<KMMessage>& msgList, const TQString& sets,
                         FolderJob::JobType jt = FolderJob::tGetMessage,
-                        KMFolder *folder = 0 ) const;
+                        KMFolder *folder = nullptr ) const;
 
   /** Provides access to the basic message fields that are also stored
     in the index. Whenever you only need subject, from, date, status
@@ -227,12 +227,12 @@ public:
     is stored in index_return if given.
     Please note that the message is added as is to the folder and the folder
     takes ownership of the message (deleting it in the destructor).*/
-  int addMsg(KMMessage* msg, int* index_return = 0);
+  int addMsg(KMMessage* msg, int* index_return = nullptr);
 
   /** (Note(bo): This needs to be fixed better at a later point.)
       This is overridden by dIMAP because addMsg strips the X-UID
       header from the mail. */
-  int addMsgKeepUID(KMMessage* msg, int* index_return = 0);
+  int addMsgKeepUID(KMMessage* msg, int* index_return = nullptr);
 
   /**
    * Adds the given messages to the folder. Behaviour is identical
@@ -256,8 +256,8 @@ public:
     adds it to this folder. Returns zero on success and an errno error
     code on failure. The index of the new message is stored in index_return
     if given. */
-  int moveMsg(KMMessage* msg, int* index_return = 0);
-  int moveMsg(TQPtrList<KMMessage>, int* index_return = 0);
+  int moveMsg(KMMessage* msg, int* index_return = nullptr);
+  int moveMsg(TQPtrList<KMMessage>, int* index_return = nullptr);
 
   /** Returns the index of the given message or -1 if not found. */
   int find(const KMMsgBase* msg) const;
@@ -328,7 +328,7 @@ public:
 
   /** Physically rename the folder. Returns zero on success and an errno
     on failure. */
-  int rename(const TQString& newName, KMFolderDir *aParent = 0);
+  int rename(const TQString& newName, KMFolderDir *aParent = nullptr);
 
   /** Returns true if the table of contents is dirty. This happens when
     a message is deleted from the folder. The toc will then be re-created
diff --git a/kmail/kmfoldercachedimap.cpp b/kmail/kmfoldercachedimap.cpp
index 740abf94b..2453e0bb5 100644
--- a/kmail/kmfoldercachedimap.cpp
+++ b/kmail/kmfoldercachedimap.cpp
@@ -129,7 +129,7 @@ DImapTroubleShootDialog::DImapTroubleShootDialog( TQWidget* parent,
                       "and all its subfolders.</p>" );
   topLayout->addWidget( new TQLabel( txt, page ) );
 
-  mButtonGroup = new TQButtonGroup( 0 );
+  mButtonGroup = new TQButtonGroup( nullptr );
 
   mIndexButton = new TQRadioButton( page );
   mIndexButton->setText( i18n( "Rebuild &Index" ) );
@@ -169,7 +169,7 @@ int DImapTroubleShootDialog::run()
 
 void DImapTroubleShootDialog::slotChanged()
 {
-  enableButtonOK( mButtonGroup->selected() != 0 );
+  enableButtonOK( mButtonGroup->selected() != nullptr );
 }
 
 void DImapTroubleShootDialog::slotDone()
@@ -212,7 +212,7 @@ KMFolderCachedImap::KMFolderCachedImap( KMFolder* folder, const char* aName )
   // if we fail to read a uid file but there is one, nuke it
   if ( readUidCache() == -1 ) {
     if ( TQFile::exists( uidCacheLocation() ) ) {
-        KMessageBox::error( 0,
+        KMessageBox::error( nullptr,
         i18n( "The UID cache file for folder %1 could not be read. There "
               "could be a problem with file system permission, or it is corrupted."
               ).arg( folder->prettyURL() ) );
@@ -318,7 +318,7 @@ void KMFolderCachedImap::readConfig()
   kdDebug( 5006 ) << "READING IN UIDSDeletedSinceLastSync: " << folder()->prettyURL() << endl << uids << endl;
 #endif
   for ( TQStringList::iterator it = delUids.begin(); it != delUids.end(); it++ ) {
-    mDeletedUIDsSinceLastSync.insert( (*it).toULong(), 0);
+    mDeletedUIDsSinceLastSync.insert( (*it).toULong(), nullptr);
   }
 }
 
@@ -484,7 +484,7 @@ int KMFolderCachedImap::writeUidCache()
         return 0;
     }
   }
-  KMessageBox::error( 0,
+  KMessageBox::error( nullptr,
         i18n( "The UID cache file for folder %1 could not be written. There "
               "could be a problem with file system permission." ).arg( folder()->prettyURL() ) );
 
@@ -574,7 +574,7 @@ void KMFolderCachedImap::rememberDeletion( int idx )
   assert(msg);
   long uid = msg->UID();
   assert(uid>=0);
-  mDeletedUIDsSinceLastSync.insert(uid, 0);
+  mDeletedUIDsSinceLastSync.insert(uid, nullptr);
   kdDebug(5006) << "Explicit delete of UID " << uid << " at index: " << idx << " in " << folder()->prettyURL() << endl;
 }
 
@@ -606,11 +606,11 @@ bool KMFolderCachedImap::canRemoveFolder() const {
 int KMFolderCachedImap::rename( const TQString& aName,
                                 KMFolderDir* /*aParent*/ )
 {
-  if ( account() == 0 || imapPath().isEmpty() ) {
+  if ( !account() || imapPath().isEmpty() ) {
     // This can happen when creating a folder and then renaming it without syncing before,
     // see https://issues.kolab.org/issue3658
     TQString err = i18n("You must synchronize with the server before renaming IMAP folders.");
-    KMessageBox::error( 0, err );
+    KMessageBox::error( nullptr, err );
     return -1;
   }
 
@@ -698,7 +698,7 @@ KMMsgBase* KMFolderCachedImap::findByUID( ulong uid )
   // Not found by now
  // if( mapReloaded )
     // Not here then
-    return 0;
+    return nullptr;
   // There could be a problem in the maps. Rebuild them and try again
   reloadUidMap();
   it = uidMap.find( uid );
@@ -710,14 +710,14 @@ KMMsgBase* KMFolderCachedImap::findByUID( ulong uid )
     kdDebug(5006) << "Reloaded, but stil didn't find uid: " << uid << endl;
 #endif
   // Then it's not here
-  return 0;
+  return nullptr;
 }
 
 // This finds and sets the proper account for this folder if it has
 // not been done
 KMAcctCachedImap *KMFolderCachedImap::account() const
 {
-  if( (KMAcctCachedImap *)mAccount == 0 && kmkernel && kmkernel->acctMgr() ) {
+  if( !(KMAcctCachedImap *)mAccount && kmkernel && kmkernel->acctMgr() ) {
     // Find the account
     mAccount = static_cast<KMAcctCachedImap *>( kmkernel->acctMgr()->findByName( name() ) );
   }
@@ -732,7 +732,7 @@ void KMFolderCachedImap::slotTroubleshoot()
   if( rc == DImapTroubleShootDialog::RefreshCache ) {
     // Refresh cache
     if( !account() ) {
-      KMessageBox::sorry( 0, i18n("No account setup for this folder.\n"
+      KMessageBox::sorry( nullptr, i18n("No account setup for this folder.\n"
                                   "Please try running a sync before this.") );
       return;
     }
@@ -742,7 +742,7 @@ void KMFolderCachedImap::slotTroubleshoot()
                        "folders.").arg( label() );
     TQString s1 = i18n("Refresh IMAP Cache");
     TQString s2 = i18n("&Refresh");
-    if( KMessageBox::warningContinueCancel( 0, str, s1, s2 ) ==
+    if( KMessageBox::warningContinueCancel( nullptr, str, s1, s2 ) ==
         KMessageBox::Continue )
       account()->invalidateIMAPFolders( this );
   } else {
@@ -764,7 +764,7 @@ void KMFolderCachedImap::slotTroubleshoot()
       default:
         return;
     }
-    KMessageBox::information( 0, i18n( "The index of this folder has been "
+    KMessageBox::information( nullptr, i18n( "The index of this folder has been "
                                        "recreated." ) );
     writeIndex();
     kmkernel->getKMMainWidget()->folderSelected();
@@ -774,7 +774,7 @@ void KMFolderCachedImap::slotTroubleshoot()
 void KMFolderCachedImap::serverSync( bool recurse, bool quotaOnly )
 {
   if( mSyncState != SYNC_STATE_INITIAL ) {
-    if( KMessageBox::warningYesNo( 0, i18n("Folder %1 is not in initial sync state (state was %2). Do you want to reset it to initial sync state and sync anyway?" ).arg( imapPath() ).arg( mSyncState ), TQString(), i18n("Reset && Sync"), KStdGuiItem::cancel() ) == KMessageBox::Yes ) {
+    if( KMessageBox::warningYesNo( nullptr, i18n("Folder %1 is not in initial sync state (state was %2). Do you want to reset it to initial sync state and sync anyway?" ).arg( imapPath() ).arg( mSyncState ), TQString(), i18n("Reset && Sync"), KStdGuiItem::cancel() ) == KMessageBox::Yes ) {
       mSyncState = SYNC_STATE_INITIAL;
     } else return;
   }
@@ -1023,7 +1023,7 @@ void KMFolderCachedImap::serverSyncInternal()
     if ( !mQuotaOnly ) {
       if( !listDirectory() ) {
         mSyncState = SYNC_STATE_INITIAL;
-        KMessageBox::error(0, i18n("Error while retrieving the folderlist"));
+        KMessageBox::error(nullptr, i18n("Error while retrieving the folderlist"));
       }
       break;
     }
@@ -1388,7 +1388,7 @@ void KMFolderCachedImap::syncNextSubFolder( bool secondSync )
 void KMFolderCachedImap::buildSubFolderList()
 {
   mSubfoldersForSync.clear();
-  mCurrentSubfolder = 0;
+  mCurrentSubfolder = nullptr;
   if( folder() && folder()->child() ) {
     KMFolderNode *node = folder()->child()->first();
     while( node ) {
@@ -1420,7 +1420,7 @@ void KMFolderCachedImap::disconnectSubFolderSignals()
               this, TQ_SLOT( slotSubFolderComplete(KMFolderCachedImap*, bool) ) );
   disconnect( mCurrentSubfolder, TQ_SIGNAL( closeToQuotaChanged() ),
               this, TQ_SLOT( slotSubFolderCloseToQuotaChanged() ) );
-  mCurrentSubfolder = 0;
+  mCurrentSubfolder = nullptr;
 }
 
 /* Connected to the imap account's connectionResult signal.
@@ -1477,7 +1477,7 @@ void KMFolderCachedImap::uploadNewMessages()
     if ( mUserRights != mOldUserRights && (mOldUserRights & KMail::ACLJobs::Insert)
          && !(mUserRights & KMail::ACLJobs::Insert) ) {
       // write access revoked
-      KMessageBox::information( 0, i18n("<p>Your access rights to folder <b>%1</b> have been restricted, "
+      KMessageBox::information( nullptr, i18n("<p>Your access rights to folder <b>%1</b> have been restricted, "
           "it will no longer be possible to add messages to this folder.</p>").arg( folder()->prettyURL() ),
           i18n("Acces rights revoked"), "KMailACLRevocationNotification" );
     }
@@ -2091,7 +2091,7 @@ void KMFolderCachedImap::slotCheckNamespace( const TQStringList& subfolderNames,
   }
 
   folder()->createChildFolder();
-  KMFolderNode *node = 0;
+  KMFolderNode *node = nullptr;
   for ( node = folder()->child()->first(); node;
         node = folder()->child()->next())
   {
@@ -2224,7 +2224,7 @@ void KMFolderCachedImap::slotListResult( const TQStringList& folderNames,
   mProgress += 5;
 
   // just in case there is nothing to rescue
-  slotRescueDone( 0 );
+  slotRescueDone( nullptr );
 }
 
 // This synchronizes the local folders as needed (creation/deletion). No network communication here.
@@ -2236,7 +2236,7 @@ void KMFolderCachedImap::listDirectory2()
   bool root = ( this == mAccount->rootFolder() );
   if ( root && !mAccount->hasInbox() )
   {
-    KMFolderCachedImap *f = 0;
+    KMFolderCachedImap *f = nullptr;
     KMFolderNode *node;
     // create the INBOX
     for (node = folder()->child()->first(); node; node = folder()->child()->next())
@@ -2278,8 +2278,8 @@ void KMFolderCachedImap::listDirectory2()
   for (uint i = 0; i < mSubfolderNames.count(); i++) {
 
     // Find the subdir, if already present
-    KMFolderCachedImap *f = 0;
-    KMFolderNode *node = 0;
+    KMFolderCachedImap *f = nullptr;
+    KMFolderNode *node = nullptr;
     for (node = folder()->child()->first(); node;
          node = folder()->child()->next())
       if (!node->isDir() && node->name() == mSubfolderNames[i]) break;
@@ -2297,7 +2297,7 @@ void KMFolderCachedImap::listDirectory2()
       // (could be that the folder was deleted & recreated meanwhile from another client...)
       if ( !locallyDeleted && mAccount->isPreviouslyDeletedFolder( subfolderPath ) ) {
            locallyDeleted = KMessageBox::warningYesNo(
-             0, i18n( "<qt><p>It seems that the folder <b>%1</b> was deleted. Do you want to delete it from the server?</p></qt>" ).arg( mSubfolderNames[i] ), TQString(), KStdGuiItem::del(), KStdGuiItem::cancel() ) == KMessageBox::Yes;
+             nullptr, i18n( "<qt><p>It seems that the folder <b>%1</b> was deleted. Do you want to delete it from the server?</p></qt>" ).arg( mSubfolderNames[i] ), TQString(), KStdGuiItem::del(), KStdGuiItem::cancel() ) == KMessageBox::Yes;
       }
 
       if ( locallyDeleted ) {
@@ -2414,7 +2414,7 @@ KMFolderCachedImap* KMFolderCachedImap::findParent( const TQString& path,
       }
     }
   }
-  return 0;
+  return nullptr;
 }
 
 void KMFolderCachedImap::slotSubFolderComplete(KMFolderCachedImap* sub, bool success)
@@ -2465,7 +2465,7 @@ KMFolderCachedImap::doCreateJob( KMMessage *msg, FolderJob::JobType jt, KMFolder
 {
   TQPtrList<KMMessage> msgList;
   msgList.append( msg );
-  CachedImapJob *job = new CachedImapJob( msgList, jt, folder? static_cast<KMFolderCachedImap*>( folder->storage() ):0 );
+  CachedImapJob *job = new CachedImapJob( msgList, jt, folder? static_cast<KMFolderCachedImap*>( folder->storage() ):nullptr );
   job->setParentFolder( this );
   return job;
 }
@@ -2476,7 +2476,7 @@ KMFolderCachedImap::doCreateJob( TQPtrList<KMMessage>& msgList, const TQString&
 {
   //FIXME: how to handle sets here?
   Q_UNUSED( sets );
-  CachedImapJob *job = new CachedImapJob( msgList, jt, folder? static_cast<KMFolderCachedImap*>( folder->storage() ):0 );
+  CachedImapJob *job = new CachedImapJob( msgList, jt, folder? static_cast<KMFolderCachedImap*>( folder->storage() ):nullptr );
   job->setParentFolder( this );
   return job;
 }
@@ -2809,7 +2809,7 @@ void KMFolderCachedImap::slotGetAnnotationResult( TDEIO::Job* job )
       // that's when the imap server doesn't support annotations
       if ( GlobalSettings::self()->theIMAPResourceStorageFormat() == GlobalSettings::EnumTheIMAPResourceStorageFormat::XML
            && (uint)GlobalSettings::self()->theIMAPResourceAccount() == mAccount->id() )
-	KMessageBox::error( 0, i18n( "The IMAP server %1 does not have support for IMAP annotations. The XML storage cannot be used on this server; please re-configure KMail differently." ).arg( mAccount->host() ) );
+	KMessageBox::error( nullptr, i18n( "The IMAP server %1 does not have support for IMAP annotations. The XML storage cannot be used on this server; please re-configure KMail differently." ).arg( mAccount->host() ) );
       mAccount->setHasNoAnnotationSupport();
     }
     else
@@ -2837,7 +2837,7 @@ void KMFolderCachedImap::slotMultiUrlGetAnnotationResult( TDEIO::Job* job )
       // that's when the imap server doesn't support annotations
       if ( GlobalSettings::self()->theIMAPResourceStorageFormat() == GlobalSettings::EnumTheIMAPResourceStorageFormat::XML
            && (uint)GlobalSettings::self()->theIMAPResourceAccount() == mAccount->id() )
-        KMessageBox::error( 0, i18n( "The IMAP server %1 doesn't have support for imap annotations. The XML storage cannot be used on this server, please re-configure KMail differently" ).arg( mAccount->host() ) );
+        KMessageBox::error( nullptr, i18n( "The IMAP server %1 doesn't have support for imap annotations. The XML storage cannot be used on this server, please re-configure KMail differently" ).arg( mAccount->host() ) );
       mAccount->setHasNoAnnotationSupport();
     }
     else
@@ -3017,7 +3017,7 @@ int KMFolderCachedImap::createIndexFromContentsRecursive()
   if ( !folder() || !folder()->child() )
     return 0;
 
-  KMFolderNode *node = 0;
+  KMFolderNode *node = nullptr;
   for( TQPtrListIterator<KMFolderNode> it( *folder()->child() ); (node = it.current()); ++it ) {
     if( !node->isDir() ) {
       KMFolderCachedImap* storage = static_cast<KMFolderCachedImap*>(static_cast<KMFolder*>(node)->storage());
@@ -3058,8 +3058,8 @@ KMCommand* KMFolderCachedImap::rescueUnsyncedMessages()
   TQValueList<unsigned long> newMsgs = findNewMessages();
   kdDebug() << k_funcinfo << newMsgs << " of " << count() << endl;
   if ( newMsgs.isEmpty() )
-    return 0;
-  KMFolder *dest = 0;
+    return nullptr;
+  KMFolder *dest = nullptr;
   bool manualMove = true;
   while ( GlobalSettings::autoLostFoundMove() ) {
     // find the inbox of this account
@@ -3075,7 +3075,7 @@ KMCommand* KMFolderCachedImap::rescueUnsyncedMessages()
 
     // create lost+found folder if needed
     KMFolderNode *node;
-    KMFolder *lfFolder = 0;
+    KMFolder *lfFolder = nullptr;
     if ( !(node = inboxDir->hasNamedFolder( i18n("lost+found") )) ) {
       kdDebug(5006) << k_funcinfo << "creating lost+found folder" << endl;
       KMFolder* folder = kmkernel->dimapFolderMgr()->createFolder(
@@ -3114,7 +3114,7 @@ KMCommand* KMFolderCachedImap::rescueUnsyncedMessages()
     dest->storage()->setContentsType( contentsType() );
     dest->storage()->writeConfig();
 
-    KMessageBox::sorry( 0, i18n("<p>There are new messages in folder <b>%1</b>, which "
+    KMessageBox::sorry( nullptr, i18n("<p>There are new messages in folder <b>%1</b>, which "
           "have not been uploaded to the server yet, but the folder has been deleted "
           "on the server or you do not "
           "have sufficient access rights on the folder to upload them.</p>"
@@ -3133,7 +3133,7 @@ KMCommand* KMFolderCachedImap::rescueUnsyncedMessages()
           "Please contact your administrator to allow upload of new messages "
           "to you, or move them out of this folder.</p> "
           "<p>Do you want to move these messages to another folder now?</p>").arg( folder()->prettyURL() ) );
-    if ( KMessageBox::warningYesNo( 0, msg, TQString(), i18n("Move"), i18n("Do Not Move") ) == KMessageBox::Yes ) {
+    if ( KMessageBox::warningYesNo( nullptr, msg, TQString(), i18n("Move"), i18n("Do Not Move") ) == KMessageBox::Yes ) {
       KMail::KMFolderSelDlg dlg( kmkernel->getKMMainWidget(),
           i18n("Move Messages to Folder"), true );
       if ( dlg.exec() ) {
@@ -3153,7 +3153,7 @@ KMCommand* KMFolderCachedImap::rescueUnsyncedMessages()
     command->start();
     return command;
   }
-  return 0;
+  return nullptr;
 }
 
 void KMFolderCachedImap::rescueUnsyncedMessagesAndDeleteFolder( KMFolder *folder, bool root )
diff --git a/kmail/kmfoldercachedimap.h b/kmail/kmfoldercachedimap.h
index 56e3dc27e..5d885e4b2 100644
--- a/kmail/kmfoldercachedimap.h
+++ b/kmail/kmfoldercachedimap.h
@@ -76,7 +76,7 @@ public:
     RefreshCache
   };
 
-  DImapTroubleShootDialog( TQWidget* parent=0, const char* name=0 );
+  DImapTroubleShootDialog( TQWidget* parent=nullptr, const char* name=nullptr );
 
   static int run();
 
@@ -103,7 +103,7 @@ public:
   /** Usually a parent is given. But in some cases there is no
     fitting parent object available. Then the name of the folder
     is used as the absolute path to the folder file. */
-  KMFolderCachedImap(KMFolder* folder, const char* name=0);
+  KMFolderCachedImap(KMFolder* folder, const char* name=nullptr);
   virtual ~KMFolderCachedImap();
 
   /**  @reimpl */
@@ -185,7 +185,7 @@ public:
   int progress() const { return mProgress; }
 
   /* Reimplemented from KMFolder. Moving is not supported, so aParent must be 0 */
-  virtual int rename(const TQString& aName, KMFolderDir *aParent=0);
+  virtual int rename(const TQString& aName, KMFolderDir *aParent=nullptr);
 
   /**
    * Reimplemented from KMFolderMaildir
@@ -202,10 +202,10 @@ public:
   void takeTemporarily( int idx );
 
   /* Reimplemented from KMFolderMaildir */
-  virtual int addMsg(KMMessage* msg, int* index_return = 0);
+  virtual int addMsg(KMMessage* msg, int* index_return = nullptr);
   /* internal version that doesn't remove the X-UID header */
-  virtual int addMsgInternal(KMMessage* msg, bool, int* index_return = 0);
-  virtual int addMsgKeepUID(KMMessage* msg, int* index_return = 0) {
+  virtual int addMsgInternal(KMMessage* msg, bool, int* index_return = nullptr);
+  virtual int addMsgKeepUID(KMMessage* msg, int* index_return = nullptr) {
     return addMsgInternal(msg, false, index_return);
   }
 
diff --git a/kmail/kmfoldercombobox.cpp b/kmail/kmfoldercombobox.cpp
index 4b722c758..56aab8947 100644
--- a/kmail/kmfoldercombobox.cpp
+++ b/kmail/kmfoldercombobox.cpp
@@ -133,7 +133,7 @@ void KMFolderComboBox::setFolder( const TQString &idString )
      insertItem(idString, -1);
      setCurrentItem(mSpecialIdx);
 
-     mFolder = 0;
+     mFolder = nullptr;
      return;
   }
   setFolder( folder );
@@ -151,7 +151,7 @@ KMFolder *KMFolderComboBox::getFolder()
   createFolderList( &names, &folders );
 
   if (currentItem() == mSpecialIdx)
-     return 0;
+     return nullptr;
 
   TQString text = currentText();
   int idx = 0;
@@ -175,7 +175,7 @@ void KMFolderComboBox::slotActivated(int index)
 
   if (index == mSpecialIdx)
   {
-     mFolder = 0;
+     mFolder = nullptr;
   }
   else
   {
diff --git a/kmail/kmfoldercombobox.h b/kmail/kmfoldercombobox.h
index 42461c0b9..d5a99ca86 100644
--- a/kmail/kmfoldercombobox.h
+++ b/kmail/kmfoldercombobox.h
@@ -17,8 +17,8 @@ class KMFolderComboBox : public TQComboBox
   
 
 public:
-  KMFolderComboBox( TQWidget *parent = 0, char *name = 0 );
-  KMFolderComboBox( bool rw, TQWidget *parent = 0, char *name = 0 );
+  KMFolderComboBox( TQWidget *parent = nullptr, char *name = nullptr );
+  KMFolderComboBox( bool rw, TQWidget *parent = nullptr, char *name = nullptr );
 
   /** Select whether the outbox folder is shown.  Default is yes. */
   void showOutboxFolder(bool shown);
diff --git a/kmail/kmfolderdia.cpp b/kmail/kmfolderdia.cpp
index ac008ee18..97d12f71f 100644
--- a/kmail/kmfolderdia.cpp
+++ b/kmail/kmfolderdia.cpp
@@ -91,8 +91,8 @@ KMFolderDialog::KMFolderDialog(KMFolder *aFolder, KMFolderDir *aFolderDir,
                KDialogBase::Ok, aParent, "KMFolderDialog", true ),
   mFolder( aFolder ),
   mFolderDir( aFolderDir ),
-  mParentFolder( 0 ),
-  mIsNewFolder( aFolder == 0 ),
+  mParentFolder( nullptr ),
+  mIsNewFolder( !aFolder ),
   mFolderTree( aParent )
 {
   kdDebug(5006)<<"KMFolderDialog::KMFolderDialog()" << endl;
@@ -248,7 +248,7 @@ KMail::FolderDiaGeneralTab::FolderDiaGeneralTab( KMFolderDialog* dlg,
                                                  const TQString& aName,
                                                  TQWidget* parent, const char* name )
   : FolderDiaTab( parent, name ),
-  mSharedSeenFlagsCheckBox( 0 ),
+  mSharedSeenFlagsCheckBox( nullptr ),
   mDlg( dlg )
 {
 
@@ -275,9 +275,9 @@ KMail::FolderDiaGeneralTab::FolderDiaGeneralTab( KMFolderDialog* dlg,
          mDlg->folder()->storage() && mDlg->parentFolder()->storage() &&
          ( mDlg->folder()->folderType() == KMFolderTypeCachedImap ||
            mDlg->folder()->folderType() == KMFolderTypeImap ) ) {
-      ImapAccountBase *account = 0;
-      KMFolderCachedImap *dimap = 0;
-      KMFolderImap *imap = 0;
+      ImapAccountBase *account = nullptr;
+      KMFolderCachedImap *dimap = nullptr;
+      KMFolderImap *imap = nullptr;
       if ( mDlg->folder()->folderType() == KMFolderTypeCachedImap ) {
         dimap = static_cast<KMFolderCachedImap*>( mDlg->folder()->storage() );
         account = dynamic_cast<ImapAccountBase*>( dimap->account() );
@@ -515,11 +515,11 @@ KMail::FolderDiaGeneralTab::FolderDiaGeneralTab( KMFolderDialog* dlg,
     if ( mDlg->folder()->isReadOnly() || mIsResourceFolder )
       mContentsComboBox->setEnabled( false );
   } else {
-    mContentsComboBox = 0;
+    mContentsComboBox = nullptr;
   }
 
-  mIncidencesForComboBox = 0;
-  mAlarmsBlockedCheckBox = 0;
+  mIncidencesForComboBox = nullptr;
+  mAlarmsBlockedCheckBox = nullptr;
 
   // Kolab incidences-for annotation.
   // Show incidences-for combobox if the contents type can be changed (new folder),
@@ -689,7 +689,7 @@ bool FolderDiaGeneralTab::save()
   folder->setPutRepliesInSameFolder( mKeepRepliesInSameFolderCheckBox->isChecked() );
 
   TQString fldName, oldFldName;
-  KMFolderCachedImap* dimap = 0;
+  KMFolderCachedImap* dimap = nullptr;
   if ( folder->folderType() == KMFolderTypeCachedImap )
     dimap = static_cast<KMFolderCachedImap *>( mDlg->folder()->storage() );
 
@@ -796,7 +796,7 @@ void FolderDiaGeneralTab::slotChangeIcon( TQString icon ) // can't use a const-r
 //----------------------------------------------------------------------------
 KMail::FolderDiaTemplatesTab::FolderDiaTemplatesTab( KMFolderDialog* dlg,
                                                      TQWidget* parent )
-  : FolderDiaTab( parent, 0 ), mDlg( dlg )
+  : FolderDiaTab( parent, nullptr ), mDlg( dlg )
 {
 
   mIsLocalSystemFolder = mDlg->folder()->isSystemFolder();
diff --git a/kmail/kmfolderdia.h b/kmail/kmfolderdia.h
index b1f418625..43b4bfdf1 100644
--- a/kmail/kmfolderdia.h
+++ b/kmail/kmfolderdia.h
@@ -71,7 +71,7 @@ class FolderDiaTab : public TQWidget
   TQ_OBJECT
   
 public:
-   FolderDiaTab( TQWidget *parent=0, const char* name=0 )
+   FolderDiaTab( TQWidget *parent=nullptr, const char* name=nullptr )
      : TQWidget( parent, name ) {}
 
   virtual void load() = 0;
@@ -116,7 +116,7 @@ class FolderDiaGeneralTab : public FolderDiaTab
 public:
   FolderDiaGeneralTab( KMFolderDialog* dlg,
                        const TQString& aName,
-                       TQWidget* parent, const char* name = 0 );
+                       TQWidget* parent, const char* name = nullptr );
 
   virtual void load();
   virtual bool save();
diff --git a/kmail/kmfolderdir.cpp b/kmail/kmfolderdir.cpp
index 19baf48f3..9764ae51e 100644
--- a/kmail/kmfolderdir.cpp
+++ b/kmail/kmfolderdir.cpp
@@ -20,7 +20,7 @@
 //=============================================================================
 KMFolderRootDir::KMFolderRootDir(KMFolderMgr* manager, const TQString& path,
                                  KMFolderDirType dirType)
-  : KMFolderDir( 0, 0, path, dirType ),
+  : KMFolderDir( nullptr, nullptr, path, dirType ),
     mPath( path ),
     mManager( manager )
 {
@@ -103,7 +103,7 @@ KMFolder* KMFolderDir::createFolder(const TQString& aFolderName, bool aSysFldr,
   else
     fld = new KMFolder( this, aFolderName, aFolderType );
 
-  assert(fld != 0);
+  assert(fld);
   fld->setSystemFolder(aSysFldr);
 
   KMFolderNode* fNode;
@@ -207,7 +207,7 @@ bool KMFolderDir::reload(void)
   if (!dir.cd(fldPath, true))
   {
     TQString msg = i18n("<qt>Cannot enter folder <b>%1</b>.</qt>").arg(fldPath);
-    KMessageBox::information(0, msg);
+    KMessageBox::information(nullptr, msg);
     return false;
   }
 
@@ -215,7 +215,7 @@ bool KMFolderDir::reload(void)
   if (!fiList)
   {
     TQString msg = i18n("<qt>Folder <b>%1</b> is unreadable.</qt>").arg(fldPath);
-    KMessageBox::information(0, msg);
+    KMessageBox::information(nullptr, msg);
     return false;
   }
 
@@ -347,7 +347,7 @@ KMFolderNode* KMFolderDir::hasNamedFolder(const TQString& aName)
     if (fNode->name() == aName)
       return fNode;
   }
-  return 0;
+  return nullptr;
 }
 
 
diff --git a/kmail/kmfolderdir.h b/kmail/kmfolderdir.h
index 18f1cbc56..1a550017c 100644
--- a/kmail/kmfolderdir.h
+++ b/kmail/kmfolderdir.h
@@ -18,7 +18,7 @@ class KMFolderDir: public KMFolderNode, public KMFolderNodeList
   
 
 public:
-  KMFolderDir( KMFolder * owner, KMFolderDir * parent = 0,
+  KMFolderDir( KMFolder * owner, KMFolderDir * parent = nullptr,
                const TQString& path = TQString(),
                KMFolderDirType = KMStandardDir );
   virtual ~KMFolderDir();
diff --git a/kmail/kmfolderimap.cpp b/kmail/kmfolderimap.cpp
index ee573c17c..282f11e0f 100644
--- a/kmail/kmfolderimap.cpp
+++ b/kmail/kmfolderimap.cpp
@@ -67,7 +67,7 @@ KMFolderImap::KMFolderImap(KMFolder* folder, const char* aName)
 {
   mContentState = imapNoInformation;
   mSubfolderState = imapNoInformation;
-  mAccount = 0;
+  mAccount = nullptr;
   mIsSelected = false;
   mLastUid = 0;
   mCheckFlags = true;
@@ -77,9 +77,9 @@ KMFolderImap::KMFolderImap(KMFolder* folder, const char* aName)
   mUserRightsState = KMail::ACLJobs::NotFetchedYet;
   mAlreadyRemoved = false;
   mHasChildren = ChildrenUnknown;
-  mMailCheckProgressItem = 0;
-  mListDirProgressItem = 0;
-  mAddMessageProgressItem = 0;
+  mMailCheckProgressItem = nullptr;
+  mListDirProgressItem = nullptr;
+  mAddMessageProgressItem = nullptr;
   mReadOnly = false;
 
   connect (this, TQ_SIGNAL( folderComplete( KMFolderImap*, bool ) ),
@@ -134,10 +134,10 @@ KMFolder* KMFolderImap::trashFolder() const
 KMMessage* KMFolderImap::getMsg(int idx)
 {
   if(!(idx >= 0 && idx <= count()))
-    return 0;
+    return nullptr;
 
   KMMsgBase* mb = getMsgBase(idx);
-  if (!mb) return 0;
+  if (!mb) return nullptr;
   if (mb->isMessage())
   {
     return ((KMMessage*)mb);
@@ -156,12 +156,12 @@ KMAcctImap* KMFolderImap::account() const
     KMFolderDir *parentFolderDir = dynamic_cast<KMFolderDir*>( folder()->parent() );
     if ( !parentFolderDir ) {
       kdWarning() << k_funcinfo << "No parent folder dir found for " << name() << endl;
-      return 0;
+      return nullptr;
     }
     KMFolder *parentFolder = parentFolderDir->owner();
     if ( !parentFolder ) {
       kdWarning() << k_funcinfo << "No parent folder found for " << name() << endl;
-      return 0;
+      return nullptr;
     }
     KMFolderImap *parentStorage = dynamic_cast<KMFolderImap*>( parentFolder->storage() );
     if ( parentStorage )
@@ -300,7 +300,7 @@ void KMFolderImap::removeMsg( const TQPtrList<KMMessage>& msgList, bool quiet )
 
   TQPtrListIterator<KMMessage> it( msgList );
   KMMessage *msg;
-  while ( (msg = it.current()) != 0 ) {
+  while ((msg = it.current()) != nullptr) {
     ++it;
     int idx = find(msg);
     assert( idx != -1);
@@ -339,7 +339,7 @@ void KMFolderImap::addMsgQuiet(KMMessage* aMsg)
   }
 
   delete aMsg;
-  aMsg = 0;
+  aMsg = nullptr;
   getFolder();
 }
 
@@ -349,7 +349,7 @@ void KMFolderImap::addMsgQuiet(TQPtrList<KMMessage> msgList)
   if ( mAddMessageProgressItem )
   {
     mAddMessageProgressItem->setComplete();
-    mAddMessageProgressItem = 0;
+    mAddMessageProgressItem = nullptr;
   }
   KMFolder *aFolder = msgList.first()->parent();
   int undoId = -1;
@@ -394,7 +394,7 @@ int KMFolderImap::addMsg(TQPtrList<KMMessage>& msgList, TQValueList<int>& aIndex
   KMMessage *aMsg = msgList.getFirst();
   KMFolder *msgParent = aMsg->parent();
 
-  ImapJob *imapJob = 0;
+  ImapJob *imapJob = nullptr;
   if (msgParent)
   {
     if (msgParent->folderType() == KMFolderTypeImap)
@@ -453,7 +453,7 @@ int KMFolderImap::addMsg(TQPtrList<KMMessage>& msgList, TQValueList<int>& aIndex
         // different account, check if messages can be added
         TQPtrListIterator<KMMessage> it( msgList );
         KMMessage *msg;
-        while ( (msg = it.current()) != 0 )
+        while ((msg = it.current()) != nullptr)
         {
           ++it;
           int index;
@@ -474,7 +474,7 @@ int KMFolderImap::addMsg(TQPtrList<KMMessage>& msgList, TQValueList<int>& aIndex
     // transfer from local folders or other accounts
     TQPtrListIterator<KMMessage> it( msgList );
     KMMessage* msg;
-    while ( ( msg = it.current() ) != 0 )
+    while ((msg = it.current()) != nullptr)
     {
       ++it;
       if ( !msg->transferInProgress() )
@@ -558,8 +558,8 @@ TQPtrList<KMMessage> KMFolderImap::splitMessageList(const TQString& set,
   if (!last_uid.isEmpty())
   {
     TQPtrListIterator<KMMessage> it( msgList );
-    KMMessage* msg = 0;
-    while ( (msg = it.current()) != 0 )
+    KMMessage* msg = nullptr;
+    while ((msg = it.current()) != nullptr)
     {
       // append the msg to the new list and delete it from the old
       temp_msgs.append(msg);
@@ -582,7 +582,7 @@ TQPtrList<KMMessage> KMFolderImap::splitMessageList(const TQString& set,
 KMMessage* KMFolderImap::take(int idx)
 {
   KMMsgBase* mb(mMsgList[idx]);
-  if (!mb) return 0;
+  if (!mb) return nullptr;
   if (!mb->isMessage()) readMsg(idx);
 
   KMMessage *msg = static_cast<KMMessage*>(mb);
@@ -679,7 +679,7 @@ void KMFolderImap::slotCheckNamespace( const TQStringList& subfolderNames,
   }
 
   folder()->createChildFolder();
-  KMFolderNode *node = 0;
+  KMFolderNode *node = nullptr;
   for ( node = folder()->child()->first(); node;
         node = folder()->child()->next())
   {
@@ -814,8 +814,8 @@ void KMFolderImap::slotListResult( const TQStringList& subfolderNames,
     checkFolders( subfolderNames, jobData.curNamespace );
   }
 
-  KMFolderImap *f = 0;
-  KMFolderNode *node = 0;
+  KMFolderImap *f = nullptr;
+  KMFolderNode *node = nullptr;
   for ( uint i = 0; i < subfolderNames.count(); i++ )
   {
     bool settingsChanged = false;
@@ -884,8 +884,8 @@ void KMFolderImap::slotListResult( const TQStringList& subfolderNames,
 //-----------------------------------------------------------------------------
 void KMFolderImap::initInbox()
 {
-  KMFolderImap *f = 0;
-  KMFolderNode *node = 0;
+  KMFolderImap *f = nullptr;
+  KMFolderNode *node = nullptr;
 
   for (node = folder()->child()->first(); node;
       node = folder()->child()->next()) {
@@ -935,7 +935,7 @@ KMFolderImap* KMFolderImap::findParent( const TQString& path, const TQString& na
       }
     }
   }
-  return 0;
+  return nullptr;
 }
 
 //-----------------------------------------------------------------------------
@@ -1060,7 +1060,7 @@ void KMFolderImap::checkValidity()
   }
   // otherwise we already are inside a mailcheck
   if ( !mMailCheckProgressItem ) {
-    ProgressItem* parent = ( account()->checkingSingleFolder() ? 0 :
+    ProgressItem* parent = ( account()->checkingSingleFolder() ? nullptr :
         account()->mailCheckProgressItem() );
     mMailCheckProgressItem = ProgressManager::createProgressItem(
               parent,
@@ -1570,7 +1570,7 @@ void KMFolderImap::slotGetMessagesData(TDEIO::Job * job, const TQByteArray & dat
       msg->fromString( (*it).cdata.mid(16, pos - 16) );
       flags = msg->headerField("X-Flags").toInt();
       ulong uid = msg->UID();
-      KMMsgMetaData *md =  0;
+      KMMsgMetaData *md =  nullptr;
       if ( mUidMetaDataMap.find( uid ) ) {
           md =  mUidMetaDataMap[uid];
       }
@@ -1588,7 +1588,7 @@ void KMFolderImap::slotGetMessagesData(TDEIO::Job * job, const TQByteArray & dat
         ok = false;
       if ( !ok ) {
         delete msg;
-        msg = 0;
+        msg = nullptr;
       } else {
         if ( serNum > 0 ) {
           // assign the sernum from the cache
@@ -1611,7 +1611,7 @@ void KMFolderImap::slotGetMessagesData(TDEIO::Job * job, const TQByteArray & dat
             delete md;
           }
         }
-        KMFolderMbox::addMsg(msg, 0);
+        KMFolderMbox::addMsg(msg, nullptr);
         // Merge with the flags from the server.
         flagsToStatus((KMMsgBase*)msg, flags, true, mUploadAllFlags ? 31 : mPermanentFlags);
         // set the correct size
@@ -1647,7 +1647,7 @@ KMFolderImap::doCreateJob( KMMessage *msg, FolderJob::JobType jt,
                            KMFolder *folder, TQString partSpecifier,
                            const AttachmentStrategy *as ) const
 {
-  KMFolderImap* kmfi = folder? dynamic_cast<KMFolderImap*>(folder->storage()) : 0;
+  KMFolderImap* kmfi = folder? dynamic_cast<KMFolderImap*>(folder->storage()) : nullptr;
   if ( jt == FolderJob::tGetMessage && partSpecifier == "STRUCTURE" &&
        account() && account()->loadOnDemand() &&
        ( msg->msgSizeServer() > 5000 || msg->msgSizeServer() == 0 ) &&
@@ -1772,7 +1772,7 @@ void KMFolderImap::slotCreateFolderResult(TDEIO::Job * job)
 
 
 //-----------------------------------------------------------------------------
-static TQTextCodec *sUtf7Codec = 0;
+static TQTextCodec *sUtf7Codec = nullptr;
 
 TQTextCodec * KMFolderImap::utf7Codec()
 {
@@ -1839,7 +1839,7 @@ void KMFolderImap::deleteMessage(KMMessage * msg)
     return;
   TDEIO::SimpleJob *job = TDEIO::file_delete(url, false);
   TDEIO::Scheduler::assignJobToSlave(account()->slave(), job);
-  ImapAccountBase::jobData jd( url.url(), 0 );
+  ImapAccountBase::jobData jd( url.url(), nullptr );
   account()->insertJob(job, jd);
   connect(job, TQ_SIGNAL(result(TDEIO::Job *)),
           account(), TQ_SLOT(slotSimpleResult(TDEIO::Job *)));
@@ -1849,7 +1849,7 @@ void KMFolderImap::deleteMessage(const TQPtrList<KMMessage>& msgList)
 {
   TQPtrListIterator<KMMessage> it( msgList );
   KMMessage *msg;
-  while ( (msg = it.current()) != 0 ) {
+  while ((msg = it.current()) != nullptr) {
     ++it;
     mUidMetaDataMap.remove( msg->UID() );
     mMetaDataMap.remove( msg->msgIdMD5() );
@@ -1872,7 +1872,7 @@ void KMFolderImap::deleteMessage(const TQPtrList<KMMessage>& msgList)
       return;
     TDEIO::SimpleJob *job = TDEIO::file_delete(url, false);
     TDEIO::Scheduler::assignJobToSlave(account()->slave(), job);
-    ImapAccountBase::jobData jd( url.url(), 0 );
+    ImapAccountBase::jobData jd( url.url(), nullptr );
     account()->insertJob(job, jd);
     connect(job, TQ_SIGNAL(result(TDEIO::Job *)),
         account(), TQ_SLOT(slotSimpleResult(TDEIO::Job *)));
@@ -1915,7 +1915,7 @@ void KMFolderImap::setStatus(TQValueList<int>& _ids, KMMsgStatus status, bool to
     // FIXME duplicated code in KMFolderCachedImap
     TQValueList<ulong> seenUids, unseenUids;
     for ( TQValueList<int>::ConstIterator it = ids.constBegin(); it != ids.constEnd(); ++it ) {
-      KMMessage *msg = 0;
+      KMMessage *msg = nullptr;
       bool unget = !isMessage(*it);
       msg = getMsg(*it);
       if (!msg) continue;
@@ -1944,7 +1944,7 @@ void KMFolderImap::setStatus(TQValueList<int>& _ids, KMMsgStatus status, bool to
 
   TQMap< TQString, TQStringList > groups;
   for ( TQValueList<int>::Iterator it = ids.begin(); it != ids.end(); ++it ) {
-    KMMessage *msg = 0;
+    KMMessage *msg = nullptr;
     bool unget = !isMessage(*it);
     msg = getMsg(*it);
     if (!msg) continue;
@@ -2039,7 +2039,7 @@ TQStringList KMFolderImap::makeSets( TQValueList<ulong>& uids, bool sort )
 //-----------------------------------------------------------------------------
 void KMFolderImap::getUids(TQValueList<int>& ids, TQValueList<ulong>& uids)
 {
-  KMMsgBase *msg = 0;
+  KMMsgBase *msg = nullptr;
   // get the uids
   for ( TQValueList<int>::Iterator it = ids.begin(); it != ids.end(); ++it )
   {
@@ -2051,10 +2051,10 @@ void KMFolderImap::getUids(TQValueList<int>& ids, TQValueList<ulong>& uids)
 
 void KMFolderImap::getUids(const TQPtrList<KMMessage>& msgList, TQValueList<ulong>& uids)
 {
-  KMMessage *msg = 0;
+  KMMessage *msg = nullptr;
 
   TQPtrListIterator<KMMessage> it( msgList );
-  while ( (msg = it.current()) != 0 ) {
+  while ((msg = it.current()) != nullptr) {
     ++it;
     if ( msg->UID() > 0 ) {
       uids.append( msg->UID() );
@@ -2072,7 +2072,7 @@ void KMFolderImap::expungeFolder(KMFolderImap * aFolder, bool quiet)
     return;
   TDEIO::SimpleJob *job = TDEIO::file_delete(url, false);
   TDEIO::Scheduler::assignJobToSlave(account()->slave(), job);
-  ImapAccountBase::jobData jd( url.url(), 0 );
+  ImapAccountBase::jobData jd( url.url(), nullptr );
   jd.quiet = quiet;
   account()->insertJob(job, jd);
   connect(job, TQ_SIGNAL(result(TDEIO::Job *)),
@@ -2244,7 +2244,7 @@ int KMFolderImap::expungeContents()
   {
     TDEIO::SimpleJob *job = TDEIO::file_delete(url, false);
     TDEIO::Scheduler::assignJobToSlave(account()->slave(), job);
-    ImapAccountBase::jobData jd( url.url(), 0 );
+    ImapAccountBase::jobData jd( url.url(), nullptr );
     jd.quiet = true;
     account()->insertJob(job, jd);
     connect(job, TQ_SIGNAL(result(TDEIO::Job *)),
@@ -2273,7 +2273,7 @@ void KMFolderImap::slotCompleteMailCheckProgress()
 {
   if ( mMailCheckProgressItem ) {
     mMailCheckProgressItem->setComplete();
-    mMailCheckProgressItem = 0;
+    mMailCheckProgressItem = nullptr;
     emit numUnreadMsgsChanged( folder() );
   }
 }
diff --git a/kmail/kmfolderimap.h b/kmail/kmfolderimap.h
index 12f2928e3..58c36e79c 100644
--- a/kmail/kmfolderimap.h
+++ b/kmail/kmfolderimap.h
@@ -102,7 +102,7 @@ public:
   /** Usually a parent is given. But in some cases there is no
     fitting parent object available. Then the name of the folder
     is used as the absolute path to the folder file. */
-  KMFolderImap(KMFolder* folder, const char* name=0);
+  KMFolderImap(KMFolder* folder, const char* name=nullptr);
   virtual ~KMFolderImap();
 
   /** Returns the type of this folder */
@@ -128,7 +128,7 @@ public:
   virtual void removeMsg(int i, bool quiet = false);
   virtual void removeMsg(const TQPtrList<KMMessage>& msgList, bool quiet = false);
 
-  virtual int rename( const TQString& newName, KMFolderDir *aParent = 0 );
+  virtual int rename( const TQString& newName, KMFolderDir *aParent = nullptr );
 
   /** Remove the IMAP folder on the server and if successful also locally */
   virtual void remove();
@@ -359,7 +359,7 @@ public slots:
     is stored in index_return if given.
     Please note that the message is added as is to the folder and the folder
     takes ownership of the message (deleting it in the destructor).*/
-  virtual int addMsg(KMMessage* msg, int* index_return = 0);
+  virtual int addMsg(KMMessage* msg, int* index_return = nullptr);
   virtual int addMsg(TQPtrList<KMMessage>&, TQValueList<int>& index_return);
 
   /** Copy the messages to this folder */
diff --git a/kmail/kmfolderindex.cpp b/kmail/kmfolderindex.cpp
index 42b5d0c5b..0bd5ca339 100644
--- a/kmail/kmfolderindex.cpp
+++ b/kmail/kmfolderindex.cpp
@@ -77,8 +77,8 @@
 KMFolderIndex::KMFolderIndex(KMFolder* folder, const char* name)
   : FolderStorage(folder, name), mMsgList(INIT_MSGS)
 {
-    mIndexStream = 0;
-    mIndexStreamPtr = 0;
+    mIndexStream = nullptr;
+    mIndexStreamPtr = nullptr;
     mIndexStreamPtrLength = 0;
     mIndexSwapByteOrder = false;
     mIndexSizeOfLong = sizeof(long);
@@ -132,7 +132,7 @@ int KMFolderIndex::writeIndex( bool createEmptyIndex )
   TQString indexName;
   mode_t old_umask;
   int len;
-  const uchar *buffer = 0;
+  const uchar *buffer = nullptr;
 
   indexName = indexLocation();
   tempName = indexName + ".temp";
@@ -140,7 +140,7 @@ int KMFolderIndex::writeIndex( bool createEmptyIndex )
 
   // We touch the folder, otherwise the index is regenerated, if KMail is
   // running, while the clock switches from daylight savings time to normal time
-  utime(TQFile::encodeName(location()), 0);
+  utime(TQFile::encodeName(location()), nullptr);
 
   old_umask = umask(077);
   FILE *tmpIndexStream = fopen(TQFile::encodeName(tempName), "w");
@@ -223,7 +223,7 @@ bool KMFolderIndex::readIndex()
   TQ_INT32 len;
   KMMsgInfo* mi;
 
-  assert(mIndexStream != 0);
+  assert(mIndexStream);
   rewind(mIndexStream);
 
   clearIndex();
@@ -241,7 +241,7 @@ bool KMFolderIndex::readIndex()
   clearIndex();
   while (!feof(mIndexStream))
   {
-    mi = 0;
+    mi = nullptr;
     if(version >= 1505) {
       if(!fread(&len, sizeof(len), 1, mIndexStream)) {
         // Seems to be normal?
@@ -266,7 +266,7 @@ bool KMFolderIndex::readIndex()
       if (feof(mIndexStream)) break;
       if (*line.data() == '\0') {
         fclose(mIndexStream);
-        mIndexStream = 0;
+        mIndexStream = nullptr;
         clearIndex();
         return false;
       }
@@ -333,7 +333,7 @@ int KMFolderIndex::count(bool cache) const
 bool KMFolderIndex::readIndexHeader(int *gv)
 {
   int indexVersion;
-  assert(mIndexStream != 0);
+  assert(mIndexStream);
   mIndexSwapByteOrder = false;
   mIndexSizeOfLong = sizeof(long);
 
@@ -364,7 +364,7 @@ bool KMFolderIndex::readIndexHeader(int *gv)
       return false;
   } else if(indexVersion > INDEX_VERSION) {
       tdeApp->setOverrideCursor(KCursor::arrowCursor());
-      int r = KMessageBox::questionYesNo(0,
+      int r = KMessageBox::questionYesNo(nullptr,
 					 i18n(
 					    "The mail index for '%1' is from an unknown version of KMail (%2).\n"
 					    "This index can be regenerated from your mail folder, but some "
@@ -429,16 +429,16 @@ bool KMFolderIndex::updateIndexStreamPtr(bool)
 {
     // We touch the folder, otherwise the index is regenerated, if KMail is
     // running, while the clock switches from daylight savings time to normal time
-    utime(TQFile::encodeName(location()), 0);
-    utime(TQFile::encodeName(indexLocation()), 0);
-    utime(TQFile::encodeName( KMMsgDict::getFolderIdsLocation( *this ) ), 0);
+    utime(TQFile::encodeName(location()), nullptr);
+    utime(TQFile::encodeName(indexLocation()), nullptr);
+    utime(TQFile::encodeName( KMMsgDict::getFolderIdsLocation( *this ) ), nullptr);
 
   mIndexSwapByteOrder = false;
 #ifdef HAVE_MMAP
     if(just_close) {
 	if(mIndexStreamPtr)
 	    munmap((char *)mIndexStreamPtr, mIndexStreamPtrLength);
-	mIndexStreamPtr = 0;
+	mIndexStreamPtr = nullptr;
 	mIndexStreamPtrLength = 0;
 	return true;
     }
@@ -448,17 +448,17 @@ bool KMFolderIndex::updateIndexStreamPtr(bool)
     if(fstat(fileno(mIndexStream), &stat_buf) == -1) {
 	if(mIndexStreamPtr)
 	    munmap((char *)mIndexStreamPtr, mIndexStreamPtrLength);
-	mIndexStreamPtr = 0;
+	mIndexStreamPtr = nullptr;
 	mIndexStreamPtrLength = 0;
 	return false;
     }
     if(mIndexStreamPtr)
 	munmap((char *)mIndexStreamPtr, mIndexStreamPtrLength);
     mIndexStreamPtrLength = stat_buf.st_size;
-    mIndexStreamPtr = (uchar *)mmap(0, mIndexStreamPtrLength, PROT_READ, MAP_SHARED,
+    mIndexStreamPtr = (uchar *)mmap(nullptr, mIndexStreamPtrLength, PROT_READ, MAP_SHARED,
 				    fileno(mIndexStream), 0);
     if(mIndexStreamPtr == MAP_FAILED) {
-	mIndexStreamPtr = 0;
+	mIndexStreamPtr = nullptr;
 	mIndexStreamPtrLength = 0;
 	return false;
     }
@@ -517,7 +517,7 @@ KMMsgInfo* KMFolderIndex::setIndexEntry( int idx, KMMessage *msg )
 
   *msgInfo = *msg;
   mMsgList.set( idx, msgInfo );
-  msg->setMsgInfo( 0 );
+  msg->setMsgInfo( nullptr );
   delete msg;
   return msgInfo;
 }
@@ -525,7 +525,7 @@ KMMsgInfo* KMFolderIndex::setIndexEntry( int idx, KMMessage *msg )
 void KMFolderIndex::recreateIndex( bool readIndexAfterwards )
 {
   tdeApp->setOverrideCursor(KCursor::arrowCursor());
-  KMessageBox::information(0,
+  KMessageBox::information(nullptr,
        i18n("The mail index for '%1' is corrupted and will be regenerated now, "
             "but some information, like status flags, might get lost.").arg(name()));
   tdeApp->restoreOverrideCursor();
diff --git a/kmail/kmfolderindex.h b/kmail/kmfolderindex.h
index 1f4fb1b57..163724c6e 100644
--- a/kmail/kmfolderindex.h
+++ b/kmail/kmfolderindex.h
@@ -56,7 +56,7 @@ public:
   /** Usually a parent is given. But in some cases there is no
     fitting parent object available. Then the name of the folder
     is used as the absolute path to the folder file. */
-  KMFolderIndex(KMFolder* folder, const char* name=0);
+  KMFolderIndex(KMFolder* folder, const char* name=nullptr);
   virtual ~KMFolderIndex();
   virtual int count(bool cache = false) const;
 
@@ -101,7 +101,7 @@ protected:
   bool readIndex();
 
   /** Read index header. Called from within readIndex(). */
-  bool readIndexHeader(int *gv=0);
+  bool readIndexHeader(int *gv=nullptr);
 
   /** Create index file from messages file and fill the message-info list
       mMsgList. Returns 0 on success and an errno value (see fopen) on
diff --git a/kmail/kmfoldermaildir.cpp b/kmail/kmfoldermaildir.cpp
index 09d88c0e0..d2cd8d241 100644
--- a/kmail/kmfoldermaildir.cpp
+++ b/kmail/kmfoldermaildir.cpp
@@ -85,10 +85,10 @@ int KMFolderMaildir::canAccess()
     int nRetVal = TQFile::exists(sBadFolderName) ? EPERM : ENOENT;
     KCursorSaver idle(KBusyPtr::idle());
     if ( nRetVal == ENOENT )
-      KMessageBox::sorry(0, i18n("Error opening %1; this folder is missing.")
+      KMessageBox::sorry(nullptr, i18n("Error opening %1; this folder is missing.")
                          .arg(sBadFolderName));
     else
-      KMessageBox::sorry(0, i18n("Error opening %1; either this is not a valid "
+      KMessageBox::sorry(nullptr, i18n("Error opening %1; either this is not a valid "
                                  "maildir folder, or you do not have sufficient access permissions.")
                          .arg(sBadFolderName));
     return nRetVal;
@@ -119,7 +119,7 @@ int KMFolderMaildir::open(const char *)
     if (KMFolderIndex::IndexOk != indexStatus()) // test if contents file has changed
     {
       TQString str;
-      mIndexStream = 0;
+      mIndexStream = nullptr;
       str = i18n("Folder `%1' changed; recreating index.")
 		  .arg(name());
       emit statusMsg(str);
@@ -238,7 +238,7 @@ void KMFolderMaildir::reallyDoClose(const char* owner)
   }
 
   mOpenCount   = 0;
-  mIndexStream = 0;
+  mIndexStream = nullptr;
   mUnreadMsgs  = -1;
 
   mMsgList.reset(INIT_MSGS);
@@ -484,7 +484,7 @@ if( fileD0.open( IO_WriteOnly ) ) {
   // write index entry if desired
   if (mAutoCreateIndex)
   {
-    assert(mIndexStream != 0);
+    assert(mIndexStream);
     clearerr(mIndexStream);
     fseek(mIndexStream, 0, SEEK_END);
     off_t revert = ftell(mIndexStream);
@@ -614,7 +614,7 @@ void KMFolderMaildir::readFileHeaderIntern(const TQString& dir, const TQString&
   char line[MAX_LINE];
   bool atEof    = false;
   bool inHeader = true;
-  TQCString *lastStr = 0;
+  TQCString *lastStr = nullptr;
 
   TQCString dateStr, fromStr, toStr, subjStr;
   TQCString xmarkStr, replyToIdStr, msgIdStr, referencesStr;
@@ -758,7 +758,7 @@ void KMFolderMaildir::readFileHeaderIntern(const TQString& dir, const TQString&
           *lastStr += line + i;
     }
     else
-      lastStr = 0;
+      lastStr = nullptr;
 
     if (inHeader && (line[0] == '\n' || line[0] == '\r'))
       inHeader = false;
@@ -867,7 +867,7 @@ int KMFolderMaildir::createIndexFromContents()
   TQFileInfoListIterator it(*list);
   TQFileInfo *fi;
 
-  while ((fi = it.current()))
+  while ((fi = it.current()) != nullptr)
   {
     readFileHeaderIntern(curDir.path(), fi->fileName(), KMMsgStatusRead);
     ++it;
@@ -877,7 +877,7 @@ int KMFolderMaildir::createIndexFromContents()
   list = newDir.entryInfoList();
   it = *list;
 
-  while ((fi=it.current()))
+  while ((fi = it.current()) != nullptr)
   {
     readFileHeaderIntern(newDir.path(), fi->fileName(), KMMsgStatusNew);
     ++it;
@@ -892,7 +892,7 @@ int KMFolderMaildir::createIndexFromContents()
   correctUnreadMsgsCount();
 
   if (kmkernel->outboxFolder() == folder() && count() > 0)
-    KMessageBox::information(0, i18n("Your outbox contains messages which were "
+    KMessageBox::information(nullptr, i18n("Your outbox contains messages which were "
     "most-likely not created by KMail;\nplease remove them from there if you "
     "do not want KMail to send them."));
 
@@ -941,13 +941,13 @@ KMMessage* KMFolderMaildir::take(int idx)
   KMMessage *msg = KMFolderIndex::take(idx);
 
   if (!msg || !msg->fileName()) {
-    return 0;
+    return nullptr;
   }
 
   if ( removeFile(msg->fileName()) ) {
     return msg;
   } else {
-    return 0;
+    return nullptr;
   }
 }
 
@@ -992,7 +992,7 @@ static bool removeDirAndContentsRecursively( const TQString & path )
   TQFileInfoListIterator it( *list );
   TQFileInfo *fi;
 
-  while ( (fi = it.current()) != 0 ) {
+  while ((fi = it.current()) != nullptr) {
     if( fi->isDir() ) {
       if ( fi->fileName() != "." && fi->fileName() != ".." )
         success = success && removeDirAndContentsRecursively( fi->absFilePath() );
@@ -1026,7 +1026,7 @@ int KMFolderMaildir::removeContents()
   return 0;
 }
 
-static TQRegExp *suffix_regex = 0;
+static TQRegExp *suffix_regex = nullptr;
 static KStaticDeleter<TQRegExp> suffix_regex_sd;
 
 //-----------------------------------------------------------------------------
@@ -1038,7 +1038,7 @@ TQString KMFolderMaildir::constructValidFileName( const TQString & filename,
 
   if (aFileName.isEmpty())
   {
-    aFileName.sprintf("%ld.%d.", (long)time(0), getpid());
+    aFileName.sprintf("%ld.%d.", (long)time(nullptr), getpid());
     aFileName += TDEApplication::randomString(5);
   }
 
@@ -1114,7 +1114,7 @@ TQ_INT64 KMFolderMaildir::doFolderSize() const
   mCurrentlyCheckingFolderSize = true;
 
   KFileItemList list;
-  KFileItem *item = 0;
+  KFileItem *item = nullptr;
   item = new KFileItem( S_IFDIR, -1, location() + "/cur" );
   list.append( item );
   item = new KFileItem( S_IFDIR, -1, location() + "/new" );
diff --git a/kmail/kmfoldermaildir.h b/kmail/kmfoldermaildir.h
index 83aced185..815dca5fa 100644
--- a/kmail/kmfoldermaildir.h
+++ b/kmail/kmfoldermaildir.h
@@ -30,7 +30,7 @@ public:
   /** Usually a parent is given. But in some cases there is no
     fitting parent object available. Then the name of the folder
     is used as the absolute path to the folder file. */
-  KMFolderMaildir(KMFolder* folder, const char* name=0);
+  KMFolderMaildir(KMFolder* folder, const char* name=nullptr);
   virtual ~KMFolderMaildir();
 
   /** Returns the type of this folder */
@@ -49,7 +49,7 @@ public:
     is stored in index_return if given.
     Please note that the message is added as is to the folder and the folder
     takes ownership of the message (deleting it in the destructor).*/
-  virtual int addMsg(KMMessage* msg, int* index_return = 0);
+  virtual int addMsg(KMMessage* msg, int* index_return = nullptr);
 
   /** Remove (first occurrence of) given message from the folder. */
   virtual void removeMsg(int i, bool imapQuiet = false);
@@ -142,7 +142,7 @@ protected:
    * delete the original.
    * TODO: Avoid this by moving the take() out of the addMsg() methods and moving it
    * into the KMMoveCommand, where it can safely happen at a much higher level. */
-  int addMsgInternal( KMMessage* msg, int* index_return = 0, bool stripUid=false );
+  int addMsgInternal( KMMessage* msg, int* index_return = nullptr, bool stripUid=false );
 
 private slots:
   void slotDirSizeJobResult( TDEIO::Job* job );
diff --git a/kmail/kmfoldermbox.cpp b/kmail/kmfoldermbox.cpp
index 7d1b99270..82424db2a 100644
--- a/kmail/kmfoldermbox.cpp
+++ b/kmail/kmfoldermbox.cpp
@@ -73,7 +73,7 @@ using KPIM::BroadcastStatus;
 KMFolderMbox::KMFolderMbox(KMFolder* folder, const char* name)
   : KMFolderIndex(folder, name)
 {
-  mStream         = 0;
+  mStream         = nullptr;
   mFilesLocked    = false;
   mReadOnly       = false;
   mLockType       = lock_none;
@@ -147,20 +147,20 @@ int KMFolderMbox::open(const char *owner)
           bool showMessage =
             configGroup.readBoolEntry( "showIndexRegenerationMessage", true );
           if (showMessage)
-            KMessageBox::queuedMessageBox( 0, KMessageBox::Information,
+            KMessageBox::queuedMessageBox( nullptr, KMessageBox::Information,
                                            msg, i18n("Index Out of Date"),
                                            KMessageBox::AllowLink );
         }
         else
         {
             KCursorSaver idle(KBusyPtr::idle());
-            KMessageBox::information( 0, msg, i18n("Index Out of Date"),
+            KMessageBox::information( nullptr, msg, i18n("Index Out of Date"),
                                       "showIndexRegenerationMessage",
                                       KMessageBox::AllowLink );
         }
        }
        TQString str;
-       mIndexStream = 0;
+       mIndexStream = nullptr;
        str = i18n("Folder `%1' changed. Recreating index.")
              .arg(name());
        emit statusMsg(str);
@@ -281,8 +281,8 @@ void KMFolderMbox::reallyDoClose(const char* owner)
     }
   }
   mOpenCount   = 0;
-  mStream      = 0;
-  mIndexStream = 0;
+  mStream      = nullptr;
+  mIndexStream = nullptr;
   mFilesLocked = false;
   mUnreadMsgs  = -1;
 
@@ -310,7 +310,7 @@ int KMFolderMbox::lock()
   fl.l_len=0;
   fl.l_pid=-1;
   TQCString cmd_str;
-  assert(mStream != 0);
+  assert(mStream);
   mFilesLocked = false;
   mReadOnly = false;
 
@@ -462,7 +462,7 @@ int KMFolderMbox::unlock()
   fl.l_len=0;
   TQCString cmd_str;
 
-  assert(mStream != 0);
+  assert(mStream);
   mFilesLocked = false;
 
   switch( mLockType )
@@ -544,7 +544,7 @@ int KMFolderMbox::createIndexFromContents()
 {
   char line[MAX_LINE];
   char status[8], xstatus[8];
-  TQCString subjStr, dateStr, fromStr, toStr, xmarkStr, *lastStr=0;
+  TQCString subjStr, dateStr, fromStr, toStr, xmarkStr, *lastStr=nullptr;
   TQCString replyToIdStr, replyToAuxIdStr, referencesStr, msgIdStr;
   TQCString sizeServerStr, uidStr;
   TQCString contentTypeStr, charset;
@@ -556,7 +556,7 @@ int KMFolderMbox::createIndexFromContents()
   int i, num, numStatus;
   short needStatus;
 
-  assert(mStream != 0);
+  assert(mStream);
   rewind(mStream);
 
   mMsgList.clear();
@@ -716,7 +716,7 @@ int KMFolderMbox::createIndexFromContents()
       if (line [i] < ' ' && line [i]>0) inHeader = false;
       else if (lastStr) *lastStr += line + i;
     }
-    else lastStr = 0;
+    else lastStr = nullptr;
 
     if (inHeader && (line [0]=='\n' || line [0]=='\r'))
       inHeader = false;
@@ -802,7 +802,7 @@ int KMFolderMbox::createIndexFromContents()
   correctUnreadMsgsCount();
 
   if (kmkernel->outboxFolder() == folder() && count() > 0)
-    KMessageBox::queuedMessageBox(0, KMessageBox::Information,
+    KMessageBox::queuedMessageBox(nullptr, KMessageBox::Information,
                                   i18n("Your outbox contains messages which were "
     "most-likely not created by KMail;\nplease remove them from there if you "
     "do not want KMail to send them."));
@@ -817,8 +817,8 @@ KMMessage* KMFolderMbox::readMsg(int idx)
 {
   KMMsgInfo* mi = (KMMsgInfo*)mMsgList[idx];
 
-  assert(mi!=0 && !mi->isMessage());
-  assert(mStream != 0);
+  assert(mi && !mi->isMessage());
+  assert(mStream);
 
   KMMessage *msg = new KMMessage(*mi);
   msg->setMsgInfo( mi ); // remember the KMMsgInfo object to that we can restore it when the KMMessage object is no longer needed
@@ -908,8 +908,8 @@ DwString KMFolderMbox::getDwString(int idx)
 {
   KMMsgInfo* mi = (KMMsgInfo*)mMsgList[idx];
 
-  assert(mi!=0);
-  assert(mStream != 0);
+  assert(mi);
+  assert(mStream);
 
   size_t msgSize = mi->msgSize();
   char* msgText = new char[ msgSize + 1 ];
@@ -992,7 +992,7 @@ if( fileD1.open( IO_WriteOnly ) ) {
   msgText = escapeFrom( aMsg->asDwString() );
   size_t len = msgText.size();
 
-  assert(mStream != 0);
+  assert(mStream);
   clearerr(mStream);
   if (len <= 0)
   {
@@ -1095,7 +1095,7 @@ if( fileD1.open( IO_WriteOnly ) ) {
   // write index entry if desired
   if (mAutoCreateIndex)
   {
-    assert(mIndexStream != 0);
+    assert(mIndexStream);
     clearerr(mIndexStream);
     fseek(mIndexStream, 0, SEEK_END);
     revert = ftell(mIndexStream);
diff --git a/kmail/kmfoldermbox.h b/kmail/kmfoldermbox.h
index 38348a15a..b3d750f37 100644
--- a/kmail/kmfoldermbox.h
+++ b/kmail/kmfoldermbox.h
@@ -55,7 +55,7 @@ public:
   /** Usually a parent is given. But in some cases there is no
     fitting parent object available. Then the name of the folder
     is used as the absolute path to the folder file. */
-  KMFolderMbox(KMFolder* folder, const char* name=0);
+  KMFolderMbox(KMFolder* folder, const char* name=nullptr);
   virtual ~KMFolderMbox();
 
   /** Returns the type of this folder */
@@ -70,7 +70,7 @@ public:
     is stored in index_return if given.
     Please note that the message is added as is to the folder and the folder
     takes ownership of the message (deleting it in the destructor).*/
-  virtual int addMsg( KMMessage* msg, int* index_return = 0 );
+  virtual int addMsg( KMMessage* msg, int* index_return = nullptr );
 
   /** Open folder for access.
     Does nothing if the folder is already opened. To reopen a folder
diff --git a/kmail/kmfoldermgr.cpp b/kmail/kmfoldermgr.cpp
index 3ff8f48bd..0c69041b1 100644
--- a/kmail/kmfoldermgr.cpp
+++ b/kmail/kmfoldermgr.cpp
@@ -46,7 +46,7 @@ KMFolderMgr::KMFolderMgr(const TQString& aBasePath, KMFolderDirType dirType):
   mQuiet = 0;
   mChanged = false;
   setBasePath(aBasePath);
-  mRemoveOrig = 0;
+  mRemoveOrig = nullptr;
 }
 
 
@@ -91,7 +91,7 @@ void KMFolderMgr::expireAll() {
 int KMFolderMgr::folderCount(KMFolderDir *dir)
 {
   int count = 0;
-  if (dir == 0)
+  if (!dir)
     dir = &mDir;
   DO_FOR_ALL(
         {
@@ -110,7 +110,7 @@ int KMFolderMgr::folderCount(KMFolderDir *dir)
 //-----------------------------------------------------------------------------
 void KMFolderMgr::compactAllFolders(bool immediate, KMFolderDir* dir)
 {
-  if (dir == 0)
+  if (!dir)
     dir = &mDir;
   DO_FOR_ALL(
         {
@@ -144,13 +144,13 @@ void KMFolderMgr::setBasePath(const TQString& aBasePath)
   // I guess - till
   if ( info.exists() ) {
    if ( !info.isDir() ) {
-      KMessageBox::sorry(0, i18n("'%1' does not appear to be a folder.\n"
+      KMessageBox::sorry(nullptr, i18n("'%1' does not appear to be a folder.\n"
                                  "Please move the file out of the way.")
                             .arg( mBasePath ) );
       ::exit(-1);
     }
     if ( !info.isReadable() || !info.isWritable() ) {
-      KMessageBox::sorry(0, i18n("The permissions of the folder '%1' are "
+      KMessageBox::sorry(nullptr, i18n("The permissions of the folder '%1' are "
                                "incorrect;\n"
                                "please make sure that you can view and modify "
                                "the content of this folder.")
@@ -160,7 +160,7 @@ void KMFolderMgr::setBasePath(const TQString& aBasePath)
    } else {
     // ~/Mail (or whatever the user specified) doesn't exist, create it
     if ( ::mkdir( TQFile::encodeName( mBasePath ) , S_IRWXU ) == -1 ) {
-      KMessageBox::sorry(0, i18n("KMail could not create folder '%1';\n"
+      KMessageBox::sorry(nullptr, i18n("KMail could not create folder '%1';\n"
                                  "please make sure that you can view and "
                                  "modify the content of the folder '%2'.")
                             .arg( mBasePath ).arg( TQDir::homeDirPath() ) );
@@ -197,10 +197,10 @@ KMFolder* KMFolderMgr::createFolder(const TQString& fName, bool sysFldr,
     if ( account->isDeletedFolder( imapPath ) || account->isDeletedFolder( imapPath + "/" )
        || account->isPreviouslyDeletedFolder( imapPath )
        || account->isPreviouslyDeletedFolder( imapPath + "/" ) ) {
-      KMessageBox::error( 0, i18n("A folder with the same name has been deleted since the last mail check."
+      KMessageBox::error( nullptr, i18n("A folder with the same name has been deleted since the last mail check."
           "You need to check mails first before creating another folder with the same name."),
           i18n("Could Not Create Folder") );
-      return 0;
+      return nullptr;
     }
   }
 
@@ -228,7 +228,7 @@ KMFolder* KMFolderMgr::find(const TQString& folderName, bool foldersOnly)
     if (node->isDir() && foldersOnly) continue;
     if (node->name()==folderName) return (KMFolder*)node;
   }
-  return 0;
+  return nullptr;
 }
 
 //-----------------------------------------------------------------------------
@@ -258,7 +258,7 @@ KMFolder* KMFolderMgr::findIdString( const TQString& folderId,
         }
   )
 
-  return 0;
+  return nullptr;
 }
 
 void KMFolderMgr::getFolderURLS( TQStringList& flist, const TQString& prefix,
@@ -294,14 +294,14 @@ KMFolder* KMFolderMgr::getFolderByURL( const TQString& vpath,
             return folder;
         }
   )
-  return 0;
+  return nullptr;
 }
 
 //-----------------------------------------------------------------------------
 KMFolder* KMFolderMgr::findOrCreate(const TQString& aFolderName, bool sysFldr,
                                     const uint id)
 {
-  KMFolder* folder = 0;
+  KMFolder* folder = nullptr;
   if ( id == 0 )
     folder = find(aFolderName);
   else
@@ -326,7 +326,7 @@ KMFolder* KMFolderMgr::findOrCreate(const TQString& aFolderName, bool sysFldr,
 
     folder = createFolder(aFolderName, sysFldr, type);
     if (!folder) {
-      KMessageBox::error(0,(i18n("Cannot create file `%1' in %2.\nKMail cannot start without it.").arg(aFolderName).arg(mBasePath)));
+      KMessageBox::error(nullptr,(i18n("Cannot create file `%1' in %2.\nKMail cannot start without it.").arg(aFolderName).arg(mBasePath)));
       exit(-1);
     }
     if ( id > 0 )
@@ -376,7 +376,7 @@ KMFolder* KMFolderMgr::parentFolder( KMFolder* folder )
   if ( !parent && fdir->parent() ) // dimap obviously has a different structure
     parent = fdir->parent()->hasNamedFolder( parentName );
 
-  KMFolder* parentF = 0;
+  KMFolder* parentF = nullptr;
   if ( parent )
     parentF = dynamic_cast<KMFolder*>( parent );
   return parentF;
@@ -385,13 +385,13 @@ KMFolder* KMFolderMgr::parentFolder( KMFolder* folder )
 void KMFolderMgr::removeFolderAux(KMFolder* aFolder, bool success)
 {
   if (!success) {
-    mRemoveOrig = 0;
+    mRemoveOrig = nullptr;
     return;
   }
 
   KMFolderDir* fdir = aFolder->parent();
   KMFolderNode* fN;
-  for (fN = fdir->first(); fN != 0; fN = fdir->next()) {
+  for (fN = fdir->first(); fN ; fN = fdir->next()) {
     if (fN->isDir() && (fN->name() == "." + aFolder->fileName() + ".directory")) {
       removeDirAux(static_cast<KMFolderDir*>(fN));
       break;
@@ -416,7 +416,7 @@ void KMFolderMgr::removeFolderAux(KMFolder* aFolder, bool success)
   if (aFolder == mRemoveOrig) {
     // call only if we're removing the original parent folder
     contentsChanged();
-    mRemoveOrig = 0;
+    mRemoveOrig = nullptr;
   }
 }
 
@@ -453,14 +453,14 @@ void KMFolderMgr::reload(void)
 void KMFolderMgr::createFolderList(TQStringList *str,
 				   TQValueList<TQGuardedPtr<KMFolder> > *folders)
 {
-  createFolderList( str, folders, 0, "" );
+  createFolderList( str, folders, nullptr, "" );
 }
 
 //-----------------------------------------------------------------------------
 void KMFolderMgr::createI18nFolderList(TQStringList *str,
 				   TQValueList<TQGuardedPtr<KMFolder> > *folders)
 {
-  createFolderList( str, folders, 0, TQString(), true );
+  createFolderList( str, folders, nullptr, TQString(), true );
 }
 
 //-----------------------------------------------------------------------------
@@ -562,7 +562,7 @@ uint KMFolderMgr::createId()
   do
   {
     newId = tdeApp->random();
-  } while ( findById( newId ) != 0 );
+  } while ( findById(newId) );
 
   return newId;
 }
diff --git a/kmail/kmfoldermgr.h b/kmail/kmfoldermgr.h
index 02304ba23..27c92da92 100644
--- a/kmail/kmfoldermgr.h
+++ b/kmail/kmfoldermgr.h
@@ -37,7 +37,7 @@ public:
 
   /** Searches for a folder with the given id, recurses into directories */
   virtual KMFolder* findIdString(const TQString& folderId,
-     const uint id = 0, KMFolderDir *dir = 0);
+     const uint id = 0, KMFolderDir *dir = nullptr);
 
   /** Uses find() to find given folder. If not found the folder is
    * created. Directories are skipped.
@@ -52,16 +52,16 @@ public:
 
   virtual void        getFolderURLS( TQStringList& flist,
                                      const TQString& prefix=TQString(),
-                                     KMFolderDir *adir=0 );
+                                     KMFolderDir *adir=nullptr );
   virtual KMFolder*   getFolderByURL( const TQString& vpath,
                                       const TQString& prefix=TQString(),
-                                      KMFolderDir *adir=0 );
+                                      KMFolderDir *adir=nullptr );
 
   /** Create a mail folder in the root folder directory dir()
     with given name. Returns Folder on success. */
   virtual KMFolder* createFolder(const TQString& fName, bool sysFldr=false,
 				 KMFolderType aFolderType=KMFolderTypeMbox,
-				 KMFolderDir *aFolderDir = 0);
+				 KMFolderDir *aFolderDir = nullptr);
 
   /** Physically remove given folder and delete the given folder object. */
   virtual void remove(KMFolder* obsoleteFolder);
@@ -91,23 +91,23 @@ public:
 				 TQValueList<TQGuardedPtr<KMFolder> > *folders );
 
   /** fsync all open folders to disk */
-  void syncAllFolders( KMFolderDir *adir = 0 );
+  void syncAllFolders( KMFolderDir *adir = nullptr );
 
   /** Compact all folders that need to be, either immediately or scheduled as a background task */
-  void compactAllFolders( bool immediate, KMFolderDir *adir = 0 );
+  void compactAllFolders( bool immediate, KMFolderDir *adir = nullptr );
 
   /** Expire old messages in all folders, either immediately or scheduled as a background task */
-  void expireAllFolders( bool immediate, KMFolderDir *adir = 0 );
+  void expireAllFolders( bool immediate, KMFolderDir *adir = nullptr );
 
   /** Enable, disable changed() signals */
   void quiet(bool);
 
   /** Number of folders for purpose of progres report */
-  int folderCount(KMFolderDir *dir=0);
+  int folderCount(KMFolderDir *dir=nullptr);
 
   /** Try closing @p folder if possible, something is attempting an exclusive access to it.
       Currently used for KMFolderSearch and the background tasks like expiry */
-  void tryReleasingFolder(KMFolder* folder, KMFolderDir *Dir=0);
+  void tryReleasingFolder(KMFolder* folder, KMFolderDir *Dir=nullptr);
 
   /** Create a new unique ID */
   uint createId();
@@ -117,7 +117,7 @@ public:
 
   /** Rename or move a folder */
   void renameFolder( KMFolder* folder, const TQString& newName, 
-      KMFolderDir* newParent = 0 );
+      KMFolderDir* newParent = nullptr );
   
   /** Copy a folder */
   void copyFolder( KMFolder* folder, KMFolderDir* newParent );
diff --git a/kmail/kmfoldersearch.cpp b/kmail/kmfoldersearch.cpp
index d5306b761..48a2efdb1 100644
--- a/kmail/kmfoldersearch.cpp
+++ b/kmail/kmfoldersearch.cpp
@@ -75,12 +75,12 @@ KMSearch::KMSearch(TQObject * parent, const char * name)
     mRemainingFolders = -1;
     mRecursive = true;
     mRunByIndex = mRunning = false;
-    mRoot = 0;
-    mSearchPattern = 0;
+    mRoot = nullptr;
+    mSearchPattern = nullptr;
     mFoundCount = 0;
     mSearchCount = 0;
 
-    mProcessNextBatchTimer = new TQTimer(0, "mProcessNextBatchTimer");
+    mProcessNextBatchTimer = new TQTimer(nullptr, "mProcessNextBatchTimer");
     connect(mProcessNextBatchTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotProcessNextBatch()));
 }
 
@@ -184,7 +184,7 @@ void KMSearch::start()
         for ( it = mFolders.begin(); it != mFolders.end(); ++it )
         {
             folder = *it;
-            KMFolderDir *dir = 0;
+            KMFolderDir *dir = nullptr;
             if ( folder )
                 dir = folder->child();
             else
@@ -229,7 +229,7 @@ void KMSearch::stop()
                     static_cast<KMFolderImap*>( folder->storage() )->account();
                 account->ignoreJobsForFolder( folder );
             }
-            folder->storage()->search( 0 );
+            folder->storage()->search( nullptr );
             mSearchCount += folder->count();
             folder->close("kmsearch");
         }
@@ -316,8 +316,8 @@ void KMSearch::slotSearchFolderResult( KMFolder* folder,
 KMFolderSearch::KMFolderSearch(KMFolder* folder, const char* name)
   : FolderStorage(folder, name)
 {
-    mIdsStream = 0;
-    mSearch = 0;
+    mIdsStream = nullptr;
+    mSearch = nullptr;
     mInvalid = false;
     mUnlinked = true;
     mTempOpened = false;
@@ -370,7 +370,7 @@ KMFolderSearch::KMFolderSearch(KMFolder* folder, const char* name)
     connect(kmkernel->dimapFolderMgr(), TQ_SIGNAL(msgHeaderChanged(KMFolder*,int)),
             this, TQ_SLOT(propagateHeaderChanged(KMFolder*,int)));
 
-  mExecuteSearchTimer = new TQTimer(0, "mExecuteSearchTimer");
+  mExecuteSearchTimer = new TQTimer(nullptr, "mExecuteSearchTimer");
   connect(mExecuteSearchTimer, TQ_SIGNAL(timeout()),
           this, TQ_SLOT(executeSearch()));
 }
@@ -379,7 +379,7 @@ KMFolderSearch::~KMFolderSearch()
 {
     delete mExecuteSearchTimer;
     delete mSearch;
-    mSearch = 0;
+    mSearch = nullptr;
     if (mOpenCount > 0)
         close("~foldersearch", true);
 }
@@ -443,7 +443,7 @@ void KMFolderSearch::addSerNum(TQ_UINT32 serNum)
     if (mInvalid) // A new search is scheduled don't bother doing anything
         return;
     int idx = -1;
-    KMFolder *aFolder = 0;
+    KMFolder *aFolder = nullptr;
     KMMsgDict::instance()->getLocation(serNum, &aFolder, &idx);
     // warn instead of assert() because of
     // https://intevation.de/roundup/kolab/issue2216
@@ -479,7 +479,7 @@ void KMFolderSearch::removeSerNum(TQ_UINT32 serNum)
     for(it = mSerNums.begin(); it != mSerNums.end(); ++it, ++i)
         if ((*it) == serNum) {
             int idx = -1;
-            KMFolder *aFolder = 0;
+            KMFolder *aFolder = nullptr;
             KMMsgDict::instance()->getLocation(serNum, &aFolder, &idx);
             assert(aFolder && (idx != -1));
             emit msgRemoved(folder(), serNum);
@@ -572,7 +572,7 @@ void KMFolderSearch::reallyDoClose(const char* owner)
         fclose(mIdsStream);
 
     mOpenCount   = 0;
-    mIdsStream = 0;
+    mIdsStream = nullptr;
     mUnreadMsgs  = -1;
 }
 
@@ -630,7 +630,7 @@ FolderJob* KMFolderSearch::doCreateJob(KMMessage*, FolderJob::JobType,
 {
     // Should never be called
     assert(0);
-    return 0;
+    return nullptr;
 }
 
 FolderJob* KMFolderSearch::doCreateJob(TQPtrList<KMMessage>&, const TQString&,
@@ -638,15 +638,15 @@ FolderJob* KMFolderSearch::doCreateJob(TQPtrList<KMMessage>&, const TQString&,
 {
     // Should never be called
     assert(0);
-    return 0;
+    return nullptr;
 }
 
 const KMMsgBase* KMFolderSearch::getMsgBase(int idx) const
 {
     int folderIdx = -1;
-    KMFolder *folder = 0;
+    KMFolder *folder = nullptr;
     if (idx < 0 || (TQ_UINT32)idx >= mSerNums.count())
-        return 0;
+        return nullptr;
     KMMsgDict::instance()->getLocation(mSerNums[idx], &folder, &folderIdx);
     assert(folder && (folderIdx != -1));
     return folder->getMsgBase(folderIdx);
@@ -655,12 +655,12 @@ const KMMsgBase* KMFolderSearch::getMsgBase(int idx) const
 KMMsgBase* KMFolderSearch::getMsgBase(int idx)
 {
     int folderIdx = -1;
-    KMFolder *folder = 0;
+    KMFolder *folder = nullptr;
     if (idx < 0 || (TQ_UINT32)idx >= mSerNums.count())
-        return 0;
+        return nullptr;
     KMMsgDict::instance()->getLocation(mSerNums[idx], &folder, &folderIdx);
     if (!folder || folderIdx == -1)
-        return 0; //exceptional case
+        return nullptr; //exceptional case
     return folder->getMsgBase(folderIdx);
 }
 
@@ -668,9 +668,9 @@ KMMsgBase* KMFolderSearch::getMsgBase(int idx)
 KMMessage* KMFolderSearch::getMsg(int idx)
 {
     int folderIdx = -1;
-    KMFolder *folder = 0;
+    KMFolder *folder = nullptr;
     if (idx < 0 || (TQ_UINT32)idx >= mSerNums.count())
-        return 0;
+        return nullptr;
     KMMsgDict::instance()->getLocation(mSerNums[idx], &folder, &folderIdx);
     assert(folder && (folderIdx != -1));
     KMMessage* msg = folder->getMsg( folderIdx );
@@ -745,7 +745,7 @@ int KMFolderSearch::writeIndex( bool )
 
     // We touch the folder, otherwise the index is regenerated, if KMail is
     // running, while the clock switches from daylight savings time to normal time
-    utime(TQFile::encodeName(location()), 0);
+    utime(TQFile::encodeName(location()), nullptr);
 
     FILE *tmpIndexStream = fopen(TQFile::encodeName(tempName), "w");
     umask(old_umask);
@@ -793,7 +793,7 @@ DwString KMFolderSearch::getDwString(int idx)
 KMMessage* KMFolderSearch::readMsg(int idx)
 {
     int folderIdx = -1;
-    KMFolder *folder = 0;
+    KMFolder *folder = nullptr;
     KMMsgDict::instance()->getLocation(mSerNums[idx], &folder, &folderIdx);
     assert(folder && (folderIdx != -1));
     return folder->getMsg( folderIdx );
@@ -811,14 +811,14 @@ bool KMFolderSearch::readIndex()
     fscanf(mIdsStream, IDS_SEARCH_HEADER, &version);
     if (version != IDS_SEARCH_VERSION) {
         fclose(mIdsStream);
-        mIdsStream = 0;
+        mIdsStream = nullptr;
         return false;
     }
     bool swapByteOrder;
     TQ_UINT32 byte_order;
     if (!fread(&byte_order, sizeof(byte_order), 1, mIdsStream)) {
         fclose(mIdsStream);
-        mIdsStream = 0;
+        mIdsStream = nullptr;
         return false;
     }
     swapByteOrder = (byte_order == 0x78563412);
@@ -826,7 +826,7 @@ bool KMFolderSearch::readIndex()
     TQ_UINT32 count;
     if (!fread(&count, sizeof(count), 1, mIdsStream)) {
         fclose(mIdsStream);
-        mIdsStream = 0;
+        mIdsStream = nullptr;
         return false;
     }
     if (swapByteOrder)
@@ -837,12 +837,12 @@ bool KMFolderSearch::readIndex()
     for (unsigned int index = 0; index < count; index++) {
         TQ_UINT32 serNum;
         int folderIdx = -1;
-        KMFolder *folder = 0;
+        KMFolder *folder = nullptr;
         bool readOk = fread(&serNum, sizeof(serNum), 1, mIdsStream);
         if (!readOk) {
             clearIndex();
             fclose(mIdsStream);
-            mIdsStream = 0;
+            mIdsStream = nullptr;
             return false;
         }
         if (swapByteOrder)
@@ -852,7 +852,7 @@ bool KMFolderSearch::readIndex()
         if (!folder || (folderIdx == -1)) {
             clearIndex();
             fclose(mIdsStream);
-            mIdsStream = 0;
+            mIdsStream = nullptr;
             return false;
         }
         mSerNums.push_back(serNum);
@@ -872,7 +872,7 @@ bool KMFolderSearch::readIndex()
     }
     mTotalMsgs = mSerNums.count();
     fclose(mIdsStream);
-    mIdsStream = 0;
+    mIdsStream = nullptr;
     mUnlinked = true;
     return true;
 }
@@ -947,7 +947,7 @@ void KMFolderSearch::examineAddedMessage(KMFolder *aFolder, TQ_UINT32 serNum)
         return;
 
     int idx = -1;
-    KMFolder *folder = 0;
+    KMFolder *folder = nullptr;
     KMMsgDict::instance()->getLocation(serNum, &folder, &idx);
     assert(folder && (idx != -1));
     assert(folder == aFolder);
@@ -1086,7 +1086,7 @@ void KMFolderSearch::examineRemovedFolder(KMFolder *folder)
     examineInvalidatedFolder(folder);
     if (mSearch->root() == folder) {
         delete mSearch;
-        mSearch = 0;
+        mSearch = nullptr;
     }
 }
 
diff --git a/kmail/kmfoldersearch.h b/kmail/kmfoldersearch.h
index 67c228cfe..3df211be9 100644
--- a/kmail/kmfoldersearch.h
+++ b/kmail/kmfoldersearch.h
@@ -55,7 +55,7 @@ class KMSearch: public TQObject
   
 
 public:
-  KMSearch(TQObject * parent = 0, const char * name = 0);
+  KMSearch(TQObject * parent = nullptr, const char * name = nullptr);
   ~KMSearch();
 
   bool write(TQString location) const;
@@ -113,7 +113,7 @@ class KMFolderSearch: public FolderStorage
   
   friend class ::KMFolderSearchJob;
 public:
-  KMFolderSearch(KMFolder* folder, const char* name=0);
+  KMFolderSearch(KMFolder* folder, const char* name=nullptr);
   virtual ~KMFolderSearch();
 
   /** Returns the type of this folder */
@@ -171,7 +171,7 @@ public slots:
 
 public:
   //See base class for documentation
-  virtual int addMsg(KMMessage* msg, int* index_return = 0);
+  virtual int addMsg(KMMessage* msg, int* index_return = nullptr);
   virtual int open(const char *owner);
   virtual int canAccess();
   virtual void sync();
diff --git a/kmail/kmfoldertree.cpp b/kmail/kmfoldertree.cpp
index 00fcf6d4e..4483630f5 100644
--- a/kmail/kmfoldertree.cpp
+++ b/kmail/kmfoldertree.cpp
@@ -55,7 +55,7 @@ KMFolderTreeItem::KMFolderTreeItem( KFolderTree *parent, const TQString & name,
                                     KFolderTreeItem::Protocol protocol )
   : TQObject( parent, name.latin1() ),
     KFolderTreeItem( parent, name, protocol, Root ),
-    mFolder( 0 ), mNeedsRepaint( true )
+    mFolder( nullptr ), mNeedsRepaint( true )
 {
   init();
   setPixmap( 0, normalIcon( iconSize() ) );
@@ -75,7 +75,7 @@ KMFolderTreeItem::KMFolderTreeItem( KFolderTree *parent, const TQString & name,
 //-----------------------------------------------------------------------------
 KMFolderTreeItem::KMFolderTreeItem( KFolderTreeItem *parent, const TQString & name,
                     KMFolder* folder )
-  : TQObject( 0, name.latin1() ),
+  : TQObject( nullptr, name.latin1() ),
     KFolderTreeItem( parent, name ),
     mFolder( folder ), mNeedsRepaint( true )
 {
@@ -151,10 +151,10 @@ TQPixmap KMFolderTreeItem::normalIcon(int size) const
   }
   TDEIconLoader * il = TDEGlobal::instance()->iconLoader();
   TQPixmap pm = il->loadIcon( icon, TDEIcon::Small, size,
-                             TDEIcon::DefaultState, 0, true );
+                             TDEIcon::DefaultState, nullptr, true );
   if ( mFolder && pm.isNull() ) {
       pm = il->loadIcon( mFolder->normalIconPath(), TDEIcon::Small, size,
-                         TDEIcon::DefaultState, 0, true );
+                         TDEIcon::DefaultState, nullptr, true );
   }
 
   return pm;
@@ -173,22 +173,22 @@ TQPixmap KMFolderTreeItem::unreadIcon(int size) const
   TDEIconLoader * il = TDEGlobal::instance()->iconLoader();
   if ( mFolder && mFolder->useCustomIcons() ) {
     pm = il->loadIcon( mFolder->unreadIconPath(), TDEIcon::Small, size,
-                       TDEIcon::DefaultState, 0, true );
+                       TDEIcon::DefaultState, nullptr, true );
     if ( pm.isNull() )
       pm = il->loadIcon( mFolder->normalIconPath(), TDEIcon::Small, size,
-                         TDEIcon::DefaultState, 0, true );
+                         TDEIcon::DefaultState, nullptr, true );
   }
   if ( pm.isNull() ) {
     if ( mFolder && mFolder->noContent() ) {
       pm = il->loadIcon( "folder_grey_open", TDEIcon::Small, size,
-                         TDEIcon::DefaultState, 0, true );
+                         TDEIcon::DefaultState, nullptr, true );
     } else {
       if( kmkernel->iCalIface().isResourceFolder( mFolder ) )
         pm = il->loadIcon( kmkernel->iCalIface().folderPixmap( type() ),
-                         TDEIcon::Small, size, TDEIcon::DefaultState, 0, true );
+                         TDEIcon::Small, size, TDEIcon::DefaultState, nullptr, true );
       if ( pm.isNull() )
         pm = il->loadIcon( "folder_open", TDEIcon::Small, size,
-                           TDEIcon::DefaultState, 0, true );
+                           TDEIcon::DefaultState, nullptr, true );
     }
   }
 
@@ -376,13 +376,13 @@ void KMFolderTreeItem::updateCount()
 KMFolderTree::KMFolderTree( KMMainWidget *mainWidget, TQWidget *parent,
                             const char *name )
   : KMail::FolderTreeBase( mainWidget, parent, name )
-  , mUpdateTimer( 0, "mUpdateTimer" )
-  , autoopen_timer( 0, "autoopen_timer" )
+  , mUpdateTimer( nullptr, "mUpdateTimer" )
+  , autoopen_timer( nullptr, "autoopen_timer" )
 {
-  oldSelected = 0;
-  oldCurrent = 0;
-  mLastItem = 0;
-  dropItem = 0;
+  oldSelected = nullptr;
+  oldCurrent = nullptr;
+  mLastItem = nullptr;
+  dropItem = nullptr;
   mMainWidget = mainWidget;
   mReloading = false;
   mCutFolder = false;
@@ -528,7 +528,7 @@ void KMFolderTree::updateUnreadAll()
 
   fdir = &kmkernel->folderMgr()->dir();
   for (folderNode = fdir->first();
-    folderNode != 0;
+    folderNode;
     folderNode =fdir->next())
   {
     if (!folderNode->isDir()) {
@@ -555,14 +555,14 @@ void KMFolderTree::reload(bool openFolders)
   mReloading = true;
 
   int top = contentsY();
-  mLastItem = 0;
+  mLastItem = nullptr;
   // invalidate selected drop item
-  oldSelected = 0;
+  oldSelected = nullptr;
   // remember last
   KMFolder* last = currentFolder();
-  KMFolder* selected = 0;
+  KMFolder* selected = nullptr;
   KMFolder* oldCurrentFolder =
-    ( oldCurrent ? static_cast<KMFolderTreeItem*>(oldCurrent)->folder(): 0 );
+    ( oldCurrent ? static_cast<KMFolderTreeItem*>(oldCurrent)->folder(): nullptr );
   for ( TQListViewItemIterator it( this ) ; it.current() ; ++it ) {
     KMFolderTreeItem * fti = static_cast<KMFolderTreeItem*>(it.current());
     writeIsListViewItemOpen( fti );
@@ -581,11 +581,11 @@ void KMFolderTree::reload(bool openFolders)
 
   fdir = &kmkernel->imapFolderMgr()->dir();
   // each imap-account creates it's own root
-  addDirectory(fdir, 0);
+  addDirectory(fdir, nullptr);
 
   fdir = &kmkernel->dimapFolderMgr()->dir();
   // each dimap-account creates it's own root
-  addDirectory(fdir, 0);
+  addDirectory(fdir, nullptr);
 
   // construct the root of the search folder hierarchy:
   root = new KMFolderTreeItem( this, i18n("Searches"), KFolderTreeItem::Search );
@@ -719,7 +719,7 @@ void KMFolderTree::addDirectory( KMFolderDir *fdir, KMFolderTreeItem* parent )
       continue;
 
     KMFolder * folder = static_cast<KMFolder*>(node);
-    KMFolderTreeItem * fti = 0;
+    KMFolderTreeItem * fti = nullptr;
     if (!parent)
     {
       // create new root-item, but only if this is not the root of a
@@ -834,9 +834,9 @@ void KMFolderTree::slotFolderRemoved(KMFolder *aFolder)
   if (!item) return;
   KMFolderTreeItem *fti = static_cast<KMFolderTreeItem*> ( item );
   if ( oldCurrent == fti )
-    oldCurrent = 0;
+    oldCurrent = nullptr;
   if ( oldSelected == fti )
-    oldSelected = 0;
+    oldSelected = nullptr;
   if (!fti || !fti->folder()) return;
   if (fti == currentItem())
   {
@@ -847,7 +847,7 @@ void KMFolderTree::slotFolderRemoved(KMFolder *aFolder)
   removeFromFolderToItemMap( aFolder );
 
   if ( dropItem == fti ) { // The removed item is the dropItem
-    dropItem = 0; // it becomes invalid
+    dropItem = nullptr; // it becomes invalid
   }
 
   delete fti;
@@ -990,7 +990,7 @@ KMFolder *KMFolderTree::currentFolder() const
     if (fti )
         return fti->folder();
     else
-        return 0;
+        return nullptr;
 }
 
 TQValueList<TQGuardedPtr<KMFolder> > KMFolderTree::selectedFolders()
@@ -1016,7 +1016,7 @@ void KMFolderTree::doFolderSelected( TQListViewItem* qlvi, bool keepSelection )
     return;
 
   KMFolderTreeItem* fti = static_cast< KMFolderTreeItem* >(qlvi);
-  KMFolder* folder = 0;
+  KMFolder* folder = nullptr;
   if (fti) folder = fti->folder();
 
   if (mLastItem && mLastItem != fti && mLastItem->folder()
@@ -1034,7 +1034,7 @@ void KMFolderTree::doFolderSelected( TQListViewItem* qlvi, bool keepSelection )
     setSelected( qlvi, true );
   ensureItemVisible( qlvi );
   if (!folder) {
-    emit folderSelected(0); // Root has been selected
+    emit folderSelected(nullptr); // Root has been selected
   }
   else {
     emit folderSelected(folder);
@@ -1204,7 +1204,7 @@ void KMFolderTree::slotContextMenuRequested( TQListViewItem *lvi,
   kmkernel->setContextMenuShown( false );
   triggerUpdate();
   delete folderMenu;
-  folderMenu = 0;
+  folderMenu = nullptr;
 }
 
 //-----------------------------------------------------------------------------
@@ -1428,8 +1428,8 @@ static const int autoopenTime = 750;
 //-----------------------------------------------------------------------------
 void KMFolderTree::contentsDragEnterEvent( TQDragEnterEvent *e )
 {
-  oldCurrent = 0;
-  oldSelected = 0;
+  oldCurrent = nullptr;
+  oldSelected = nullptr;
 
   oldCurrent = currentItem();
   for ( TQListViewItemIterator it( this ) ; it.current() ; ++it )
@@ -1444,7 +1444,7 @@ void KMFolderTree::contentsDragEnterEvent( TQDragEnterEvent *e )
     autoopen_timer.start( autoopenTime );
   }
   else
-    dropItem = 0;
+    dropItem = nullptr;
 
   e->accept( acceptDrag(e) );
 }
@@ -1487,7 +1487,7 @@ void KMFolderTree::contentsDragMoveEvent( TQDragMoveEvent *e )
     } else {
         e->accept( false );
         autoopen_timer.stop();
-        dropItem = 0;
+        dropItem = nullptr;
     }
 }
 
@@ -1497,7 +1497,7 @@ void KMFolderTree::contentsDragLeaveEvent( TQDragLeaveEvent * )
     if (!oldCurrent) return;
 
     autoopen_timer.stop();
-    dropItem = 0;
+    dropItem = nullptr;
 
     setCurrentItem( oldCurrent );
     if ( oldSelected )
@@ -1515,7 +1515,7 @@ void KMFolderTree::contentsDropEvent( TQDropEvent *e )
     for ( TQValueList<TQGuardedPtr<KMFolder> >::ConstIterator it = mCopySourceFolders.constBegin();
 	  it != mCopySourceFolders.constEnd(); ++it ) {
       if ( ! (*it) ) {
-	fti = 0;
+	fti = nullptr;
 	break;
       }
     }
@@ -1523,7 +1523,7 @@ void KMFolderTree::contentsDropEvent( TQDropEvent *e )
     {
       KMFolder *source = mCopySourceFolders.first();
       // if we are dragging to ourselves or to our parent, set fti to 0 so nothing is done
-      if (source == fti->folder() || source->parent()->owner() == fti->folder()) fti = 0;
+      if (source == fti->folder() || source->parent()->owner() == fti->folder()) fti = nullptr;
     }
     if (fti && acceptDrag(e) && ( fti != oldSelected || e->source() != mMainWidget->headers()->viewport() ) )
     {
@@ -1557,7 +1557,7 @@ void KMFolderTree::contentsDropEvent( TQDropEvent *e )
     } else
       e->accept( false );
 
-    dropItem = 0;
+    dropItem = nullptr;
 
     setCurrentItem( oldCurrent );
     if ( oldCurrent) mLastItem = static_cast<KMFolderTreeItem*>(oldCurrent);
@@ -1627,7 +1627,7 @@ void KMFolderTree::slotRenameFolder(TQListViewItem *item, int col,
 
   TQString fldName, oldFldName;
 
-  oldFldName = fti->name(0);
+  oldFldName = fti->name(nullptr);
 
   if (!text.isEmpty())
           fldName = text;
@@ -2086,7 +2086,7 @@ TQDragObject * KMFolderTree::dragObject()
   KMFolderTreeItem *item = static_cast<KMFolderTreeItem*>
       (itemAt(viewport()->mapFromGlobal(TQCursor::pos())));
   if ( !item || !item->parent() || !item->folder() ) // top-level items or something invalid
-    return 0;
+    return nullptr;
   mCopySourceFolders = selectedFolders();
 
   TQDragObject *drag = KFolderTree::dragObject();
diff --git a/kmail/kmfoldertree.h b/kmail/kmfoldertree.h
index f6e5df114..98e57d657 100644
--- a/kmail/kmfoldertree.h
+++ b/kmail/kmfoldertree.h
@@ -112,8 +112,8 @@ class KMFolderTree : public KMail::FolderTreeBase
   
 
 public:
-  KMFolderTree( KMMainWidget *mainWidget, TQWidget *parent=0,
-		const char *name=0 );
+  KMFolderTree( KMMainWidget *mainWidget, TQWidget *parent=nullptr,
+		const char *name=nullptr );
 
   /** Save config options */
   void writeConfig();
@@ -169,7 +169,7 @@ public:
 
   /** Generate a popup menu that contains all folders that can have content */
   void folderToPopupMenu( MenuAction action, TQObject *receiver, KMMenuToFolder *,
-      TQPopupMenu *menu, TQListViewItem *start = 0 );
+      TQPopupMenu *menu, TQListViewItem *start = nullptr );
 
 signals:
   /** The selected folder has changed */
@@ -223,10 +223,10 @@ public slots:
    * If no item is given we take the current one
    * If startListing is true a folder listing is started
    */
-  void slotResetFolderList( TQListViewItem* item = 0, bool startList = true );
+  void slotResetFolderList( TQListViewItem* item = nullptr, bool startList = true );
 
   /** Create a child folder */
-  void addChildFolder( KMFolder *folder = 0, TQWidget * parent = 0 );
+  void addChildFolder( KMFolder *folder = nullptr, TQWidget * parent = nullptr );
 
   /** Copies the currently selected folder. */
   void copyFolder();
diff --git a/kmail/kmheaders.cpp b/kmail/kmheaders.cpp
index d127e32b0..81fb276b3 100644
--- a/kmail/kmheaders.cpp
+++ b/kmail/kmheaders.cpp
@@ -61,33 +61,33 @@ using namespace KPIM;
 
 #include "textsource.h"
 
-TQPixmap* KMHeaders::pixNew = 0;
-TQPixmap* KMHeaders::pixUns = 0;
-TQPixmap* KMHeaders::pixDel = 0;
-TQPixmap* KMHeaders::pixRead = 0;
-TQPixmap* KMHeaders::pixRep = 0;
-TQPixmap* KMHeaders::pixQueued = 0;
-TQPixmap* KMHeaders::pixTodo = 0;
-TQPixmap* KMHeaders::pixSent = 0;
-TQPixmap* KMHeaders::pixFwd = 0;
-TQPixmap* KMHeaders::pixFlag = 0;
-TQPixmap* KMHeaders::pixWatched = 0;
-TQPixmap* KMHeaders::pixIgnored = 0;
-TQPixmap* KMHeaders::pixSpam = 0;
-TQPixmap* KMHeaders::pixHam = 0;
-TQPixmap* KMHeaders::pixFullySigned = 0;
-TQPixmap* KMHeaders::pixPartiallySigned = 0;
-TQPixmap* KMHeaders::pixUndefinedSigned = 0;
-TQPixmap* KMHeaders::pixFullyEncrypted = 0;
-TQPixmap* KMHeaders::pixPartiallyEncrypted = 0;
-TQPixmap* KMHeaders::pixUndefinedEncrypted = 0;
-TQPixmap* KMHeaders::pixEncryptionProblematic = 0;
-TQPixmap* KMHeaders::pixSignatureProblematic = 0;
-TQPixmap* KMHeaders::pixAttachment = 0;
-TQPixmap* KMHeaders::pixInvitation = 0;
-TQPixmap* KMHeaders::pixReadFwd = 0;
-TQPixmap* KMHeaders::pixReadReplied = 0;
-TQPixmap* KMHeaders::pixReadFwdReplied = 0;
+TQPixmap* KMHeaders::pixNew = nullptr;
+TQPixmap* KMHeaders::pixUns = nullptr;
+TQPixmap* KMHeaders::pixDel = nullptr;
+TQPixmap* KMHeaders::pixRead = nullptr;
+TQPixmap* KMHeaders::pixRep = nullptr;
+TQPixmap* KMHeaders::pixQueued = nullptr;
+TQPixmap* KMHeaders::pixTodo = nullptr;
+TQPixmap* KMHeaders::pixSent = nullptr;
+TQPixmap* KMHeaders::pixFwd = nullptr;
+TQPixmap* KMHeaders::pixFlag = nullptr;
+TQPixmap* KMHeaders::pixWatched = nullptr;
+TQPixmap* KMHeaders::pixIgnored = nullptr;
+TQPixmap* KMHeaders::pixSpam = nullptr;
+TQPixmap* KMHeaders::pixHam = nullptr;
+TQPixmap* KMHeaders::pixFullySigned = nullptr;
+TQPixmap* KMHeaders::pixPartiallySigned = nullptr;
+TQPixmap* KMHeaders::pixUndefinedSigned = nullptr;
+TQPixmap* KMHeaders::pixFullyEncrypted = nullptr;
+TQPixmap* KMHeaders::pixPartiallyEncrypted = nullptr;
+TQPixmap* KMHeaders::pixUndefinedEncrypted = nullptr;
+TQPixmap* KMHeaders::pixEncryptionProblematic = nullptr;
+TQPixmap* KMHeaders::pixSignatureProblematic = nullptr;
+TQPixmap* KMHeaders::pixAttachment = nullptr;
+TQPixmap* KMHeaders::pixInvitation = nullptr;
+TQPixmap* KMHeaders::pixReadFwd = nullptr;
+TQPixmap* KMHeaders::pixReadReplied = nullptr;
+TQPixmap* KMHeaders::pixReadFwdReplied = nullptr;
 
 
 //-----------------------------------------------------------------------------
@@ -100,7 +100,7 @@ KMHeaders::KMHeaders(KMMainWidget *aOwner, TQWidget *parent,
   //qInitImageIO();
   KImageIO::registerFormats();
   mOwner  = aOwner;
-  mFolder = 0;
+  mFolder = nullptr;
   noRepaint = false;
   getMsgIndex = -1;
   mTopItem = 0;
@@ -258,8 +258,8 @@ bool KMHeaders::eventFilter ( TQObject *o, TQEvent *e )
 
 void KMHeaders::slotToggleColumn(int id, int mode)
 {
-  bool *show = 0;
-  int  *col  = 0;
+  bool *show = nullptr;
+  int  *col  = nullptr;
   int  width = 0;
   int moveToCol = -1;
 
@@ -696,7 +696,7 @@ void KMHeaders::setFolder( KMFolder *aFolder, bool forceJumpToUnread )
     if (mFolder) {
     // WABA: Make sure that no KMReaderWin is still using a msg
     // from this folder, since it's msg's are about to be deleted.
-      highlightMessage(0, false);
+      highlightMessage(nullptr, false);
 
       disconnect(mFolder, TQ_SIGNAL(numUnreadMsgsChanged(KMFolder*)),
           this, TQ_SLOT(setFolderInfoStatus()));
@@ -884,17 +884,17 @@ void KMHeaders::msgChanged()
       if (msgIdMD5.isEmpty() || (msgIdMD5 != mb->msgIdMD5()))
         emit selected(mFolder->getMsg(hi->msgId()));
     } else {
-      emit selected(0);
+      emit selected(nullptr);
     }
   } else
-    emit selected(0);
+    emit selected(nullptr);
 }
 
 
 //-----------------------------------------------------------------------------
 void KMHeaders::msgAdded(int id)
 {
-  HeaderItem* hi = 0;
+  HeaderItem* hi = nullptr;
   if (!isUpdatesEnabled()) return;
 
   CREATE_TIMER(msgAdded);
@@ -1314,7 +1314,7 @@ int KMHeaders::slotFilterMsg(KMMessage *msg)
   }
   if (msg->parent()) { // unGet this msg
     int idx = -1;
-    KMFolder * p = 0;
+    KMFolder * p = nullptr;
     KMMsgDict::instance()->getLocation( msg, &p, &idx );
     assert( p == msg->parent() ); assert( idx >= 0 );
     p->unGetMsg( idx );
@@ -1455,10 +1455,10 @@ void KMHeaders::applyFiltersOnMsg()
         tdeApp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput, 50 );
       }
 
-      KMFolder *folder = 0;
+      KMFolder *folder = nullptr;
       int idx;
       KMMsgDict::instance()->getLocation( *it, &folder, &idx );
-      KMMessage *msg = 0;
+      KMMessage *msg = nullptr;
       if (folder)
         msg = folder->getMsg(idx);
       if (msg) {
@@ -1481,7 +1481,7 @@ void KMHeaders::applyFiltersOnMsg()
       progressItem->incCompletedItems();
     }
     progressItem->setComplete();
-    progressItem = 0;
+    progressItem = nullptr;
     END_TIMER(filter);
     SHOW_TIMER(filter);
   }
@@ -1537,7 +1537,7 @@ void KMHeaders::moveSelectedToFolder( int menuId )
 //-----------------------------------------------------------------------------
 HeaderItem* KMHeaders::prepareMove( int *contentX, int *contentY )
 {
-  HeaderItem *ret = 0;
+  HeaderItem *ret = nullptr;
   emit maybeDeleting();
 
   disconnect( this, TQ_SIGNAL(currentChanged(TQListViewItem*)),
@@ -1564,14 +1564,14 @@ HeaderItem* KMHeaders::prepareMove( int *contentX, int *contentY )
 //-----------------------------------------------------------------------------
 void KMHeaders::finalizeMove( HeaderItem *item, int contentX, int contentY )
 {
-  emit selected( 0 );
+  emit selected( nullptr );
   clearSelection();
 
   if ( item ) {
     setCurrentItem( item );
     setSelected( item, true );
     setSelectionAnchor( currentItem() );
-    mPrevCurrent = 0;
+    mPrevCurrent = nullptr;
     highlightMessage( item, false);
   }
 
@@ -1615,7 +1615,7 @@ void KMHeaders::moveMsgToFolder ( KMFolder* destFolder, bool askForConfirmation
 void KMHeaders::slotMoveCompleted( KMCommand *command )
 {
   kdDebug(5006) << k_funcinfo << command->result() << endl;
-  bool deleted = static_cast<KMMoveCommand *>( command )->destFolder() == 0;
+  bool deleted = static_cast<KMMoveCommand *>( command )->destFolder() == nullptr;
   if ( command->result() == KMCommand::OK ) {
     // make sure the current item is shown
     makeHeaderVisible();
@@ -1676,7 +1676,7 @@ void KMHeaders::copyMsgToFolder(KMFolder* destFolder, KMMessage* aMsg)
   if ( !destFolder )
     return;
 
-  KMCommand * command = 0;
+  KMCommand * command = nullptr;
   if (aMsg)
     command = new KMCopyCommand( destFolder, aMsg );
   else {
@@ -1923,8 +1923,8 @@ void KMHeaders::findUnreadAux( HeaderItem*& item,
                                         bool onlyNew,
                                         bool aDirNext )
 {
-  KMMsgBase* msgBase = 0;
-  HeaderItem *lastUnread = 0;
+  KMMsgBase* msgBase = nullptr;
+  HeaderItem *lastUnread = nullptr;
   /* itemAbove() is _slow_ */
   if (aDirNext)
   {
@@ -2123,14 +2123,14 @@ void KMHeaders::highlightMessage(TQListViewItem* lvi, bool markitread)
   }
 
   if (!item) {
-    emit selected( 0 ); return;
+    emit selected( nullptr ); return;
   }
 
   int idx = item->msgId();
   KMMessage *msg = mFolder->getMsg(idx);
   if (mReaderWindowActive && !msg) {
-    emit selected( 0 );
-    mPrevCurrent = 0;
+    emit selected( nullptr );
+    mPrevCurrent = nullptr;
     return;
   }
 
@@ -2184,7 +2184,7 @@ void KMHeaders::selectMessage(TQListViewItem* lvi)
 //-----------------------------------------------------------------------------
 void KMHeaders::updateMessageList( bool set_selection, bool forceJumpToUnread )
 {
-  mPrevCurrent = 0;
+  mPrevCurrent = nullptr;
   noRepaint = true;
   clear();
   mItems.resize(0); // will contain deleted pointers
@@ -2518,7 +2518,7 @@ KMMessage* KMHeaders::currentMsg()
 {
   HeaderItem *hi = currentHeaderItem();
   if (!hi)
-    return 0;
+    return nullptr;
   else
     return mFolder->getMsg(hi->msgId());
 }
@@ -2693,8 +2693,8 @@ void KMHeaders::folderCleared()
     mSortCacheItems.clear(); //autoDelete is true
     mSubjectLists.clear();
     mImperfectlyThreadedList.clear();
-    mPrevCurrent = 0;
-    emit selected(0);
+    mPrevCurrent = nullptr;
+    emit selected(nullptr);
 }
 
 
@@ -2759,7 +2759,7 @@ bool KMHeaders::writeSortOrder()
         } else if( i->nextSibling()) {
           i = i->nextSibling();
         } else {
-            for(i=0; !i && s.count(); i = s.pop()->nextSibling())
+            for(i=nullptr; !i && s.count(); i = s.pop()->nextSibling())
               ;
         }
       }
@@ -3070,8 +3070,8 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
     bool jumpToUnread = (GlobalSettings::self()->actionEnterFolder() ==
                          GlobalSettings::EnumActionEnterFolder::SelectFirstUnreadNew) ||
                         forceJumpToUnread;
-    HeaderItem *oldestItem = 0;
-    HeaderItem *newestItem = 0;
+    HeaderItem *oldestItem = nullptr;
+    HeaderItem *newestItem = nullptr;
     TQMemArray<SortCacheItem *> sortCache(mFolder->count());
     bool error = false;
 
@@ -3080,8 +3080,8 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
     mImperfectlyThreadedList.clear();
 
     //cleanup
-    mItems.fill( 0, mFolder->count() );
-    sortCache.fill( 0 );
+    mItems.fill( nullptr, mFolder->count() );
+    sortCache.fill( nullptr );
 
     mRoot->clearChildren();
 
@@ -3118,7 +3118,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
             SortCacheItem *item;
             unsigned long serNum, parentSerNum;
             int id, len, parent, x;
-            TQChar *tmp_qchar = 0;
+            TQChar *tmp_qchar = nullptr;
             int tmp_qchar_len = 0;
             const int mFolderCount = mFolder->count();
             TQString key;
@@ -3203,7 +3203,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
             if (error || (x != sorted_count + discovered_count)) {// sanity check
                 kdDebug(5006) << endl << "Whoa: x " << x << ", sorted_count " << sorted_count << ", discovered_count " << discovered_count << ", count " << mFolder->count() << endl << endl;
                 fclose(sortStream);
-                sortStream = 0;
+                sortStream = nullptr;
             }
 
             if(tmp_qchar)
@@ -3213,11 +3213,11 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
           }
           else {
               fclose(sortStream);
-              sortStream = 0;
+              sortStream = nullptr;
           }
         } else {
             fclose(sortStream);
-            sortStream = 0;
+            sortStream = nullptr;
         }
     }
 
@@ -3233,7 +3233,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
     if((sorted_count + discovered_count - deleted_count) < mFolder->count()) {
         CREATE_TIMER(holes);
         START_TIMER(holes);
-        KMMsgBase *msg = 0;
+        KMMsgBase *msg = nullptr;
         for(int x = 0; x < mFolder->count(); x++) {
             if((!sortCache[x] || (sortCache[x]->id() < 0)) && (msg=mFolder->getMsgBase(x))) {
                 int sortOrder = column;
@@ -3416,7 +3416,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
     }
 
     if (getNestingPolicy()<2)
-      for (HeaderItem *khi=static_cast<HeaderItem*>(firstChild()); khi!=0;khi=static_cast<HeaderItem*>(khi->nextSibling()))
+      for (HeaderItem *khi=static_cast<HeaderItem*>(firstChild()); khi;khi=static_cast<HeaderItem*>(khi->nextSibling()))
         khi->setOpen(true);
 
     END_TIMER(header_creation);
@@ -3463,11 +3463,11 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
             setTopItemByIndex( mTopItem );
 
             if ( GlobalSettings::self()->actionEnterFolder() ==
-                 GlobalSettings::EnumActionEnterFolder::SelectNewest && newestItem != 0 ) {
+                 GlobalSettings::EnumActionEnterFolder::SelectNewest && newestItem ) {
               setCurrentItemByIndex( newestItem->msgId() );
             }
             else if ( GlobalSettings::self()->actionEnterFolder() ==
-                      GlobalSettings::EnumActionEnterFolder::SelectOldest && oldestItem != 0 ) {
+                      GlobalSettings::EnumActionEnterFolder::SelectOldest && oldestItem ) {
               setCurrentItemByIndex( oldestItem->msgId() );
             }
             else if ( mCurrentItem >= 0 )
diff --git a/kmail/kmheaders.h b/kmail/kmheaders.h
index ab3abf09d..1a7a1d35f 100644
--- a/kmail/kmheaders.h
+++ b/kmail/kmheaders.h
@@ -51,7 +51,7 @@ class KMHeaders : public TDEListView
   friend class ::KMail::HeaderItem; // For easy access to the pixmaps
 
 public:
-  KMHeaders(KMMainWidget *owner, TQWidget *parent=0, const char *name=0);
+  KMHeaders(KMMainWidget *owner, TQWidget *parent=nullptr, const char *name=nullptr);
   virtual ~KMHeaders();
 
   /** A new folder has been selected update the list of headers shown
@@ -98,7 +98,7 @@ public:
   /** Messages are duplicated and added to given folder.
       If aMsg is set this one will be written to the destination folder. */
   virtual void copyMsgToFolder(KMFolder* destination,
-                               KMMessage* aMsg = 0);
+                               KMMessage* aMsg = nullptr);
 
   /** Resets toBeDeleted and selectable status of all selected items. */
   virtual void clearSelectableAndAboutToBeDeleted(TQ_UINT32 serNum);
diff --git a/kmail/kmkernel.cpp b/kmail/kmkernel.cpp
index 2e7f6b062..e15923a2d 100644
--- a/kmail/kmkernel.cpp
+++ b/kmail/kmkernel.cpp
@@ -92,7 +92,7 @@ using TDEWallet::Wallet;
 #include <tdecmdlineargs.h>
 #include <tdestartupinfo.h>
 
-KMKernel *KMKernel::mySelf = 0;
+KMKernel *KMKernel::mySelf = nullptr;
 static bool s_askingToGoOnline = false;
 
 /********************************************************************/
@@ -100,34 +100,34 @@ static bool s_askingToGoOnline = false;
 /********************************************************************/
 KMKernel::KMKernel (TQObject *parent, const char *name) :
   DCOPObject("KMailIface"), TQObject(parent, name),
-  mIdentityManager(0), mConfigureDialog(0),
-  mContextMenuShown( false ), mWallet( 0 )
+  mIdentityManager(nullptr), mConfigureDialog(nullptr),
+  mContextMenuShown( false ), mWallet( nullptr )
 {
   kdDebug(5006) << "KMKernel::KMKernel" << endl;
   mySelf = this;
   the_startingUp = true;
   closed_by_user = true;
   the_firstInstance = true;
-  the_msgIndex = 0;
-
-  the_inboxFolder = 0;
-  the_outboxFolder = 0;
-  the_sentFolder = 0;
-  the_trashFolder = 0;
-  the_draftsFolder = 0;
-  the_templatesFolder = 0;
-
-  the_folderMgr = 0;
-  the_imapFolderMgr = 0;
-  the_dimapFolderMgr = 0;
-  the_searchFolderMgr = 0;
-  the_undoStack = 0;
-  the_acctMgr = 0;
-  the_filterMgr = 0;
-  the_popFilterMgr = 0;
-  the_filterActionDict = 0;
-  the_msgSender = 0;
-  mWin = 0;
+  the_msgIndex = nullptr;
+
+  the_inboxFolder = nullptr;
+  the_outboxFolder = nullptr;
+  the_sentFolder = nullptr;
+  the_trashFolder = nullptr;
+  the_draftsFolder = nullptr;
+  the_templatesFolder = nullptr;
+
+  the_folderMgr = nullptr;
+  the_imapFolderMgr = nullptr;
+  the_dimapFolderMgr = nullptr;
+  the_searchFolderMgr = nullptr;
+  the_undoStack = nullptr;
+  the_acctMgr = nullptr;
+  the_filterMgr = nullptr;
+  the_popFilterMgr = nullptr;
+  the_filterActionDict = nullptr;
+  the_msgSender = nullptr;
+  mWin = nullptr;
   mMailCheckAborted = false;
 
   // make sure that we check for config updates before doing anything else
@@ -142,7 +142,7 @@ KMKernel::KMKernel (TQObject *parent, const char *name) :
 
   mJobScheduler = new JobScheduler( this );
 
-  mXmlGuiInstance = 0;
+  mXmlGuiInstance = nullptr;
 
   new Kpgp::Module();
 
@@ -197,14 +197,14 @@ KMKernel::~KMKernel ()
   }
 
   delete mICalIface;
-  mICalIface = 0;
+  mICalIface = nullptr;
   delete mMailService;
-  mMailService = 0;
+  mMailService = nullptr;
 
   GlobalSettings::self()->writeConfig();
   delete mWallet;
-  mWallet = 0;
-  mySelf = 0;
+  mWallet = nullptr;
+  mySelf = nullptr;
   kdDebug(5006) << "KMKernel::~KMKernel" << endl;
 }
 
@@ -364,8 +364,8 @@ void KMKernel::saveToProfile( const TQString& ) const
 
 void KMKernel::openReader( bool onlyCheck )
 {
-  mWin = 0;
-  TDEMainWindow *ktmw = 0;
+  mWin = nullptr;
+  TDEMainWindow *ktmw = nullptr;
   kdDebug(5006) << "KMKernel::openReader called" << endl;
 
   if (TDEMainWindow::memberList)
@@ -524,7 +524,7 @@ int KMKernel::openComposer (const TQString &to, const TQString &cc,
   kdDebug(5006) << "KMKernel::openComposer()" << endl;
 
   KMMessage *msg = new KMMessage;
-  KMMessagePart *msgPart = 0;
+  KMMessagePart *msgPart = nullptr;
   msg->initHeader();
   msg->setCharset( "utf-8" );
   if ( !cc.isEmpty() ) msg->setCc(cc);
@@ -668,7 +668,7 @@ DCOPRef KMKernel::newMessage(const TQString &to,
                              const KURL & /*messageFile*/,
                              const KURL &attachURL)
 {
-  KMail::Composer * win = 0;
+  KMail::Composer * win = nullptr;
   KMMessage *msg = new KMMessage;
   KMFolder *folder = nullptr;
   uint id;
@@ -711,7 +711,7 @@ DCOPRef KMKernel::newMessage(const TQString &to,
 
 int KMKernel::viewMessage( const KURL & messageFile )
 {
-  KMOpenMsgCommand *openCommand = new KMOpenMsgCommand( 0, messageFile );
+  KMOpenMsgCommand *openCommand = new KMOpenMsgCommand( nullptr, messageFile );
 
   openCommand->start();
 
@@ -971,7 +971,7 @@ int KMKernel::dcopAddMessage( const TQString & foldername,const KURL & msgUrl,
         } else {
           retval =- 2;
           delete msg;
-          msg = 0;
+          msg = nullptr;
         }
       } else {
         //tqDebug( "duplicate: " + msgId + "; subj: " + msg->subject() + ", from: " + msgId = msg->fromStrip());
@@ -1083,7 +1083,7 @@ int KMKernel::dcopAddMessage_fastImport( const TQString & foldername,
       } else {
         retval =- 2;
         delete msg;
-        msg = 0;
+        msg = nullptr;
       }
     } else {
       retval = -1;
@@ -1137,9 +1137,9 @@ void KMKernel::raise()
 
 bool KMKernel::showMail( TQ_UINT32 serialNumber, TQString /* messageId */ )
 {
-  KMMainWidget *mainWidget = 0;
+  KMMainWidget *mainWidget = nullptr;
   if (TDEMainWindow::memberList) {
-    TDEMainWindow *win = 0;
+    TDEMainWindow *win = nullptr;
     TQObjectList *l;
 
     // First look for a TDEMainWindow.
@@ -1157,7 +1157,7 @@ bool KMKernel::showMail( TQ_UINT32 serialNumber, TQString /* messageId */ )
 
   if (mainWidget) {
     int idx = -1;
-    KMFolder *folder = 0;
+    KMFolder *folder = nullptr;
     KMMsgDict::instance()->getLocation(serialNumber, &folder, &idx);
     if (!folder || (idx == -1))
       return false;
@@ -1187,7 +1187,7 @@ bool KMKernel::showMail( TQ_UINT32 serialNumber, TQString /* messageId */ )
 TQString KMKernel::getFrom( TQ_UINT32 serialNumber )
 {
   int idx = -1;
-  KMFolder *folder = 0;
+  KMFolder *folder = nullptr;
   KMMsgDict::instance()->getLocation(serialNumber, &folder, &idx);
   if (!folder || (idx == -1))
     return TQString();
@@ -1214,8 +1214,8 @@ TQString KMKernel::debugSernum( TQ_UINT32 serialNumber )
   TQString res;
   if (serialNumber != 0) {
     int idx = -1;
-    KMFolder *folder = 0;
-    KMMsgBase *msg = 0;
+    KMFolder *folder = nullptr;
+    KMMsgBase *msg = nullptr;
     KMMsgDict::instance()->getLocation( serialNumber, &folder, &idx );
     // It's possible that the message has been deleted or moved into a
     // different folder
@@ -1371,7 +1371,7 @@ void KMKernel::testDir(const char *_name)
   TQFileInfo info( foldersPath );
   if ( !info.exists() ) {
     if ( ::mkdir( TQFile::encodeName( foldersPath ) , S_IRWXU ) == -1 ) {
-      KMessageBox::sorry(0, i18n("KMail could not create folder '%1';\n"
+      KMessageBox::sorry(nullptr, i18n("KMail could not create folder '%1';\n"
                                  "please make sure that you can view and "
                                  "modify the content of the folder '%2'.")
                             .arg( foldersPath ).arg( TQDir::homeDirPath() ) );
@@ -1379,7 +1379,7 @@ void KMKernel::testDir(const char *_name)
     }
   }
   if ( !info.isDir() || !info.isReadable() || !info.isWritable() ) {
-    KMessageBox::sorry(0, i18n("The permissions of the folder '%1' are "
+    KMessageBox::sorry(nullptr, i18n("The permissions of the folder '%1' are "
                                "incorrect;\n"
                                "please make sure that you can view and modify "
                                "the content of this folder.")
@@ -1623,7 +1623,7 @@ void KMKernel::readConfig()
 
 void KMKernel::cleanupImapFolders()
 {
-  KMAccount *acct = 0;
+  KMAccount *acct = nullptr;
   KMFolderNode *node = the_imapFolderMgr->dir().first();
   while (node)
   {
@@ -1674,7 +1674,7 @@ void KMKernel::cleanupImapFolders()
   the_dimapFolderMgr->quiet( true );
   for (acct = the_acctMgr->first(); acct; acct = the_acctMgr->next())
   {
-    KMFolderCachedImap *cfld = 0;
+    KMFolderCachedImap *cfld = nullptr;
     KMAcctCachedImap *cachedImapAcct;
 
     if (acct->type() != "cachedimap" ) continue;
@@ -1682,12 +1682,12 @@ void KMKernel::cleanupImapFolders()
     KMFolder* fld = the_dimapFolderMgr->find(TQString::number(acct->id()));
     if( fld )
       cfld = static_cast<KMFolderCachedImap*>( fld->storage() );
-    if (cfld == 0) {
+    if (!cfld) {
       // Folder doesn't exist yet
       cfld = static_cast<KMFolderCachedImap*>(the_dimapFolderMgr->createFolder(TQString::number(acct->id()),
             false, KMFolderTypeCachedImap)->storage());
       if (!cfld) {
-        KMessageBox::error(0,(i18n("Cannot create file `%1' in %2.\nKMail cannot start without it.").arg(acct->name()).arg(the_dimapFolderMgr->basePath())));
+        KMessageBox::error(nullptr,(i18n("Cannot create file `%1' in %2.\nKMail cannot start without it.").arg(acct->name()).arg(the_dimapFolderMgr->basePath())));
         exit(-1);
       }
       cfld->folder()->setId( acct->id() );
@@ -1727,7 +1727,7 @@ void KMKernel::recreateCorruptIndexFiles()
       folderNames << foldersWithBrokenIndex[i]->label();
     }
 
-    KMessageBox::informationList( 0, i18n( "There is a problem with the mail index of the following "
+    KMessageBox::informationList( nullptr, i18n( "There is a problem with the mail index of the following "
                                            "folders, the indices will now be regenerated.\n"
                                            "This can happen because the index files are out of date, missing or corrupted.\n"
                                            "Contact your administrator if this happens frequently.\n"
@@ -1761,8 +1761,8 @@ void KMKernel::closeAllKMailWindows()
 {
   if (!TDEMainWindow::memberList) return;
   TQPtrListIterator<TDEMainWindow> it(*TDEMainWindow::memberList);
-  TDEMainWindow *window = 0;
-  while ((window = it.current()) != 0) {
+  TDEMainWindow *window = nullptr;
+  while ((window = it.current()) != nullptr) {
     ++it;
     if (window->isA("KMMainWindow") ||
 	window->inherits("KMail::SecondaryWindow"))
@@ -1777,21 +1777,21 @@ void KMKernel::cleanup(void)
   closeAllKMailWindows();
 
   delete the_acctMgr;
-  the_acctMgr = 0;
+  the_acctMgr = nullptr;
   delete the_filterMgr;
-  the_filterMgr = 0;
+  the_filterMgr = nullptr;
   delete the_msgSender;
-  the_msgSender = 0;
+  the_msgSender = nullptr;
   delete the_filterActionDict;
-  the_filterActionDict = 0;
+  the_filterActionDict = nullptr;
   delete the_undoStack;
-  the_undoStack = 0;
+  the_undoStack = nullptr;
   delete the_popFilterMgr;
-  the_popFilterMgr = 0;
+  the_popFilterMgr = nullptr;
 
 #if 0
   delete the_weaver;
-  the_weaver = 0;
+  the_weaver = nullptr;
 #endif
 
   TDEConfig* config =  KMKernel::config();
@@ -1831,20 +1831,20 @@ void KMKernel::cleanup(void)
   }
 
   delete the_msgIndex;
-  the_msgIndex = 0;
+  the_msgIndex = nullptr;
   delete the_folderMgr;
-  the_folderMgr = 0;
+  the_folderMgr = nullptr;
   delete the_imapFolderMgr;
-  the_imapFolderMgr = 0;
+  the_imapFolderMgr = nullptr;
   delete the_dimapFolderMgr;
-  the_dimapFolderMgr = 0;
+  the_dimapFolderMgr = nullptr;
   delete the_searchFolderMgr;
-  the_searchFolderMgr = 0;
+  the_searchFolderMgr = nullptr;
   delete mConfigureDialog;
-  mConfigureDialog = 0;
+  mConfigureDialog = nullptr;
   // do not delete, because mWin may point to an existing window
   // delete mWin;
-  mWin = 0;
+  mWin = nullptr;
 
   if ( RecentAddresses::exists() )
     RecentAddresses::self( config )->save( config );
@@ -1964,7 +1964,7 @@ void KMKernel::kmailMsgHandler(TQtMsgType aType, const char* aMsg)
     ungrabPtrKb();
     kdDebug(5006) << tdeApp->caption() << " fatal error "
 		  << aMsg << endl;
-    KMessageBox::error(0, aMsg);
+    KMessageBox::error(nullptr, aMsg);
     abort();
   }
 
@@ -1981,7 +1981,7 @@ void KMKernel::dumpDeadLetters()
   if ( !TDEMainWindow::memberList )
     return;
 
-  for ( TQPtrListIterator<TDEMainWindow> it(*TDEMainWindow::memberList) ; it.current() != 0; ++it ) {
+  for ( TQPtrListIterator<TDEMainWindow> it(*TDEMainWindow::memberList) ; it.current() ; ++it ) {
     if ( KMail::Composer * win = ::tqt_cast<KMail::Composer*>( it.current() ) ) {
       win->autoSaveMessage();
       // saving the message has to be finished right here, we are called from a dtor,
@@ -2059,7 +2059,7 @@ void KMKernel::slotResult(TDEIO::Job *job)
   {
     if (job->error() == TDEIO::ERR_FILE_ALREADY_EXIST)
     {
-      if (KMessageBox::warningContinueCancel(0,
+      if (KMessageBox::warningContinueCancel(nullptr,
         i18n("File %1 exists.\nDo you want to replace it?")
         .arg((*it).url.prettyURL()), i18n("Save to File"), i18n("&Replace"))
         == KMessageBox::Continue)
@@ -2078,12 +2078,12 @@ void KMKernel::slotRequestConfigSync() {
 void KMKernel::slotShowConfigurationDialog()
 {
   if( !mConfigureDialog ) {
-    mConfigureDialog = new ConfigureDialog( 0, "configure", false );
+    mConfigureDialog = new ConfigureDialog( nullptr, "configure", false );
     connect( mConfigureDialog, TQ_SIGNAL( configChanged() ),
              this, TQ_SLOT( slotConfigChanged() ) );
   }
 
-  if( KMKernel::getKMMainWidget() == 0 )
+  if(!KMKernel::getKMMainWidget())
   {
     // ensure that there is a main widget available
     // as parts of the configure dialog (identity) rely on this
@@ -2251,7 +2251,7 @@ KMMsgIndex *KMKernel::msgIndex()
 TDEMainWindow* KMKernel::mainWin()
 {
   if (TDEMainWindow::memberList) {
-    TDEMainWindow *kmWin = 0;
+    TDEMainWindow *kmWin = nullptr;
 
     // First look for a KMMainWin.
     for (kmWin = TDEMainWindow::memberList->first(); kmWin;
@@ -2283,7 +2283,7 @@ void KMKernel::slotEmptyTrash()
 {
   TQString title = i18n("Empty Trash");
   TQString text = i18n("Are you sure you want to empty the trash folders of all accounts?");
-  if (KMessageBox::warningContinueCancel(0, text, title,
+  if (KMessageBox::warningContinueCancel(nullptr, text, title,
                                          KStdGuiItem::cont(), "confirm_empty_trash")
       != KMessageBox::Continue)
   {
@@ -2348,7 +2348,7 @@ KMMainWidget *KMKernel::getKMMainWidget()
   TQWidgetListIt it( *l );
   TQWidget *wid;
 
-  while ( ( wid = it.current() ) != 0 ) {
+  while ((wid = it.current()) != nullptr) {
     ++it;
     TQObjectList *l2 = wid->topLevelWidget()->queryList( "KMMainWidget" );
     if (l2 && l2->first()) {
@@ -2361,7 +2361,7 @@ KMMainWidget *KMKernel::getKMMainWidget()
     delete l2;
   }
   delete l;
-  return 0;
+  return nullptr;
 }
 
 void KMKernel::slotRunBackgroundTasks() // called regularly by timer
@@ -2462,7 +2462,7 @@ bool KMKernel::canQueryClose()
 
 void KMKernel::messageCountChanged()
 {
-  mTimeOfLastMessageCountChange = ::time( 0 );
+  mTimeOfLastMessageCountChange = ::time( nullptr );
 }
 
 int KMKernel::timeOfLastMessageCountChange() const
@@ -2511,7 +2511,7 @@ Wallet *KMKernel::wallet() {
     return mWallet;
 
   if ( !Wallet::isEnabled() || walletOpenFailed )
-    return 0;
+    return nullptr;
 
   // find an appropriate parent window for the wallet dialog
   WId window = 0;
@@ -2525,7 +2525,7 @@ Wallet *KMKernel::wallet() {
 
   if ( !mWallet ) {
     walletOpenFailed = true;
-    return 0;
+    return nullptr;
   }
 
   if ( !mWallet->hasFolder( "kmail" ) )
@@ -2548,7 +2548,7 @@ TQValueList< TQGuardedPtr<KMFolder> > KMKernel::allFolders()
 
 KMFolder *KMKernel::currentFolder() {
   KMMainWidget *widget = getKMMainWidget();
-  KMFolder *folder = 0;
+  KMFolder *folder = nullptr;
   if ( widget && widget->folderTree() ) {
     folder = widget->folderTree()->currentFolder();
   }
diff --git a/kmail/kmkernel.h b/kmail/kmkernel.h
index fba221999..9b400587e 100644
--- a/kmail/kmkernel.h
+++ b/kmail/kmkernel.h
@@ -93,7 +93,7 @@ class TDE_EXPORT KMKernel : public TQObject, virtual public KMailIface
   
 
 public:
-  KMKernel (TQObject *parent=0, const char *name=0);
+  KMKernel (TQObject *parent=nullptr, const char *name=nullptr);
   ~KMKernel ();
 
   /** dcop callable stuff */
diff --git a/kmail/kmlineeditspell.cpp b/kmail/kmlineeditspell.cpp
index 92cc4f7f6..ffaf63afe 100644
--- a/kmail/kmlineeditspell.cpp
+++ b/kmail/kmlineeditspell.cpp
@@ -152,7 +152,7 @@ TQPopupMenu *KMLineEdit::createPopupMenu()
 {
     TQPopupMenu *menu = KPIM::AddresseeLineEdit::createPopupMenu();
     if ( !menu )
-        return 0;
+        return nullptr;
 
     menu->insertSeparator();
     menu->insertItem( i18n( "Edit Recent Addresses..." ),
diff --git a/kmail/kmlineeditspell.h b/kmail/kmlineeditspell.h
index 98b8ba760..6b3ff7334 100644
--- a/kmail/kmlineeditspell.h
+++ b/kmail/kmlineeditspell.h
@@ -14,8 +14,8 @@ class KMLineEdit : public KPIM::AddresseeLineEdit
     TQ_OBJECT
   
 public:
-    KMLineEdit(bool useCompletion, TQWidget *parent = 0,
-               const char *name = 0);
+    KMLineEdit(bool useCompletion, TQWidget *parent = nullptr,
+               const char *name = nullptr);
 
 signals:
     void focusUp();
@@ -43,8 +43,8 @@ class KMLineEditSpell : public KMLineEdit
     TQ_OBJECT
   
 public:
-    KMLineEditSpell(bool useCompletion, TQWidget *parent = 0,
-               const char *name = 0);
+    KMLineEditSpell(bool useCompletion, TQWidget *parent = nullptr,
+               const char *name = nullptr);
     void highLightWord( unsigned int length, unsigned int pos );
     void spellCheckDone( const TQString &s );
     void spellCheckerMisspelling( const TQString &text, const TQStringList &, unsigned int pos);
diff --git a/kmail/kmmainwidget.cpp b/kmail/kmmainwidget.cpp
index 8e354c7f7..87cf8aa68 100644
--- a/kmail/kmmainwidget.cpp
+++ b/kmail/kmmainwidget.cpp
@@ -130,7 +130,7 @@ using KPIM::ProgressManager;
 
 #include "kmmainwidget.moc"
 
-TQValueList<KMMainWidget*>* KMMainWidget::s_mainWidgetList = 0;
+TQValueList<KMMainWidget*>* KMMainWidget::s_mainWidgetList = nullptr;
 static KStaticDeleter<TQValueList<KMMainWidget*> > mwlsd;
 
 //-----------------------------------------------------------------------------
@@ -138,31 +138,31 @@ KMMainWidget::KMMainWidget(TQWidget *parent, const char *name,
                            KXMLGUIClient *aGUIClient,
                            TDEActionCollection *actionCollection, TDEConfig* config ) :
     TQWidget(parent, name),
-    mFavoritesCheckMailAction( 0 ),
-    mFavoriteFolderView( 0 ),
-    mFolderView( 0 ),
-    mFolderViewParent( 0 ),
-    mFolderViewSplitter( 0 ),
-    mQuickSearchLine( 0 ),
-    mArchiveFolderAction( 0 ),
-    mShowBusySplashTimer( 0 ),
+    mFavoritesCheckMailAction( nullptr ),
+    mFavoriteFolderView( nullptr ),
+    mFolderView( nullptr ),
+    mFolderViewParent( nullptr ),
+    mFolderViewSplitter( nullptr ),
+    mQuickSearchLine( nullptr ),
+    mArchiveFolderAction( nullptr ),
+    mShowBusySplashTimer( nullptr ),
     mShowingOfflineScreen( false ),
-    mMsgActions( 0 ),
+    mMsgActions( nullptr ),
     mVacationIndicatorActive( false )
 {
   // must be the first line of the constructor:
   mStartupDone = false;
-  mSearchWin = 0;
+  mSearchWin = nullptr;
   mIntegrated  = true;
-  mFolder = 0;
-  mTemplateFolder = 0;
+  mFolder = nullptr;
+  mTemplateFolder = nullptr;
   mFolderThreadPref = false;
   mFolderThreadSubjPref = true;
   mReaderWindowActive = true;
   mReaderWindowBelow = true;
   mFolderHtmlPref = false;
   mFolderHtmlLoadExtPref = false;
-  mSystemTray = 0;
+  mSystemTray = nullptr;
   mDestructed = false;
   mActionCollection = actionCollection;
   mTopLayout = new TQVBoxLayout(this);
@@ -170,16 +170,16 @@ KMMainWidget::KMMainWidget(TQWidget *parent, const char *name,
   mFilterTBarActions.setAutoDelete(false);
   mFilterCommands.setAutoDelete(true);
   mFolderShortcutCommands.setAutoDelete(true);
-  mJob = 0;
+  mJob = nullptr;
   mConfig = config;
   mGUIClient = aGUIClient;
 
-  mCustomReplyActionMenu = 0;
-  mCustomReplyAllActionMenu = 0;
-  mCustomForwardActionMenu = 0;
-  mCustomReplyMapper = 0;
-  mCustomReplyAllMapper = 0;
-  mCustomForwardMapper = 0;
+  mCustomReplyActionMenu = nullptr;
+  mCustomReplyAllActionMenu = nullptr;
+  mCustomForwardActionMenu = nullptr;
+  mCustomReplyMapper = nullptr;
+  mCustomReplyAllMapper = nullptr;
+  mCustomForwardMapper = nullptr;
 
   // FIXME This should become a line separator as soon as the API
   // is extended in tdelibs.
@@ -246,7 +246,7 @@ KMMainWidget::KMMainWidget(TQWidget *parent, const char *name,
 
 
   TDEMainWindow *mainWin = dynamic_cast<TDEMainWindow*>(topLevelWidget());
-  KStatusBar *sb =  mainWin ? mainWin->statusBar() : 0;
+  KStatusBar *sb =  mainWin ? mainWin->statusBar() : nullptr;
   mVacationScriptIndicator = new KStatusBarLabel( TQString(), 0, sb );
   mVacationScriptIndicator->hide();
   connect( mVacationScriptIndicator, TQ_SIGNAL(itemReleased(int)), TQ_SLOT(slotEditVacation()) );
@@ -551,8 +551,8 @@ void KMMainWidget::writeConfig(void)
 void KMMainWidget::createWidgets(void)
 {
   // Create the splitters according to the layout settings
-  TQWidget *headerParent = 0,
-            *mimeParent = 0, *messageParent = 0;
+  TQWidget *headerParent = nullptr,
+            *mimeParent = nullptr, *messageParent = nullptr;
 
   const bool opaqueResize = TDEGlobalSettings::opaqueResize();
   if ( mLongFolderList ) {
@@ -631,7 +631,7 @@ void KMMainWidget::createWidgets(void)
                      mHeaders, TQ_SLOT(selectNextMessage()));
 
   if (mReaderWindowActive) {
-    mMsgView = new KMReaderWin(messageParent, this, actionCollection(), 0 );
+    mMsgView = new KMReaderWin(messageParent, this, actionCollection(), nullptr );
     if ( mMsgActions ) {
       mMsgActions->setMessageView( mMsgView );
     }
@@ -841,7 +841,7 @@ void KMMainWidget::slotSearch()
 //-------------------------------------------------------------------------
 void KMMainWidget::slotSearchClosed()
 {
-  mSearchWin = 0;
+  mSearchWin = nullptr;
 }
 
 
@@ -1432,7 +1432,7 @@ void KMMainWidget::slotMessageQueuedOrDrafted()
 void KMMainWidget::slotForwardInlineMsg()
 {
   KMMessageList* selected = mHeaders->selectedMsgs();
-  KMCommand *command = 0L;
+  KMCommand *command = nullptr;
   if(selected && !selected->isEmpty()) {
     command = new KMForwardInlineCommand( this, *selected,
                                           mFolder->identity() );
@@ -1449,7 +1449,7 @@ void KMMainWidget::slotForwardInlineMsg()
 void KMMainWidget::slotForwardAttachedMsg()
 {
   KMMessageList* selected = mHeaders->selectedMsgs();
-  KMCommand *command = 0L;
+  KMCommand *command = nullptr;
   if(selected && !selected->isEmpty()) {
     command = new KMForwardAttachedCommand( this, *selected, mFolder->identity() );
   } else {
@@ -1463,7 +1463,7 @@ void KMMainWidget::slotForwardAttachedMsg()
 void KMMainWidget::slotForwardDigestMsg()
 {
   KMMessageList* selected = mHeaders->selectedMsgs();
-  KMCommand *command = 0L;
+  KMCommand *command = nullptr;
   if(selected && !selected->isEmpty()) {
     command = new KMForwardDigestCommand( this, *selected, mFolder->identity() );
   } else {
@@ -1496,7 +1496,7 @@ void KMMainWidget::slotTrashMsg()
 //-----------------------------------------------------------------------------
 void KMMainWidget::slotDeleteMsg( bool confirmDelete )
 {
-  mHeaders->moveMsgToFolder( 0, confirmDelete );
+  mHeaders->moveMsgToFolder( nullptr, confirmDelete );
 }
 
 //-----------------------------------------------------------------------------
@@ -1510,7 +1510,7 @@ void KMMainWidget::slotTrashThread()
 void KMMainWidget::slotDeleteThread( bool confirmDelete )
 {
   mHeaders->highlightCurrentThread();
-  mHeaders->moveMsgToFolder( 0, confirmDelete );
+  mHeaders->moveMsgToFolder( nullptr, confirmDelete );
 }
 
 //-----------------------------------------------------------------------------
@@ -1555,7 +1555,7 @@ void KMMainWidget::slotCustomForwardMsg( int tid )
   TQString tmpl = mCustomTemplates[ tid ];
   kdDebug() << "Forward with template: " << tmpl << " (" << tid << ")" << endl;
   KMMessageList* selected = mHeaders->selectedMsgs();
-  KMCommand *command = 0L;
+  KMCommand *command = nullptr;
   if(selected && !selected->isEmpty()) {
     command = new KMCustomForwardCommand( this, *selected,
                                           mFolder->identity(), tmpl );
@@ -1839,7 +1839,7 @@ void KMMainWidget::slotPrintMsg()
 //-----------------------------------------------------------------------------
 void KMMainWidget::setupForwardActions()
 {
-  disconnect( mForwardActionMenu, TQ_SIGNAL( activated() ), 0, 0 );
+  disconnect( mForwardActionMenu, TQ_SIGNAL( activated() ), nullptr, nullptr );
   mForwardActionMenu->remove( mForwardInlineAction );
   mForwardActionMenu->remove( mForwardAttachedAction );
 
@@ -1887,7 +1887,7 @@ void KMMainWidget::slotSaveMsg()
 //-----------------------------------------------------------------------------
 void KMMainWidget::slotOpenMsg()
 {
-  KMOpenMsgCommand *openCommand = new KMOpenMsgCommand( this, 0, overrideEncoding() );
+  KMOpenMsgCommand *openCommand = new KMOpenMsgCommand( this, nullptr, overrideEncoding() );
 
   openCommand->start();
 }
@@ -2021,7 +2021,7 @@ void KMMainWidget::folderSelected( KMFolder* aFolder, bool forceJumpToUnread )
 
   // Delete any pending timer, if needed it will be recreated below
   delete mShowBusySplashTimer;
-  mShowBusySplashTimer = 0;
+  mShowBusySplashTimer = nullptr;
 
   if ( newFolder )
     writeFolderConfig();
@@ -2053,7 +2053,7 @@ void KMMainWidget::folderSelected( KMFolder* aFolder, bool forceJumpToUnread )
       connect( imap, TQ_SIGNAL( folderComplete( KMFolderImap*, bool ) ),
           this, TQ_SLOT( folderSelected() ) );
       imap->getAndCheckFolder();
-      mHeaders->setFolder( 0 );
+      mHeaders->setFolder( nullptr );
       updateFolderMenu();
       mForceJumpToUnread = forceJumpToUnread;
 
@@ -2128,10 +2128,10 @@ void KMMainWidget::slotMsgSelected(KMMessage *msg)
     mMsgView->setWaitingForSerNum( msg->getMsgSerNum() );
 
     if ( mJob ) {
-       disconnect( mJob, 0, mMsgView, 0 );
+       disconnect( mJob, nullptr, mMsgView, nullptr );
        delete mJob;
     }
-    mJob = msg->parent()->createJob( msg, FolderJob::tGetMessage, 0,
+    mJob = msg->parent()->createJob( msg, FolderJob::tGetMessage, nullptr,
           "STRUCTURE", mMsgView->attachmentStrategy() );
     connect(mJob, TQ_SIGNAL(messageRetrieved(KMMessage*)),
             mMsgView, TQ_SLOT(slotMessageArrived(KMMessage*)));
@@ -2334,7 +2334,7 @@ void KMMainWidget::slotMsgActivated(KMMessage *msg)
     return;
   }
 
-  assert( msg != 0 );
+  assert(msg);
   KMReaderMainWin *win = new KMReaderMainWin( mFolderHtmlPref, mFolderHtmlLoadExtPref );
   TDEConfigGroup reader( KMKernel::config(), "Reader" );
   bool useFixedFont = mMsgView ? mMsgView->isFixedFont()
@@ -2672,7 +2672,7 @@ void KMMainWidget::setupActions()
 		      actionCollection(), "check_mail" );
 
   mFavoritesCheckMailAction = new TDEAction( i18n("Check Mail in Favorite Folders"),
-              "mail_get", CTRL+SHIFT+Key_L, 0, 0,
+              "mail_get", CTRL+SHIFT+Key_L, nullptr, nullptr,
               actionCollection(), "favorite_check_mail" );
   if ( mFavoriteFolderView )
     connect( mFavoritesCheckMailAction, TQ_SIGNAL(activated()), mFavoriteFolderView, TQ_SLOT(checkMail()) );
@@ -2807,7 +2807,7 @@ void KMMainWidget::setupActions()
                                       TDEStdAccel::shortcut( TDEStdAccel::Reload ), this,
                                       TQ_SLOT(slotRefreshFolder()),
                                       actionCollection(), "refresh_folder" );
-  mTroubleshootFolderAction = 0; // set in initializeIMAPActions
+  mTroubleshootFolderAction = nullptr; // set in initializeIMAPActions
 
   mEmptyFolderAction = new TDEAction( "foo" /*set in updateFolderMenu*/, "edittrash", 0, this,
 		      TQ_SLOT(slotEmptyFolder()), actionCollection(), "empty" );
@@ -3142,7 +3142,7 @@ void KMMainWidget::setupActions()
   (void) new TDEAction( i18n("Manage &Sieve Scripts..."), 0, this,
                       TQ_SLOT(slotManageSieveScripts()), actionCollection(), "sieveFilters" );
 
-  (void) new TDEAction( KGuiItem( i18n("KMail &Introduction"), 0,
+  (void) new TDEAction( KGuiItem( i18n("KMail &Introduction"), nullptr,
 				i18n("Display KMail's Welcome Page") ),
 		      0, this, TQ_SLOT(slotIntro()),
 		      actionCollection(), "help_kmail_welcomepage" );
@@ -3198,7 +3198,7 @@ void KMMainWidget::setupForwardingActionsList()
 void KMMainWidget::slotEditNotifications()
 {
   if(kmkernel->xmlGuiInstance())
-    KNotifyDialog::configure(this, 0, kmkernel->xmlGuiInstance()->aboutData());
+    KNotifyDialog::configure(this, nullptr, kmkernel->xmlGuiInstance()->aboutData());
   else
     KNotifyDialog::configure(this);
 }
@@ -3319,7 +3319,7 @@ void KMMainWidget::updateMessageActions()
       mMsgActions->setSelectedSernums( mHeaders->selectedSernums() );
       mMsgActions->setSelectedVisibleSernums( mHeaders->selectedVisibleSernums() );
     } else {
-      mMsgActions->setCurrentMessage( 0 );
+      mMsgActions->setCurrentMessage( nullptr );
     }
 
     updateListFilterAction();
@@ -3330,7 +3330,7 @@ void KMMainWidget::updateMessageActions()
       for ( TQPtrListIterator<TQListViewItem> it( selectedItems ) ;
             it.current() ; ++ it ) {
         TQListViewItem * item = *it;
-        if ( item->parent()==0 && item->childCount()==0 ) {
+        if ( !item->parent() && item->childCount()==0 ) {
           allSelectedInCommonThread = false;
           break;
         }
@@ -3342,7 +3342,7 @@ void KMMainWidget::updateMessageActions()
 
     TQListViewItem *curItemParent = mHeaders->currentItem();
     bool parent_thread = 0;
-    if ( curItemParent && curItemParent->firstChild() != 0 ) parent_thread = 1;
+    if ( curItemParent && curItemParent->firstChild() ) parent_thread = 1;
 
     bool mass_actions = count >= 1;
     bool thread_actions = mass_actions && allSelectedInCommonThread &&
@@ -3536,7 +3536,7 @@ void KMMainWidget::slotIntro()
 
   mMsgView->displayAboutPage();
 
-  mFolder = 0;
+  mFolder = nullptr;
 }
 
 void KMMainWidget::slotShowStartupFolder()
@@ -3565,7 +3565,7 @@ void KMMainWidget::slotShowStartupFolder()
     return;
   }
 
-  KMFolder* startup = 0;
+  KMFolder* startup = nullptr;
   if ( !mStartupFolder.isEmpty() ) {
     // find the startup-folder
     startup = kmkernel->findFolderById( mStartupFolder );
@@ -3600,7 +3600,7 @@ void KMMainWidget::removeDuplicates()
   if (!mFolder)
     return;
   KMFolder *oFolder = mFolder;
-  mHeaders->setFolder(0);
+  mHeaders->setFolder(nullptr);
   TQMap< TQString, TQValueList<int> > idMD5s;
   TQValueList<int> redundantIds;
   TQValueList<int>::Iterator kt;
@@ -3706,7 +3706,7 @@ void KMMainWidget::initializeFilterActions()
 {
   TQString filterName, normalizedName;
   KMMetaFilterActionCommand *filterCommand;
-  TDEAction *filterAction = 0;
+  TDEAction *filterAction = nullptr;
 
   clearFilterActions();
   mApplyAllFiltersAction->plug(mApplyFilterActionsMenu->popupMenu());
@@ -3762,7 +3762,7 @@ void KMMainWidget::initializeIMAPActions( bool setState /* false the first time,
       break;
     }
   }
-  if ( hasImapAccount == ( mTroubleshootFolderAction != 0 ) )
+  if (hasImapAccount == static_cast<bool>(mTroubleshootFolderAction))
     return; // nothing to do
 
   KXMLGUIFactory* factory = mGUIClient->factory();
@@ -3776,7 +3776,7 @@ void KMMainWidget::initializeIMAPActions( bool setState /* false the first time,
       updateFolderMenu(); // set initial state of the action
   } else {
     delete mTroubleshootFolderAction ;
-    mTroubleshootFolderAction = 0;
+    mTroubleshootFolderAction = nullptr;
   }
 
   if ( factory )
@@ -3831,7 +3831,7 @@ TQString KMMainWidget::findCurrentImapPath()
 //-----------------------------------------------------------------------------
 ImapAccountBase* KMMainWidget::findCurrentImapAccountBase()
 {
-  ImapAccountBase* account = 0;
+  ImapAccountBase* account = nullptr;
   if (!mFolder) return account;
   if (mFolder->folderType() == KMFolderTypeImap)
   {
@@ -3897,7 +3897,7 @@ void KMMainWidget::toggleSystemTray()
     // Get rid of system tray on user's request
     kdDebug(5006) << "deleting systray" << endl;
     delete mSystemTray;
-    mSystemTray = 0;
+    mSystemTray = nullptr;
   }
 
   // Set mode of systemtray. If mode has changed, tray will handle this.
@@ -3922,7 +3922,7 @@ void KMMainWidget::slotAntiVirusWizard()
 //-----------------------------------------------------------------------------
 void KMMainWidget::slotFilterLogViewer()
 {
-  FilterLogDialog * dlg = new FilterLogDialog( 0 );
+  FilterLogDialog * dlg = new FilterLogDialog( nullptr );
   dlg->show();
 }
 
diff --git a/kmail/kmmainwin.cpp b/kmail/kmmainwin.cpp
index 120b1606a..3159038a2 100644
--- a/kmail/kmmainwin.cpp
+++ b/kmail/kmmainwin.cpp
@@ -26,7 +26,7 @@
 #include "kmmainwin.moc"
 
 KMMainWin::KMMainWin(TQWidget *)
-    : TDEMainWindow( 0, "kmail-mainwindow#" ),
+    : TDEMainWindow( nullptr, "kmail-mainwindow#" ),
       mReallyClose( false )
 {
   // Set this to be the group leader for all subdialogs - this means
diff --git a/kmail/kmmainwin.h b/kmail/kmmainwin.h
index 990d6a8a5..5c9f7fc52 100644
--- a/kmail/kmmainwin.h
+++ b/kmail/kmmainwin.h
@@ -39,7 +39,7 @@ class KMMainWin : public TDEMainWindow
 public:
   // the main window needs to have a name since else restoring the window
   // settings by twin doesn't work
-  KMMainWin(TQWidget *parent = 0);
+  KMMainWin(TQWidget *parent = nullptr);
   virtual ~KMMainWin();
   KMMainWidget *mainKMWidget() const { return mKMMainWidget; };
   StatusbarProgressWidget* progressWidget() const { return mLittleProgress; }
diff --git a/kmail/kmmessage.cpp b/kmail/kmmessage.cpp
index d5f35ec47..c796fbb18 100644
--- a/kmail/kmmessage.cpp
+++ b/kmail/kmmessage.cpp
@@ -121,7 +121,7 @@ KMMessage::KMMessage(KMMsgInfo& msgInfo): KMMsgBase()
 KMMessage::KMMessage(const KMMessage& other) :
     KMMsgBase( other ),
     ISubject(),
-    mMsg(0)
+    mMsg(nullptr)
 {
   init(); // to be safe
   assign( other );
@@ -135,7 +135,7 @@ void KMMessage::init( DwMessage* aMsg )
   } else {
     mMsg = new DwMessage;
   }
-  mOverrideCodec = 0;
+  mOverrideCodec = nullptr;
   mDecodeHTML = false;
   mComplete = true;
   mReadyToShow = true;
@@ -147,10 +147,10 @@ void KMMessage::init( DwMessage* aMsg )
   mSignatureState = KMMsgSignatureStateUnknown;
   mMDNSentState = KMMsgMDNStateUnknown;
   mDate    = 0;
-  mUnencryptedMsg = 0;
-  mLastUpdated = 0;
+  mUnencryptedMsg = nullptr;
+  mLastUpdated = nullptr;
   mCursorPos = 0;
-  mMsgInfo = 0;
+  mMsgInfo = nullptr;
   mIsParsed = false;
 }
 
@@ -164,7 +164,7 @@ void KMMessage::assign( const KMMessage& other )
   if( other.mMsg )
     mMsg = new DwMessage( *(other.mMsg) );
   else
-    mMsg = 0;
+    mMsg = nullptr;
   mOverrideCodec = other.mOverrideCodec;
   mDecodeHTML = other.mDecodeHTML;
   mMsgSize = other.mMsgSize;
@@ -179,7 +179,7 @@ void KMMessage::assign( const KMMessage& other )
   if( other.hasUnencryptedMsg() )
     mUnencryptedMsg = new KMMessage( *other.unencryptedMsg() );
   else
-    mUnencryptedMsg = 0;
+    mUnencryptedMsg = nullptr;
   setDrafts( other.drafts() );
   setTemplates( other.templates() );
   //mFileName = ""; // we might not want to copy the other messages filename (?)
@@ -730,7 +730,7 @@ void KMMessage::parseTextStringFromDwPart( partNode * root,
   if( curNode ) {
     isHTML = DwMime::kSubtypeHtml == curNode->subType();
     // now parse the TEXT message part we want to quote
-    ObjectTreeParser otp( 0, 0, true, false, true );
+    ObjectTreeParser otp( nullptr, nullptr, true, false, true );
     otp.parseObjectTree( curNode );
     parsedString = otp.rawReplyString();
     codec = curNode->msgPart().codec();
@@ -747,7 +747,7 @@ TQString KMMessage::asPlainTextFromObjectTree( partNode *root, bool aStripSignat
 
   TQCString parsedString;
   bool isHTML = false;
-  const TQTextCodec * codec = 0;
+  const TQTextCodec * codec = nullptr;
 
   if ( !root ) return TQString();
   parseTextStringFromDwPart( root, parsedString, codec, isHTML );
@@ -1374,14 +1374,14 @@ static int requestAdviceOnMDN( const char * what ) {
     if ( !qstrcmp( what, mdnMessageBoxes[i].dontAskAgainID ) ) {
       if ( mdnMessageBoxes[i].canDeny ) {
         const KCursorSaver saver( TQCursor::ArrowCursor );
-        int answer = TQMessageBox::information( 0,
+        int answer = TQMessageBox::information( nullptr,
                                                i18n("Message Disposition Notification Request"),
                                                i18n( mdnMessageBoxes[i].text ),
                                                i18n("&Ignore"), i18n("Send \"&denied\""), i18n("&Send") );
         return answer ? answer + 1 : 0 ; // map to "mode" in createMDN
       } else {
         const KCursorSaver saver( TQCursor::ArrowCursor );
-        int answer = TQMessageBox::information( 0,
+        int answer = TQMessageBox::information( nullptr,
                                                i18n("Message Disposition Notification Request"),
                                                i18n( mdnMessageBoxes[i].text ),
                                                i18n("&Ignore"), i18n("&Send") );
@@ -1408,7 +1408,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a,
 #ifndef MDN_DEBUG
   if ( mdnSentState() != KMMsgMDNStateUnknown &&
        mdnSentState() != KMMsgMDNNone )
-    return 0;
+    return nullptr;
 #else
   char st[2]; st[0] = (char)mdnSentState(); st[1] = 0;
   kdDebug(5006) << "mdnSentState() == '" << st << "'" << endl;
@@ -1418,12 +1418,12 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a,
   if ( findDwBodyPart( DwMime::kTypeMessage,
 		       DwMime::kSubtypeDispositionNotification ) ) {
     setMDNSentState( KMMsgMDNIgnore );
-    return 0;
+    return nullptr;
   }
 
   // extract where to send to:
   TQString receiptTo = headerField("Disposition-Notification-To");
-  if ( receiptTo.stripWhiteSpace().isEmpty() ) return 0;
+  if ( receiptTo.stripWhiteSpace().isEmpty() ) return nullptr;
   receiptTo.remove( '\n' );
 
 
@@ -1436,7 +1436,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a,
   if ( !mode || mode < 0 || mode > 3 ) {
     // early out for ignore:
     setMDNSentState( KMMsgMDNIgnore );
-    return 0;
+    return nullptr;
   }
 
   // RFC 2298: An importance of "required" indicates that
@@ -1450,7 +1450,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a,
     // ### hacky; should parse...
     // There is a required option that we don't understand. We need to
     // ask the user what we should do:
-    if ( !allowGUI ) return 0; // don't setMDNSentState here!
+    if ( !allowGUI ) return nullptr; // don't setMDNSentState here!
     mode = requestAdviceOnMDN( "mdnUnknownOption" );
     s = MDN::SentManually;
 
@@ -1466,7 +1466,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a,
   kdDebug(5006) << "KPIM::splitEmailAddrList(receiptTo): "
 	    << KPIM::splitEmailAddrList(receiptTo).join("\n") << endl;
   if ( KPIM::splitEmailAddrList(receiptTo).count() > 1 ) {
-    if ( !allowGUI ) return 0; // don't setMDNSentState here!
+    if ( !allowGUI ) return nullptr; // don't setMDNSentState here!
     mode = requestAdviceOnMDN( "mdnMultipleAddressesInReceiptTo" );
     s = MDN::SentManually;
   }
@@ -1481,7 +1481,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a,
     : returnPathList.front().localPart + '@' + returnPathList.front().domain ;
   kdDebug(5006) << "clean return path: " << returnPath << endl;
   if ( returnPath.isEmpty() || !receiptTo.contains( returnPath, false ) ) {
-    if ( !allowGUI ) return 0; // don't setMDNSentState here!
+    if ( !allowGUI ) return nullptr; // don't setMDNSentState here!
     mode = requestAdviceOnMDN( returnPath.isEmpty() ?
 			       "mdnReturnPathEmpty" :
 			       "mdnReturnPathNotInReceiptTo" );
@@ -1491,7 +1491,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a,
   if ( a != KMime::MDN::AutomaticAction ) {
     //TODO: only ingore user settings for AutomaticAction if requested
     if ( mode == 1 ) { // ask
-      if ( !allowGUI ) return 0; // don't setMDNSentState here!
+      if ( !allowGUI ) return nullptr; // don't setMDNSentState here!
       mode = requestAdviceOnMDN( "mdnNormalAsk" );
       s = MDN::SentManually; // asked user
     }
@@ -1499,7 +1499,7 @@ KMMessage* KMMessage::createMDN( MDN::ActionMode a,
     switch ( mode ) {
       case 0: // ignore:
         setMDNSentState( KMMsgMDNIgnore );
-        return 0;
+        return nullptr;
       default:
       case 1:
         kdFatal(5006) << "KMMessage::createMDN(): The \"ask\" mode should "
@@ -1641,7 +1641,7 @@ KMMessage* KMMessage::createDeliveryReceipt() const
   KMMessage *receipt;
 
   receiptTo = headerField("Disposition-Notification-To");
-  if ( receiptTo.stripWhiteSpace().isEmpty() ) return 0;
+  if ( receiptTo.stripWhiteSpace().isEmpty() ) return nullptr;
   receiptTo.remove( '\n' );
 
   receipt = new KMMessage;
@@ -1862,7 +1862,7 @@ time_t KMMessage::date() const
 void KMMessage::setDateToday()
 {
   struct timeval tval;
-  gettimeofday(&tval, 0);
+  gettimeofday(&tval, nullptr);
   setDate((time_t)tval.tv_sec);
 }
 
@@ -2903,7 +2903,7 @@ DwBodyPart * KMMessage::dwBodyPart( int aIdx ) const
   // Get the DwBodyPart for this index
 
   curpart = getFirstDwBodyPart();
-  part = 0;
+  part = nullptr;
 
   while (curpart && !part) {
     //dive into multipart messages
@@ -2942,7 +2942,7 @@ DwBodyPart * KMMessage::findDwBodyPart( int type, int subtype ) const
   // Get the DwBodyPart for this index
 
   curpart = getFirstDwBodyPart();
-  part = 0;
+  part = nullptr;
 
   while (curpart && !part) {
     //dive into multipart messages
@@ -2991,7 +2991,7 @@ DwBodyPart * KMMessage::findDwBodyPart( const TQCString& type, const TQCString&
   // Get the DwBodyPart for this index
 
   curpart = getFirstDwBodyPart();
-  part = 0;
+  part = nullptr;
 
   while (curpart && !part) {
     //dive into multipart messages
@@ -3220,7 +3220,7 @@ bool KMMessage::deleteBodyPart( int partIndex )
 //-----------------------------------------------------------------------------
 DwBodyPart* KMMessage::createDWBodyPart(const KMMessagePart* aPart)
 {
-  DwBodyPart* part = DwBodyPart::NewBodyPart(emptyString, 0);
+  DwBodyPart* part = DwBodyPart::NewBodyPart(emptyString, nullptr);
 
   if ( !aPart )
     return part;
@@ -4240,7 +4240,7 @@ void KMMessage::getLink(int n, ulong *retMsgSerNum, KMMsgStatus *reStatus) const
 //-----------------------------------------------------------------------------
 DwBodyPart* KMMessage::findDwBodyPart( DwBodyPart* part, const TQString & partSpecifier )
 {
-  if ( !part ) return 0;
+  if ( !part ) return nullptr;
   DwBodyPart* current;
 
   if ( part->partId() == partSpecifier )
@@ -4488,7 +4488,7 @@ TQCString KMMessage::mboxMessageSeparator()
     str = "unknown@unknown.invalid";
   TQCString dateStr( dateShortStr() );
   if ( dateStr.isEmpty() ) {
-    time_t t = ::time( 0 );
+    time_t t = ::time( nullptr );
     dateStr = ctime( &t );
     const int len = dateStr.length();
     if ( dateStr[len-1] == '\n' )
@@ -4512,11 +4512,11 @@ DwBodyPart* KMMessage::findPartInternal(DwEntity * root, int index, int & accu)
 {
   accu++;
   if ( index < accu ) // should not happen
-    return 0;
+    return nullptr;
   DwBodyPart *current = dynamic_cast<DwBodyPart*>( root );
   if ( index == accu )
     return current;
-  DwBodyPart *rv = 0;
+  DwBodyPart *rv = nullptr;
   if ( root->Body().FirstBodyPart() )
     rv = findPartInternal( root->Body().FirstBodyPart(), index, accu );
   if ( !rv && current && current->Next() )
diff --git a/kmail/kmmessage.h b/kmail/kmmessage.h
index a96470df0..334efb7df 100644
--- a/kmail/kmmessage.h
+++ b/kmail/kmmessage.h
@@ -84,7 +84,7 @@ public:
   using KMMsgBase::setSignatureStateChar; // dto.
 
   /** Straight forward initialization. */
-  KMMessage(KMFolder* parent=0);
+  KMMessage(KMFolder* parent=nullptr);
 
   /** Constructor from a DwMessage. KMMessage takes possession of the
       DwMessage, so don't dare to delete it.
@@ -131,7 +131,7 @@ public:
   void setUnencryptedMsg( KMMessage* unencrypted );
 
   /** Returns true if the message contains an unencrypted copy of itself. */
-  bool hasUnencryptedMsg() const { return 0 != mUnencryptedMsg; }
+  bool hasUnencryptedMsg() const { return mUnencryptedMsg != nullptr; }
 
   /** Returns an unencrypted copy of this message or 0 if none exists. */
   KMMessage* unencryptedMsg() const { return mUnencryptedMsg; }
@@ -144,7 +144,7 @@ public:
   KMMessage* takeUnencryptedMsg()
   {
     KMMessage* ret = mUnencryptedMsg;
-    mUnencryptedMsg = 0;
+    mUnencryptedMsg = nullptr;
     return ret;
   }
 
@@ -519,20 +519,20 @@ public:
    * returned. If this is zero, the toplevel message will be taken.
    */
   TQCString contentTransferEncodingStr() const;
-  int contentTransferEncoding( DwEntity *entity = 0 ) const;
-  void setContentTransferEncodingStr( const TQCString& cteString, DwEntity *entity = 0 );
-  void setContentTransferEncoding( int cte, DwEntity *entity = 0 );
+  int contentTransferEncoding( DwEntity *entity = nullptr ) const;
+  void setContentTransferEncodingStr( const TQCString& cteString, DwEntity *entity = nullptr );
+  void setContentTransferEncoding( int cte, DwEntity *entity = nullptr );
 
   /**
    * Cte is short for ContentTransferEncoding.
    * These functions are an alternative to the ones with longer names.
    */
   TQCString cteStr() const { return contentTransferEncodingStr(); }
-  int cte( DwEntity *entity = 0 ) const { return contentTransferEncoding( entity ); }
-  void setCteStr( const TQCString& aStr, DwEntity *entity = 0 ) {
+  int cte( DwEntity *entity = nullptr ) const { return contentTransferEncoding( entity ); }
+  void setCteStr( const TQCString& aStr, DwEntity *entity = nullptr ) {
     setContentTransferEncodingStr( aStr, entity );
   }
-  void setCte( int aCte, DwEntity *entity = 0 ) {
+  void setCte( int aCte, DwEntity *entity = nullptr ) {
     setContentTransferEncoding( aCte, entity );
   }
 
@@ -543,11 +543,11 @@ public:
    * @param entity The body of this entity will be changed. If entity is 0,
    *               the body of the whole message will be changed.
    */
-  void setBodyFromUnicode( const TQString & str, DwEntity *entity = 0 );
+  void setBodyFromUnicode( const TQString & str, DwEntity *entity = nullptr );
 
   /** Returns the body part decoded to unicode.
    **/
-  TQString bodyToUnicode(const TQTextCodec* codec=0) const;
+  TQString bodyToUnicode(const TQTextCodec* codec=nullptr) const;
 
   /** Get the message body. Does not decode the body. */
   TQCString body() const;
@@ -569,8 +569,8 @@ public:
    *               set. If this is 0, the body of the toplevel message will be
    *               set.
    */
-  void setBodyEncoded( const TQCString& aStr, DwEntity *entity = 0 );
-  void setBodyEncodedBinary( const TQByteArray& aStr, DwEntity *entity = 0 );
+  void setBodyEncoded( const TQCString& aStr, DwEntity *entity = nullptr );
+  void setBodyEncodedBinary( const TQByteArray& aStr, DwEntity *entity = nullptr );
 
   /** Returns a list of content-transfer-encodings that can be used with
       the given result of the character frequency analysis of a message or
@@ -595,13 +595,13 @@ public:
   void setBodyAndGuessCte( const TQByteArray& aBuf, TQValueList<int>& allowedCte,
                            bool allow8Bit = false,
                            bool willBeSigned = false,
-                           DwEntity *entity = 0 );
+                           DwEntity *entity = nullptr );
 
   void setBodyAndGuessCte( const TQCString& aBuf,
                            TQValueList<int>& allowedCte,
                            bool allow8Bit = false,
                            bool willBeSigned = false,
-                           DwEntity *entity = 0 );
+                           DwEntity *entity = nullptr );
 
   /** Returns a decoded version of the body from the current content transfer
       encoding. The first method returns a null terminated string, the second
@@ -773,7 +773,7 @@ public:
    * @param entity the body part or message of which the charset should be changed.
    *               If this is 0, the charset of the toplevel message will be changed.
    */
-  void setCharset( const TQCString& charset, DwEntity *entity = 0 );
+  void setCharset( const TQCString& charset, DwEntity *entity = nullptr );
 
   /** Get a TQTextCodec suitable for this message part */
   const TQTextCodec * codec() const;
@@ -830,7 +830,7 @@ public:
   KMMsgStatus status() const { return mStatus; }
   /** Set status and mark dirty. */
   void setStatus(const KMMsgStatus status, int idx = -1);
-  void setStatus(const char* s1, const char* s2=0) { KMMsgBase::setStatus(s1, s2); }
+  void setStatus(const char* s1, const char* s2=nullptr) { KMMsgBase::setStatus(s1, s2); }
 
   /** Set encryption status of the message. */
   void setEncryptionState(const KMMsgEncryptionState, int idx = -1);
@@ -873,7 +873,7 @@ public:
   /** Set if the message is ready to be shown */
   void setReadyToShow( bool v ) { mReadyToShow = v; }
 
-  void updateAttachmentState( DwBodyPart *part = 0 );
+  void updateAttachmentState( DwBodyPart *part = nullptr );
   void updateInvitationState();
 
   /** Return, if the message should not be deleted */
@@ -945,7 +945,7 @@ public:
 private:
 
   /** Initialization shared by the ctors. */
-  void init( DwMessage* aMsg = 0 );
+  void init( DwMessage* aMsg = nullptr );
   /** Assign the values of @param other to this message. Used in the copy c'tor. */
   void assign( const KMMessage& other );
 
diff --git a/kmail/kmmimeparttree.cpp b/kmail/kmmimeparttree.cpp
index 56910cb24..e689ae010 100644
--- a/kmail/kmmimeparttree.cpp
+++ b/kmail/kmmimeparttree.cpp
@@ -125,7 +125,7 @@ void KMMimePartTree::itemRightClicked( TQListViewItem* item,
 {
     // TODO: remove this member var?
     mCurrentContextMenuItem = dynamic_cast<KMMimePartTreeItem*>( item );
-    if ( 0 == mCurrentContextMenuItem ) {
+    if ( !mCurrentContextMenuItem ) {
         kdDebug(5006) << "Item was not a KMMimePartTreeItem!" << endl;
     }
     else {
@@ -160,7 +160,7 @@ void KMMimePartTree::itemRightClicked( TQListViewItem* item,
           popup->insertItem( i18n("Properties"), this, TQ_SLOT(slotProperties()) );
         popup->exec( point );
         delete popup;
-        mCurrentContextMenuItem = 0;
+        mCurrentContextMenuItem = nullptr;
     }
 }
 
@@ -295,7 +295,7 @@ void KMMimePartTree::startHandleAttachmentCommand(int type)
   TQString name = mReaderWin->tempFileUrlFromPartNode( node ).path();
   KMHandleAttachmentCommand* command = new KMHandleAttachmentCommand(
       node, mReaderWin->message(), node->nodeId(), name,
-      KMHandleAttachmentCommand::AttachmentAction( type ), 0, this );
+      KMHandleAttachmentCommand::AttachmentAction( type ), nullptr, this );
   connect( command, TQ_SIGNAL( showAttachment( int, const TQString& ) ),
            mReaderWin, TQ_SLOT( slotAtmView( int, const TQString& ) ) );
   command->start();
diff --git a/kmail/kmmimeparttree.h b/kmail/kmmimeparttree.h
index 84da01cf2..fbcbcaa52 100644
--- a/kmail/kmmimeparttree.h
+++ b/kmail/kmmimeparttree.h
@@ -49,7 +49,7 @@ class KMMimePartTree : public TDEListView
 public:
   KMMimePartTree( KMReaderWin* readerWin,
                   TQWidget* parent,
-                  const char* name = 0 );
+                  const char* name = nullptr );
   virtual ~KMMimePartTree();
 
   void correctSize( TQListViewItem * item );
diff --git a/kmail/kmmsgbase.cpp b/kmail/kmmsgbase.cpp
index 61952a00e..c15b97dde 100644
--- a/kmail/kmmsgbase.cpp
+++ b/kmail/kmmsgbase.cpp
@@ -89,7 +89,7 @@ KMFolderIndex* KMMsgBase::storage() const
   // not inherit KMFolderIndex?
   if( mParent )
     return static_cast<KMFolderIndex*>( mParent->storage() );
-  return 0;
+  return nullptr;
 }
 
 //-----------------------------------------------------------------------------
@@ -573,7 +573,7 @@ TQString KMMsgBase::skipKeyword(const TQString& aStr, TQChar sepChar,
 //-----------------------------------------------------------------------------
 const TQTextCodec* KMMsgBase::codecForName(const TQCString& _str)
 {
-  if (_str.isEmpty()) return 0;
+  if (_str.isEmpty()) return nullptr;
   TQCString codec = _str;
   kasciitolower(codec.data());
   return TDEGlobal::charsets()->codecForName(codec);
@@ -701,7 +701,7 @@ TQString KMMsgBase::decodeRFC2047String(const TQCString& aStr, TQCString prefCha
     // verbatimly copy normal text
     if (pos[0]!='=' || pos[1]!='?') {
       result += LWSP_buffer + pos[0];
-      LWSP_buffer = 0;
+      LWSP_buffer = nullptr;
       lastWasEncodedWord = false;
       continue;
     }
@@ -748,7 +748,7 @@ TQString KMMsgBase::decodeRFC2047String(const TQCString& aStr, TQCString prefCha
       lastWasEncodedWord = true;
 
       ++pos; // eat '?' (for loop eats '=')
-      LWSP_buffer = 0;
+      LWSP_buffer = nullptr;
     }
     continue;
   invalid_encoded_word:
@@ -759,7 +759,7 @@ TQString KMMsgBase::decodeRFC2047String(const TQCString& aStr, TQCString prefCha
     result += "=?";
     lastWasEncodedWord = false;
     ++pos; // eat '?' (for loop eats '=')
-    LWSP_buffer = 0;
+    LWSP_buffer = nullptr;
   }
   return result;
 }
@@ -1126,7 +1126,7 @@ static void swapEndian(TQString &str)
 
 //-----------------------------------------------------------------------------
 static int g_chunk_length = 0, g_chunk_offset=0;
-static uchar *g_chunk = 0;
+static uchar *g_chunk = nullptr;
 
 namespace {
   template < typename T > void copy_from_stream( T & x ) {
@@ -1186,7 +1186,7 @@ retry:
 	kdDebug(5006) << "This should never happen.. " << __FILE__ << ":" << __LINE__ << endl;
         if(using_mmap) {
             g_chunk_length = 0;
-            g_chunk = 0;
+            g_chunk = nullptr;
         }
         storage()->recreateIndex();
         goto retry;
@@ -1202,7 +1202,7 @@ retry:
   }
   if(using_mmap) {
       g_chunk_length = 0;
-      g_chunk = 0;
+      g_chunk = nullptr;
   }
   // Normally we need to swap the byte order because the TQStrings are written
   // in the style of TQt2 (MSB -> network ordered).
@@ -1264,7 +1264,7 @@ retry:
       kdDebug(5006) << "This should never happen.. " << __FILE__ << ":" << __LINE__ << endl;
       if(using_mmap) {
         g_chunk_length = 0;
-        g_chunk = 0;
+        g_chunk = nullptr;
       }
       storage()->recreateIndex();
       goto retry;
@@ -1330,7 +1330,7 @@ retry:
   }
   if(using_mmap) {
     g_chunk_length = 0;
-    g_chunk = 0;
+    g_chunk = nullptr;
   }
   return ret;
 }
@@ -1361,7 +1361,7 @@ retry:
 const uchar *KMMsgBase::asIndexString(int &length) const
 {
   unsigned int csize = 256;
-  static uchar *ret = 0; //different static buffer here for we may use the other buffer in the functions below
+  static uchar *ret = nullptr; //different static buffer here for we may use the other buffer in the functions below
   if(!ret)
     ret = (uchar *)malloc(csize);
   length = 0;
diff --git a/kmail/kmmsgbase.h b/kmail/kmmsgbase.h
index 9ed08445a..033f17310 100644
--- a/kmail/kmmsgbase.h
+++ b/kmail/kmmsgbase.h
@@ -145,7 +145,7 @@ typedef enum
 class KMMsgBase
 {
 public:
-  KMMsgBase(KMFolder* p=0);
+  KMMsgBase(KMFolder* p=nullptr);
   virtual ~KMMsgBase();
 
   /** Return owning storage. */
@@ -222,7 +222,7 @@ public:
    * specify the index of this message within the parent folder. */
   virtual void setStatus(const KMMsgStatus status, int idx = -1);
   virtual void toggleStatus(const KMMsgStatus status, int idx = -1);
-  virtual void setStatus(const char* statusField, const char* xstatusField=0);
+  virtual void setStatus(const char* statusField, const char* xstatusField=nullptr);
 
   /** Encryption status of the message. */
   virtual KMMsgEncryptionState encryptionState() const = 0;
@@ -324,7 +324,7 @@ public:
    * If keywordFound is specified it will be true if a keyword was skipped
    * and false otherwise. */
   static TQString skipKeyword(const TQString& str, TQChar sepChar=':',
-				 bool* keywordFound=0);
+				 bool* keywordFound=nullptr);
 
   /** Return a TQTextCodec for the specified charset.
    * This function is a bit more tolerant, than TQTextCodec::codecForName */
@@ -333,7 +333,7 @@ public:
   /** Convert all non-ascii characters to question marks
     * If ok is non-null, *ok will be set to true if all characters
     * where ascii, *ok will be set to false otherwise */
-  static TQCString toUsAscii(const TQString& _str, bool *ok=0);
+  static TQCString toUsAscii(const TQString& _str, bool *ok=nullptr);
 
   /** Return a list of the supported encodings */
   static TQStringList supportedEncodings(bool usAscii);
diff --git a/kmail/kmmsgdict.cpp b/kmail/kmmsgdict.cpp
index 729a3663a..a8bdd06b7 100644
--- a/kmail/kmmsgdict.cpp
+++ b/kmail/kmmsgdict.cpp
@@ -75,7 +75,7 @@ public:
   {
     array.resize(size);
     memset(array.data(), 0, array.size() * sizeof(KMMsgDictEntry *));  // faster than a loop
-    fp = 0;
+    fp = nullptr;
     swapByteOrder = false;
     baseOffset = 0;
   }
@@ -95,7 +95,7 @@ public:
         int newsize = TQMAX(size + 25, index + 1);
         array.resize(newsize);
         for (int j = size; j < newsize; j++)
-          array.at(j) = 0;
+          array.at(j) = nullptr;
       }
       array.at(index) = entry;
     }
@@ -105,7 +105,7 @@ public:
   {
     if (index >= 0 && (unsigned)index < array.size())
       return array.at(index);
-    return 0;
+    return nullptr;
   }
 
   ulong getMsn(int index)
@@ -141,7 +141,7 @@ public:
 
 
 static KStaticDeleter<KMMsgDict> msgDict_sd;
-KMMsgDict * KMMsgDict::m_self = 0;
+KMMsgDict * KMMsgDict::m_self = nullptr;
 
 //-----------------------------------------------------------------------------
 
@@ -286,7 +286,7 @@ void KMMsgDict::remove(unsigned long msgSerNum)
   if (entry->folder) {
     KMMsgDictREntry *rentry = entry->folder->storage()->rDict();
     if (rentry)
-      rentry->set(entry->index, 0);
+      rentry->set(entry->index, nullptr);
   }
 
   dict->remove((long)key);
@@ -308,7 +308,7 @@ void KMMsgDict::update(const KMMsgBase *msg, int index, int newIndex)
     KMMsgDictEntry *entry = rentry->get(index);
     if (entry) {
       entry->index = newIndex;
-      rentry->set(index, 0);
+      rentry->set(index, nullptr);
       rentry->set(newIndex, entry);
     }
   }
@@ -324,7 +324,7 @@ void KMMsgDict::getLocation(unsigned long key,
     *retFolder = (KMFolder *)entry->folder;
     *retIndex = entry->index;
   } else {
-    *retFolder = 0;
+    *retFolder = nullptr;
     *retIndex = -1;
   }
 }
@@ -499,7 +499,7 @@ KMMsgDictREntry *KMMsgDict::openFolderIds( const FolderStorage& storage, bool tr
 
   if (!rentry->fp) {
     TQString filename = getFolderIdsLocation( storage );
-    FILE *fp = truncate ? 0 : fopen(TQFile::encodeName(filename), "r+");
+    FILE *fp = truncate ? nullptr : fopen(TQFile::encodeName(filename), "r+");
     if (fp)
     {
       int version = 0;
@@ -513,7 +513,7 @@ KMMsgDictREntry *KMMsgDict::openFolderIds( const FolderStorage& storage, bool tr
       else
       {
          fclose(fp);
-         fp = 0;
+         fp = nullptr;
       }
     }
 
@@ -526,8 +526,8 @@ KMMsgDictREntry *KMMsgDict::openFolderIds( const FolderStorage& storage, bool tr
                       << "' cannot open with folder " << storage.label() << ": "
                       << strerror(errno) << " (" << errno << ")" << endl;
          delete rentry;
-         rentry = 0;
-         return 0;
+         rentry = nullptr;
+         return nullptr;
       }
       fprintf(fp, IDS_HEADER, IDS_VERSION);
       TQ_UINT32 byteOrder = 0x12345678;
@@ -575,7 +575,7 @@ int KMMsgDict::writeFolderIds( const FolderStorage &storage )
   TQString filename = getFolderIdsLocation( storage );
   truncate(TQFile::encodeName(filename), eof);
   fclose(rentry->fp);
-  rentry->fp = 0;
+  rentry->fp = nullptr;
 
   return 0;
 }
@@ -588,7 +588,7 @@ int KMMsgDict::touchFolderIds( const FolderStorage &storage )
   if (rentry) {
     rentry->sync();
     fclose(rentry->fp);
-    rentry->fp = 0;
+    rentry->fp = nullptr;
   }
   return 0;
 }
@@ -640,7 +640,7 @@ int KMMsgDict::appendToFolderIds( FolderStorage& storage, int index)
 
   rentry->sync();
   fclose(rentry->fp);
-  rentry->fp = 0;
+  rentry->fp = nullptr;
 
   return 0;
 }
@@ -649,14 +649,14 @@ int KMMsgDict::appendToFolderIds( FolderStorage& storage, int index)
 
 bool KMMsgDict::hasFolderIds( const FolderStorage& storage )
 {
-  return storage.rDict() != 0;
+  return storage.rDict() != nullptr;
 }
 
 //-----------------------------------------------------------------------------
 
 bool KMMsgDict::removeFolderIds( FolderStorage& storage )
 {
-  storage.setRDict( 0 );
+  storage.setRDict( nullptr );
   TQString filename = getFolderIdsLocation( storage );
   return unlink( TQFile::encodeName( filename) );
 }
diff --git a/kmail/kmmsginfo.cpp b/kmail/kmmsginfo.cpp
index bcea46791..63cf46a05 100644
--- a/kmail/kmmsginfo.cpp
+++ b/kmail/kmmsginfo.cpp
@@ -126,7 +126,7 @@ public:
 //-----------------------------------------------------------------------------
 KMMsgInfo::KMMsgInfo(KMFolder* p, off_t off, short len) :
     KMMsgBase(p),
-    kd(0)
+    kd(nullptr)
 {
     setIndexOffset(off);
     setIndexLength(len);
@@ -152,7 +152,7 @@ KMMsgInfo& KMMsgInfo::operator=(const KMMsgInfo& other)
         *kd = *other.kd;
     } else {
         delete kd;
-        kd = 0;
+        kd = nullptr;
     }
     mStatus = other.status();
     return *this;
diff --git a/kmail/kmmsginfo.h b/kmail/kmmsginfo.h
index 2a4a54fb7..b293671fc 100644
--- a/kmail/kmmsginfo.h
+++ b/kmail/kmmsginfo.h
@@ -107,7 +107,7 @@ public:
   virtual void setTo( const TQString &to );
 
   /** Grr.. c++! */
-  virtual void setStatus(const char* s1, const char* s2=0) { KMMsgBase::setStatus(s1, s2); }
+  virtual void setStatus(const char* s1, const char* s2=nullptr) { KMMsgBase::setStatus(s1, s2); }
   virtual void setDate(const char* s1) { KMMsgBase::setDate(s1); }
 
   virtual bool dirty(void) const;
diff --git a/kmail/kmmsglist.cpp b/kmail/kmmsglist.cpp
index c77811483..d76d53898 100644
--- a/kmail/kmmsglist.cpp
+++ b/kmail/kmmsglist.cpp
@@ -17,7 +17,7 @@ KMMsgList::KMMsgList(int initSize)
 {
   if ( size() > 0 )
     for (unsigned int i=size(); i>0; i--)
-	TQMemArray<KMMsgBase*>::at(i-1) = 0;
+	TQMemArray<KMMsgBase*>::at(i-1) = nullptr;
 }
 
 
@@ -38,7 +38,7 @@ void KMMsgList::clear(bool doDelete, bool syncDict)
       if (msg) {
         if ( syncDict )
           KMMsgDict::mutableInstance()->remove(msg);
-        at(i-1) = 0;
+        at(i-1) = nullptr;
         if (doDelete) delete msg;
       }
     }
@@ -73,7 +73,7 @@ bool KMMsgList::resize(unsigned int aSize)
 
   // initialize new elements
   for (i=oldSize; i<aSize; i++)
-    at(i) = 0;
+    at(i) = nullptr;
 
   return true;
 }
@@ -151,7 +151,7 @@ void KMMsgList::remove(unsigned int idx)
     at(i) = at(i+1);
   }
 
-  at(mHigh) = 0;
+  at(mHigh) = nullptr;
 
   rethinkHigh();
 }
diff --git a/kmail/kmmsgpart.cpp b/kmail/kmmsgpart.cpp
index c7fa30d89..fba3b165b 100644
--- a/kmail/kmmsgpart.cpp
+++ b/kmail/kmmsgpart.cpp
@@ -29,13 +29,13 @@ using namespace KMime;
 //-----------------------------------------------------------------------------
 KMMessagePart::KMMessagePart()
   : mType("text"), mSubtype("plain"), mCte("7bit"), mBodyDecodedSize(0),
-    mParent(0), mLoadHeaders(false), mLoadPart(false)
+    mParent(nullptr), mLoadHeaders(false), mLoadPart(false)
 {
 }
 
 //-----------------------------------------------------------------------------
 KMMessagePart::KMMessagePart( TQDataStream & stream )
-  : mParent(0), mLoadHeaders(false), mLoadPart(false)
+  : mParent(nullptr), mLoadHeaders(false), mLoadPart(false)
 {
   unsigned long size;
   stream >> mOriginalContentTypeStr >> mName >> mContentDescription
@@ -76,7 +76,7 @@ void KMMessagePart::clear()
   mCharset = TQCString();
   mPartSpecifier = TQString();
   mBodyDecodedSize = 0;
-  mParent = 0;
+  mParent = nullptr;
   mLoadHeaders = false;
   mLoadPart = false;
 }
diff --git a/kmail/kmmsgpart.h b/kmail/kmmsgpart.h
index 34939e51b..f3f2d1f16 100644
--- a/kmail/kmmsgpart.h
+++ b/kmail/kmmsgpart.h
@@ -60,7 +60,7 @@ public:
 
   /** Returns the body part decoded to unicode.
    **/
-  TQString bodyToUnicode(const TQTextCodec* codec=0) const;
+  TQString bodyToUnicode(const TQTextCodec* codec=nullptr) const;
 
   /** Returns body as decoded string. Assumes that content-transfer-encoding
     contains the correct encoding. This routine is meant for binary data.
diff --git a/kmail/kmmsgpartdlg.cpp b/kmail/kmmsgpartdlg.cpp
index 3b63badc8..538f82a31 100644
--- a/kmail/kmmsgpartdlg.cpp
+++ b/kmail/kmmsgpartdlg.cpp
@@ -332,7 +332,7 @@ void KMMsgPartDialog::slotMimeTypeChanged( const TQString & mimeType ) {
 
 
 KMMsgPartDialogCompat::KMMsgPartDialogCompat( TQWidget * parent, const char *, bool readOnly)
-  : KMMsgPartDialog(TQString(), parent ), mMsgPart( 0 )
+  : KMMsgPartDialog(TQString(), parent ), mMsgPart( nullptr )
 {
   setShownEncodings( SevenBit|EightBit|QuotedPrintable|Base64 );
   if (readOnly)
diff --git a/kmail/kmmsgpartdlg.h b/kmail/kmmsgpartdlg.h
index 29ccd3188..51d840b64 100644
--- a/kmail/kmmsgpartdlg.h
+++ b/kmail/kmmsgpartdlg.h
@@ -43,7 +43,7 @@ class KMMsgPartDialog: public KDialogBase
 
 public:
   KMMsgPartDialog( const TQString & caption=TQString(),
-		   TQWidget * parent=0, const char * name=0 );
+		   TQWidget * parent=nullptr, const char * name=nullptr );
   virtual ~KMMsgPartDialog();
 
   /** Get the currently selected mimetype */
@@ -142,7 +142,7 @@ class KMMsgPartDialogCompat : public KMMsgPartDialog {
   TQ_OBJECT
   
 public:
-  KMMsgPartDialogCompat( TQWidget * parent=0, const char * caption=0, bool=false );
+  KMMsgPartDialogCompat( TQWidget * parent=nullptr, const char * caption=nullptr, bool=false );
   virtual ~KMMsgPartDialogCompat();
 
   /** Display information about this message part. */
diff --git a/kmail/kmpopfiltercnfrmdlg.cpp b/kmail/kmpopfiltercnfrmdlg.cpp
index 9e18532d2..d9fc770a1 100644
--- a/kmail/kmpopfiltercnfrmdlg.cpp
+++ b/kmail/kmpopfiltercnfrmdlg.cpp
@@ -317,7 +317,7 @@ KMPopFilterCnfrmDlg::KMPopFilterCnfrmDlg(TQPtrList<KMPopHeaders> *aHeaders, cons
   KMPopHeaders *headers;
   for(headers = aHeaders->first(); headers; headers = aHeaders->next())
   {
-    KMPopHeadersViewItem *lvi = 0;
+    KMPopHeadersViewItem *lvi = nullptr;
 
     if(headers->ruleMatched())
     {
diff --git a/kmail/kmpopfiltercnfrmdlg.h b/kmail/kmpopfiltercnfrmdlg.h
index f2fc4f80a..e27d0864d 100644
--- a/kmail/kmpopfiltercnfrmdlg.h
+++ b/kmail/kmpopfiltercnfrmdlg.h
@@ -39,7 +39,7 @@ class KMPopHeadersView : public TDEListView
   
 
 public:
-  KMPopHeadersView(TQWidget *aParent=0, KMPopFilterCnfrmDlg *aDialog=0);
+  KMPopHeadersView(TQWidget *aParent=nullptr, KMPopFilterCnfrmDlg *aDialog=nullptr);
   ~KMPopHeadersView();
   static const KMPopFilterAction mapToAction(int aColumn) { return (KMPopFilterAction)aColumn;};
   static const int mapToColumn(KMPopFilterAction aAction) { return (int)aAction;};
@@ -92,7 +92,7 @@ protected:
 	
 
 public:
-  KMPopFilterCnfrmDlg(TQPtrList<KMPopHeaders> *aHeaders, const TQString &aAccount, bool aShowLaterMsgs = false, TQWidget *aParent=0, const char *aName=0);
+  KMPopFilterCnfrmDlg(TQPtrList<KMPopHeaders> *aHeaders, const TQString &aAccount, bool aShowLaterMsgs = false, TQWidget *aParent=nullptr, const char *aName=nullptr);
   ~KMPopFilterCnfrmDlg();
 
 public:
diff --git a/kmail/kmpopheaders.cpp b/kmail/kmpopheaders.cpp
index 2828a49e0..230fa9e20 100644
--- a/kmail/kmpopheaders.cpp
+++ b/kmail/kmpopheaders.cpp
@@ -17,7 +17,7 @@ KMPopHeaders::KMPopHeaders()
     mId(),
     mUid(),
     mRuleMatched(false),
-    mHeader(0)
+    mHeader(nullptr)
 {
 }
 
@@ -31,7 +31,7 @@ KMPopHeaders::KMPopHeaders(const TQString& aId, const TQString& aUid, KMPopFilte
     mId(aId),
     mUid(aUid),
     mRuleMatched(false),
-    mHeader(0)
+    mHeader(nullptr)
 {
 }
 
diff --git a/kmail/kmreadermainwin.cpp b/kmail/kmreadermainwin.cpp
index db42f3fa9..7921ce3db 100644
--- a/kmail/kmreadermainwin.cpp
+++ b/kmail/kmreadermainwin.cpp
@@ -53,7 +53,7 @@
 KMReaderMainWin::KMReaderMainWin( bool htmlOverride, bool htmlLoadExtDefault,
                                   char *name )
   : KMail::SecondaryWindow( name ? name : "readerwindow#" ),
-    mMsg( 0 )
+    mMsg( nullptr )
 {
   mReaderWin = new KMReaderWin( this, this, actionCollection() );
   //mReaderWin->setShowCompleteMessage( true );
@@ -69,7 +69,7 @@ KMReaderMainWin::KMReaderMainWin( bool htmlOverride, bool htmlLoadExtDefault,
 //-----------------------------------------------------------------------------
 KMReaderMainWin::KMReaderMainWin( char *name )
   : KMail::SecondaryWindow( name ? name : "readerwindow#" ),
-    mMsg( 0 )
+    mMsg( nullptr )
 {
   mReaderWin = new KMReaderWin( this, this, actionCollection() );
   mReaderWin->setAutoDelete( true );
@@ -82,7 +82,7 @@ KMReaderMainWin::KMReaderMainWin(KMMessagePart* aMsgPart,
     bool aHTML, const TQString& aFileName, const TQString& pname,
     const TQString & encoding, char *name )
   : KMail::SecondaryWindow( name ? name : "readerwindow#" ),
-    mMsg( 0 )
+    mMsg( nullptr )
 {
   mReaderWin = new KMReaderWin( this, this, actionCollection() );
   mReaderWin->setOverrideEncoding( encoding );
@@ -165,7 +165,7 @@ void KMReaderMainWin::slotFolderRemoved( TQObject* folderPtr )
   assert(mMsg);
   assert(folderPtr == mMsg->parent());
   if( mMsg && folderPtr == mMsg->parent() )
-    mMsg->setParent( 0 );
+    mMsg->setParent( nullptr );
 }
 
 void KMReaderMainWin::slotReplyOrForwardFinished()
@@ -234,7 +234,7 @@ void KMReaderMainWin::slotPrintMsg()
 //-----------------------------------------------------------------------------
 void KMReaderMainWin::slotForwardInlineMsg()
 {
-   KMCommand *command = 0;
+   KMCommand *command = nullptr;
    if ( mReaderWin->message() && mReaderWin->message()->parent() ) {
     command = new KMForwardInlineCommand( this, mReaderWin->message(),
         mReaderWin->message()->parent()->identity() );
@@ -249,7 +249,7 @@ void KMReaderMainWin::slotForwardInlineMsg()
 //-----------------------------------------------------------------------------
 void KMReaderMainWin::slotForwardAttachedMsg()
 {
-   KMCommand *command = 0;
+   KMCommand *command = nullptr;
    if ( mReaderWin->message() && mReaderWin->message()->parent() ) {
      command = new KMForwardAttachedCommand( this, mReaderWin->message(),
         mReaderWin->message()->parent()->identity() );
@@ -264,7 +264,7 @@ void KMReaderMainWin::slotForwardAttachedMsg()
 //-----------------------------------------------------------------------------
 void KMReaderMainWin::slotForwardDigestMsg()
 {
-   KMCommand *command = 0;
+   KMCommand *command = nullptr;
    if ( mReaderWin->message() && mReaderWin->message()->parent() ) {
      command = new KMForwardDigestCommand( this, mReaderWin->message(),
         mReaderWin->message()->parent()->identity() );
@@ -299,7 +299,7 @@ void KMReaderMainWin::slotShowMsgSrc()
 //-----------------------------------------------------------------------------
 void KMReaderMainWin::setupForwardActions()
 {
-  disconnect( mForwardActionMenu, TQ_SIGNAL( activated() ), 0, 0 );
+  disconnect( mForwardActionMenu, TQ_SIGNAL( activated() ), nullptr, nullptr );
   mForwardActionMenu->remove( mForwardInlineAction );
   mForwardActionMenu->remove( mForwardAttachedAction );
 
diff --git a/kmail/kmreadermainwin.h b/kmail/kmreadermainwin.h
index 2a753b951..4657797fc 100644
--- a/kmail/kmreadermainwin.h
+++ b/kmail/kmreadermainwin.h
@@ -26,11 +26,11 @@ class KMReaderMainWin : public KMail::SecondaryWindow
   
 
 public:
-  KMReaderMainWin( bool htmlOverride, bool htmlLoadExtDefault, char *name = 0 );
-  KMReaderMainWin( char *name = 0 );
+  KMReaderMainWin( bool htmlOverride, bool htmlLoadExtDefault, char *name = nullptr );
+  KMReaderMainWin( char *name = nullptr );
   KMReaderMainWin(KMMessagePart* aMsgPart,
     bool aHTML, const TQString& aFileName, const TQString& pname,
-    const TQString & encoding, char *name = 0 );
+    const TQString & encoding, char *name = nullptr );
   virtual ~KMReaderMainWin();
 
   void setUseFixedFont( bool useFixedFont );
diff --git a/kmail/kmreaderwin.cpp b/kmail/kmreaderwin.cpp
index d2ce03d48..726fb6fbd 100644
--- a/kmail/kmreaderwin.cpp
+++ b/kmail/kmreaderwin.cpp
@@ -268,13 +268,13 @@ void KMReaderWin::objectTreeToDecryptedMsg( partNode* node,
 
 
     DwHeaders& rootHeaders( theMessage.headers() );
-    DwBodyPart * part = dataNode->dwPart() ? dataNode->dwPart() : 0;
+    DwBodyPart * part = dataNode->dwPart() ? dataNode->dwPart() : nullptr;
     DwHeaders * headers(
         (part && part->hasHeaders())
         ? &part->Headers()
         : (  (weAreReplacingTheRootNode || !dataNode->parentNode())
             ? &rootHeaders
-            : 0 ) );
+            : nullptr ) );
     if ( dataNode == curNode ) {
       kdDebug(5006) << "dataNode == curNode:  Save curNode without replacing it." << endl;
 
@@ -407,36 +407,36 @@ KMReaderWin::KMReaderWin(TQWidget *aParent,
   : TQWidget(aParent, aName, aFlags | TQt::WDestructiveClose),
     mSerNumOfOriginalMessage( 0 ),
     mNodeIdOffset( -1 ),
-    mAttachmentStrategy( 0 ),
-    mHeaderStrategy( 0 ),
-    mHeaderStyle( 0 ),
-    mUpdateReaderWinTimer( 0, "mUpdateReaderWinTimer" ),
-    mResizeTimer( 0, "mResizeTimer" ),
-    mDelayedMarkTimer( 0, "mDelayedMarkTimer" ),
-    mHeaderRefreshTimer( 0, "mHeaderRefreshTimer" ),
+    mAttachmentStrategy( nullptr ),
+    mHeaderStrategy( nullptr ),
+    mHeaderStyle( nullptr ),
+    mUpdateReaderWinTimer( nullptr, "mUpdateReaderWinTimer" ),
+    mResizeTimer( nullptr, "mResizeTimer" ),
+    mDelayedMarkTimer( nullptr, "mDelayedMarkTimer" ),
+    mHeaderRefreshTimer( nullptr, "mHeaderRefreshTimer" ),
     mOldGlobalOverrideEncoding( "---" ), // init with dummy value
-    mCSSHelper( 0 ),
-    mRootNode( 0 ),
+    mCSSHelper( nullptr ),
+    mRootNode( nullptr ),
     mMainWindow( mainWindow ),
     mActionCollection( actionCollection ),
-    mMailToComposeAction( 0 ),
-    mMailToReplyAction( 0 ),
-    mMailToForwardAction( 0 ),
-    mAddAddrBookAction( 0 ),
-    mOpenAddrBookAction( 0 ),
-    mCopyAction( 0 ),
-    mCopyURLAction( 0 ),
-    mUrlOpenAction( 0 ),
-    mUrlSaveAsAction( 0 ),
-    mAddBookmarksAction( 0 ),
-    mStartIMChatAction( 0 ),
-    mSelectAllAction( 0 ),
-    mHeaderOnlyAttachmentsAction( 0 ),
-    mSelectEncodingAction( 0 ),
-    mToggleFixFontAction( 0 ),
-    mToggleMimePartTreeAction( 0 ),
+    mMailToComposeAction( nullptr ),
+    mMailToReplyAction( nullptr ),
+    mMailToForwardAction( nullptr ),
+    mAddAddrBookAction( nullptr ),
+    mOpenAddrBookAction( nullptr ),
+    mCopyAction( nullptr ),
+    mCopyURLAction( nullptr ),
+    mUrlOpenAction( nullptr ),
+    mUrlSaveAsAction( nullptr ),
+    mAddBookmarksAction( nullptr ),
+    mStartIMChatAction( nullptr ),
+    mSelectAllAction( nullptr ),
+    mHeaderOnlyAttachmentsAction( nullptr ),
+    mSelectEncodingAction( nullptr ),
+    mToggleFixFontAction( nullptr ),
+    mToggleMimePartTreeAction( nullptr ),
     mCanStartDrag( false ),
-    mHtmlWriter( 0 ),
+    mHtmlWriter( nullptr ),
     mSavedRelativePosition( 0 ),
     mDecrytMessageOverwrite( false ),
     mShowSignatureDetails( false ),
@@ -451,7 +451,7 @@ KMReaderWin::KMReaderWin(TQWidget *aParent,
   mAutoDelete = false;
   mLastSerNum = 0;
   mWaitingForSerNum = 0;
-  mMessage = 0;
+  mMessage = nullptr;
   mMsgDisplay = true;
   mPrinting = false;
   mShowColorbar = false;
@@ -483,7 +483,7 @@ void KMReaderWin::createActions( TDEActionCollection * ac ) {
   if ( !ac )
       return;
 
-  TDERadioAction *raction = 0;
+  TDERadioAction *raction = nullptr;
 
   // header style
   TDEActionMenu *headerMenu =
@@ -631,8 +631,8 @@ void KMReaderWin::createActions( TDEActionCollection * ac ) {
 // little helper function
 TDERadioAction *KMReaderWin::actionForHeaderStyle( const HeaderStyle * style, const HeaderStrategy * strategy ) {
   if ( !mActionCollection )
-    return 0;
-  const char * actionName = 0;
+    return nullptr;
+  const char * actionName = nullptr;
   if ( style == HeaderStyle::enterprise() )
     actionName = "view_headers_enterprise";
   if ( style == HeaderStyle::fancy() )
@@ -650,13 +650,13 @@ TDERadioAction *KMReaderWin::actionForHeaderStyle( const HeaderStyle * style, co
   if ( actionName )
     return static_cast<TDERadioAction*>(mActionCollection->action(actionName));
   else
-    return 0;
+    return nullptr;
 }
 
 TDERadioAction *KMReaderWin::actionForAttachmentStrategy( const AttachmentStrategy * as ) {
   if ( !mActionCollection )
-    return 0;
-  const char * actionName = 0;
+    return nullptr;
+  const char * actionName = nullptr;
   if ( as == AttachmentStrategy::iconic() )
     actionName = "view_attachments_as_icons";
   else if ( as == AttachmentStrategy::smart() )
@@ -671,7 +671,7 @@ TDERadioAction *KMReaderWin::actionForAttachmentStrategy( const AttachmentStrate
   if ( actionName )
     return static_cast<TDERadioAction*>(mActionCollection->action(actionName));
   else
-    return 0;
+    return nullptr;
 }
 
 void KMReaderWin::slotEnterpriseHeaders() {
@@ -726,7 +726,7 @@ void KMReaderWin::slotCycleHeaderStyles() {
   const HeaderStrategy * strategy = headerStrategy();
   const HeaderStyle * style = headerStyle();
 
-  const char * actionName = 0;
+  const char * actionName = nullptr;
   if ( style == HeaderStyle::enterprise() ) {
     slotFancyHeaders();
     actionName = "view_headers_fancy";
@@ -790,10 +790,10 @@ KMReaderWin::~KMReaderWin()
     message()->detach( this );
   }
   clearBodyPartMementos();
-  delete mHtmlWriter; mHtmlWriter = 0;
+  delete mHtmlWriter; mHtmlWriter = nullptr;
   delete mCSSHelper;
   if (mAutoDelete) delete message();
-  delete mRootNode; mRootNode = 0;
+  delete mRootNode; mRootNode = nullptr;
   removeTempFiles();
 }
 
@@ -824,7 +824,7 @@ void KMReaderWin::update( KMail::Interface::Observable * observable )
     return;
 
   KMMessage* msg = static_cast<KMMessage*>( observable );
-  assert( msg != 0 );
+  assert(msg);
 
   // find our partNode and update it
   if ( !msg->lastUpdatedPart() ) {
@@ -1016,7 +1016,7 @@ void KMReaderWin::initHtmlWidget(void)
     mHtmlWriter = new TeeHtmlWriter( new FileHtmlWriter( TQString() ),
 				     new KHtmlPartHtmlWriter( mViewer, 0 ) );
 #else
-    mHtmlWriter = new KHtmlPartHtmlWriter( mViewer, 0 );
+    mHtmlWriter = new KHtmlPartHtmlWriter( mViewer, nullptr );
 #endif
 
   connect(mViewer->browserExtension(),
@@ -1117,7 +1117,7 @@ void KMReaderWin::setPrintFont( const TQFont& font )
 const TQTextCodec * KMReaderWin::overrideCodec() const
 {
   if ( mOverrideEncoding.isEmpty() || mOverrideEncoding == "Auto" ) // Auto
-    return 0;
+    return nullptr;
   else
     return KMMsgBase::codecForName( mOverrideEncoding.latin1() );
 }
@@ -1187,7 +1187,7 @@ void KMReaderWin::setMsg( KMMessage* aMsg, bool force, bool updateOnly )
 
   mDelayedMarkTimer.stop();
 
-  mMessage = 0;
+  mMessage = nullptr;
   if ( !aMsg ) {
     mWaitingForSerNum = 0; // otherwise it has been set
     mLastSerNum = 0;
@@ -1248,7 +1248,7 @@ void KMReaderWin::clearCache()
   mDelayedMarkTimer.stop();
   mLastSerNum = 0;
   mWaitingForSerNum = 0;
-  mMessage = 0;
+  mMessage = nullptr;
 }
 
 // enter items for the "Important changes" list here:
@@ -1409,7 +1409,7 @@ void KMReaderWin::updateReaderWin()
 
   htmlWriter()->reset();
 
-  KMFolder* folder = 0;
+  KMFolder* folder = nullptr;
   if (message(&folder))
   {
     if ( mShowColorbar )
@@ -1513,7 +1513,7 @@ void KMReaderWin::parseMsg(KMMessage* aMsg)
   TQCString subtype, contDisp;
   TQByteArray str;
 
-  assert(aMsg!=0);
+  assert(aMsg);
 
   aMsg->setIsBeingParsed( true );
 
@@ -1537,7 +1537,7 @@ void KMReaderWin::parseMsg(KMMessage* aMsg)
     cntEnc = aMsg->contentTransferEncodingStr();
 
   // fill the MIME part tree viewer
-  mRootNode->fillMimePartTree( 0,
+  mRootNode->fillMimePartTree( nullptr,
 			       mMimePartTree,
 			       cntDesc,
 			       mainCntTypeStr,
@@ -1563,7 +1563,7 @@ void KMReaderWin::parseMsg(KMMessage* aMsg)
   }
 
   if ( !mRootNode || !mRootNode->isToltecMessage() || mShowRawToltecMail ) {
-    htmlWriter()->queue( writeMsgHeader(aMsg, hasVCard ? vCardNode : 0, true ) );
+    htmlWriter()->queue( writeMsgHeader(aMsg, hasVCard ? vCardNode : nullptr, true ) );
   }
 
   // show message content
@@ -1647,7 +1647,7 @@ kdDebug(5006) << "|| (KMMsgPartiallyEncrypted == encryptionState) = " << (KMMsgP
       // try this:
       aMsg->setBody( resultString );
       KMMessage* unencryptedMessage = new KMMessage( *aMsg );
-      unencryptedMessage->setParent( 0 );
+      unencryptedMessage->setParent( nullptr );
       // because this did not work:
       /*
       DwMessage dwMsg( aMsg->asDwString() );
@@ -2103,13 +2103,13 @@ void KMReaderWin::styleChange( TQStyle& oldStyle )
 void KMReaderWin::slotHandleAttachment( int choice )
 {
   mAtmUpdate = true;
-  partNode* node = mRootNode ? mRootNode->findId( mAtmCurrent ) : 0;
+  partNode* node = mRootNode ? mRootNode->findId( mAtmCurrent ) : nullptr;
   if ( mAtmCurrentName.isEmpty() && node )
     mAtmCurrentName = tempFileUrlFromPartNode( node ).path();
   if ( choice < 7 ) {
   KMHandleAttachmentCommand* command = new KMHandleAttachmentCommand(
       node, message(), mAtmCurrent, mAtmCurrentName,
-      KMHandleAttachmentCommand::AttachmentAction( choice ), 0, this );
+      KMHandleAttachmentCommand::AttachmentAction( choice ), nullptr, this );
   connect( command, TQ_SIGNAL( showAttachment( int, const TQString& ) ),
       this, TQ_SLOT( slotAtmView( int, const TQString& ) ) );
   command->start();
@@ -2172,10 +2172,10 @@ void KMReaderWin::slotCopySelectedText()
 //-----------------------------------------------------------------------------
 void KMReaderWin::atmViewMsg( KMMessagePart* aMsgPart, int nodeId )
 {
-  assert(aMsgPart!=0);
+  assert(aMsgPart);
   KMMessage* msg = new KMMessage;
   msg->fromString(aMsgPart->bodyDecoded());
-  assert(msg != 0);
+  assert(msg);
   msg->setMsgSerNum( 0 ); // because lookups will fail
   // some information that is needed for imap messages with LOD
   msg->setParent( message()->parent() );
@@ -2194,7 +2194,7 @@ void KMReaderWin::setMsgPart( partNode * node ) {
   htmlWriter()->write( mCSSHelper->htmlHead( isFixedFont() ) );
   // end ###
   if ( node ) {
-    ObjectTreeParser otp( this, 0, true );
+    ObjectTreeParser otp( this, nullptr, true );
     otp.parseObjectTree( node );
   }
   // ### this, too
@@ -2210,7 +2210,7 @@ void KMReaderWin::setMsgPart( KMMessagePart* aMsgPart, bool aHTML,
   if (kasciistricmp(aMsgPart->typeStr(), "message")==0) {
       // if called from compose win
       KMMessage* msg = new KMMessage;
-      assert(aMsgPart!=0);
+      assert(aMsgPart);
       msg->fromString(aMsgPart->bodyDecoded());
       mMainWindow->setCaption(msg->subject());
       setMsg(msg, true);
@@ -2301,7 +2301,7 @@ void KMReaderWin::setMsgPart( KMMessagePart* aMsgPart, bool aHTML,
 //-----------------------------------------------------------------------------
 void KMReaderWin::slotAtmView( int id, const TQString& name )
 {
-  partNode* node = mRootNode ? mRootNode->findId( id ) : 0;
+  partNode* node = mRootNode ? mRootNode->findId( id ) : nullptr;
   if( node ) {
     mAtmCurrent = id;
     mAtmCurrentName = name;
@@ -2335,7 +2335,7 @@ void KMReaderWin::openAttachment( int id, const TQString & name )
 
   TQString str, pname, cmd, fileName;
 
-  partNode* node = mRootNode ? mRootNode->findId( id ) : 0;
+  partNode* node = mRootNode ? mRootNode->findId( id ) : nullptr;
   if( !node ) {
     kdWarning(5006) << "KMReaderWin::openAttachment - could not find node " << id << endl;
     return;
@@ -2561,11 +2561,11 @@ KMMessage* KMReaderWin::message( KMFolder** aFolder ) const
 {
   KMFolder*  tmpFolder;
   KMFolder*& folder = aFolder ? *aFolder : tmpFolder;
-  folder = 0;
+  folder = nullptr;
   if (mMessage)
       return mMessage;
   if (mLastSerNum) {
-    KMMessage *message = 0;
+    KMMessage *message = nullptr;
     int index;
     KMMsgDict::instance()->getLocation( mLastSerNum, &folder, &index );
     if (folder )
@@ -2574,7 +2574,7 @@ KMMessage* KMReaderWin::message( KMFolder** aFolder ) const
       kdWarning(5006) << "Attempt to reference invalid serial number " << mLastSerNum << endl;
     return message;
   }
-  return 0;
+  return nullptr;
 }
 
 
@@ -2668,11 +2668,11 @@ void KMReaderWin::slotMailtoReply()
 
 //-----------------------------------------------------------------------------
 partNode * KMReaderWin::partNodeFromUrl( const KURL & url ) {
-  return mRootNode ? mRootNode->findId( msgPartFromUrl( url ) ) : 0 ;
+  return mRootNode ? mRootNode->findId( msgPartFromUrl( url ) ) : nullptr ;
 }
 
 partNode * KMReaderWin::partNodeForId( int id ) {
-  return mRootNode ? mRootNode->findId( id ) : 0 ;
+  return mRootNode ? mRootNode->findId( id ) : nullptr ;
 }
 
 
@@ -2824,7 +2824,7 @@ void KMReaderWin::fillCommandInfo( partNode *node, KMMessage **msg, int *nodeId
   Q_ASSERT( msg && nodeId );
 
   if ( mSerNumOfOriginalMessage != 0 ) {
-    KMFolder *folder = 0;
+    KMFolder *folder = nullptr;
     int index = -1;
     KMMsgDict::instance()->getLocation( mSerNumOfOriginalMessage, &folder, &index );
     if ( folder && index != -1 )
@@ -2853,7 +2853,7 @@ void KMReaderWin::slotDeleteAttachment(partNode * node)
   }
 
   int nodeId = -1;
-  KMMessage *msg = 0;
+  KMMessage *msg = nullptr;
   fillCommandInfo( node, &msg, &nodeId );
   if ( msg && nodeId != -1 ) {
     KMDeleteAttachmentCommand* command = new KMDeleteAttachmentCommand( nodeId, msg, this );
@@ -2909,7 +2909,7 @@ void KMReaderWin::slotEditAttachment(partNode * node)
   }
 
   int nodeId = -1;
-  KMMessage *msg = 0;
+  KMMessage *msg = nullptr;
   fillCommandInfo( node, &msg, &nodeId );
   if ( msg && nodeId != -1 ) {
     KMEditAttachmentCommand* command = new KMEditAttachmentCommand( nodeId, msg, this );
@@ -3106,7 +3106,7 @@ void KMReaderWin::setBodyPartMemento( const partNode * node, const TQCString & w
     }
   }
 
-  if ( Observable * o = memento ? memento->asObservable() : 0 )
+  if ( Observable * o = memento ? memento->asObservable() : nullptr )
     o->attach( this );
 }
 
@@ -3115,7 +3115,7 @@ BodyPartMemento * KMReaderWin::bodyPartMemento( const partNode * node, const TQC
   const TQCString index = node->path() + ':' + which.lower();
   const std::map<TQCString,BodyPartMemento*>::const_iterator it = mBodyPartMementoMap.find( index );
   if ( it == mBodyPartMementoMap.end() ) {
-    return 0;
+    return nullptr;
   }
   else {
     return it->second;
@@ -3123,7 +3123,7 @@ BodyPartMemento * KMReaderWin::bodyPartMemento( const partNode * node, const TQC
 }
 
 static void detach_and_delete( BodyPartMemento * memento, KMReaderWin * obs ) {
-  if ( Observable * const o = memento ? memento->asObservable() : 0 )
+  if ( Observable * const o = memento ? memento->asObservable() : nullptr )
     o->detach( obs );
   delete memento;
 }
diff --git a/kmail/kmreaderwin.h b/kmail/kmreaderwin.h
index df4d88457..521b6aaa4 100644
--- a/kmail/kmreaderwin.h
+++ b/kmail/kmreaderwin.h
@@ -88,7 +88,7 @@ public:
   KMReaderWin( TQWidget *parent,
 	       TQWidget *mainWindow,
 	       TDEActionCollection *actionCollection,
-               const char *name=0,
+               const char *name=nullptr,
 	       int f=0 );
   virtual ~KMReaderWin();
 
@@ -176,7 +176,7 @@ public:
     { mIdOfLastViewedMessage = msgId; }
 
   /** Clear the reader and discard the current message. */
-  void clear(bool force = false) { setMsg(0, force); }
+  void clear(bool force = false) { setMsg(nullptr, force); }
 
   /** Saves the relative position of the scroll view. Call this before calling update()
       if you want to preserve the current view. */
@@ -297,7 +297,7 @@ public:
   TDEHTMLPart * htmlPart() const { return mViewer; }
 
   /** Returns the current message or 0 if none. */
-  KMMessage* message(KMFolder** folder=0) const;
+  KMMessage* message(KMFolder** folder=nullptr) const;
 
   void openAttachment( int id, const TQString & name );
   void saveAttachment( const KURL &tempFileName );
@@ -508,7 +508,7 @@ protected:
 
   /** Creates a nice mail header depending on the current selected
     header style. */
-  TQString writeMsgHeader(KMMessage* aMsg, partNode *vCardNode = 0, bool topLevel=false );
+  TQString writeMsgHeader(KMMessage* aMsg, partNode *vCardNode = nullptr, bool topLevel=false );
 
   /** Writes the given message part to a temporary file and returns the
       name of this file or TQString() if writing failed.
diff --git a/kmail/kmsearchpattern.cpp b/kmail/kmsearchpattern.cpp
index a6bef32aa..c7227a024 100644
--- a/kmail/kmsearchpattern.cpp
+++ b/kmail/kmsearchpattern.cpp
@@ -101,7 +101,7 @@ KMSearchRule * KMSearchRule::createInstance( const TQCString & field,
                                              Function func,
                                              const TQString & contents )
 {
-  KMSearchRule *ret = 0;
+  KMSearchRule *ret = nullptr;
   if (field == "<status>")
     ret = new KMSearchRuleStatus( field, func, contents );
   else if ( field == "<age in days>" || field == "<size>" )
@@ -201,14 +201,14 @@ KMSearchRuleString::KMSearchRuleString( const TQCString & field,
           : KMSearchRule(field, func, contents)
 {
   if ( field.isEmpty() || field[0] == '<' )
-    mBmHeaderField = 0;
+    mBmHeaderField = nullptr;
   else // make sure you handle the unrealistic case of the message starting with mField
     mBmHeaderField = new DwBoyerMoore(("\n" + field + ": ").data());
 }
 
 KMSearchRuleString::KMSearchRuleString( const KMSearchRuleString & other )
   : KMSearchRule( other ),
-    mBmHeaderField( 0 )
+    mBmHeaderField( nullptr )
 {
   if ( other.mBmHeaderField )
     mBmHeaderField = new DwBoyerMoore( *other.mBmHeaderField );
@@ -223,7 +223,7 @@ const KMSearchRuleString & KMSearchRuleString::operator=( const KMSearchRuleStri
   mBmHeaderField = new DwBoyerMoore( *other.mBmHeaderField );
   setFunction( other.function() );
   setContents( other.contents() );
-  delete mBmHeaderField; mBmHeaderField = 0;
+  delete mBmHeaderField; mBmHeaderField = nullptr;
   if ( other.mBmHeaderField )
     mBmHeaderField = new DwBoyerMoore( *other.mBmHeaderField );
 
@@ -233,7 +233,7 @@ const KMSearchRuleString & KMSearchRuleString::operator=( const KMSearchRuleStri
 KMSearchRuleString::~KMSearchRuleString()
 {
   delete mBmHeaderField;
-  mBmHeaderField = 0;
+  mBmHeaderField = nullptr;
 }
 
 bool KMSearchRuleString::isEmpty() const
@@ -342,7 +342,7 @@ bool KMSearchRuleString::matches( const KMMessage * msg ) const
     msgContents += msg->bodyToUnicode();
     const DwHeaders& headers = msg->headers();
     const DwField * dwField = headers.FirstField();
-    while( dwField != 0 ) {
+    while(dwField) {
       const char * const fieldName = dwField->FieldNameStr().c_str();
       const TQString fieldValue = msg->headerFields( fieldName ).join( " " );
       msgContents += " " + fieldValue;
@@ -781,7 +781,7 @@ bool KMSearchPattern::matches( TQ_UINT32 serNum, bool ignoreBody ) const
 
   bool res;
   int idx = -1;
-  KMFolder *folder = 0;
+  KMFolder *folder = nullptr;
   KMMsgDict::instance()->getLocation(serNum, &folder, &idx);
   if (!folder || (idx == -1) || (idx >= folder->count())) {
     return false;
diff --git a/kmail/kmsearchpattern.h b/kmail/kmsearchpattern.h
index 620589364..956e10b94 100644
--- a/kmail/kmsearchpattern.h
+++ b/kmail/kmsearchpattern.h
@@ -84,7 +84,7 @@ public:
        @return true if the rule matched, false otherwise.
    */
    virtual bool matches( const DwString & str, KMMessage & msg,
-                         const DwBoyerMoore * headerField=0,
+                         const DwBoyerMoore * headerField=nullptr,
                          int headerLen=-1 ) const;
 
   /** Determine whether the rule is worth considering. It isn't if
@@ -173,7 +173,7 @@ public:
       @return true if the rule matched, false otherwise.
   */
   virtual bool matches( const DwString & str, KMMessage & msg,
-                        const DwBoyerMoore * headerField=0,
+                        const DwBoyerMoore * headerField=nullptr,
                         int headerLen=-1 ) const;
 
   /** Helper for the main matches() method. Does the actual comparing. */
@@ -218,7 +218,7 @@ namespace KMail {
     { I18N_NOOP( "New" ),              "kmmsgnew"   },
     { I18N_NOOP( "Unread" ),           "kmmsgunseen"   },
     { I18N_NOOP( "Read" ),             "kmmsgread"   },
-    { I18N_NOOP( "Old" ),              0   },
+    { I18N_NOOP( "Old" ),              nullptr   },
     { I18N_NOOP( "Deleted" ),          "kmmsgdel"   },
     { I18N_NOOP( "Replied" ),          "kmmsgreplied"   },
     { I18N_NOOP( "Forwarded" ),        "kmmsgforwarded"   },
@@ -322,7 +322,7 @@ public:
       to match any KMMessage. You can query for such an empty
       rule by using isEmpty, which is inherited from TQPtrList.
   */
-  KMSearchPattern( const TDEConfig * config=0 );
+  KMSearchPattern( const TDEConfig * config=nullptr );
 
   /** Destructor. Deletes all stored rules! */
   ~KMSearchPattern();
diff --git a/kmail/kmsearchpatternedit.cpp b/kmail/kmsearchpatternedit.cpp
index 43f56e95f..da9cf8ff0 100644
--- a/kmail/kmsearchpatternedit.cpp
+++ b/kmail/kmsearchpatternedit.cpp
@@ -57,9 +57,9 @@ KMSearchRuleWidget::KMSearchRuleWidget( TQWidget *parent, KMSearchRule *aRule,
                                         const char *name, bool headersOnly,
                                         bool absoluteDates )
   : TQWidget( parent, name ),
-    mRuleField( 0 ),
-    mFunctionStack( 0 ),
-    mValueStack( 0 ),
+    mRuleField( nullptr ),
+    mFunctionStack( nullptr ),
+    mValueStack( nullptr ),
     mAbsoluteDates( absoluteDates )
 {
   initFieldList( headersOnly, absoluteDates );
@@ -284,7 +284,7 @@ void KMSearchRuleWidget::slotRuleFieldChanged( const TQString & field )
 KMSearchRuleWidgetLister::KMSearchRuleWidgetLister( TQWidget *parent, const char* name, bool headersOnly, bool absoluteDates )
   : KWidgetLister( 2, FILTER_MAX_RULES, parent, name )
 {
-  mRuleList = 0;
+  mRuleList = nullptr;
   mHeadersOnly = headersOnly;
   mAbsoluteDates = absoluteDates;
 }
@@ -352,13 +352,13 @@ void KMSearchRuleWidgetLister::reset()
   if ( mRuleList )
     regenerateRuleListFromWidgets();
 
-  mRuleList = 0;
+  mRuleList = nullptr;
   slotClear();
 }
 
 TQWidget* KMSearchRuleWidgetLister::createWidget( TQWidget *parent )
 {
-  return new KMSearchRuleWidget(parent, 0, 0, mHeadersOnly, mAbsoluteDates);
+  return new KMSearchRuleWidget(parent, nullptr, nullptr, mHeadersOnly, mAbsoluteDates);
 }
 
 void KMSearchRuleWidgetLister::clearWidget( TQWidget *aWidget )
diff --git a/kmail/kmsearchpatternedit.h b/kmail/kmsearchpatternedit.h
index ebb2498c4..6e35f07b8 100644
--- a/kmail/kmsearchpatternedit.h
+++ b/kmail/kmsearchpatternedit.h
@@ -43,7 +43,7 @@ class KMSearchRuleWidget : public TQWidget
 public:
   /** Constructor. You can give a KMSearchRule as parameter, which will
       be used to initialize the widget. */
-  KMSearchRuleWidget( TQWidget* parent=0, KMSearchRule* aRule=0, const char* name=0, bool headersOnly = false, bool absoluteDates = false );
+  KMSearchRuleWidget( TQWidget* parent=nullptr, KMSearchRule* aRule=nullptr, const char* name=nullptr, bool headersOnly = false, bool absoluteDates = false );
 
   enum { Message, Body, AnyHeader, Recipients, Size, AgeInDays, Status,
          Subject, From, To, CC, ReplyTo, Organization };
@@ -110,7 +110,7 @@ class KMSearchRuleWidgetLister : public KWidgetLister
   friend class ::KMSearchPatternEdit;
 
 public:
-  KMSearchRuleWidgetLister( TQWidget *parent=0, const char* name=0, bool headersOnly = false, bool absoluteDates = false );
+  KMSearchRuleWidgetLister( TQWidget *parent=nullptr, const char* name=nullptr, bool headersOnly = false, bool absoluteDates = false );
 
   virtual ~KMSearchRuleWidgetLister();
 
@@ -170,10 +170,10 @@ class KMSearchPatternEdit : public TQGroupBox  {
 public:
   /** Constructor. The parent and name parameters are passed to the underlying
       TQGroupBox, as usual. */
-  KMSearchPatternEdit(TQWidget *parent=0, const char *name=0, bool headersOnly = false, bool absoluteDates = false);
+  KMSearchPatternEdit(TQWidget *parent=nullptr, const char *name=nullptr, bool headersOnly = false, bool absoluteDates = false);
   /** Constructor. This one allows you to set a title different from
       i18n("Search Criteria"). */
-  KMSearchPatternEdit(const TQString & title, TQWidget *parent=0, const char *name=0, bool headersOnly = false, bool absoluteDates = false);
+  KMSearchPatternEdit(const TQString & title, TQWidget *parent=nullptr, const char *name=nullptr, bool headersOnly = false, bool absoluteDates = false);
   ~KMSearchPatternEdit();
 
   /** Set the search pattern. Rules are inserted regardless of the
diff --git a/kmail/kmsender.cpp b/kmail/kmsender.cpp
index fd4cf5e86..c92f8cad2 100644
--- a/kmail/kmsender.cpp
+++ b/kmail/kmsender.cpp
@@ -47,13 +47,13 @@ using namespace KMime::Types;
 
 //-----------------------------------------------------------------------------
 KMSender::KMSender()
-  : mOutboxFolder( 0 ), mSentFolder( 0 )
+  : mOutboxFolder( nullptr ), mSentFolder( nullptr )
 {
-  mPrecommand = 0;
-  mSendProc = 0;
+  mPrecommand = nullptr;
+  mSendProc = nullptr;
   mSendProcStarted = false;
   mSendInProgress = false;
-  mCurrentMsg = 0;
+  mCurrentMsg = nullptr;
   mTransportInfo = new KMTransportInfo();
   readConfig();
   mSendAborted = false;
@@ -62,7 +62,7 @@ KMSender::KMSender()
   mFailedMessages = 0;
   mSentBytes = 0;
   mTotalBytes = 0;
-  mProgressItem = 0;
+  mProgressItem = nullptr;
 }
 
 
@@ -110,7 +110,7 @@ bool KMSender::settingsOk() const
 {
   if (KMTransportInfo::availableTransports().isEmpty())
   {
-    KMessageBox::information(0,i18n("Please create an account for sending and try again."));
+    KMessageBox::information(nullptr,i18n("Please create an account for sending and try again."));
     return false;
   }
   return true;
@@ -167,7 +167,7 @@ bool KMSender::doSend(KMMessage* aMsg, short sendNow)
 
   if ( const int err = outbox->addMsg(aMsg) ) {
     Q_UNUSED( err );
-    KMessageBox::information(0,i18n("Cannot add message to outbox folder"));
+    KMessageBox::information(nullptr,i18n("Cannot add message to outbox folder"));
     return false;
   }
 
@@ -223,7 +223,7 @@ bool KMSender::doSendQueued( const TQString &customTransport )
   if (mTotalMessages == 0) {
     // Nothing in the outbox. We are done.
     mOutboxFolder->close("dosendoutbox");
-    mOutboxFolder = 0;
+    mOutboxFolder = nullptr;
     return true;
   }
   mTotalBytes = 0;
@@ -232,7 +232,7 @@ bool KMSender::doSendQueued( const TQString &customTransport )
 
   connect( mOutboxFolder, TQ_SIGNAL(msgAdded(int)),
            this, TQ_SLOT(outboxMsgAdded(int)) );
-  mCurrentMsg = 0;
+  mCurrentMsg = nullptr;
 
   mSentFolder = kmkernel->sentFolder();
   mSentFolder->open("dosendsent");
@@ -287,7 +287,7 @@ void KMSender::doSendMsg()
   }
 
   // Post-process sent message (filtering)
-  KMFolder *sentFolder = 0, *imapSentFolder = 0;
+  KMFolder *sentFolder = nullptr, *imapSentFolder = nullptr;
   if (mCurrentMsg  && kmkernel->filterMgr())
   {
     mCurrentMsg->setTransferInProgress( false );
@@ -323,32 +323,32 @@ void KMSender::doSendMsg()
     if ( !mCurrentMsg->fcc().isEmpty() )
     {
       sentFolder = kmkernel->folderMgr()->findIdString( mCurrentMsg->fcc() );
-      if ( sentFolder == 0 )
+      if (!sentFolder)
       // This is *NOT* supposed to be imapSentFolder!
         sentFolder =
           kmkernel->dimapFolderMgr()->findIdString( mCurrentMsg->fcc() );
-      if ( sentFolder == 0 )
+      if (!sentFolder)
         imapSentFolder =
           kmkernel->imapFolderMgr()->findIdString( mCurrentMsg->fcc() );
     }
     // No, or no usable sentFolder, and no, or no usable imapSentFolder,
     // let's try the on in the identity
-    if ( ( sentFolder == 0 || sentFolder->isReadOnly() )
-      && ( imapSentFolder == 0 || imapSentFolder->isReadOnly() )
+    if ( ( !sentFolder || sentFolder->isReadOnly() )
+      && ( !imapSentFolder || imapSentFolder->isReadOnly() )
       && !id.fcc().isEmpty() )
     {
       sentFolder = kmkernel->folderMgr()->findIdString( id.fcc() );
-      if ( sentFolder == 0 )
+      if (!sentFolder)
         // This is *NOT* supposed to be imapSentFolder!
         sentFolder = kmkernel->dimapFolderMgr()->findIdString( id.fcc() );
-      if ( sentFolder == 0 )
+      if (!sentFolder)
         imapSentFolder = kmkernel->imapFolderMgr()->findIdString( id.fcc() );
     }
     if (imapSentFolder
         && ( imapSentFolder->noContent() || imapSentFolder->isReadOnly() ) )
-        imapSentFolder = 0;
+        imapSentFolder = nullptr;
 
-    if ( sentFolder == 0 || sentFolder->isReadOnly() )
+    if ( !sentFolder || sentFolder->isReadOnly() )
       sentFolder = kmkernel->sentFolder();
 
     if ( sentFolder ) {
@@ -370,7 +370,7 @@ void KMSender::doSendMsg()
     switch (processResult) {
     case 2:
       perror("Critical error: Unable to process sent mail (out of space?)");
-      KMessageBox::information(0, i18n("Critical error: "
+      KMessageBox::information(nullptr, i18n("Critical error: "
                    "Unable to process sent mail (out of space?)"
                    "Moving failing message to \"sent-mail\" folder."));
       if ( sentFolder ) {
@@ -382,7 +382,7 @@ void KMSender::doSendMsg()
     case 1:
       if ( sentFolder && sentFolder->moveMsg(mCurrentMsg) != 0 )
       {
-        KMessageBox::error(0, i18n("Moving the sent message \"%1\" from the "
+        KMessageBox::error(nullptr, i18n("Moving the sent message \"%1\" from the "
           "\"outbox\" to the \"sent-mail\" folder failed.\n"
           "Possible reasons are lack of disk space or write permission. "
           "Please try to fix the problem and move the message manually.")
@@ -409,7 +409,7 @@ void KMSender::doSendMsg()
       mCurrentMsg->parent()->unGetMsg( mCurrentMsg->parent()->count() -1 );
     }
 
-    mCurrentMsg = 0;
+    mCurrentMsg = nullptr;
   }
 
   // See if there is another queued message
@@ -428,7 +428,7 @@ void KMSender::doSendMsg()
       mCurrentMsg->setFrom( kmkernel->identityManager()->defaultIdentity().fullEmailAddr() );
     }
     else {
-      KMessageBox::sorry( 0, i18n( "It's not possible to send messages "
+      KMessageBox::sorry( nullptr, i18n( "It's not possible to send messages "
                                    "without specifying a sender address.\n"
                                    "Please set the email address of "
                                    "identity '%1' in the Identities "
@@ -436,16 +436,16 @@ void KMSender::doSendMsg()
                                    "and then try again." )
                              .arg( id.identityName() ) );
       mOutboxFolder->unGetMsg( mFailedMessages );
-      mCurrentMsg = 0;
+      mCurrentMsg = nullptr;
     }
   }
   if (!mCurrentMsg || mCurrentMsg->transferInProgress())
   {
     // a message is locked finish the send
     if (mCurrentMsg && mCurrentMsg->transferInProgress())
-    	mCurrentMsg = 0;
+      mCurrentMsg = nullptr;
     // no more message: cleanup and done
-    if ( sentFolder != 0 )
+    if (sentFolder)
         sentFolder->close("sentFolder");
     if ( someSent ) {
       if ( mSentMessages == mTotalMessages ) {
@@ -501,7 +501,7 @@ void KMSender::doSendMsg()
     if( mTransportInfo->encryption == "TLS" || mTransportInfo->encryption == "SSL" ) {
       mProgressItem->setUsesCrypto( true );
     } else if ( !mCustomTransport.isEmpty() ) {
-        int result = KMessageBox::warningContinueCancel( 0,
+        int result = KMessageBox::warningContinueCancel( nullptr,
         i18n( "You have chosen to send all queued email using an unencrypted transport, do you want to continue? "),
         i18n( "Security Warning" ),
         i18n( "Send Unencrypted" ),
@@ -543,7 +543,7 @@ bool KMSender::runPrecommand( const TQString & cmd ) {
   connect( mPrecommand, TQ_SIGNAL(finished(bool)),
            TQ_SLOT(slotPrecommandFinished(bool)) );
   if ( !mPrecommand->start() ) {
-    delete mPrecommand; mPrecommand = 0;
+    delete mPrecommand; mPrecommand = nullptr;
     return false;
   }
   return true;
@@ -557,7 +557,7 @@ void KMSender::sendProcStarted(bool success)
        mSendProc->finish();
     else
       setStatusMsg(i18n("Unrecognized transport protocol. Unable to send message."));
-    mSendProc = 0;
+    mSendProc = nullptr;
     mSendProcStarted = false;
     cleanup();
     return;
@@ -614,7 +614,7 @@ void KMSender::doSendMsgAux()
       mCurrentMsg->setTransferInProgress( false );
     if ( mOutboxFolder )
       mOutboxFolder->unGetMsg( mFailedMessages );
-    mCurrentMsg = 0;
+    mCurrentMsg = nullptr;
     cleanup();
     setStatusMsg(i18n("Failed to send (some) queued messages."));
     return;
@@ -629,18 +629,18 @@ void KMSender::cleanup(void)
 {
   kdDebug(5006) << k_funcinfo << endl;
   if (mSendProc && mSendProcStarted) mSendProc->finish();
-  mSendProc = 0;
+  mSendProc = nullptr;
   mSendProcStarted = false;
   if (mSendInProgress) tdeApp->deref();
   mSendInProgress = false;
   if (mCurrentMsg)
   {
     mCurrentMsg->setTransferInProgress( false );
-    mCurrentMsg = 0;
+    mCurrentMsg = nullptr;
   }
   if ( mSentFolder ) {
     mSentFolder->close("dosendsent");
-    mSentFolder = 0;
+    mSentFolder = nullptr;
   }
   if ( mOutboxFolder ) {
     disconnect( mOutboxFolder, TQ_SIGNAL(msgAdded(int)),
@@ -652,7 +652,7 @@ void KMSender::cleanup(void)
     else if ( mOutboxFolder->needsCompacting() ) {
       mOutboxFolder->compact( KMFolder::CompactSilentlyNow );
     }
-    mOutboxFolder = 0;
+    mOutboxFolder = nullptr;
   }
 
   mSendAborted = false;
@@ -661,7 +661,7 @@ void KMSender::cleanup(void)
   mSentBytes = 0;
   if ( mProgressItem )
     mProgressItem->setComplete();
-  mProgressItem = 0;
+  mProgressItem = nullptr;
   kmkernel->filterMgr()->deref();
 }
 
@@ -671,14 +671,14 @@ void KMSender::slotAbortSend()
 {
   mSendAborted = true;
   delete mPrecommand;
-  mPrecommand = 0;
+  mPrecommand = nullptr;
   if (mSendProc) mSendProc->abort();
 }
 
 //-----------------------------------------------------------------------------
 void KMSender::slotIdle()
 {
-  assert(mSendProc != 0);
+  assert(mSendProc);
 
   TQString msg;
   TQString errString;
@@ -691,7 +691,7 @@ void KMSender::slotIdle()
       mCurrentMsg->setTransferInProgress( false );
       if ( mOutboxFolder )
         mOutboxFolder->unGetMsg( mFailedMessages );
-      mCurrentMsg = 0;
+      mCurrentMsg = nullptr;
     }
     msg = i18n("Sending aborted:\n%1\n"
         "The message will stay in the 'outbox' folder until you either "
@@ -700,7 +700,7 @@ void KMSender::slotIdle()
         "The following transport protocol was used:\n  %2")
       .arg(errString)
       .arg(mMethodStr);
-    if (!errString.isEmpty()) KMessageBox::error(0,msg);
+    if (!errString.isEmpty()) KMessageBox::error(nullptr,msg);
     setStatusMsg( i18n( "Sending aborted." ) );
   } else {
     if (!mSendProc->sendOk()) {
@@ -708,7 +708,7 @@ void KMSender::slotIdle()
         mCurrentMsg->setTransferInProgress( false );
       if ( mOutboxFolder )
         mOutboxFolder->unGetMsg( mFailedMessages );
-      mCurrentMsg = 0;
+      mCurrentMsg = nullptr;
       mFailedMessages++;
       // reset cached password
       TQMapIterator <TQString,TQString> pc;
@@ -728,7 +728,7 @@ void KMSender::slotIdle()
             "<p>Do you want me to continue sending the remaining messages?</p>")
             .arg(errString)
             .arg(mMethodStr);
-          res = KMessageBox::warningYesNo( 0 , msg ,
+          res = KMessageBox::warningYesNo( nullptr , msg ,
                   i18n( "Continue Sending" ), i18n( "&Continue Sending" ),
                   i18n("&Abort Sending") );
         } else {
@@ -739,7 +739,7 @@ void KMSender::slotIdle()
             "The following transport protocol was used:\n %2")
             .arg(errString)
             .arg(mMethodStr);
-          KMessageBox::error(0,msg);
+          KMessageBox::error(nullptr,msg);
         }
         if (res == KMessageBox::Yes) {
           // Try the next one.
@@ -756,7 +756,7 @@ void KMSender::slotIdle()
     }
   }
   mSendProc->finish();
-  mSendProc = 0;
+  mSendProc = nullptr;
   mSendProcStarted = false;
 
   cleanup();
@@ -767,7 +767,7 @@ void KMSender::slotIdle()
 void KMSender::slotPrecommandFinished(bool normalExit)
 {
   delete mPrecommand;
-  mPrecommand = 0;
+  mPrecommand = nullptr;
   if (normalExit) mSendProc->start();
   else slotIdle();
 }
@@ -843,7 +843,7 @@ KMSendProc* KMSender::createSendProcFromString( const TQString & transport )
   if (mTransportInfo->type == "smtp" || mTransportInfo->type == "smtps")
     return new KMSendSMTP(this);
 
-  return 0L;
+  return nullptr;
 }
 
 //-----------------------------------------------------------------------------
@@ -858,7 +858,7 @@ void KMSender::setStatusByLink(const KMMessage *aMsg)
       break;
     n++;
 
-    KMFolder *folder = 0;
+    KMFolder *folder = nullptr;
     int index = -1;
     KMMsgDict::instance()->getLocation(msn, &folder, &index);
     if (folder && index != -1) {
@@ -880,7 +880,7 @@ void KMSender::setStatusByLink(const KMMessage *aMsg)
 //=============================================================================
 //=============================================================================
 KMSendProc::KMSendProc( KMSender * sender )
-  : TQObject( 0 ),
+  : TQObject( nullptr ),
     mSender( sender ),
     mLastErrorMessage(),
     mSendOk( false ),
@@ -915,15 +915,15 @@ void KMSendProc::statusMsg(const TQString& aMsg)
 KMSendSendmail::KMSendSendmail( KMSender * sender )
   : KMSendProc( sender ),
     mMsgStr(),
-    mMsgPos( 0 ),
+    mMsgPos( nullptr ),
     mMsgRest( 0 ),
-    mMailerProc( 0 )
+    mMailerProc( nullptr )
 {
 
 }
 
 KMSendSendmail::~KMSendSendmail() {
-  delete mMailerProc; mMailerProc = 0;
+  delete mMailerProc; mMailerProc = nullptr;
 }
 
 bool KMSendSendmail::doStart() {
@@ -938,14 +938,14 @@ bool KMSendSendmail::doStart() {
                              "The following transport protocol was used:\n  %2")
                         .arg(str + "\n")
                         .arg("sendmail://");
-    KMessageBox::information(0,msg);
+    KMessageBox::information(nullptr,msg);
     return false;
   }
 
   if (!mMailerProc)
   {
     mMailerProc = new TDEProcess;
-    assert(mMailerProc != 0);
+    assert(mMailerProc);
     connect(mMailerProc,TQ_SIGNAL(processExited(TDEProcess*)),
 	    this, TQ_SLOT(sendmailExited(TDEProcess*)));
     connect(mMailerProc,TQ_SIGNAL(wroteStdin(TDEProcess*)),
@@ -958,13 +958,13 @@ bool KMSendSendmail::doStart() {
 
 void KMSendSendmail::doFinish() {
   delete mMailerProc;
-  mMailerProc = 0;
+  mMailerProc = nullptr;
 }
 
 void KMSendSendmail::abort()
 {
   delete mMailerProc;
-  mMailerProc = 0;
+  mMailerProc = nullptr;
   mSendOk = false;
   mMsgStr = 0;
   idle();
@@ -979,7 +979,7 @@ bool KMSendSendmail::doSend( const TQString & sender, const TQStringList & to, c
   mMsgStr = message;
 
   if ( !mMailerProc->start( TDEProcess::NotifyOnExit, TDEProcess::All ) ) {
-    KMessageBox::information( 0, i18n("Failed to execute mailer program %1")
+    KMessageBox::information( nullptr, i18n("Failed to execute mailer program %1")
                               .arg( mSender->transportInfo()->host ) );
     return false;
   }
@@ -996,7 +996,7 @@ void KMSendSendmail::wroteStdin(TDEProcess *proc)
   char* str;
   int len;
 
-  assert(proc!=0);
+  assert(proc);
   Q_UNUSED( proc );
 
   str = mMsgPos;
@@ -1019,7 +1019,7 @@ void KMSendSendmail::wroteStdin(TDEProcess *proc)
 
 void KMSendSendmail::receivedStderr(TDEProcess *proc, char *buffer, int buflen)
 {
-  assert(proc!=0);
+  assert(proc);
   Q_UNUSED( proc );
   mLastErrorMessage.replace(mLastErrorMessage.length(), buflen, buffer);
 }
@@ -1027,7 +1027,7 @@ void KMSendSendmail::receivedStderr(TDEProcess *proc, char *buffer, int buflen)
 
 void KMSendSendmail::sendmailExited(TDEProcess *proc)
 {
-  assert(proc!=0);
+  assert(proc);
   mSendOk = (proc->normalExit() && proc->exitStatus()==0);
   if (!mSendOk) failed(i18n("Sendmail exited abnormally."));
   mMsgStr = 0;
@@ -1042,8 +1042,8 @@ void KMSendSendmail::sendmailExited(TDEProcess *proc)
 KMSendSMTP::KMSendSMTP(KMSender *sender)
   : KMSendProc(sender),
     mInProcess(false),
-    mJob(0),
-    mSlave(0)
+    mJob(nullptr),
+    mSlave(nullptr)
 {
   TDEIO::Scheduler::connect(TQ_SIGNAL(slaveError(TDEIO::Slave *, int,
     const TQString &)), this, TQ_SLOT(slaveError(TDEIO::Slave *, int,
@@ -1165,14 +1165,14 @@ void KMSendSMTP::cleanup() {
   if(mJob)
   {
     mJob->kill(true);
-    mJob = 0;
-    mSlave = 0;
+    mJob = nullptr;
+    mSlave = nullptr;
   }
 
   if (mSlave)
   {
     TDEIO::Scheduler::disconnectSlave(mSlave);
-    mSlave = 0;
+    mSlave = nullptr;
   }
 
   mInProcess = false;
@@ -1205,12 +1205,12 @@ void KMSendSMTP::dataReq(TDEIO::Job *, TQByteArray &array)
 void KMSendSMTP::result(TDEIO::Job *_job)
 {
   if (!mJob) return;
-  mJob = 0;
+  mJob = nullptr;
 
   if(_job->error())
   {
     mSendOk = false;
-    if (_job->error() == TDEIO::ERR_SLAVE_DIED) mSlave = 0;
+    if (_job->error() == TDEIO::ERR_SLAVE_DIED) mSlave = nullptr;
     failed(_job->errorString());
     abort();
   } else {
@@ -1222,9 +1222,9 @@ void KMSendSMTP::slaveError(TDEIO::Slave *aSlave, int error, const TQString &err
 {
   if (aSlave == mSlave)
   {
-    if (error == TDEIO::ERR_SLAVE_DIED) mSlave = 0;
+    if (error == TDEIO::ERR_SLAVE_DIED) mSlave = nullptr;
     mSendOk = false;
-    mJob = 0;
+    mJob = nullptr;
     failed(TDEIO::buildErrorString(error, errorMsg));
     abort();
   }
diff --git a/kmail/kmservertest.cpp b/kmail/kmservertest.cpp
index 1ef59a3f6..14da5cb57 100644
--- a/kmail/kmservertest.cpp
+++ b/kmail/kmservertest.cpp
@@ -48,7 +48,7 @@
 KMServerTest::KMServerTest( const TQString & protocol, const TQString & host, int port )
   : TQObject(),
     mProtocol( protocol ), mHost( host ),
-    mSSL( false ), mJob( 0 ), mSlave( 0 ), mConnectionErrorCount( 0 )
+    mSSL( false ), mJob( nullptr ), mSlave( nullptr ), mConnectionErrorCount( 0 )
 {
   TDEIO::Scheduler::connect(
     TQ_SIGNAL(slaveError(TDEIO::Slave *, int, const TQString &)),
@@ -82,7 +82,7 @@ void KMServerTest::startOffSlave( int port ) {
 
   mSlave = TDEIO::Scheduler::getConnectedSlave( url, slaveConfig() );
   if ( !mSlave ) {
-    slotSlaveResult( 0, 1 );
+    slotSlaveResult( nullptr, 1 );
     return;
   }
   connect( mSlave, TQ_SIGNAL(metaData(const TDEIO::MetaData&)),
@@ -151,7 +151,7 @@ void KMServerTest::slotSlaveResult(TDEIO::Slave *aSlave, int error,
   {
     // disconnect slave after every connect
     TDEIO::Scheduler::disconnectSlave(mSlave);
-    mSlave = 0;
+    mSlave = nullptr;
   }
   if ( error == TDEIO::ERR_COULD_NOT_CONNECT )
   {
@@ -165,7 +165,7 @@ void KMServerTest::slotSlaveResult(TDEIO::Slave *aSlave, int error,
   }
   if ( error )
   {
-    mJob = 0;
+    mJob = nullptr;
     KMessageBox::error( tdeApp->activeWindow(),
         TDEIO::buildErrorString( error, errorText ),
         i18n("Error") );
@@ -178,7 +178,7 @@ void KMServerTest::slotSlaveResult(TDEIO::Slave *aSlave, int error,
     mListNormal.append("NORMAL-CONNECTION");
     startOffSlave();
   } else {
-    mJob = 0;
+    mJob = nullptr;
 
     emit capabilities( mListNormal, mListSSL );
     emit capabilities( mListNormal, mListSSL, mAuthNone, mAuthSSL, mAuthTLS );
diff --git a/kmail/kmstartup.cpp b/kmail/kmstartup.cpp
index 7fd0ba4f0..5f202485c 100644
--- a/kmail/kmstartup.cpp
+++ b/kmail/kmstartup.cpp
@@ -228,7 +228,7 @@ void lockOrDie() {
 
     KCursorSaver idle( KBusyPtr::idle() );
     if ( KMessageBox::No ==
-         KMessageBox::warningYesNo( 0, msg, TQString(),
+         KMessageBox::warningYesNo( nullptr, msg, TQString(),
                                     i18n("Start %1").arg( programName ),
                                     i18n("Exit") ) ) {
       exit(1);
diff --git a/kmail/kmsystemtray.cpp b/kmail/kmsystemtray.cpp
index 45d8bfc95..b9ed27027 100644
--- a/kmail/kmsystemtray.cpp
+++ b/kmail/kmsystemtray.cpp
@@ -64,12 +64,12 @@ KMSystemTray::KMSystemTray(TQWidget *parent, const char *name)
     mMode( GlobalSettings::EnumSystemTrayPolicy::ShowOnUnread ),
     mCount( 0 ),
     mNewMessagePopupId(-1),
-    mPopupMenu(0)
+    mPopupMenu(nullptr)
 {
   setAlignment( AlignCenter );
   kdDebug(5006) << "Initting systray" << endl;
 
-  mLastUpdate = time( 0 );
+  mLastUpdate = time( nullptr );
   mUpdateTimer = new TQTimer( this, "systraytimer" );
   connect( mUpdateTimer, TQ_SIGNAL( timeout() ), TQ_SLOT( updateNewMessages() ) );
 
@@ -147,7 +147,7 @@ KMSystemTray::~KMSystemTray()
   kmkernel->unregisterSystemTrayApplet( this );
 
   delete mPopupMenu;
-  mPopupMenu = 0;
+  mPopupMenu = nullptr;
 }
 
 void KMSystemTray::setMode(int newMode)
@@ -376,8 +376,8 @@ TQString KMSystemTray::prettyName(KMFolder * fldr)
     KMFolderImap * imap = dynamic_cast<KMFolderImap*> (fldr->storage());
     assert(imap);
 
-    if((imap->account() != 0) &&
-       (imap->account()->name() != 0) )
+    if (imap->account() &&
+        imap->account()->name() != nullptr)
     {
       kdDebug(5006) << "IMAP folder, prepend label with type" << endl;
       rvalue = imap->account()->name() + "->" + rvalue;
@@ -472,7 +472,7 @@ void KMSystemTray::updateNewMessageNotification(KMFolder * fldr)
   }
 
   mPendingUpdates[ fldr ] = true;
-  if ( time( 0 ) - mLastUpdate > 2 ) {
+  if ( time( nullptr ) - mLastUpdate > 2 ) {
     mUpdateTimer->stop();
     updateNewMessages();
   }
@@ -568,7 +568,7 @@ void KMSystemTray::updateNewMessages()
                              "There are %n unread messages.",
                            mCount));
 
-  mLastUpdate = time( 0 );
+  mLastUpdate = time( nullptr );
 }
 
 /**
diff --git a/kmail/kmsystemtray.h b/kmail/kmsystemtray.h
index 0472a98cb..bb911608f 100644
--- a/kmail/kmsystemtray.h
+++ b/kmail/kmsystemtray.h
@@ -44,7 +44,7 @@ class KMSystemTray : public KSystemTray
   
 public:
   /** construtor */
-  KMSystemTray(TQWidget* parent=0, const char *name=0);
+  KMSystemTray(TQWidget* parent=nullptr, const char *name=nullptr);
   /** destructor */
   ~KMSystemTray();
 
diff --git a/kmail/kmtransport.cpp b/kmail/kmtransport.cpp
index 44c8b3f0e..4954d31a0 100644
--- a/kmail/kmtransport.cpp
+++ b/kmail/kmtransport.cpp
@@ -137,7 +137,7 @@ void KMTransportInfo::writeConfig(int id)
       passwdStored = wallet ? !mStorePasswdInConfig /*already in the wallet*/ : config->hasKey("pass");
     }
     // wallet not available, ask the user if we should use the config file instead
-    if ( !passwdStored && ( mStorePasswdInConfig ||  KMessageBox::warningYesNo( 0,
+    if ( !passwdStored && ( mStorePasswdInConfig ||  KMessageBox::warningYesNo( nullptr,
          i18n("TDEWallet is not available. It is strongly recommended to use "
               "TDEWallet for managing your passwords.\n"
               "However, KMail can store the password in its configuration "
@@ -285,11 +285,11 @@ KMTransportDialog::KMTransportDialog( const TQString & caption,
 				      TQWidget *parent, const char *name,
 				      bool modal )
   : KDialogBase( parent, name, modal, caption, Ok|Cancel, Ok, true ),
-    mServerTest( 0 ),
+    mServerTest( nullptr ),
     mTransportInfo( transportInfo ),
     mAuthNone( AllAuth ), mAuthSSL( AllAuth ), mAuthTLS( AllAuth )
 {
-  assert(transportInfo != 0);
+  assert(transportInfo);
 
   if( transportInfo->type == TQString::fromLatin1("sendmail") )
   {
@@ -615,7 +615,7 @@ void KMTransportDialog::saveSettings()
 
 void KMTransportDialog::slotSendmailChooser()
 {
-  KFileDialog dialog("/", TQString(), this, 0, true );
+  KFileDialog dialog("/", TQString(), this, nullptr, true );
   dialog.setCaption(i18n("Choose sendmail Location") );
 
   if( dialog.exec() == TQDialog::Accepted )
@@ -628,7 +628,7 @@ void KMTransportDialog::slotSendmailChooser()
 
     if( url.isLocalFile() == false )
     {
-      KMessageBox::sorry( 0, i18n( "Only local files allowed." ) );
+      KMessageBox::sorry( nullptr, i18n( "Only local files allowed." ) );
       return;
     }
 
@@ -776,7 +776,7 @@ void KMTransportDialog::slotSmtpCapabilities( const TQStringList & capaNormal,
                 << "; mAuthTLS = " << mAuthTLS << endl;
   checkHighest( mSmtp.encryptionGroup );
   delete mServerTest;
-  mServerTest = 0;
+  mServerTest = nullptr;
 }
 bool KMTransportDialog::sanityCheckSmtpInput()
 {
diff --git a/kmail/kmtransport.h b/kmail/kmtransport.h
index 5f0efdee5..4be28dfa5 100644
--- a/kmail/kmtransport.h
+++ b/kmail/kmtransport.h
@@ -67,7 +67,7 @@ class KMTransportSelDlg : public KDialogBase
   
 
 public:
-  KMTransportSelDlg( TQWidget *parent=0, const char *name=0, bool modal=true );
+  KMTransportSelDlg( TQWidget *parent=nullptr, const char *name=nullptr, bool modal=true );
   int selected() const;
 
 private slots:
@@ -84,7 +84,7 @@ class KMTransportDialog : public KDialogBase
 
 public:
   KMTransportDialog( const TQString & caption, KMTransportInfo *transportInfo,
-		     TQWidget *parent=0, const char *name=0, bool modal=true );
+		     TQWidget *parent=nullptr, const char *name=nullptr, bool modal=true );
   virtual ~KMTransportDialog();
 
 private slots:
diff --git a/kmail/listjob.cpp b/kmail/listjob.cpp
index 6c189293c..a8d218b17 100644
--- a/kmail/listjob.cpp
+++ b/kmail/listjob.cpp
@@ -53,7 +53,7 @@ using namespace KMail;
 ListJob::ListJob( ImapAccountBase* account, ImapAccountBase::ListType type,
     FolderStorage* storage, const TQString& path, bool complete,
     KPIM::ProgressItem* item )
- : FolderJob( 0, tOther, (storage ? storage->folder() : 0) ),
+ : FolderJob( nullptr, tOther, (storage ? storage->folder() : nullptr) ),
    mStorage( storage ), mAccount( account ), mType( type ),
    mComplete( complete ),
    mHonorLocalSubscription( false ), mPath( path ),
diff --git a/kmail/listjob.h b/kmail/listjob.h
index 54cb535d8..08dcacb42 100644
--- a/kmail/listjob.h
+++ b/kmail/listjob.h
@@ -67,8 +67,8 @@ public:
    * @param item a parent ProgressItem
    */
   ListJob( ImapAccountBase* account, ImapAccountBase::ListType type,
-           FolderStorage* storage = 0, const TQString& path = TQString(),
-           bool complete = false, KPIM::ProgressItem* item = 0 );
+           FolderStorage* storage = nullptr, const TQString& path = TQString(),
+           bool complete = false, KPIM::ProgressItem* item = nullptr );
 
   virtual ~ListJob();
 
diff --git a/kmail/maildirjob.cpp b/kmail/maildirjob.cpp
index 11f6edfb2..11da58896 100644
--- a/kmail/maildirjob.cpp
+++ b/kmail/maildirjob.cpp
@@ -47,14 +47,14 @@ namespace KMail {
 
 //-----------------------------------------------------------------------------
 MaildirJob::MaildirJob( KMMessage *msg, JobType jt , KMFolder *folder )
-  : FolderJob( msg, jt, folder ), mParentFolder( 0 )
+  : FolderJob( msg, jt, folder ), mParentFolder( nullptr )
 {
 }
 
 //-----------------------------------------------------------------------------
 MaildirJob::MaildirJob( TQPtrList<KMMessage>& msgList, const TQString& sets,
                         JobType jt , KMFolder *folder )
-  : FolderJob( msgList, sets, jt, folder ), mParentFolder( 0 )
+  : FolderJob( msgList, sets, jt, folder ), mParentFolder( nullptr )
 {
 }
 
diff --git a/kmail/maildirjob.h b/kmail/maildirjob.h
index 1c21833be..5c3fc4832 100644
--- a/kmail/maildirjob.h
+++ b/kmail/maildirjob.h
@@ -43,9 +43,9 @@ class MaildirJob : public FolderJob
   TQ_OBJECT
   
 public:
-  MaildirJob( KMMessage *msg, JobType jt = tGetMessage, KMFolder *folder = 0 );
+  MaildirJob( KMMessage *msg, JobType jt = tGetMessage, KMFolder *folder = nullptr );
   MaildirJob( TQPtrList<KMMessage>& msgList, const TQString& sets,
-              JobType jt = tGetMessage, KMFolder *folder = 0 );
+              JobType jt = tGetMessage, KMFolder *folder = nullptr );
   virtual ~MaildirJob();
 
   void setParentFolder( const KMFolderMaildir* parent );
diff --git a/kmail/mailinglistpropertiesdialog.cpp b/kmail/mailinglistpropertiesdialog.cpp
index ab9841615..f80384654 100644
--- a/kmail/mailinglistpropertiesdialog.cpp
+++ b/kmail/mailinglistpropertiesdialog.cpp
@@ -318,7 +318,7 @@ void MailingListFolderPropertiesDialog::fillEditBox()
 
 void MailingListFolderPropertiesDialog::slotInvokeHandler()
 {
-  KMCommand *command =0;
+  KMCommand *command =nullptr;
   switch ( mAddressCombo->currentItem() ) {
   case 0:
     command = new KMMailingListPostCommand( this, mFolder );
diff --git a/kmail/mailsourceviewer.cpp b/kmail/mailsourceviewer.cpp
index ac6d60bc0..ce8b5b14b 100644
--- a/kmail/mailsourceviewer.cpp
+++ b/kmail/mailsourceviewer.cpp
@@ -54,7 +54,7 @@ int MailSourceHighlighter::highlightParagraph( const TQString& text, int ) {
 }
 
 MailSourceViewer::MailSourceViewer( TQWidget *parent, const char *name )
-  : KTextBrowser( parent, name ), mSourceHighLighter( 0 )
+  : KTextBrowser( parent, name ), mSourceHighLighter( nullptr )
 {
   setWFlags( WDestructiveClose );
   TQAccel *accel = new TQAccel( this, "browser close-accel" );
@@ -66,12 +66,12 @@ MailSourceViewer::MailSourceViewer( TQWidget *parent, const char *name )
 
 MailSourceViewer::~MailSourceViewer()
 {
-  delete mSourceHighLighter; mSourceHighLighter = 0;
+  delete mSourceHighLighter; mSourceHighLighter = nullptr;
 }
 
 void MailSourceViewer::setText( const TQString& text )
 {
-  delete mSourceHighLighter; mSourceHighLighter = 0;
+  delete mSourceHighLighter; mSourceHighLighter = nullptr;
   if ( text.length() > 500000 ) {
     setTextFormat( TQt::LogText );
   } else {
diff --git a/kmail/mailsourceviewer.h b/kmail/mailsourceviewer.h
index 68f82c238..8e7dc5356 100644
--- a/kmail/mailsourceviewer.h
+++ b/kmail/mailsourceviewer.h
@@ -59,7 +59,7 @@ public:
 class MailSourceViewer : public KTextBrowser
 {
 public:
-  MailSourceViewer( TQWidget *parent = 0, const char *name = 0 );
+  MailSourceViewer( TQWidget *parent = nullptr, const char *name = nullptr );
   ~MailSourceViewer();
   void setText( const TQString& text );
 private:
diff --git a/kmail/managesievescriptsdialog.cpp b/kmail/managesievescriptsdialog.cpp
index 509a39b53..e6634bb40 100644
--- a/kmail/managesievescriptsdialog.cpp
+++ b/kmail/managesievescriptsdialog.cpp
@@ -23,17 +23,17 @@
 #include <cassert>
 
 inline TQCheckListItem * qcli_cast( TQListViewItem * lvi ) {
-  return lvi && lvi->rtti() == 1 ? static_cast<TQCheckListItem*>( lvi ) : 0 ;
+  return lvi && lvi->rtti() == 1 ? static_cast<TQCheckListItem*>( lvi ) : nullptr ;
 }
 inline const TQCheckListItem * qcli_cast( const TQListViewItem * lvi ) {
-  return lvi && lvi->rtti() == 1 ? static_cast<const TQCheckListItem*>( lvi ) : 0 ;
+  return lvi && lvi->rtti() == 1 ? static_cast<const TQCheckListItem*>( lvi ) : nullptr ;
 }
 
 KMail::ManageSieveScriptsDialog::ManageSieveScriptsDialog( TQWidget * parent, const char * name )
   : KDialogBase( Plain, i18n( "Manage Sieve Scripts" ), Close, Close,
     parent, name, false ),
-    mSieveEditor( 0 ),
-    mContextMenuItem( 0 ),
+    mSieveEditor( nullptr ),
+    mContextMenuItem( nullptr ),
     mWasActive( false )
 {
   setWFlags( WGroupLeader|WDestructiveClose );
@@ -102,7 +102,7 @@ void KMail::ManageSieveScriptsDialog::slotRefresh() {
 
   KMail::AccountManager * am = kmkernel->acctMgr();
   assert( am );
-  TQCheckListItem * last = 0;
+  TQCheckListItem * last = nullptr;
   for ( KMAccount * a = am->first() ; a ; a = am->next() ) {
     last = new TQCheckListItem( mListView, last, a->name(), TQCheckListItem::Controller );
     last->setPixmap( 0, SmallIcon( "server" ) );
@@ -170,7 +170,7 @@ void KMail::ManageSieveScriptsDialog::slotContextMenuRequested( TQListViewItem *
     menu.insertItem( i18n( "New Script..." ), this, TQ_SLOT(slotNewScript()) );
   }
   menu.exec( p );
-  mContextMenuItem = 0;
+  mContextMenuItem = nullptr;
 }
 
 
@@ -231,7 +231,7 @@ void KMail::ManageSieveScriptsDialog::slotDoubleClicked( TQListViewItem * i ) {
     return;
   mContextMenuItem = item;
   slotEditScript();
-  mContextMenuItem = 0;
+  mContextMenuItem = nullptr;
 }
 
 void KMail::ManageSieveScriptsDialog::slotDeleteScript() {
@@ -308,7 +308,7 @@ void KMail::ManageSieveScriptsDialog::slotNewScript() {
   (void) new TQCheckListItem( mContextMenuItem, name, TQCheckListItem::RadioButton );
 
   mCurrentURL = u;
-  slotGetResult( 0, true, TQString(), false );
+  slotGetResult( nullptr, true, TQString(), false );
 }
 
 KMail::SieveEditor::SieveEditor( TQWidget * parent, const char * name )
@@ -357,7 +357,7 @@ void KMail::ManageSieveScriptsDialog::slotSieveEditorOkClicked() {
 }
 
 void KMail::ManageSieveScriptsDialog::slotSieveEditorCancelClicked() {
-  mSieveEditor->deleteLater(); mSieveEditor = 0;
+  mSieveEditor->deleteLater(); mSieveEditor = nullptr;
   mCurrentURL = KURL();
   slotRefresh();
 }
@@ -366,7 +366,7 @@ void KMail::ManageSieveScriptsDialog::slotPutResult( KMail::SieveJob *, bool suc
   if ( success ) {
     KMessageBox::information( this, i18n( "The Sieve script was successfully uploaded." ),
                               i18n( "Sieve Script Upload" ) );
-    mSieveEditor->deleteLater(); mSieveEditor = 0;
+    mSieveEditor->deleteLater(); mSieveEditor = nullptr;
     mCurrentURL = KURL();
   } else {
     mSieveEditor->show();
diff --git a/kmail/managesievescriptsdialog.h b/kmail/managesievescriptsdialog.h
index b3a6848c0..74a17435b 100644
--- a/kmail/managesievescriptsdialog.h
+++ b/kmail/managesievescriptsdialog.h
@@ -17,7 +17,7 @@ class ManageSieveScriptsDialog : public KDialogBase {
   TQ_OBJECT
   
 public:
-  ManageSieveScriptsDialog( TQWidget * parent=0, const char * name=0 );
+  ManageSieveScriptsDialog( TQWidget * parent=nullptr, const char * name=nullptr );
   ~ManageSieveScriptsDialog();
 
 private slots:
diff --git a/kmail/managesievescriptsdialog_p.h b/kmail/managesievescriptsdialog_p.h
index d3b84e694..12dedfe07 100644
--- a/kmail/managesievescriptsdialog_p.h
+++ b/kmail/managesievescriptsdialog_p.h
@@ -12,7 +12,7 @@ class SieveEditor : public KDialogBase {
   
   TQ_PROPERTY( TQString script READ script WRITE setScript )
 public:
-  SieveEditor( TQWidget * parent=0, const char * name=0 );
+  SieveEditor( TQWidget * parent=nullptr, const char * name=nullptr );
   ~SieveEditor();
 
   TQString script() const { return mTextEdit->text(); }
diff --git a/kmail/mboxjob.h b/kmail/mboxjob.h
index 8c65e181c..abdeebb53 100644
--- a/kmail/mboxjob.h
+++ b/kmail/mboxjob.h
@@ -44,9 +44,9 @@ class MboxJob : public FolderJob
   
   friend class ::KMFolderMbox;
 public:
-  MboxJob( KMMessage *msg, JobType jt = tGetMessage, KMFolder *folder = 0 );
+  MboxJob( KMMessage *msg, JobType jt = tGetMessage, KMFolder *folder = nullptr );
   MboxJob( TQPtrList<KMMessage>& msgList, const TQString& sets,
-             JobType jt = tGetMessage, KMFolder *folder = 0 );
+             JobType jt = tGetMessage, KMFolder *folder = nullptr );
   virtual ~MboxJob();
 protected:
   void execute();
diff --git a/kmail/messageactions.cpp b/kmail/messageactions.cpp
index e7233d3ea..c5bbe9061 100644
--- a/kmail/messageactions.cpp
+++ b/kmail/messageactions.cpp
@@ -36,8 +36,8 @@ MessageActions::MessageActions( TDEActionCollection *ac, TQWidget * parent ) :
     TQObject( parent ),
     mParent( parent ),
     mActionCollection( ac ),
-    mCurrentMessage( 0 ),
-    mMessageView( 0 )
+    mCurrentMessage( nullptr ),
+    mMessageView( nullptr )
 {
     mReplyActionMenu = new TDEActionMenu( i18n("Message->","&Reply"),
                                       "mail-reply-sender", mActionCollection,
@@ -138,7 +138,7 @@ void MessageActions::setSelectedVisibleSernums(const TQValueList< TQ_UINT32 > &
 
 void MessageActions::updateActions()
 {
-  bool singleMsg = (mCurrentMessage != 0);
+  bool singleMsg = (mCurrentMessage != nullptr);
   if ( mCurrentMessage && mCurrentMessage->parent() ) {
     if ( mCurrentMessage->parent()->isTemplates() )
       singleMsg = false;
@@ -261,7 +261,7 @@ void MessageActions::editCurrentMessage()
 {
   if ( !mCurrentMessage )
     return;
-  KMCommand *command = 0;
+  KMCommand *command = nullptr;
   KMFolder *folder = mCurrentMessage->parent();
   // edit, unlike send again, removes the message from the folder
   // we only want that for templates and drafts folders
diff --git a/kmail/messagecomposer.cpp b/kmail/messagecomposer.cpp
index 1cc0cd33f..5097cc4fe 100644
--- a/kmail/messagecomposer.cpp
+++ b/kmail/messagecomposer.cpp
@@ -288,8 +288,8 @@ public:
 };
 
 MessageComposer::MessageComposer( KMComposeWin* win, const char* name )
-  : TQObject( win, name ), mComposeWin( win ), mCurrentJob( 0 ),
-    mReferenceMessage( 0 ), mKeyResolver( 0 ), 
+  : TQObject( win, name ), mComposeWin( win ), mCurrentJob( nullptr ),
+    mReferenceMessage( nullptr ), mKeyResolver( nullptr ),
     mUseOpportunisticEncryption( false ),
     mSignBody( false ), mEncryptBody( false ),
     mSigningRequested(  false ), mEncryptionRequested( false ),
@@ -302,7 +302,7 @@ MessageComposer::MessageComposer( KMComposeWin* win, const char* name )
     mIsRichText( false ),
     mIdentityUid( 0 ), mRc( true ),
     mHoldJobs( false ),
-    mNewBodyPart( 0 ),
+    mNewBodyPart( nullptr ),
     mEarlyAddAttachments( false ), mAllAttachmentsAreInBody( false ),
     mPreviousBoundaryLevel( 0 ),
     mEncryptWithChiasmus( false ),
@@ -312,14 +312,14 @@ MessageComposer::MessageComposer( KMComposeWin* win, const char* name )
 
 MessageComposer::~MessageComposer()
 {
-  delete mKeyResolver; mKeyResolver = 0;
-  delete mNewBodyPart; mNewBodyPart = 0;
+  delete mKeyResolver; mKeyResolver = nullptr;
+  delete mNewBodyPart; mNewBodyPart = nullptr;
 }
 
 void MessageComposer::applyChanges( bool disableCrypto )
 {
   // Do the initial setup
-  if( getenv("KMAIL_DEBUG_COMPOSER_CRYPTO") != 0 ) {
+  if(getenv("KMAIL_DEBUG_COMPOSER_CRYPTO")) {
     TQCString cE = getenv("KMAIL_DEBUG_COMPOSER_CRYPTO");
     mDebugComposerCrypto = cE == "1" || cE.upper() == "ON" || cE.upper() == "TRUE";
     kdDebug(5006) << "KMAIL_DEBUG_COMPOSER_CRYPTO = TRUE" << endl;
@@ -354,7 +354,7 @@ void MessageComposer::applyChanges( bool disableCrypto )
 
 void MessageComposer::doNextJob()
 {
-  delete mCurrentJob; mCurrentJob = 0;
+  delete mCurrentJob; mCurrentJob = nullptr;
 
   if( mJobs.isEmpty() ) {
     // No more jobs. Signal that we're done
@@ -380,7 +380,7 @@ void MessageComposer::emitDone( bool b )
 {
   // Save memory - before sending the mail
   mEncodedBody = TQByteArray();
-  delete mNewBodyPart; mNewBodyPart = 0;
+  delete mNewBodyPart; mNewBodyPart = nullptr;
   mOldBodyPart.clear();
   emit done( b );
 }
@@ -464,7 +464,7 @@ void MessageComposer::readFromComposeWin()
   const KPIM::Identity & id = mComposeWin->identity();
 
   KMFolder *f = mComposeWin->mFcc->getFolder();
-  assert( f != 0 );
+  assert(f);
   if ( f->idString() == id.fcc() )
     mReferenceMessage->removeHeaderField("X-KMail-Fcc");
   else
@@ -1027,7 +1027,7 @@ static inline bool makeMimeObject( Kleo::CryptoMessageFormat f, bool /*signing*/
 static inline const char * toplevelContentType( Kleo::CryptoMessageFormat f, bool signing ) {
   switch ( f ) {
   default:
-  case Kleo::InlineOpenPGPFormat: return 0;
+  case Kleo::InlineOpenPGPFormat: return nullptr;
   case Kleo::OpenPGPMIMEFormat:
     return signing ?
       "multipart/signed;\n\t"
@@ -1067,10 +1067,10 @@ static inline const char * toplevelContentDisposition( Kleo::CryptoMessageFormat
   default:
   case Kleo::InlineOpenPGPFormat:
   case Kleo::OpenPGPMIMEFormat:
-    return 0;
+    return nullptr;
   case Kleo::SMIMEFormat:
     if ( signing )
-      return 0;
+      return nullptr;
   case Kleo::SMIMEOpaqueFormat:
     return "attachment; filename=\"smime.p7m\"";
   }
@@ -1091,7 +1091,7 @@ static inline const char * nestedContentType( Kleo::CryptoMessageFormat f, bool
   default:
   case Kleo::InlineOpenPGPFormat:
   case Kleo::SMIMEOpaqueFormat:
-    return 0;
+    return nullptr;
   }
 }
 
@@ -1100,7 +1100,7 @@ static inline const char * nestedContentDisposition( Kleo::CryptoMessageFormat f
     return "inline; filename=\"msg.asc\"";
   if ( signing && f == Kleo::SMIMEFormat )
     return "attachment; filename=\"smime.p7s\"";
-  return 0;
+  return nullptr;
 }
 
 static inline bool binaryHint( Kleo::CryptoMessageFormat f ) {
@@ -1161,7 +1161,7 @@ public:
     mComposer->encryptMessage( mMsg, mSplitInfo, mDoSign, mDoEncrypt,
                                tmpNewBodyPart, mFormat );
     if ( !mComposer->mRc ) {
-      delete mMsg; mMsg = 0;
+      delete mMsg; mMsg = nullptr;
       return;
     }
     mComposer->mMessageList.push_back( mMsg );
@@ -1200,7 +1200,7 @@ void MessageComposer::composeInlineOpenPGPMessage( KMMessage& theMessage,
     return;
   }
 
-  mNewBodyPart = 0; // unused
+  mNewBodyPart = nullptr; // unused
   mEarlyAddAttachments = false;
   mAllAttachmentsAreInBody = false;
 
@@ -1284,7 +1284,7 @@ void MessageComposer::composeChiasmusMessage( KMMessage& theMessage, Kleo::Crypt
     return;
   }
 
-  mNewBodyPart = 0; // unused
+  mNewBodyPart = nullptr; // unused
   mEarlyAddAttachments = false;
   mAllAttachmentsAreInBody = false;
 
@@ -1453,7 +1453,7 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
     newbody +=                 "\n";
     newbody += textDwPart->AsString().c_str();
     delete textDwPart;
-    textDwPart = 0;
+    textDwPart = nullptr;
 
     KMMessagePart htmlBodyPart;
     htmlBodyPart.setTypeStr("text");
@@ -1472,7 +1472,7 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
     newbody +=                 "\n";
     newbody += htmlDwPart->AsString().c_str();
     delete htmlDwPart;
-    htmlDwPart = 0;
+    htmlDwPart = nullptr;
 
     newbody += "--";
     newbody +=     boundaryCStr;
@@ -1544,7 +1544,7 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
       KMail::Util::insert( bodyData, 0, "--" + mMultipartMixedBoundary + "\n" ); // prepend
     }
     delete innerDwPart;
-    innerDwPart = 0;
+    innerDwPart = nullptr;
     // add all matching Attachments
     // NOTE: This code will be changed when KMime is complete.
     for ( TQValueVector<Attachment>::iterator it = mAttachments.begin() ; it != mAttachments.end() ; ++it ) {
@@ -1554,7 +1554,7 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
         KMail::Util::append( bodyData, TQCString( "\n--" + mMultipartMixedBoundary + "\n" ) );
         KMail::Util::append( bodyData, innerDwPart->AsString().c_str() );
         delete innerDwPart;
-        innerDwPart = 0;
+        innerDwPart = nullptr;
       }
     }
     KMail::Util::append( bodyData, TQCString( "\n--" + mMultipartMixedBoundary + "--\n" ) );
@@ -1588,7 +1588,7 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
     }
     mEncodedBody = KMail::Util::ByteArray( dwPart->AsString() );
     delete dwPart;
-    dwPart = 0;
+    dwPart = nullptr;
 
     // manually add a boundary definition to the Content-Type header
     if( !mMultipartMixedBoundary.isEmpty() ) {
@@ -1696,7 +1696,7 @@ void MessageComposer::encryptMessage( KMMessage* msg,
       dwPart->Assemble();
       innerContent = KMail::Util::ByteArray( dwPart->AsString() );
       delete dwPart;
-      dwPart = 0;
+      dwPart = nullptr;
     } else {
       innerContent = mEncodedBody;
     }
@@ -1792,7 +1792,7 @@ void MessageComposer::addBodyAndAttachments( KMMessage* msg,
       innerDwPart->Assemble();
       TQByteArray encodedAttachment = KMail::Util::ByteArray( innerDwPart->AsString() );
       delete innerDwPart;
-      innerDwPart = 0;
+      innerDwPart = nullptr;
 
       // replace simple LFs by CRLFs for all MIME supporting CryptPlugs
       // according to RfC 2633, 3.1.1 Canonicalization
@@ -1821,7 +1821,7 @@ void MessageComposer::addBodyAndAttachments( KMMessage* msg,
               dwPart->Assemble();
               encodedAttachment = KMail::Util::ByteArray( dwPart->AsString() );
               delete dwPart;
-              dwPart = 0;
+              dwPart = nullptr;
             }
           } else
             KMessageBox::sorry( mComposeWin, mErrorProcessingStructuringInfo );
@@ -1955,7 +1955,7 @@ bool MessageComposer::processStructuringInfo( const TQString bugURL,
 
     DwString mainDwStr;
     mainDwStr = TQCString(mainHeader + "\n\n").data();
-    DwBodyPart mainDwPa( mainDwStr, 0 );
+    DwBodyPart mainDwPa( mainDwStr, nullptr );
     mainDwPa.Parse();
     KMMessage::bodyPart( &mainDwPa, &resultingPart );
     if( !makeMultiMime( format, signing ) ) {
@@ -2064,7 +2064,7 @@ TQCString MessageComposer::plainTextFromMarkup( const TQString& markupText )
   const TQTextCodec *codec = KMMsgBase::codecForName( mCharset );
   if( mCharset == "us-ascii" ) {
     textbody = KMMsgBase::toUsAscii( text );
-  } else if( codec == 0 ) {
+  } else if( !codec ) {
     kdDebug(5006) << "Something is wrong and I can not get a codec." << endl;
     textbody = text.local8Bit();
   } else {
@@ -2095,7 +2095,7 @@ TQByteArray MessageComposer::breakLinesAndApplyCodec()
   if( mCharset == "us-ascii" ) {
     cText = KMMsgBase::toUsAscii( text );
     newText = TQString::fromLatin1( cText );
-  } else if( codec == 0 ) {
+  } else if( !codec ) {
     kdDebug(5006) << "Something is wrong and I can not get a codec." << endl;
     cText = text.local8Bit();
     newText = TQString::fromLocal8Bit( cText );
@@ -2194,7 +2194,7 @@ void MessageComposer::pgpSignedMsg( const TQByteArray& cText, Kleo::CryptoMessag
 
   if ( GlobalSettings::showGnuPGAuditLogAfterSuccessfulSignEncrypt() )
       if ( Kleo::MessageBox::showAuditLogButton( job.get() ) )
-      Kleo::MessageBox::auditLog( 0, job.get(), i18n("GnuPG Audit Log for Signing Operation") );
+      Kleo::MessageBox::auditLog( nullptr, job.get(), i18n("GnuPG Audit Log for Signing Operation") );
 
   mSignature = signature;
   if ( mSignature.isEmpty() ) {
@@ -2248,7 +2248,7 @@ Kpgp::Result MessageComposer::pgpEncryptedMsg( TQByteArray & encryptedBody,
 
   if ( GlobalSettings::showGnuPGAuditLogAfterSuccessfulSignEncrypt() )
       if ( Kleo::MessageBox::showAuditLogButton( job.get() ) )
-      Kleo::MessageBox::auditLog( 0, job.get(), i18n("GnuPG Audit Log for Encryption Operation") );
+      Kleo::MessageBox::auditLog( nullptr, job.get(), i18n("GnuPG Audit Log for Encryption Operation") );
 
   return Kpgp::Ok;
 }
@@ -2299,7 +2299,7 @@ Kpgp::Result MessageComposer::pgpSignedAndEncryptedMsg( TQByteArray & encryptedB
 
   if ( GlobalSettings::showGnuPGAuditLogAfterSuccessfulSignEncrypt() )
       if ( Kleo::MessageBox::showAuditLogButton( job.get() ) )
-      Kleo::MessageBox::auditLog( 0, job.get(), i18n("GnuPG Audit Log for Encryption Operation") );
+      Kleo::MessageBox::auditLog( nullptr, job.get(), i18n("GnuPG Audit Log for Encryption Operation") );
 
   return Kpgp::Ok;
 }
diff --git a/kmail/messagecomposer.h b/kmail/messagecomposer.h
index 241237590..95536477e 100644
--- a/kmail/messagecomposer.h
+++ b/kmail/messagecomposer.h
@@ -72,7 +72,7 @@ class MessageComposer : public TQObject {
 public:
   class KeyResolver;
 
-  MessageComposer( KMComposeWin* win, const char* name=0 );
+  MessageComposer( KMComposeWin* win, const char* name=nullptr );
   ~MessageComposer();
 
   /**
@@ -230,7 +230,7 @@ private:
   TQCString mSignCertFingerprint;
 
   struct Attachment {
-    Attachment( KMMessagePart * p=0, bool s=false, bool e=false )
+    Attachment( KMMessagePart * p=nullptr, bool s=false, bool e=false )
       : part( p ), sign( s ), encrypt( e ) {}
     KMMessagePart * part;
     bool sign;
diff --git a/kmail/messagecopyhelper.cpp b/kmail/messagecopyhelper.cpp
index 4b46141fb..4cc21ae87 100644
--- a/kmail/messagecopyhelper.cpp
+++ b/kmail/messagecopyhelper.cpp
@@ -33,7 +33,7 @@ MessageCopyHelper::MessageCopyHelper( const TQValueList< TQ_UINT32 > & msgs,
   if ( msgs.isEmpty() || !dest )
     return;
 
-  KMFolder *f = 0;
+  KMFolder *f = nullptr;
   int index;
   TQPtrList<KMMsgBase> list;
 
@@ -100,7 +100,7 @@ TQValueList< TQ_UINT32 > MessageCopyHelper::serNumListFromMsgList(TQPtrList< KMM
 
 bool MessageCopyHelper::inReadOnlyFolder(const TQValueList< TQ_UINT32 > & sernums)
 {
-  KMFolder *f = 0;
+  KMFolder *f = nullptr;
   int index;
   for ( TQValueList<TQ_UINT32>::ConstIterator it = sernums.begin(); it != sernums.end(); ++it ) {
     KMMsgDict::instance()->getLocation( *it, &f, &index );
diff --git a/kmail/messagecopyhelper.h b/kmail/messagecopyhelper.h
index a097d4b8a..96511b26d 100644
--- a/kmail/messagecopyhelper.h
+++ b/kmail/messagecopyhelper.h
@@ -51,7 +51,7 @@ class MessageCopyHelper : public TQObject
       @param parent The parent object.
     */
     MessageCopyHelper( const TQValueList<TQ_UINT32> &msgs, KMFolder *dest,
-                       bool move, TQObject *parent = 0 );
+                       bool move, TQObject *parent = nullptr );
 
     /**
       Converts a MailList into a serial number list.
diff --git a/kmail/messageproperty.cpp b/kmail/messageproperty.cpp
index b8b37f915..d31c1e1ef 100644
--- a/kmail/messageproperty.cpp
+++ b/kmail/messageproperty.cpp
@@ -49,7 +49,7 @@ void MessageProperty::setFiltering( TQ_UINT32 serNum, bool filter )
 {
   assert(!filtering(serNum) || !filter);
   if (filter && !filtering(serNum))
-    sFolders.replace(serNum, TQGuardedPtr<KMFolder>(0) );
+    sFolders.replace(serNum, TQGuardedPtr<KMFolder>(nullptr) );
   else if (!filter)
     sFolders.remove(serNum);
 }
@@ -67,7 +67,7 @@ void MessageProperty::setFiltering( const KMMsgBase *msgBase, bool filter )
 KMFolder* MessageProperty::filterFolder( TQ_UINT32 serNum )
 {
   TQMap<TQ_UINT32, TQGuardedPtr<KMFolder> >::const_iterator it = sFolders.find( serNum );
-  return it == sFolders.constEnd() ? 0 : (*it).operator->();
+  return it == sFolders.constEnd() ? nullptr : (*it).operator->();
 }
 
 void MessageProperty::setFilterFolder( TQ_UINT32 serNum, KMFolder* folder )
@@ -88,7 +88,7 @@ void MessageProperty::setFilterFolder( const KMMsgBase *msgBase, KMFolder* folde
 ActionScheduler* MessageProperty::filterHandler( TQ_UINT32 serNum )
 {
   TQMap<TQ_UINT32, TQGuardedPtr<ActionScheduler> >::const_iterator it = sHandlers.find( serNum );
-  return it == sHandlers.constEnd() ? 0 : (*it).operator->();
+  return it == sHandlers.constEnd() ? nullptr : (*it).operator->();
 }
 
 void MessageProperty::setFilterHandler( TQ_UINT32 serNum, ActionScheduler* handler )
diff --git a/kmail/networkaccount.cpp b/kmail/networkaccount.cpp
index 9a5f5e993..1dfaa002b 100644
--- a/kmail/networkaccount.cpp
+++ b/kmail/networkaccount.cpp
@@ -51,7 +51,7 @@ namespace KMail {
 
   NetworkAccount::NetworkAccount( AccountManager * parent, const TQString & name, uint id )
     : KMAccount( parent, name, id ),
-      mSlave( 0 ),
+      mSlave( nullptr ),
       mAuth( "*" ),
       mPort( 0 ),
       mStorePasswd( false ),
@@ -216,7 +216,7 @@ namespace KMail {
       }
       // if wallet is not available, write to config file, since the account
       // manager deletes this group, we need to write it always
-      if ( !passwdStored && ( mStorePasswdInConfig || KMessageBox::warningYesNo( 0,
+      if ( !passwdStored && ( mStorePasswdInConfig || KMessageBox::warningYesNo( nullptr,
            i18n("TDEWallet is not available. It is strongly recommended to use "
                 "TDEWallet for managing your passwords.\n"
                 "However, KMail can store the password in its configuration "
diff --git a/kmail/newfolderdialog.cpp b/kmail/newfolderdialog.cpp
index 862833f0d..68ce496b7 100644
--- a/kmail/newfolderdialog.cpp
+++ b/kmail/newfolderdialog.cpp
@@ -59,9 +59,9 @@ NewFolderDialog::NewFolderDialog( TQWidget* parent, KMFolder *folder )
     : KDialogBase( parent, "new_folder_dialog", false, i18n( "New Folder" ),
                    KDialogBase::Ok|KDialogBase::Cancel,
                    KDialogBase::Ok, true ),
-      mFormatComboBox( 0 ),
-      mContentsComboBox( 0 ),
-      mNamespacesComboBox( 0 ),
+      mFormatComboBox( nullptr ),
+      mContentsComboBox( nullptr ),
+      mNamespacesComboBox( nullptr ),
       mFolder( folder )
 {
   setWFlags( getWFlags() | WDestructiveClose );
@@ -74,7 +74,7 @@ NewFolderDialog::NewFolderDialog( TQWidget* parent, KMFolder *folder )
   mTopLevelLayout = new TQVBoxLayout( privateLayoutWidget, 0, spacingHint(),
                                      "mTopLevelLayout");
 
-  mNameHBox = new TQHBoxLayout( 0, 0, 6, "mNameHBox");
+  mNameHBox = new TQHBoxLayout( nullptr, 0, 6, "mNameHBox");
 
   mNameLabel = new TQLabel( privateLayoutWidget, "mNameLabel" );
   mNameLabel->setText( i18n( "&Name:" ) );
@@ -91,7 +91,7 @@ NewFolderDialog::NewFolderDialog( TQWidget* parent, KMFolder *folder )
   if ( !mFolder ||
       ( mFolder->folderType() != KMFolderTypeImap &&
         mFolder->folderType() != KMFolderTypeCachedImap ) ) {
-    mFormatHBox = new TQHBoxLayout( 0, 0, 6, "mFormatHBox");
+    mFormatHBox = new TQHBoxLayout( nullptr, 0, 6, "mFormatHBox");
     mMailboxFormatLabel = new TQLabel( privateLayoutWidget, "mMailboxFormatLabel" );
     mMailboxFormatLabel->setText( i18n( "Mailbox &format:" ) );
     mFormatHBox->addWidget( mMailboxFormatLabel );
@@ -118,7 +118,7 @@ NewFolderDialog::NewFolderDialog( TQWidget* parent, KMFolder *folder )
   // --- contents -----
   if ( kmkernel->iCalIface().isEnabled() &&
        mFolder && mFolder->folderType() != KMFolderTypeImap ) {
-    mContentsHBox = new TQHBoxLayout( 0, 0, 6, "mContentsHBox");
+    mContentsHBox = new TQHBoxLayout( nullptr, 0, 6, "mContentsHBox");
 
     mContentsLabel = new TQLabel( privateLayoutWidget, "mContentsLabel" );
     mContentsLabel->setText( i18n( "Folder &contains:" ) );
@@ -159,7 +159,7 @@ NewFolderDialog::NewFolderDialog( TQWidget* parent, KMFolder *folder )
       }
     }
     if ( rootFolder && namespaces.count() > 1 ) {
-      mNamespacesHBox = new TQHBoxLayout( 0, 0, 6, "mNamespaceHBox");
+      mNamespacesHBox = new TQHBoxLayout( nullptr, 0, 6, "mNamespaceHBox");
 
       mNamespacesLabel = new TQLabel( privateLayoutWidget, "mNamespacesLabel" );
       mNamespacesLabel->setText( i18n( "Namespace for &folder:" ) );
@@ -172,7 +172,7 @@ NewFolderDialog::NewFolderDialog( TQWidget* parent, KMFolder *folder )
       mNamespacesHBox->addWidget( mNamespacesComboBox );
       mTopLevelLayout->addLayout( mNamespacesHBox );
     } else {
-      mNamespacesComboBox = 0;
+      mNamespacesComboBox = nullptr;
     }
   }
 
diff --git a/kmail/newfolderdialog.h b/kmail/newfolderdialog.h
index b6d0f9298..4bfe8733d 100644
--- a/kmail/newfolderdialog.h
+++ b/kmail/newfolderdialog.h
@@ -50,7 +50,7 @@ class NewFolderDialog : public KDialogBase
   
 
   public:
-    NewFolderDialog( TQWidget* parent = 0, KMFolder *folder = 0 );
+    NewFolderDialog( TQWidget* parent = nullptr, KMFolder *folder = nullptr );
     ~NewFolderDialog() {};
 
     TQLabel* mNameLabel;
diff --git a/kmail/objecttreeparser.cpp b/kmail/objecttreeparser.cpp
index 0ef90d5c9..c5ede4998 100644
--- a/kmail/objecttreeparser.cpp
+++ b/kmail/objecttreeparser.cpp
@@ -125,7 +125,7 @@ namespace KMail {
     const Kleo::CryptoBackend::Protocol * protocol;
   public:
     CryptoProtocolSaver( ObjectTreeParser * _otp, const Kleo::CryptoBackend::Protocol* _w )
-      : otp( _otp ), protocol( _otp ? _otp->cryptoProtocol() : 0 )
+      : otp( _otp ), protocol( _otp ? _otp->cryptoProtocol() : nullptr )
     {
       if ( otp )
         otp->setCryptoProtocol( _w );
@@ -187,7 +187,7 @@ namespace KMail {
                                                      const char* cntDesc,
                                                      bool append, bool addToTextualContent )
   {
-    DwBodyPart* myBody = new DwBodyPart( DwString( content ), 0 );
+    DwBodyPart* myBody = new DwBodyPart( DwString( content ), nullptr );
     myBody->Parse();
 
     if ( ( !myBody->Body().FirstBodyPart() ||
@@ -224,7 +224,7 @@ namespace KMail {
       parentNode->setFirstChild( newNode );
 
     if ( startNode.mimePartTreeItem() ) {
-      newNode->fillMimePartTree( startNode.mimePartTreeItem(), 0,
+      newNode->fillMimePartTree( startNode.mimePartTreeItem(), nullptr,
                                  TQString(), TQString(), TQString(), 0,
                                  append );
     } else {
@@ -487,7 +487,7 @@ namespace KMail {
 
     PartMetaData messagePart;
     messagePart.isSigned = true;
-    messagePart.technicalProblem = ( cryptProto == 0 );
+    messagePart.technicalProblem = !cryptProto;
     messagePart.isGoodSignature = false;
     messagePart.isEncrypted = false;
     messagePart.isDecryptable = false;
@@ -526,7 +526,7 @@ namespace KMail {
         } else if ( m->isRunning() ) {
           messagePart.inProgress = true;
           mHasPendingAsyncJobs = true;
-          m = 0;
+          m = nullptr;
         }
 
         if ( m ) {
@@ -562,7 +562,7 @@ namespace KMail {
         } else if ( m->isRunning() ) {
           messagePart.inProgress = true;
           mHasPendingAsyncJobs = true;
-          m = 0;
+          m = nullptr;
         }
 
         if ( m ) {
@@ -840,7 +840,7 @@ bool ObjectTreeParser::okDecryptMIME( partNode& data,
       Kleo::DecryptVerifyJob * job = cryptProto->decryptVerifyJob();
       if ( !job ) {
         cryptPlugError = CANT_DECRYPT;
-        cryptProto = 0;
+        cryptProto = nullptr;
       } else {
         DecryptVerifyBodyPartMemento * newM
           = new DecryptVerifyBodyPartMemento( job, cryptProto->keyListJob(), ciphertext );
@@ -860,7 +860,7 @@ bool ObjectTreeParser::okDecryptMIME( partNode& data,
     } else if ( m->isRunning() ) {
       decryptionStarted = true;
       mHasPendingAsyncJobs = true;
-      m = 0;
+      m = nullptr;
     }
 
     if ( m ) {
@@ -1324,7 +1324,7 @@ namespace KMail {
     // by all implementaions of security multiparts
 
     const TQString contentType = node->contentTypeParameter( "protocol" ).lower();
-    const Kleo::CryptoBackend::Protocol *protocol = 0;
+    const Kleo::CryptoBackend::Protocol *protocol = nullptr;
     if ( contentType == "application/pkcs7-signature" || contentType == "application/x-pkcs7-signature" )
       protocol = Kleo::CryptoBackendFactory::instance()->smime();
     else if ( contentType == "application/pgp-signature" || contentType == "application/x-pgp-signature" )
@@ -1359,7 +1359,7 @@ namespace KMail {
       return true;
     }
 
-    const Kleo::CryptoBackend::Protocol * useThisCryptProto = 0;
+    const Kleo::CryptoBackend::Protocol * useThisCryptProto = nullptr;
 
     /*
       ATTENTION: This code is to be replaced by the new 'auto-detect' feature. --------------------------------------
@@ -1453,7 +1453,7 @@ namespace KMail {
       // MUA 'should' have sent.  :-D       (khz, 12.09.2002)
       //
       if ( signatureFound ) {
-        writeOpaqueOrMultipartSignedData( 0,
+        writeOpaqueOrMultipartSignedData( nullptr,
                                           *node,
                                           node->trueFromAddress(),
                                           false,
@@ -1733,7 +1733,7 @@ namespace KMail {
     // Analyze "signTestNode" node to find/verify a signature.
     // If zero this verification was successfully done after
     // decrypting via recursion by insertAndParseNewChildNode().
-    partNode* signTestNode = isEncrypted ? 0 : node;
+    partNode* signTestNode = isEncrypted ? nullptr : node;
 
 
     // We try decrypting the content
@@ -1760,7 +1760,7 @@ namespace KMail {
       if ( mReader && !mReader->decryptMessage() ) {
         writeDeferredDecryptionBlock();
         isEncrypted = true;
-        signTestNode = 0; // PENDING(marc) to be abs. sure, we'd need to have to look at the content
+        signTestNode = nullptr; // PENDING(marc) to be abs. sure, we'd need to have to look at the content
       } else {
         const bool bOkDecrypt = okDecryptMIME( *node,
                           decryptedData,
@@ -1782,7 +1782,7 @@ namespace KMail {
           //kdDebug(5006) << "pkcs7 mime  -  encryption found  -  enveloped (encrypted) data !" << endl;
           isEncrypted = true;
           node->setEncryptionState( KMMsgFullyEncrypted );
-          signTestNode = 0;
+          signTestNode = nullptr;
           // paint the frame
           messagePart.isDecryptable = true;
           if ( mReader )
@@ -1801,7 +1801,7 @@ namespace KMail {
           // assuming it's signed
           if ( passphraseError || ( smimeType.isEmpty() && actuallyEncrypted ) ) {
             isEncrypted = true;
-            signTestNode = 0;
+            signTestNode = nullptr;
           }
 
           if ( isEncrypted ) {
@@ -1834,7 +1834,7 @@ namespace KMail {
         //kdDebug(5006) << "pkcs7 mime  -  type unknown  -  opaque signed data ?" << endl;
       }
 
-      bool sigFound = writeOpaqueOrMultipartSignedData( 0,
+      bool sigFound = writeOpaqueOrMultipartSignedData( nullptr,
                                                         *signTestNode,
                                                         node->trueFromAddress(),
                                                         true,
@@ -1953,7 +1953,7 @@ bool ObjectTreeParser::processApplicationChiasmusTextSubtype( partNode * curNode
   messagePart.errorText = errorText;
   if ( mReader )
     htmlWriter()->queue( writeSigstatHeader( messagePart,
-                                             0, //cryptPlugWrapper(),
+                                             nullptr, //cryptPlugWrapper(),
                                              curNode->trueFromAddress() ) );
   const TQByteArray body = bOkDecrypt ? decryptedBody : data;
   const TQString chiasmusCharset = curNode->contentTypeParameter("chiasmus-charset");
@@ -2804,7 +2804,7 @@ void ObjectTreeParser::writeBodyStr( const TQCString& aStr, const TQTextCodec *a
 {
   bool goodSignature = false;
   Kpgp::Module* pgp = Kpgp::Module::getKpgp();
-  assert(pgp != 0);
+  assert(pgp);
   bool isPgpMessage = false; // true if the message contains at least one
                              // PGP MESSAGE or one PGP SIGNED MESSAGE block
   TQString dir = ( TQApplication::reverseLayout() ? "rtl" : "ltr" );
@@ -2830,7 +2830,7 @@ void ObjectTreeParser::writeBodyStr( const TQCString& aStr, const TQTextCodec *a
       TQStrListIterator npbit( nonPgpBlocks );
 
       TQString htmlStr;
-      for( ; *pbit != 0; ++pbit, ++npbit )
+      for( ; *pbit ; ++pbit, ++npbit )
       {
           // insert the next Non-OpenPGP block
           TQCString str( *npbit );
@@ -2923,7 +2923,7 @@ void ObjectTreeParser::writeBodyStr( const TQCString& aStr, const TQTextCodec *a
               messagePart.keyId = keyId;
               messagePart.keyTrust = keyTrust;
 
-              htmlStr += writeSigstatHeader( messagePart, 0, fromAddress );
+              htmlStr += writeSigstatHeader( messagePart, nullptr, fromAddress );
 
               htmlStr += quotedHTML( aCodec->toUnicode( block->text() ), decorate );
               htmlStr += writeSigstatFooter( messagePart );
diff --git a/kmail/objecttreeparser.h b/kmail/objecttreeparser.h
index 9487de87b..3de025495 100644
--- a/kmail/objecttreeparser.h
+++ b/kmail/objecttreeparser.h
@@ -109,12 +109,12 @@ namespace KMail {
     /** Internal. Copies the context of @p other, but not it's rawReplyString() */
     ObjectTreeParser( const ObjectTreeParser & other );
   public:
-    ObjectTreeParser( KMReaderWin * reader=0, const Kleo::CryptoBackend::Protocol * protocol=0,
+    ObjectTreeParser( KMReaderWin * reader=nullptr, const Kleo::CryptoBackend::Protocol * protocol=nullptr,
                       bool showOneMimePart=false, bool keepEncryptions=false,
                       bool includeSignatures=true,
-                      const KMail::AttachmentStrategy * attachmentStrategy=0,
-                      KMail::HtmlWriter * htmlWriter=0,
-                      KMail::CSSHelper * cssHelper=0 );
+                      const KMail::AttachmentStrategy * attachmentStrategy=nullptr,
+                      KMail::HtmlWriter * htmlWriter=nullptr,
+                      KMail::CSSHelper * cssHelper=nullptr );
     virtual ~ObjectTreeParser();
 
     void setAllowAsync( bool allow ) { assert( !mHasPendingAsyncJobs ); mAllowAsync = allow; }
@@ -215,7 +215,7 @@ namespace KMail {
                                            const TQString & fromAddress,
                                            bool doCheck=true,
                                            bool hideErrors=false,
-                                           TQCString * cleartextData=0,
+                                           TQCString * cleartextData=nullptr,
                                            const std::vector<GpgME::Signature> & paramSignatures = std::vector<GpgME::Signature>(),
                                            const GpgME::Key & paramKey = GpgME::Key() );
 
@@ -297,7 +297,7 @@ namespace KMail {
     TQString writeSigstatHeader( KMail::PartMetaData & part,
                                 const Kleo::CryptoBackend::Protocol * cryptProto,
                                 const TQString & fromAddress,
-                                partNode *node = 0 );
+                                partNode *node = nullptr );
     TQString writeSigstatFooter( KMail::PartMetaData & part );
 
     // The attachment mark is a div that is placed around the attchment. It is used for drawing
diff --git a/kmail/objecttreeparser_p.cpp b/kmail/objecttreeparser_p.cpp
index ce7afb108..e2a499128 100644
--- a/kmail/objecttreeparser_p.cpp
+++ b/kmail/objecttreeparser_p.cpp
@@ -51,7 +51,7 @@ using namespace Kleo;
 using namespace GpgME;
 
 CryptoBodyPartMemento::CryptoBodyPartMemento()
-  : TQObject( 0 ),
+  : TQObject( nullptr ),
     Interface::BodyPartMemento(),
     ISubject(),
     m_running( false )
@@ -99,7 +99,7 @@ bool GenericVerifyMemento::startKeyListJob()
 void GenericVerifyMemento::destroyKeyListJob() {
   if ( m_keylistjob )
     m_keylistjob->deleteLater();
-  m_keylistjob = 0;
+  m_keylistjob = nullptr;
 }
 
 bool GenericVerifyMemento::canStartKeyListJob() const {
@@ -116,7 +116,7 @@ void GenericVerifyMemento::slotNextKey( const GpgME::Key & key )
 
 void GenericVerifyMemento::slotKeyListJobDone()
 {
-  m_keylistjob = 0;
+  m_keylistjob = nullptr;
   setRunning( false );
   notify();
 }
@@ -167,7 +167,7 @@ void DecryptVerifyBodyPartMemento::exec() {
   const std::pair<DecryptionResult,VerificationResult> p = m_job->exec( m_cipherText, plainText );
   saveResult( p.first, p.second, plainText );
   m_job->deleteLater(); // exec'ed jobs don't delete themselves
-  m_job = 0;
+  m_job = nullptr;
   execKeyListJob();
   setRunning( false );
 }
@@ -190,7 +190,7 @@ void DecryptVerifyBodyPartMemento::slotResult( const DecryptionResult & dr,
 {
   saveResult( dr, vr, plainText );
   setRunning( false );
-  m_job = 0;
+  m_job = nullptr;
   if ( startKeyListJob() )
     return;
   destroyKeyListJob();
@@ -233,7 +233,7 @@ void VerifyDetachedBodyPartMemento::exec() {
   setRunning( true );
   saveResult( m_job->exec( m_signature, m_plainText ) );
   m_job->deleteLater(); // exec'ed jobs don't delete themselves
-  m_job = 0;
+  m_job = nullptr;
   execKeyListJob();
   setRunning( false );
 }
@@ -248,7 +248,7 @@ void VerifyDetachedBodyPartMemento::saveResult( const VerificationResult & vr )
 void VerifyDetachedBodyPartMemento::slotResult( const VerificationResult & vr )
 {
   saveResult( vr );
-  m_job = 0;
+  m_job = nullptr;
   if ( startKeyListJob() )
     return;
   destroyKeyListJob();
@@ -289,7 +289,7 @@ void VerifyOpaqueBodyPartMemento::exec() {
   TQByteArray plainText;
   saveResult( m_job->exec( m_signature, plainText ), plainText );
   m_job->deleteLater(); // exec'ed jobs don't delete themselves
-  m_job = 0;
+  m_job = nullptr;
   execKeyListJob();
   setRunning( false );
 }
@@ -307,7 +307,7 @@ void VerifyOpaqueBodyPartMemento::slotResult( const VerificationResult & vr,
                                               const TQByteArray & plainText )
 {
   saveResult( vr, plainText );
-  m_job = 0;
+  m_job = nullptr;
   if ( startKeyListJob() )
     return;
   destroyKeyListJob();
diff --git a/kmail/objecttreeparser_p.h b/kmail/objecttreeparser_p.h
index 6c338ea46..059f5ce27 100644
--- a/kmail/objecttreeparser_p.h
+++ b/kmail/objecttreeparser_p.h
@@ -66,7 +66,7 @@ namespace KMail {
     CryptoBodyPartMemento();
     ~CryptoBodyPartMemento();
 
-    /* reimp */ Interface::Observer   * asObserver()   { return 0;    }
+    /* reimp */ Interface::Observer   * asObserver()   { return nullptr;    }
     /* reimp */ Interface::Observable * asObservable() { return this; }
 
     bool isRunning() const { return m_running; }
diff --git a/kmail/partNode.cpp b/kmail/partNode.cpp
index 31b94d68d..8428d0ef6 100644
--- a/kmail/partNode.cpp
+++ b/kmail/partNode.cpp
@@ -55,9 +55,9 @@
 */
 
 partNode::partNode()
-  : mRoot( 0 ), mNext( 0 ), mChild( 0 ),
+  : mRoot( nullptr ), mNext( nullptr ), mChild( nullptr ),
     mWasProcessed( false ),
-    mDwPart( 0 ),
+    mDwPart( nullptr ),
     mType( DwMime::kTypeUnknown ),
     mSubType( DwMime::kSubtypeUnknown ),
     mEncryptionState( KMMsgNotEncrypted ),
@@ -65,9 +65,9 @@ partNode::partNode()
     mMsgPartOk( false ),
     mEncodedOk( false ),
     mDeleteDwBodyPart( false ),
-    mMimePartTreeItem( 0 ),
+    mMimePartTreeItem( nullptr ),
     mBodyPartMementoMap(),
-    mReader( 0 ),
+    mReader( nullptr ),
     mDisplayedEmbedded( false )
 {
   adjustDefaultType( this );
@@ -75,7 +75,7 @@ partNode::partNode()
 
 partNode::partNode( KMReaderWin * win, DwBodyPart* dwPart, int explicitType, int explicitSubType,
 		    bool deleteDwBodyPart )
-  : mRoot( 0 ), mNext( 0 ), mChild( 0 ),
+  : mRoot( nullptr ), mNext( nullptr ), mChild( nullptr ),
     mWasProcessed( false ),
     mDwPart( dwPart ),
     mEncryptionState( KMMsgNotEncrypted ),
@@ -83,7 +83,7 @@ partNode::partNode( KMReaderWin * win, DwBodyPart* dwPart, int explicitType, int
     mMsgPartOk( false ),
     mEncodedOk( false ),
     mDeleteDwBodyPart( deleteDwBodyPart ),
-    mMimePartTreeItem( 0 ),
+    mMimePartTreeItem( nullptr ),
     mBodyPartMementoMap(),
     mReader( win ),
     mDisplayedEmbedded( false ),
@@ -105,7 +105,7 @@ partNode::partNode( KMReaderWin * win, DwBodyPart* dwPart, int explicitType, int
 
 partNode * partNode::fromMessage( const KMMessage * msg, KMReaderWin * win ) {
   if ( !msg )
-    return 0;
+    return nullptr;
 
   int mainType    = msg->type();
   int mainSubType = msg->subtype();
@@ -131,7 +131,7 @@ partNode * partNode::fromMessage( const KMMessage * msg, KMReaderWin * win ) {
 }
 
 partNode::partNode( bool deleteDwBodyPart, DwBodyPart* dwPart )
-  : mRoot( 0 ), mNext( 0 ), mChild( 0 ),
+  : mRoot( nullptr ), mNext( nullptr ), mChild( nullptr ),
     mWasProcessed( false ),
     mDwPart( dwPart ),
     mEncryptionState( KMMsgNotEncrypted ),
@@ -139,9 +139,9 @@ partNode::partNode( bool deleteDwBodyPart, DwBodyPart* dwPart )
     mMsgPartOk( false ),
     mEncodedOk( false ),
     mDeleteDwBodyPart( deleteDwBodyPart ),
-    mMimePartTreeItem( 0 ),
+    mMimePartTreeItem( nullptr ),
     mBodyPartMementoMap(),
-    mReader( 0 ),
+    mReader( nullptr ),
     mDisplayedEmbedded( false )
 {
   if ( dwPart && dwPart->hasHeaders() && dwPart->Headers().HasContentType() ) {
@@ -156,9 +156,9 @@ partNode::partNode( bool deleteDwBodyPart, DwBodyPart* dwPart )
 partNode::~partNode() {
   if( mDeleteDwBodyPart )
     delete mDwPart;
-  mDwPart = 0;
-  delete mChild; mChild = 0;
-  delete mNext; mNext = 0;
+  mDwPart = nullptr;
+  delete mChild; mChild = nullptr;
+  delete mNext; mNext = nullptr;
   for ( std::map<TQCString,KMail::Interface::BodyPartMemento*>::const_iterator it = mBodyPartMementoMap.begin(), end = mBodyPartMementoMap.end() ; it != end ; ++it )
       delete it->second;
   mBodyPartMementoMap.clear();
@@ -185,7 +185,7 @@ const TQCString & partNode::encodedBody() {
   if ( mDwPart )
     mEncodedBody = KMail::Util::CString( mDwPart->Body().AsString() );
   else
-    mEncodedBody = 0;
+    mEncodedBody = nullptr;
   mEncodedOk = true;
   return mEncodedBody;
 }
@@ -217,7 +217,7 @@ void partNode::buildObjectTree( bool processSiblings )
             curNode->setNext( nextNode );
             curNode = nextNode;
         } else
-            curNode = 0;
+            curNode = nullptr;
     }
 }
 
@@ -377,7 +377,7 @@ int partNode::nodeId() const
     partNode* rootNode = const_cast<partNode*>( this );
     while( rootNode->mRoot )
         rootNode = rootNode->mRoot;
-    return rootNode->calcNodeIdOrFindNode( curId, this, 0, 0 );
+    return rootNode->calcNodeIdOrFindNode( curId, this, 0, nullptr );
 }
 
 
@@ -388,7 +388,7 @@ partNode* partNode::findId( int id )
     while( rootNode->mRoot )
         rootNode = rootNode->mRoot;
     partNode* foundNode;
-    rootNode->calcNodeIdOrFindNode( curId, 0, id, &foundNode );
+    rootNode->calcNodeIdOrFindNode( curId, nullptr, id, &foundNode );
     return foundNode;
 }
 
@@ -415,7 +415,7 @@ int partNode::calcNodeIdOrFindNode( int &curId, const partNode* findNode, int fi
         return mNext->calcNodeIdOrFindNode( curId, findNode, findId, foundNode );
 
     if(  foundNode )
-        *foundNode = 0;
+        *foundNode = nullptr;
     return -1;
 }
 
@@ -432,12 +432,12 @@ partNode* partNode::findType( int type, int subType, bool deep, bool wide )
         return mChild->findType( type, subType, deep, wide );
     if ( mNext && wide )
         return mNext->findType(  type, subType, deep, wide );
-    return 0;
+    return nullptr;
 }
 
 partNode* partNode::findNodeForDwPart( DwBodyPart* part )
 {
-    partNode* found = 0;
+    partNode* found = nullptr;
     if( kasciistricmp( dwPart()->partId(), part->partId() ) == 0 )
         return this;
     if( mChild )
@@ -459,7 +459,7 @@ partNode* partNode::findTypeNot( int type, int subType, bool deep, bool wide )
         return mChild->findTypeNot( type, subType, deep, wide );
     if ( mNext && wide )
         return mNext->findTypeNot(  type, subType, deep, wide );
-    return 0;
+    return nullptr;
 }
 
 void partNode::fillMimePartTree( KMMimePartTreeItem* parentItem,
@@ -481,7 +481,7 @@ void partNode::fillMimePartTree( KMMimePartTreeItem* parentItem,
     TDEIO::filesize_t cntSize = 0;
 
     if( labelDescr.isEmpty() ) {
-        DwHeaders* headers = 0;
+        DwHeaders* headers = nullptr;
         if( mDwPart && mDwPart->hasHeaders() )
           headers = &mDwPart->Headers();
         if( headers && headers->HasSubject() )
@@ -534,7 +534,7 @@ void partNode::fillMimePartTree( KMMimePartTreeItem* parentItem,
                                                   cntSize );
     mMimePartTreeItem->setOpen( true );
     if( mChild )
-        mChild->fillMimePartTree( mMimePartTreeItem, 0,
+        mChild->fillMimePartTree( mMimePartTreeItem, nullptr,
                                   TQString(), TQString(), TQString(), 0,
                                   revertOrder );
 
@@ -597,7 +597,7 @@ partNode * partNode::next( bool allowChildren ) const {
   for ( partNode * p = parentNode() ; p ; p = p->parentNode() )
     if ( partNode * s = p->nextSibling() )
       return s;
-  return 0;
+  return nullptr;
 }
 
 bool partNode::isFirstTextPart() const {
@@ -693,7 +693,7 @@ KMail::Interface::BodyPartMemento * partNode::internalBodyPartMemento( const TQC
     assert( !reader() );
 
     const std::map<TQCString,KMail::Interface::BodyPartMemento*>::const_iterator it = mBodyPartMementoMap.find( which.lower() );
-    return it != mBodyPartMementoMap.end() ? it->second : 0 ;
+    return it != mBodyPartMementoMap.end() ? it->second : nullptr ;
 }
 
 void partNode::setBodyPartMemento( const TQCString & which, KMail::Interface::BodyPartMemento * memento )
diff --git a/kmail/partNode.h b/kmail/partNode.h
index 918f3f31b..c4e6d6d4e 100644
--- a/kmail/partNode.h
+++ b/kmail/partNode.h
@@ -85,7 +85,7 @@ public:
       bool displayInHeader;
     };
 
-    static partNode * fromMessage( const KMMessage * msg, KMReaderWin * win=0 );
+    static partNode * fromMessage( const KMMessage * msg, KMReaderWin * win=nullptr );
 
     partNode( bool deleteDwBodyPart,
               DwBodyPart* dwPart );
@@ -276,7 +276,7 @@ public:
 
 private:
     KMReaderWin * reader() const {
-        return mReader ? mReader : mRoot ? mRoot->reader() : 0 ;
+        return mReader ? mReader : mRoot ? mRoot->reader() : nullptr ;
     }
     KMail::Interface::BodyPartMemento * internalBodyPartMemento( const TQCString & ) const;
     void internalSetBodyPartMemento( const TQCString & which, KMail::Interface::BodyPartMemento * memento );
diff --git a/kmail/partnodebodypart.h b/kmail/partnodebodypart.h
index 6ce17615f..1fe62144c 100644
--- a/kmail/partnodebodypart.h
+++ b/kmail/partnodebodypart.h
@@ -47,7 +47,7 @@ namespace KMail {
   */
   class PartNodeBodyPart : public Interface::BodyPart {
   public:
-    PartNodeBodyPart( partNode & n, const TQTextCodec * codec=0 );
+    PartNodeBodyPart( partNode & n, const TQTextCodec * codec=nullptr );
 
     TQString makeLink( const TQString & path ) const;
     TQString asText() const;
diff --git a/kmail/popaccount.cpp b/kmail/popaccount.cpp
index d03347124..15d7b8c72 100644
--- a/kmail/popaccount.cpp
+++ b/kmail/popaccount.cpp
@@ -56,15 +56,15 @@ namespace KMail {
 PopAccount::PopAccount(AccountManager* aOwner, const TQString& aAccountName, uint id)
   : NetworkAccount(aOwner, aAccountName, id),
     headerIt(headersOnServer),
-    processMsgsTimer( 0, "processMsgsTimer" )
+    processMsgsTimer( nullptr, "processMsgsTimer" )
 {
   init();
-  job = 0;
-  mSlave = 0;
+  job = nullptr;
+  mSlave = nullptr;
   mPort = defaultPort();
   stage = Idle;
   indexOfCurrentMsg = -1;
-  curMsgStrm = 0;
+  curMsgStrm = nullptr;
   processingDelay = 2*100;
   mProcessing = false;
   dataCounter = 0;
@@ -96,7 +96,7 @@ PopAccount::~PopAccount()
     // set mMailCheckProgressItem = 0 before calling setComplete() to prevent
     // a race condition
     ProgressItem *savedMailCheckProgressItem = mMailCheckProgressItem;
-    mMailCheckProgressItem = 0;
+    mMailCheckProgressItem = nullptr;
     savedMailCheckProgressItem->setComplete(); // that will delete it
   }
 }
@@ -341,7 +341,7 @@ void PopAccount::slotProcessPendingMsgs()
     else {
       idsOfMsgsToDelete.append( *curId );
       mUidsOfNextSeenMsgsDict.insert( *curUid, (const int *)1 );
-      mTimeOfNextSeenMsgsMap.insert( *curUid, time(0) );
+      mTimeOfNextSeenMsgsMap.insert( *curUid, time(nullptr) );
     }
     ++cur;
     ++curId;
@@ -364,8 +364,8 @@ void PopAccount::slotAbortRequested()
                 this, TQ_SLOT( slotAbortRequested() ) );
   stage = Quit;
   if (job) job->kill();
-  job = 0;
-  mSlave = 0;
+  job = nullptr;
+  mSlave = nullptr;
   slotCancel();
 }
 
@@ -376,7 +376,7 @@ void PopAccount::startJob()
   // Run the precommand
   if (!runPrecommand(precommand()))
     {
-      KMessageBox::sorry(0,
+      KMessageBox::sorry(nullptr,
                          i18n("Could not execute precommand: %1").arg(precommand()),
                          i18n("KMail Error Message"));
       checkDone( false, CheckError );
@@ -387,7 +387,7 @@ void PopAccount::startJob()
   KURL url = getUrl();
 
   if ( !url.isValid() ) {
-    KMessageBox::error(0, i18n("Source URL is malformed"),
+    KMessageBox::error(nullptr, i18n("Source URL is malformed"),
                           i18n("Kioslave Error Message") );
     return;
   }
@@ -420,7 +420,7 @@ void PopAccount::startJob()
   mSlave = TDEIO::Scheduler::getConnectedSlave( url, slaveConfig() );
   if (!mSlave)
   {
-    slotSlaveError(0, TDEIO::ERR_CANNOT_LAUNCH_PROCESS, url.protocol());
+    slotSlaveError(nullptr, TDEIO::ERR_CANNOT_LAUNCH_PROCESS, url.protocol());
     return;
   }
   url.setPath(TQString("/index"));
@@ -499,7 +499,7 @@ void PopAccount::slotJobFinished() {
 
     if ( mLeaveOnServer && mUidForIdMap.isEmpty() &&
         mUidsOfNextSeenMsgsDict.isEmpty() && !idsOfMsgs.isEmpty() ) {
-      KMessageBox::sorry(0, i18n("Your POP3 server (Account: %1) does not support "
+      KMessageBox::sorry(nullptr, i18n("Your POP3 server (Account: %1) does not support "
       "the UIDL command: this command is required to determine, in a reliable way, "
       "which of the mails on the server KMail has already seen before;\n"
       "the feature to leave the mails on the server will therefore not "
@@ -641,7 +641,7 @@ void PopAccount::slotJobFinished() {
                                           (const int *)1 );
           idsOfMsgsToDelete.append(headersOnServer.current()->id());
           mTimeOfNextSeenMsgsMap.insert( headersOnServer.current()->uid(),
-                                          time(0) );
+                                          time(nullptr) );
         }
         else {
           mHeaderLaterUids.insert(headersOnServer.current()->uid(), true);
@@ -690,7 +690,7 @@ void PopAccount::slotJobFinished() {
         idsOfMsgsToDelete.clear();
       // Delete old messages
       else if ( mLeaveOnServerDays > 0 && !mTimeOfNextSeenMsgsMap.isEmpty() ) {
-        time_t timeLimit = time(0) - (86400 * mLeaveOnServerDays);
+        time_t timeLimit = time(nullptr) - (86400 * mLeaveOnServerDays);
         kdDebug() << "timeLimit is " << timeLimit << endl;
         TQStringList::Iterator cur = idsOfMsgsToDelete.begin();
         for ( ; cur != idsOfMsgsToDelete.end(); ++cur) {
@@ -798,9 +798,9 @@ void PopAccount::slotJobFinished() {
   else if (stage == Quit) {
     kdDebug(5006) << k_funcinfo << "stage == Quit" << endl;
     saveUidList();
-    job = 0;
+    job = nullptr;
     if (mSlave) TDEIO::Scheduler::disconnectSlave(mSlave);
-    mSlave = 0;
+    mSlave = nullptr;
     stage = Idle;
     if( mMailCheckProgressItem ) { // do this only once...
       bool canceled = !kmkernel || kmkernel->mailCheckAborted() || mMailCheckProgressItem->canceled();
@@ -810,7 +810,7 @@ void PopAccount::slotJobFinished() {
       // set mMailCheckProgressItem = 0 before calling setComplete() to prevent
       // a race condition
       ProgressItem *savedMailCheckProgressItem = mMailCheckProgressItem;
-      mMailCheckProgressItem = 0;
+      mMailCheckProgressItem = nullptr;
       savedMailCheckProgressItem->setComplete(); // that will delete it
       checkDone( ( numMessages > 0 ), canceled ? CheckAborted : CheckOK );
     }
@@ -866,7 +866,7 @@ void PopAccount::slotGetNextMsg()
   numMsgBytesRead = 0;
   curMsgLen = 0;
   delete curMsgStrm;
-  curMsgStrm = 0;
+  curMsgStrm = nullptr;
 
   if ( next != mMsgsPendingDownload.end() ) {
     // get the next message
@@ -951,9 +951,9 @@ void PopAccount::slotData( TDEIO::Job* job, const TQByteArray &data)
     else {
       stage = Idle;
       if ( job ) job->kill();
-      job = 0;
-      mSlave = 0;
-      KMessageBox::error( 0, i18n( "Unable to complete LIST operation." ),
+      job = nullptr;
+      mSlave = nullptr;
+      KMessageBox::error( nullptr, i18n( "Unable to complete LIST operation." ),
                              i18n( "Invalid Response From Server") );
       return;
     }
@@ -996,7 +996,7 @@ void PopAccount::slotData( TDEIO::Job* job, const TQByteArray &data)
     int *size = new int; //malloc(size_of(int));
     *size = mMsgsPendingDownload[id];
     mSizeOfNextSeenMsgsDict.insert( uid, size );
-    if ( mUidsOfSeenMsgsDict.find( uid ) != 0 ) {
+    if (mUidsOfSeenMsgsDict.find( uid )) {
       if ( mMsgsPendingDownload.contains( id ) ) {
         mMsgsPendingDownload.remove( id );
       }
@@ -1005,7 +1005,7 @@ void PopAccount::slotData( TDEIO::Job* job, const TQByteArray &data)
       idsOfMsgsToDelete.append( id );
       mUidsOfNextSeenMsgsDict.insert( uid, (const int *)1 );
       if ( mTimeOfSeenMsgsVector.empty() ) {
-        mTimeOfNextSeenMsgsMap.insert( uid, time(0) );
+        mTimeOfNextSeenMsgsMap.insert( uid, time(nullptr) );
       }
       else {
         // cast the int* with a long to can convert it to a int, BTW
@@ -1030,7 +1030,7 @@ void PopAccount::slotResult( TDEIO::Job* )
       }
       if (stage == Head && job->error() == TDEIO::ERR_COULD_NOT_READ)
       {
-        KMessageBox::error(0, i18n("Your server does not support the "
+        KMessageBox::error(nullptr, i18n("Your server does not support the "
           "TOP command. Therefore it is not possible to fetch the headers "
           "of large emails first, before downloading them."));
         slotCancel();
@@ -1052,12 +1052,12 @@ void PopAccount::slotSlaveError(TDEIO::Slave *aSlave, int error,
   const TQString &errorMsg)
 {
   if (aSlave != mSlave) return;
-  if (error == TDEIO::ERR_SLAVE_DIED) mSlave = 0;
+  if (error == TDEIO::ERR_SLAVE_DIED) mSlave = nullptr;
 
   // explicitely disconnect the slave if the connection went down
   if ( error == TDEIO::ERR_CONNECTION_BROKEN && mSlave ) {
     TDEIO::Scheduler::disconnectSlave( mSlave );
-    mSlave = 0;
+    mSlave = nullptr;
   }
 
   if (interactive && kmkernel) {
@@ -1080,7 +1080,7 @@ void PopAccount::slotGetNextHdr(){
 
   curMsgData.resize(0);
   delete curMsgStrm;
-  curMsgStrm = 0;
+  curMsgStrm = nullptr;
 
   curMsgStrm = new TQDataStream( curMsgData, IO_WriteOnly );
 }
diff --git a/kmail/recipientseditor.cpp b/kmail/recipientseditor.cpp
index 4525bb970..75c655ce0 100644
--- a/kmail/recipientseditor.cpp
+++ b/kmail/recipientseditor.cpp
@@ -321,7 +321,7 @@ void RecipientLine::setRemoveLineButtonEnabled( bool b )
 // ------------ RecipientsView ---------------------
 
 RecipientsView::RecipientsView( TQWidget *parent )
-  : TQScrollView( parent ), mCurDelLine( 0 ),
+  : TQScrollView( parent ), mCurDelLine( nullptr ),
     mLineHeight( 0 ), mFirstColumnWidth( 0 ),
     mModified( false )
 {
@@ -348,7 +348,7 @@ RecipientLine *RecipientsView::emptyLine()
     if ( line->isEmpty() ) return line;
   }
 
-  return 0;
+  return nullptr;
 }
 
 RecipientLine *RecipientsView::addLine()
@@ -749,7 +749,7 @@ void RecipientsToolTip::maybeTip( const TQPoint & p )
 
 
 SideWidget::SideWidget( RecipientsView *view, TQWidget *parent )
-  : TQWidget( parent ), mView( view ), mRecipientPicker( 0 )
+  : TQWidget( parent ), mView( view ), mRecipientPicker( nullptr )
 {
   TQBoxLayout *topLayout = new TQVBoxLayout( this );
 
diff --git a/kmail/recipientspicker.cpp b/kmail/recipientspicker.cpp
index 24679d8e8..ca10108c7 100644
--- a/kmail/recipientspicker.cpp
+++ b/kmail/recipientspicker.cpp
@@ -302,7 +302,7 @@ RecipientItem * RecipientsCollection::getEquivalentItem( RecipientItem *item) co
   TQMap<TQString, RecipientItem *>::ConstIterator it;
   it = mKeyMap.find( item->key() );
   if ( it == mKeyMap.end() )
-    return 0;
+    return nullptr;
   return (*it);
 }
 
@@ -345,7 +345,7 @@ RecipientsPicker::RecipientsPicker( TQWidget *parent )
 #ifndef TDEPIM_NEW_DISTRLISTS
     , mDistributionListManager( 0 )
 #endif
-    ,mLdapSearchDialog( 0 )
+    ,mLdapSearchDialog( nullptr )
 {
 //  KWin::setType( winId(), NET::TQt::Dock );
 
@@ -631,7 +631,7 @@ void RecipientsPicker::setRecipients( const Recipient::List &recipients )
 
   Recipient::List::ConstIterator it;
   for( it = recipients.begin(); it != recipients.end(); ++it ) {
-    RecipientItem *item = 0;
+    RecipientItem *item = nullptr;
 
     // if recipient is a distribution list, create
     // a detached copy.
diff --git a/kmail/redirectdialog.h b/kmail/redirectdialog.h
index 7b0b26012..19a7564c0 100644
--- a/kmail/redirectdialog.h
+++ b/kmail/redirectdialog.h
@@ -60,7 +60,7 @@ namespace KMail {
         @param immediate True, if the Send Now button should be default
                          or false if the Queue button should be default
       */
-      RedirectDialog( TQWidget *parent=0, const char *name=0,
+      RedirectDialog( TQWidget *parent=nullptr, const char *name=nullptr,
                       bool modal=false, bool immediate=true );
 
       /** Return the addresses for the redirection */
diff --git a/kmail/regexplineedit.cpp b/kmail/regexplineedit.cpp
index e99528a98..15ce31fa2 100644
--- a/kmail/regexplineedit.cpp
+++ b/kmail/regexplineedit.cpp
@@ -51,9 +51,9 @@ namespace KMail {
 
   RegExpLineEdit::RegExpLineEdit( TQWidget *parent, const char *name )
     : TQWidget( parent, name ),
-      mLineEdit( 0 ),
-      mRegExpEditButton( 0 ),
-      mRegExpEditDialog( 0 )
+      mLineEdit( nullptr ),
+      mRegExpEditButton( nullptr ),
+      mRegExpEditDialog( nullptr )
   {
     initWidget();
   }
@@ -61,9 +61,9 @@ namespace KMail {
   RegExpLineEdit::RegExpLineEdit( const TQString &str, TQWidget *parent,
                                   const char *name )
     : TQWidget( parent, name ),
-      mLineEdit( 0 ),
-      mRegExpEditButton( 0 ),
-      mRegExpEditDialog( 0 )
+      mLineEdit( nullptr ),
+      mRegExpEditButton( nullptr ),
+      mRegExpEditDialog( nullptr )
   {
     initWidget( str );
   }
diff --git a/kmail/regexplineedit.h b/kmail/regexplineedit.h
index 22dd69ff4..30d8abc04 100644
--- a/kmail/regexplineedit.h
+++ b/kmail/regexplineedit.h
@@ -50,9 +50,9 @@ namespace KMail {
   
 
   public:
-    RegExpLineEdit( const TQString &str, TQWidget *parent = 0,
-                    const char *name = 0 );
-    RegExpLineEdit( TQWidget *parent = 0, const char *name = 0 );
+    RegExpLineEdit( const TQString &str, TQWidget *parent = nullptr,
+                    const char *name = nullptr );
+    RegExpLineEdit( TQWidget *parent = nullptr, const char *name = nullptr );
 
     TQString text() const;
 
diff --git a/kmail/renamejob.cpp b/kmail/renamejob.cpp
index 1c3cbef0b..8cd54334d 100644
--- a/kmail/renamejob.cpp
+++ b/kmail/renamejob.cpp
@@ -70,11 +70,11 @@ template <typename T> static TQStringList imapPaths( FolderStorage* storage )
 
 RenameJob::RenameJob( FolderStorage* storage, const TQString& newName,
     KMFolderDir* newParent )
- : FolderJob( 0, tOther, (storage ? storage->folder() : 0) ),
+ : FolderJob( nullptr, tOther, (storage ? storage->folder() : nullptr) ),
    mStorage( storage ), mNewParent( newParent ),
-   mNewName( newName ), mNewFolder( 0 ), mCopyFolderJob( 0 )
+   mNewName( newName ), mNewFolder( nullptr ), mCopyFolderJob( nullptr )
 {
-  mStorageTempOpened = 0;
+  mStorageTempOpened = nullptr;
   if ( storage ) {
     mOldName = storage->name();
     if ( storage->folderType() == KMFolderTypeImap ) {
@@ -197,11 +197,11 @@ void RenameJob::folderCopyComplete(bool success)
     return;
   }
   mNewFolder = mCopyFolderJob->targetFolder();
-  mCopyFolderJob = 0;
+  mCopyFolderJob = nullptr;
 
   if ( mStorageTempOpened ) {
     mStorageTempOpened->close( "renamejob" );
-    mStorageTempOpened = 0;
+    mStorageTempOpened = nullptr;
   }
 
   kdDebug(5006) << "deleting old folder" << endl;
diff --git a/kmail/renamejob.h b/kmail/renamejob.h
index f0a54db60..6c400d91c 100644
--- a/kmail/renamejob.h
+++ b/kmail/renamejob.h
@@ -60,7 +60,7 @@ public:
    * @param newParent the new parent if the folder should be moved, else 0
    */
   RenameJob( FolderStorage* storage, const TQString& newName,
-      KMFolderDir* newParent = 0 );
+      KMFolderDir* newParent = nullptr );
 
   virtual ~RenameJob();
 
diff --git a/kmail/rulewidgethandlermanager.cpp b/kmail/rulewidgethandlermanager.cpp
index 27aa68bce..287bedd5f 100644
--- a/kmail/rulewidgethandlermanager.cpp
+++ b/kmail/rulewidgethandlermanager.cpp
@@ -54,7 +54,7 @@
 using std::for_each;
 using std::remove;
 
-KMail::RuleWidgetHandlerManager * KMail::RuleWidgetHandlerManager::self = 0;
+KMail::RuleWidgetHandlerManager * KMail::RuleWidgetHandlerManager::self = nullptr;
 
 namespace {
   class TextRuleWidgetHandler : public KMail::RuleWidgetHandler {
@@ -233,11 +233,11 @@ namespace {
   */
   int childCount( const TQObject *parent, const char *objName )
   {
-    TQObjectList *list = parent->queryList( 0, objName, false, false );
+    TQObjectList *list = parent->queryList( nullptr, objName, false, false );
     if ( !list )
       return 0;
     const int count = list->count();
-    delete list; list = 0;
+    delete list; list = nullptr;
     return count;
   }
 }
@@ -247,7 +247,7 @@ void KMail::RuleWidgetHandlerManager::createWidgets( TQWidgetStack *functionStac
                                                      const TQObject *receiver ) const
 {
   for ( const_iterator it = mHandlers.begin(); it != mHandlers.end(); ++it ) {
-    TQWidget *w = 0;
+    TQWidget *w = nullptr;
     for ( int i = 0;
           ( w = (*it)->createFunctionWidget( i, functionStack, receiver ) );
           ++i ) {
@@ -260,7 +260,7 @@ void KMail::RuleWidgetHandlerManager::createWidgets( TQWidgetStack *functionStac
         kdDebug(5006) << "RuleWidgetHandlerManager::createWidgets: "
                       << w->name() << " already exists in functionStack"
                       << endl;
-        delete w; w = 0;
+        delete w; w = nullptr;
       }
     }
     for ( int i = 0;
@@ -275,7 +275,7 @@ void KMail::RuleWidgetHandlerManager::createWidgets( TQWidgetStack *functionStac
         kdDebug(5006) << "RuleWidgetHandlerManager::createWidgets: "
                       << w->name() << " already exists in valueStack"
                       << endl;
-        delete w; w = 0;
+        delete w; w = nullptr;
       }
     }
   }
@@ -362,7 +362,7 @@ namespace {
   {
     const TQObjectList list = parent->childrenListObject();
     if ( list.isEmpty() )
-      return 0;
+      return nullptr;
 
     TQObjectListIterator it( list );
     TQObject *obj;
@@ -424,7 +424,7 @@ namespace {
                                                          const TQObject *receiver ) const
   {
     if ( number != 0 )
-      return 0;
+      return nullptr;
 
     TQComboBox *funcCombo = new TQComboBox( functionStack, "textRuleFuncCombo" );
     for ( int i = 0; i < TextFunctionCount; ++i ) {
@@ -464,7 +464,7 @@ namespace {
       return combo;
     }
 
-    return 0;
+    return nullptr;
   }
 
   //---------------------------------------------------------------------------
@@ -581,7 +581,7 @@ namespace {
     // reset the function combo box
     TQComboBox *funcCombo =
       dynamic_cast<TQComboBox*>( functionStack->child( "textRuleFuncCombo",
-                                                      0, false ) );
+                                                      nullptr, false ) );
     if ( funcCombo ) {
       funcCombo->blockSignals( true );
       funcCombo->setCurrentItem( 0 );
@@ -591,7 +591,7 @@ namespace {
     // reset the value widget
     RegExpLineEdit *lineEdit =
       dynamic_cast<RegExpLineEdit*>( valueStack->child( "regExpLineEdit",
-                                                        0, false ) );
+                                                        nullptr, false ) );
     if ( lineEdit ) {
       lineEdit->blockSignals( true );
       lineEdit->clear();
@@ -602,7 +602,7 @@ namespace {
 
     TQComboBox *combo =
       dynamic_cast<TQComboBox*>( valueStack->child( "categoryCombo",
-                                                   0, false ) );
+                                                   nullptr, false ) );
     if (combo) {
       combo->blockSignals( true );
       combo->setCurrentItem( 0 );
@@ -628,7 +628,7 @@ namespace {
         break;
     TQComboBox *funcCombo =
       dynamic_cast<TQComboBox*>( functionStack->child( "textRuleFuncCombo",
-                                                      0, false ) );
+                                                      nullptr, false ) );
     if ( funcCombo ) {
       funcCombo->blockSignals( true );
       if ( i < TextFunctionCount )
@@ -647,14 +647,14 @@ namespace {
          func == KMSearchRule::FuncIsNotInAddressbook ) {
       TQWidget *w =
         static_cast<TQWidget*>( valueStack->child( "textRuleValueHider",
-                                                  0, false ) );
+                                                  nullptr, false ) );
       valueStack->raiseWidget( w );
     }
     else if ( func == KMSearchRule::FuncIsInCategory ||
               func == KMSearchRule::FuncIsNotInCategory) {
       TQComboBox *combo =
         static_cast<TQComboBox*>( static_cast<TQWidget*>(valueStack->child( "categoryCombo",
-                                                    0, false )) );
+                                                    nullptr, false )) );
       combo->blockSignals( true );
       for ( i = 0; i < combo->count(); ++i )
         if ( rule->contents() == combo->text( i ) ) {
@@ -670,7 +670,7 @@ namespace {
     else {
       RegExpLineEdit *lineEdit =
         dynamic_cast<RegExpLineEdit*>( valueStack->child( "regExpLineEdit",
-                                                          0, false ) );
+                                                          nullptr, false ) );
       if ( lineEdit ) {
         lineEdit->blockSignals( true );
         lineEdit->setText( rule->contents() );
@@ -693,7 +693,7 @@ namespace {
     // raise the correct function widget
     functionStack->raiseWidget(
       static_cast<TQWidget*>( functionStack->child( "textRuleFuncCombo",
-                                                   0, false ) ) );
+                                                   nullptr, false ) ) );
 
     // raise the correct value widget
     KMSearchRule::Function func = currentFunction( functionStack );
@@ -701,18 +701,18 @@ namespace {
          func == KMSearchRule::FuncIsNotInAddressbook ) {
       valueStack->raiseWidget(
         static_cast<TQWidget*>( valueStack->child( "textRuleValueHider",
-                                                  0, false ) ) );
+                                                  nullptr, false ) ) );
     }
     else if ( func == KMSearchRule::FuncIsInCategory ||
               func == KMSearchRule::FuncIsNotInCategory) {
       valueStack->raiseWidget(
         static_cast<TQWidget*>( valueStack->child( "categoryCombo",
-                                                  0, false ) ) );
+                                                  nullptr, false ) ) );
     }
     else {
       RegExpLineEdit *lineEdit =
         dynamic_cast<RegExpLineEdit*>( valueStack->child( "regExpLineEdit",
-                                                          0, false ) );
+                                                          nullptr, false ) );
       if ( lineEdit ) {
         lineEdit->showEditButton( func == KMSearchRule::FuncRegExp ||
                                   func == KMSearchRule::FuncNotRegExp );
@@ -755,7 +755,7 @@ namespace {
                                                             const TQObject *receiver ) const
   {
     if ( number != 0 )
-      return 0;
+      return nullptr;
 
     TQComboBox *funcCombo = new TQComboBox( functionStack, "messageRuleFuncCombo" );
     for ( int i = 0; i < MessageFunctionCount; ++i ) {
@@ -786,7 +786,7 @@ namespace {
       return new TQLabel( valueStack, "textRuleValueHider" );
     }
 
-    return 0;
+    return nullptr;
   }
 
   //---------------------------------------------------------------------------
@@ -891,7 +891,7 @@ namespace {
     // reset the function combo box
     TQComboBox *funcCombo =
       dynamic_cast<TQComboBox*>( functionStack->child( "messageRuleFuncCombo",
-                                                      0, false ) );
+                                                      nullptr, false ) );
     if ( funcCombo ) {
       funcCombo->blockSignals( true );
       funcCombo->setCurrentItem( 0 );
@@ -901,7 +901,7 @@ namespace {
     // reset the value widget
     RegExpLineEdit *lineEdit =
       dynamic_cast<RegExpLineEdit*>( valueStack->child( "regExpLineEdit",
-                                                        0, false ) );
+                                                        nullptr, false ) );
     if ( lineEdit ) {
       lineEdit->blockSignals( true );
       lineEdit->clear();
@@ -929,7 +929,7 @@ namespace {
         break;
     TQComboBox *funcCombo =
       dynamic_cast<TQComboBox*>( functionStack->child( "messageRuleFuncCombo",
-                                                      0, false ) );
+                                                      nullptr, false ) );
     if ( funcCombo ) {
       funcCombo->blockSignals( true );
       if ( i < MessageFunctionCount )
@@ -948,13 +948,13 @@ namespace {
          func == KMSearchRule::FuncHasNoAttachment ) {
       TQWidget *w =
         static_cast<TQWidget*>( valueStack->child( "textRuleValueHider",
-                                                  0, false ) );
+                                                  nullptr, false ) );
       valueStack->raiseWidget( w );
     }
     else {
       RegExpLineEdit *lineEdit =
         dynamic_cast<RegExpLineEdit*>( valueStack->child( "regExpLineEdit",
-                                                          0, false ) );
+                                                          nullptr, false ) );
       if ( lineEdit ) {
         lineEdit->blockSignals( true );
         lineEdit->setText( rule->contents() );
@@ -979,7 +979,7 @@ namespace {
     // raise the correct function widget
     functionStack->raiseWidget(
       static_cast<TQWidget*>( functionStack->child( "messageRuleFuncCombo",
-                                                   0, false ) ) );
+                                                   nullptr, false ) ) );
 
     // raise the correct value widget
     KMSearchRule::Function func = currentFunction( functionStack );
@@ -987,13 +987,13 @@ namespace {
          func == KMSearchRule::FuncHasNoAttachment ) {
       TQWidget *w =
         static_cast<TQWidget*>( valueStack->child( "textRuleValueHider",
-                                                  0, false ) );
+                                                  nullptr, false ) );
       valueStack->raiseWidget( w );
     }
     else {
       RegExpLineEdit *lineEdit =
         dynamic_cast<RegExpLineEdit*>( valueStack->child( "regExpLineEdit",
-                                                          0, false ) );
+                                                          nullptr, false ) );
       if ( lineEdit ) {
         lineEdit->showEditButton( func == KMSearchRule::FuncRegExp ||
                                   func == KMSearchRule::FuncNotRegExp );
@@ -1030,7 +1030,7 @@ namespace {
                                                            const TQObject *receiver ) const
   {
     if ( number != 0 )
-      return 0;
+      return nullptr;
 
     TQComboBox *funcCombo = new TQComboBox( functionStack,
                                           "statusRuleFuncCombo" );
@@ -1050,7 +1050,7 @@ namespace {
                                                         const TQObject *receiver ) const
   {
     if ( number != 0 )
-      return 0;
+      return nullptr;
 
     TQComboBox *statusCombo = new TQComboBox( valueStack,
                                             "statusRuleValueCombo" );
@@ -1159,7 +1159,7 @@ namespace {
     // reset the function combo box
     TQComboBox *funcCombo =
       dynamic_cast<TQComboBox*>( functionStack->child( "statusRuleFuncCombo",
-                                                      0, false ) );
+                                                      nullptr, false ) );
     if ( funcCombo ) {
       funcCombo->blockSignals( true );
       funcCombo->setCurrentItem( 0 );
@@ -1169,7 +1169,7 @@ namespace {
     // reset the status value combo box
     TQComboBox *statusCombo =
       dynamic_cast<TQComboBox*>( valueStack->child( "statusRuleValueCombo",
-                                                   0, false ) );
+                                                   nullptr, false ) );
     if ( statusCombo ) {
       statusCombo->blockSignals( true );
       statusCombo->setCurrentItem( 0 );
@@ -1196,7 +1196,7 @@ namespace {
         break;
     TQComboBox *funcCombo =
       dynamic_cast<TQComboBox*>( functionStack->child( "statusRuleFuncCombo",
-                                                      0, false ) );
+                                                      nullptr, false ) );
     if ( funcCombo ) {
       funcCombo->blockSignals( true );
       if ( funcIndex < StatusFunctionCount )
@@ -1220,7 +1220,7 @@ namespace {
         break;
     TQComboBox *statusCombo =
       dynamic_cast<TQComboBox*>( valueStack->child( "statusRuleValueCombo",
-                                                   0, false ) );
+                                                   nullptr, false ) );
     if ( statusCombo ) {
       statusCombo->blockSignals( true );
       if ( valueIndex < KMail::StatusValueCountWithoutHidden )
@@ -1250,12 +1250,12 @@ namespace {
     // raise the correct function widget
     functionStack->raiseWidget(
       static_cast<TQWidget*>( functionStack->child( "statusRuleFuncCombo",
-                                                   0, false ) ) );
+                                                   nullptr, false ) ) );
 
     // raise the correct value widget
     valueStack->raiseWidget(
       static_cast<TQWidget*>( valueStack->child( "statusRuleValueCombo",
-                                                0, false ) ) );
+                                                nullptr, false ) ) );
     return true;
   }
 
@@ -1290,7 +1290,7 @@ namespace {
                                                             const TQObject *receiver ) const
   {
     if ( number != 0 )
-      return 0;
+      return nullptr;
 
     TQComboBox *funcCombo = new TQComboBox( functionStack,
                                           "numericRuleFuncCombo" );
@@ -1310,7 +1310,7 @@ namespace {
                                                          const TQObject *receiver ) const
   {
     if ( number != 0 )
-      return 0;
+      return nullptr;
 
     KIntNumInput *numInput = new KIntNumInput( valueStack, "KIntNumInput" );
     TQObject::connect( numInput, TQ_SIGNAL( valueChanged( int ) ),
@@ -1406,7 +1406,7 @@ namespace {
     // reset the function combo box
     TQComboBox *funcCombo =
       dynamic_cast<TQComboBox*>( functionStack->child( "numericRuleFuncCombo",
-                                                      0, false ) );
+                                                      nullptr, false ) );
     if ( funcCombo ) {
       funcCombo->blockSignals( true );
       funcCombo->setCurrentItem( 0 );
@@ -1416,7 +1416,7 @@ namespace {
     // reset the value widget
     KIntNumInput *numInput =
       dynamic_cast<KIntNumInput*>( valueStack->child( "KIntNumInput",
-                                                      0, false ) );
+                                                      nullptr, false ) );
     if ( numInput ) {
       numInput->blockSignals( true );
       numInput->setValue( 0 );
@@ -1457,7 +1457,7 @@ namespace {
         break;
     TQComboBox *funcCombo =
       dynamic_cast<TQComboBox*>( functionStack->child( "numericRuleFuncCombo",
-                                                      0, false ) );
+                                                      nullptr, false ) );
     if ( funcCombo ) {
       funcCombo->blockSignals( true );
       if ( funcIndex < NumericFunctionCount )
@@ -1479,7 +1479,7 @@ namespace {
       value = 0;
     KIntNumInput *numInput =
       dynamic_cast<KIntNumInput*>( valueStack->child( "KIntNumInput",
-                                                      0, false ) );
+                                                      nullptr, false ) );
     if ( numInput ) {
       initNumInput( numInput, rule->field() );
       numInput->blockSignals( true );
@@ -1503,12 +1503,12 @@ namespace {
     // raise the correct function widget
     functionStack->raiseWidget(
       static_cast<TQWidget*>( functionStack->child( "numericRuleFuncCombo",
-                                                   0, false ) ) );
+                                                   nullptr, false ) ) );
 
     // raise the correct value widget
     KIntNumInput *numInput =
       dynamic_cast<KIntNumInput*>( valueStack->child( "KIntNumInput",
-                                                      0, false ) );
+                                                      nullptr, false ) );
     if ( numInput ) {
       initNumInput( numInput, field );
       valueStack->raiseWidget( numInput );
diff --git a/kmail/scalix.cpp b/kmail/scalix.cpp
index 4910119d0..0680dd523 100644
--- a/kmail/scalix.cpp
+++ b/kmail/scalix.cpp
@@ -61,7 +61,7 @@ KMFolder* Utils::findStandardResourceFolder( KMFolderDir* folderParentDir,
   typeMap.insert( KMail::ContentsTypeTask, "IPF.Task" );
 
   if ( !typeMap.contains( contentsType ) )
-    return 0;
+    return nullptr;
 
   for ( uint i = 0; i < attributes.count(); ++i ) {
     FolderAttributeParser parser( attributes[ i ] );
@@ -72,7 +72,7 @@ KMFolder* Utils::findStandardResourceFolder( KMFolderDir* folderParentDir,
     }
   }
 
-  return 0;
+  return nullptr;
 }
 
 KMail::FolderContentsType Utils::scalixIdToContentsType( const TQString &name )
diff --git a/kmail/searchjob.cpp b/kmail/searchjob.cpp
index 7b0b55584..c9f061b6c 100644
--- a/kmail/searchjob.cpp
+++ b/kmail/searchjob.cpp
@@ -52,9 +52,9 @@ namespace KMail {
 
 SearchJob::SearchJob( KMFolderImap* folder, ImapAccountBase* account,
                       const KMSearchPattern* pattern, TQ_UINT32 serNum )
- : FolderJob( 0, tOther, (folder ? folder->folder() : 0) ),
+ : FolderJob( nullptr, tOther, (folder ? folder->folder() : nullptr) ),
    mFolder( folder ), mAccount( account ), mSearchPattern( pattern ),
-   mSerNum( serNum ), mRemainingMsgs( 0 ), mProgress( 0 ),
+   mSerNum( serNum ), mRemainingMsgs( 0 ), mProgress( nullptr ),
    mUngetCurrentMsg( false )
 {
 }
@@ -80,7 +80,7 @@ void SearchJob::searchCompleteFolder()
   TQString searchString = searchStringFromPattern( mSearchPattern );
 
   if ( searchString.isEmpty() ) // skip imap search and download the messages
-    return slotSearchData( 0, TQString() );
+    return slotSearchData( nullptr, TQString() );
 
   // do the IMAP search  
   KURL url = mAccount->getUrl();
@@ -253,7 +253,7 @@ void SearchJob::slotSearchFolder()
       TQString question = i18n("To execute your search all messages of the folder %1 "
           "have to be downloaded from the server. This may take some time. "
           "Do you want to continue your search?").arg( mFolder->label() );
-      if ( KMessageBox::warningContinueCancel( 0, question,
+      if ( KMessageBox::warningContinueCancel( nullptr, question,
             i18n("Continue Search"), i18n("&Search"), 
             "continuedownloadingforsearch" ) != KMessageBox::Continue ) 
       {
@@ -320,7 +320,7 @@ void SearchJob::slotSearchMessageArrived( KMMessage* msg )
       }
     }
     int idx = -1;
-    KMFolder * p = 0;
+    KMFolder * p = nullptr;
     KMMsgDict::instance()->getLocation( msg, &p, &idx );
     if ( idx != -1 && mUngetCurrentMsg )
       mFolder->unGetMsg( idx );
@@ -333,7 +333,7 @@ void SearchJob::slotSearchMessageArrived( KMMessage* msg )
     if ( complete && mProgress )
     {
       mProgress->setComplete();
-      mProgress = 0;
+      mProgress = nullptr;
     }
     if ( matches || complete )
     {
@@ -368,12 +368,12 @@ void SearchJob::searchSingleMessage()
   if ( searchString.isEmpty() )
   {
     // no imap search
-    slotSearchDataSingleMessage( 0, TQString() );
+    slotSearchDataSingleMessage( nullptr, TQString() );
   } else
   {
     // imap search
     int idx = -1;
-    KMFolder *aFolder = 0;
+    KMFolder *aFolder = nullptr;
     KMMsgDict::instance()->getLocation( mSerNum, &aFolder, &idx );
     assert(aFolder && (idx != -1));
     KMMsgBase *mb = mFolder->getMsgBase( idx );
@@ -412,7 +412,7 @@ void SearchJob::slotSearchDataSingleMessage( TDEIO::Job* job, const TQString& da
 
   // add the local search
   int idx = -1;
-  KMFolder *aFolder = 0;
+  KMFolder *aFolder = nullptr;
   KMMsgDict::instance()->getLocation( mSerNum, &aFolder, &idx );
   assert(aFolder && (idx != -1));
   mUngetCurrentMsg = !mFolder->getMsgBase( idx )->isMessage();
diff --git a/kmail/searchwindow.cpp b/kmail/searchwindow.cpp
index 537473632..c4b2cda92 100644
--- a/kmail/searchwindow.cpp
+++ b/kmail/searchwindow.cpp
@@ -71,7 +71,7 @@ const int SearchWindow::MSGID_COLUMN = 4;
 class MatchListView : public TDEListView
 {
   public:
-    MatchListView( TQWidget *parent, SearchWindow* sw, const char* name = 0 ) :
+    MatchListView( TQWidget *parent, SearchWindow* sw, const char* name = nullptr ) :
       TDEListView( parent, name ),
       mSearchWindow( sw )
     {}
@@ -108,7 +108,7 @@ class MatchListView : public TDEListView
 //-----------------------------------------------------------------------------
 SearchWindow::SearchWindow(KMMainWidget* w, const char* name,
                          KMFolder *curFolder, bool modal):
-  KDialogBase(0, name, modal, i18n("Find Messages"),
+  KDialogBase(nullptr, name, modal, i18n("Find Messages"),
               User1 | User2 | Close, User1, false,
               KGuiItem( i18n("&Search"), "edit-find" ),
               KStdGuiItem::stop()),
@@ -116,9 +116,9 @@ SearchWindow::SearchWindow(KMMainWidget* w, const char* name,
   mCloseRequested(false),
   mSortColumn(0),
   mSortOrder(Ascending),
-  mFolder(0),
+  mFolder(nullptr),
   mTimer(new TQTimer(this, "mTimer")),
-  mLastFocus(0),
+  mLastFocus(nullptr),
   mKMMainWidget(w)
 {
   KWin::setIcons(winId(), tdeApp->icon(), tdeApp->miniIcon());
@@ -160,7 +160,7 @@ SearchWindow::SearchWindow(KMMainWidget* w, const char* name,
   mPatternEdit->setFrameStyle( TQFrame::NoFrame | TQFrame::Plain );
   mPatternEdit->setInsideMargin( 0 );
   mSearchPattern = new KMSearchPattern();
-  KMFolderSearch *searchFolder = 0;
+  KMFolderSearch *searchFolder = nullptr;
   if (curFolder)
       searchFolder = dynamic_cast<KMFolderSearch*>(curFolder->storage());
   if (searchFolder) {
@@ -177,8 +177,8 @@ SearchWindow::SearchWindow(KMMainWidget* w, const char* name,
       }
   }
   mPatternEdit->setSearchPattern( mSearchPattern );
-  TQObjectList *list = mPatternEdit->queryList( 0, "mRuleField" );
-  TQObject *object = 0;
+  TQObjectList *list = mPatternEdit->queryList( nullptr, "mRuleField" );
+  TQObject *object = nullptr;
   if ( list )
       object = list->first();
   delete list;
@@ -348,7 +348,7 @@ SearchWindow::SearchWindow(KMMainWidget* w, const char* name,
                                  this, TQ_SLOT(slotSaveAttachments()), ac, "search_save_attachments" );
 
   mPrintAction = KStdAction::print( this, TQ_SLOT(slotPrintMsg()), ac, "search_print" );
-  mClearAction = new TDEAction( i18n("Clear Selection"), 0, 0, this,
+  mClearAction = new TDEAction( i18n("Clear Selection"), nullptr, 0, this,
                               TQ_SLOT(slotClearSelection()), ac, "search_clear_selection" );
 
   mCopyAction = KStdAction::copy( this, TQ_SLOT(slotCopyMsgs()), ac, "search_copy_messages" );
@@ -398,7 +398,7 @@ void SearchWindow::updStatus(void)
 {
     TQString genMsg, detailMsg, procMsg;
     int numMatches = 0, numProcessed = 0;
-    KMSearch const *search = (mFolder) ? (mFolder->search()) : 0;
+    KMSearch const *search = mFolder ? mFolder->search() : nullptr;
     TQString folderName;
     if (search) {
         numMatches = search->foundCount();
@@ -433,7 +433,7 @@ void SearchWindow::updStatus(void)
 //-----------------------------------------------------------------------------
 void SearchWindow::keyPressEvent(TQKeyEvent *evt)
 {
-    KMSearch const *search = (mFolder) ? mFolder->search() : 0;
+    KMSearch const *search = mFolder ? mFolder->search() : nullptr;
     bool searching = (search) ? search->running() : false;
     if (evt->key() == Key_Escape && searching) {
         mFolder->stopSearch();
@@ -681,7 +681,7 @@ void SearchWindow::folderInvalidated(KMFolder *folder)
 KMMessage *SearchWindow::indexToMessage( TQListViewItem *item )
 {
   if( !item ) {
-    return 0;
+    return nullptr;
   }
 
   KMFolder *folder;
@@ -690,7 +690,7 @@ KMMessage *SearchWindow::indexToMessage( TQListViewItem *item )
                                       &folder, &msgIndex );
 
   if ( !folder || msgIndex < 0 ) {
-    return 0;
+    return nullptr;
   }
 
   mKMMainWidget->slotSelectFolder( folder );
@@ -728,13 +728,13 @@ bool SearchWindow::slotViewMsg( TQListViewItem *item )
 //-----------------------------------------------------------------------------
 void SearchWindow::slotCurrentChanged(TQListViewItem *item)
 {
-  mSearchResultOpenBtn->setEnabled(item!=0);
+  mSearchResultOpenBtn->setEnabled(item != nullptr);
 }
 
 //-----------------------------------------------------------------------------
 void SearchWindow::enableGUI()
 {
-    KMSearch const *search = (mFolder) ? (mFolder->search()) : 0;
+    KMSearch const *search = mFolder ? mFolder->search() : nullptr;
     bool searching = (search) ? (search->running()) : false;
     actionButton(KDialogBase::Close)->setEnabled(!searching);
     mCbxFolders->setEnabled(!searching && !mChkbxAllFolders->isChecked());
@@ -751,7 +751,7 @@ void SearchWindow::enableGUI()
 KMMessageList SearchWindow::selectedMessages()
 {
     KMMessageList msgList;
-    KMFolder* folder = 0;
+    KMFolder* folder = nullptr;
     int msgIndex = -1;
     for (TQListViewItemIterator it(mLbxMatches); it.current(); it++)
         if (it.current()->isSelected()) {
@@ -767,14 +767,14 @@ KMMessageList SearchWindow::selectedMessages()
 KMMessage* SearchWindow::message()
 {
     TQListViewItem *item = mLbxMatches->currentItem();
-    KMFolder* folder = 0;
+    KMFolder* folder = nullptr;
     int msgIndex = -1;
     if (!item)
-        return 0;
+        return nullptr;
     KMMsgDict::instance()->getLocation(item->text(MSGID_COLUMN).toUInt(),
                                    &folder, &msgIndex);
     if (!folder || msgIndex < 0)
-        return 0;
+        return nullptr;
 
     return folder->getMsg(msgIndex);
 }
diff --git a/kmail/searchwindow.h b/kmail/searchwindow.h
index 2bc715933..1e628df85 100644
--- a/kmail/searchwindow.h
+++ b/kmail/searchwindow.h
@@ -79,8 +79,8 @@ public:
    * of search operations.
    * @param modal Whether the dialog is to be shown modal.
    */
-  SearchWindow( KMMainWidget* parent, const char* name=0,
-                       KMFolder *curFolder=0, bool modal=false );
+  SearchWindow( KMMainWidget* parent, const char* name=nullptr,
+                       KMFolder *curFolder=nullptr, bool modal=false );
   virtual ~SearchWindow();
 
   /**
diff --git a/kmail/secondarywindow.cpp b/kmail/secondarywindow.cpp
index cd4a91624..671df1d30 100644
--- a/kmail/secondarywindow.cpp
+++ b/kmail/secondarywindow.cpp
@@ -39,7 +39,7 @@ namespace KMail {
 
   //---------------------------------------------------------------------------
   SecondaryWindow::SecondaryWindow( const char * name )
-    : TDEMainWindow( 0, name )
+    : TDEMainWindow( nullptr, name )
   {
     // Set this to be the group leader for all subdialogs - this means
     // modal subdialogs will only affect this window, not the other windows
diff --git a/kmail/secondarywindow.h b/kmail/secondarywindow.h
index 335524dd2..cb3967a5e 100644
--- a/kmail/secondarywindow.h
+++ b/kmail/secondarywindow.h
@@ -47,7 +47,7 @@ namespace KMail {
   
 
   public:
-    SecondaryWindow( const char * name = 0 );
+    SecondaryWindow( const char * name = nullptr );
     ~SecondaryWindow();
 
   protected:
diff --git a/kmail/sieveconfig.h b/kmail/sieveconfig.h
index 41c1beace..d38a1ca2f 100644
--- a/kmail/sieveconfig.h
+++ b/kmail/sieveconfig.h
@@ -89,7 +89,7 @@ namespace KMail {
     TQ_OBJECT
   
   public:
-    SieveConfigEditor( TQWidget * parent=0, const char * name=0 );
+    SieveConfigEditor( TQWidget * parent=nullptr, const char * name=nullptr );
 
     bool managesieveSupported() const;
     virtual void setManagesieveSupported( bool enable );
diff --git a/kmail/sievedebugdialog.cpp b/kmail/sievedebugdialog.cpp
index 09d7d3fa1..12afbe299 100644
--- a/kmail/sievedebugdialog.cpp
+++ b/kmail/sievedebugdialog.cpp
@@ -189,7 +189,7 @@ namespace KMail
 SieveDebugDialog::SieveDebugDialog( TQWidget *parent, const char *name )
 :   KDialogBase( parent, name, true, i18n( "Sieve Diagnostics" ), KDialogBase::Ok,
     KDialogBase::Ok, true ),
-    mSieveJob( 0 )
+    mSieveJob( nullptr )
 {
     // Collect all accounts
     AccountManager *am = kmkernel->acctMgr();
@@ -214,7 +214,7 @@ SieveDebugDialog::~SieveDebugDialog()
     if ( mSieveJob )
     {
         mSieveJob->kill();
-        mSieveJob = 0;
+        mSieveJob = nullptr;
     }
     kdDebug( 5006 ) << k_funcinfo << endl;
 }
@@ -313,7 +313,7 @@ void SieveDebugDialog::slotGetScript( SieveJob * /* job */, bool success,
               << ", ?, " << active << " )" << endl
               << "script:" << endl
               << script << endl;
-    mSieveJob = 0; // job deletes itself after returning from this slot!
+    mSieveJob = nullptr; // job deletes itself after returning from this slot!
 
     if ( script.isEmpty() )
     {
@@ -336,7 +336,7 @@ void SieveDebugDialog::slotGetScriptList( SieveJob *job, bool success,
 {
     kdDebug( 5006 ) << k_funcinfo << "Success: " << success << ", List: " << scriptList.join( ", " ) <<
         ", active: " << activeScript << endl;
-    mSieveJob = 0; // job deletes itself after returning from this slot!
+    mSieveJob = nullptr; // job deletes itself after returning from this slot!
 
     mEdit->append( i18n( "Sieve capabilities:\n" ) );
     TQStringList caps = job->sieveCapabilities();
@@ -389,7 +389,7 @@ void SieveDebugDialog::handlePutResult( SieveJob *, bool success, bool activated
 {
     if ( success )
     {
-        KMessageBox::information( 0, activated ? i18n(
+        KMessageBox::information( nullptr, activated ? i18n(
             "Sieve script installed successfully on the server.\n"
             "Out of Office reply is now active." )
             : i18n( "Sieve script installed successfully on the server.\n"
@@ -397,7 +397,7 @@ void SieveDebugDialog::handlePutResult( SieveJob *, bool success, bool activated
     }
 
     kdDebug( 5006 ) << "SieveDebugDialog::handlePutResult( ???, " << success << ", ? )" << endl;
-    mSieveJob = 0; // job deletes itself after returning from this slot!
+    mSieveJob = nullptr; // job deletes itself after returning from this slot!
 }
 
 
diff --git a/kmail/sievedebugdialog.h b/kmail/sievedebugdialog.h
index e565cd6eb..f42c13c55 100644
--- a/kmail/sievedebugdialog.h
+++ b/kmail/sievedebugdialog.h
@@ -53,7 +53,7 @@ class SieveDebugDialog : public KDialogBase
   
 
 public:
-    SieveDebugDialog( TQWidget *parent = 0, const char *name = 0 );
+    SieveDebugDialog( TQWidget *parent = nullptr, const char *name = nullptr );
     virtual ~SieveDebugDialog();
 
 protected:
diff --git a/kmail/sievejob.cpp b/kmail/sievejob.cpp
index fc7b92cf9..4e6697f8e 100644
--- a/kmail/sievejob.cpp
+++ b/kmail/sievejob.cpp
@@ -36,7 +36,7 @@ namespace KMail {
 		      const TQValueStack<Command> & commands,
 		      TQObject * parent, const char * name )
     : TQObject( parent, name ),
-      mUrl( url ), mJob( 0 ), mDec( 0 ),
+      mUrl( url ), mJob( nullptr ), mDec( nullptr ),
       mScript( script ), mFileExists( DontKnow ), mCommands( commands ),
       mShowProgressInfo(true)
   {
@@ -49,7 +49,7 @@ namespace KMail {
                       bool showProgressInfo,
 		      TQObject * parent, const char * name )
     : TQObject( parent, name ),
-      mUrl( url ), mJob( 0 ), mDec( 0 ),
+      mUrl( url ), mJob( nullptr ), mDec( nullptr ),
       mScript( script ), mFileExists( DontKnow ), mCommands( commands ),
       mShowProgressInfo(showProgressInfo)
   {
@@ -194,7 +194,7 @@ namespace KMail {
       mFileExists = No;
     // prepare for next round:
     mCommands.pop();
-    delete mDec; mDec = 0;
+    delete mDec; mDec = nullptr;
 
     if ( mSieveCapabilities.empty() ) {
       mSieveCapabilities = TQStringList::split( ' ', job->queryMetaData( "sieveExtensions" ) );
@@ -205,7 +205,7 @@ namespace KMail {
     // check for errors:
     if ( job->error() ) {
       if ( job->isInteractive() ) {
-        job->showErrorDialog( 0 );
+        job->showErrorDialog( nullptr );
       }
 
       emit result( this, false, mScript, mUrl.fileName() == mActiveScriptName );
@@ -215,7 +215,7 @@ namespace KMail {
       else
 	emit gotScript( this, false, mScript, mUrl.fileName() == mActiveScriptName );
 
-      mJob = 0;
+      mJob = nullptr;
       delete this;
       return;
     }
@@ -237,7 +237,7 @@ namespace KMail {
       else
 	emit gotScript( this, true, mScript, mUrl.fileName() == mActiveScriptName );
 
-      mJob = 0; // deletes itself on returning from this slot
+      mJob = nullptr; // deletes itself on returning from this slot
       delete this;
       return;
     } else {
diff --git a/kmail/sievejob.h b/kmail/sievejob.h
index 8a9a2bff0..7e9ad4d18 100644
--- a/kmail/sievejob.h
+++ b/kmail/sievejob.h
@@ -38,11 +38,11 @@ namespace KMail {
     enum Command { Get, Put, Activate, Deactivate, SearchActive, List, Delete };
     SieveJob( const KURL & url, const TQString & script,
 	      const TQValueStack<Command> & commands,
-	      TQObject * parent=0, const char * name=0 );
+	      TQObject * parent=nullptr, const char * name=nullptr );
     SieveJob( const KURL & url, const TQString & script,
 	      const TQValueStack<Command> & commands,
 	      bool showProgressInfo,
-	      TQObject * parent=0, const char * name=0 );
+	      TQObject * parent=nullptr, const char * name=nullptr );
     virtual ~SieveJob();
 
   public:
diff --git a/kmail/signatureconfigurator.h b/kmail/signatureconfigurator.h
index 2027110a1..74203bf0a 100644
--- a/kmail/signatureconfigurator.h
+++ b/kmail/signatureconfigurator.h
@@ -35,7 +35,7 @@ namespace KMail {
     TQ_OBJECT
   
   public:
-    SignatureConfigurator( TQWidget * parent=0, const char * name=0 );
+    SignatureConfigurator( TQWidget * parent=nullptr, const char * name=nullptr );
     virtual ~SignatureConfigurator();
 
     bool isSignatureEnabled() const;
diff --git a/kmail/simplefoldertree.h b/kmail/simplefoldertree.h
index f8102d8b5..cc2a543ba 100644
--- a/kmail/simplefoldertree.h
+++ b/kmail/simplefoldertree.h
@@ -37,7 +37,7 @@ namespace KMail {
 
 static int recurseFilter( TQListViewItem * item, const TQString& filter, int column )
 {
-    if ( item == 0 )
+    if (!item)
       return 0;
 
     TQListViewItem * child;
@@ -66,7 +66,7 @@ class TreeItemBase
 {
    public :
    TreeItemBase()
-     : mFolder( 0 )
+     : mFolder( nullptr )
    {
      kdDebug(5006) << k_funcinfo << endl;
    }
diff --git a/kmail/simplestringlisteditor.cpp b/kmail/simplestringlisteditor.cpp
index c62b73aec..f29ef1e3c 100644
--- a/kmail/simplestringlisteditor.cpp
+++ b/kmail/simplestringlisteditor.cpp
@@ -50,7 +50,7 @@
 
 // small helper function:
 static inline TQListBoxItem * findSelectedItem( TQListBox * lb ) {
-  TQListBoxItem * item = 0;
+  TQListBoxItem * item = nullptr;
   for ( item = lb->firstItem() ; item && !item->isSelected() ;
 	item = item->next() ) ;
   return item;
@@ -64,8 +64,8 @@ SimpleStringListEditor::SimpleStringListEditor( TQWidget * parent,
 						const TQString & modifyLabel,
 						const TQString & addDialogLabel )
   : TQWidget( parent, name ),
-    mAddButton(0), mRemoveButton(0), mModifyButton(0),
-    mUpButton(0), mDownButton(0),
+    mAddButton(nullptr), mRemoveButton(nullptr), mModifyButton(nullptr),
+    mUpButton(nullptr), mDownButton(nullptr),
     mAddDialogLabel( addDialogLabel.isEmpty() ?
 		     i18n("New entry:") : addDialogLabel )
 {
diff --git a/kmail/simplestringlisteditor.h b/kmail/simplestringlisteditor.h
index a86afeffa..b3f6a1088 100644
--- a/kmail/simplestringlisteditor.h
+++ b/kmail/simplestringlisteditor.h
@@ -58,7 +58,7 @@ public:
   };
 
   /** Constructor. Populates the list with @p strings. */
-  SimpleStringListEditor( TQWidget * parent=0, const char * name=0,
+  SimpleStringListEditor( TQWidget * parent=nullptr, const char * name=nullptr,
 			  ButtonCode buttons=Unsorted,
 			  const TQString & addLabel=TQString(),
 			  const TQString & removeLabel=TQString(),
diff --git a/kmail/snippetdlg.h b/kmail/snippetdlg.h
index 8ae34df47..f8c66c022 100644
--- a/kmail/snippetdlg.h
+++ b/kmail/snippetdlg.h
@@ -22,7 +22,7 @@ class SnippetDlg : public SnippetDlgBase
   
 
   public:
-    SnippetDlg( TDEActionCollection* ac, TQWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
+    SnippetDlg( TDEActionCollection* ac, TQWidget* parent = nullptr, const char* name = nullptr, bool modal = false, WFlags fl = 0 );
     ~SnippetDlg();
 
     void setShowShortcut( bool show );
diff --git a/kmail/snippetitem.cpp b/kmail/snippetitem.cpp
index 134b8b2e5..5c439c558 100644
--- a/kmail/snippetitem.cpp
+++ b/kmail/snippetitem.cpp
@@ -18,7 +18,7 @@
 #include <tqstring.h>
 
 SnippetItem::SnippetItem(TQListView * parent, TQString name, TQString text )
-			: TQListViewItem( parent, name ), action(0)
+			: TQListViewItem( parent, name ), action(nullptr)
 {
   strName = name;
   strText = text;
@@ -27,7 +27,7 @@ SnippetItem::SnippetItem(TQListView * parent, TQString name, TQString text )
 }
 
 SnippetItem::SnippetItem(TQListViewItem * parent, TQString name, TQString text)
-			: TQListViewItem( parent, name ), action(0)
+			: TQListViewItem( parent, name ), action(nullptr)
 {
   strName = name;
   strText = text;
diff --git a/kmail/snippetsettings.h b/kmail/snippetsettings.h
index 23f628ed4..656d45fd5 100644
--- a/kmail/snippetsettings.h
+++ b/kmail/snippetsettings.h
@@ -31,8 +31,8 @@ class SnippetSettings : public SnippetSettingsBase
 TQ_OBJECT
   
 public:
-    SnippetSettings(TQWidget *parent = 0, const char *name = 0);
-    SnippetSettings(SnippetWidget * w, TQWidget *parent = 0, const char *name = 0);
+    SnippetSettings(TQWidget *parent = nullptr, const char *name = nullptr);
+    SnippetSettings(SnippetWidget * w, TQWidget *parent = nullptr, const char *name = nullptr);
 
     ~SnippetSettings();
 
diff --git a/kmail/snippetwidget.cpp b/kmail/snippetwidget.cpp
index 6bb924315..2e89581c8 100644
--- a/kmail/snippetwidget.cpp
+++ b/kmail/snippetwidget.cpp
@@ -75,7 +75,7 @@ SnippetWidget::SnippetWidget(KMEdit* editor, TDEActionCollection* actionCollecti
 
     connect( editor, TQ_SIGNAL( insertSnippet() ), this, TQ_SLOT( slotExecute() ));
 
-    _cfg = 0;
+    _cfg = nullptr;
 
     TQTimer::singleShot(0, this, TQ_SLOT(initConfig()));
 }
@@ -223,7 +223,7 @@ void SnippetWidget::slotRemove()
  */
 void SnippetWidget::slotEdit( TQListViewItem* item )
 {
-    if( item == 0 ) {
+    if(!item) {
 	item = currentItem();
     }
 
@@ -301,7 +301,7 @@ void SnippetWidget::slotEditGroup()
 
 void SnippetWidget::slotExecuted(TQListViewItem * item)
 {
-    if( item == 0 )
+    if(!item)
     {
 	item = currentItem();
     }
@@ -345,7 +345,7 @@ void SnippetWidget::writeConfig()
   int iGroupCount = 0;
 
   SnippetItem* item=_list.first();
-  while ( item != 0) {
+  while (item) {
 
     //kdDebug(5006) << "-->ERROR " << item->getName() << endl;
     //kdDebug(5006) << "SnippetWidget::writeConfig() " << item->getName() << endl;
@@ -507,8 +507,8 @@ void SnippetWidget::initConfig()
   _SnippetConfig.setToolTips( _cfg->readBoolEntry("snippetToolTips", true) );
   _SnippetConfig.setAutoOpenGroups( _cfg->readNumEntry("snippetGroupAutoOpen", 1) );
 
-  _SnippetConfig.setSingleRect( _cfg->readRectEntry("snippetSingleRect", 0L) );
-  _SnippetConfig.setMultiRect( _cfg->readRectEntry("snippetMultiRect", 0L) );
+  _SnippetConfig.setSingleRect( _cfg->readRectEntry("snippetSingleRect", nullptr) );
+  _SnippetConfig.setMultiRect( _cfg->readRectEntry("snippetMultiRect", nullptr) );
 }
 
 /*!
@@ -661,9 +661,9 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ
   dlg.setCaption(i18n("Enter Values for Variables"));
 
   TQGridLayout * layout = new TQGridLayout( &dlg, 1, 1, 11, 6, "layout");
-  TQGridLayout * layoutTop = new TQGridLayout( 0, 1, 1, 0, 6, "layoutTop");
-  TQGridLayout * layoutVar = new TQGridLayout( 0, 1, 1, 0, 6, "layoutVar");
-  TQGridLayout * layoutBtn = new TQGridLayout( 0, 1, 1, 0, 6, "layoutBtn");
+  TQGridLayout * layoutTop = new TQGridLayout( nullptr, 1, 1, 0, 6, "layoutTop");
+  TQGridLayout * layoutVar = new TQGridLayout( nullptr, 1, 1, 0, 6, "layoutVar");
+  TQGridLayout * layoutBtn = new TQGridLayout( nullptr, 1, 1, 0, 6, "layoutBtn");
 
   KTextEdit *te = nullptr;
   TQLabel * labTop = nullptr;
@@ -789,9 +789,9 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri
   dlg.setCaption(i18n("Enter Values for Variables"));
 
   TQGridLayout * layout = new TQGridLayout( &dlg, 1, 1, 11, 6, "layout");
-  TQGridLayout * layoutTop = new TQGridLayout( 0, 1, 1, 0, 6, "layoutTop");
-  TQGridLayout * layoutVar = new TQGridLayout( 0, 1, 1, 0, 6, "layoutVar");
-  TQGridLayout * layoutBtn = new TQGridLayout( 0, 2, 1, 0, 6, "layoutBtn");
+  TQGridLayout * layoutTop = new TQGridLayout( nullptr, 1, 1, 0, 6, "layoutTop");
+  TQGridLayout * layoutVar = new TQGridLayout( nullptr, 1, 1, 0, 6, "layoutVar");
+  TQGridLayout * layoutBtn = new TQGridLayout( nullptr, 2, 1, 0, 6, "layoutBtn");
 
   KTextEdit *te = nullptr;
   TQLabel * labTop = nullptr;
diff --git a/kmail/snippetwidget.h b/kmail/snippetwidget.h
index ea9f5d247..4448d2174 100644
--- a/kmail/snippetwidget.h
+++ b/kmail/snippetwidget.h
@@ -48,7 +48,7 @@ class SnippetWidget : public TDEListView, public TQToolTip
   
 
 public:
-    SnippetWidget(KMEdit* editor, TDEActionCollection* actionCollection, TQWidget* parent = 0);
+    SnippetWidget(KMEdit* editor, TDEActionCollection* actionCollection, TQWidget* parent = nullptr);
     ~SnippetWidget();
     TQPtrList<SnippetItem> * getList() { return (&_list); }
     void writeConfig();
@@ -79,7 +79,7 @@ private:
 
 public slots:
     void slotRemove();
-    void slotEdit( TQListViewItem* item_ = 0 );
+    void slotEdit( TQListViewItem* item_ = nullptr );
     void slotEditGroup();
     void slotAdd();
     void slotAddGroup();
@@ -87,7 +87,7 @@ public slots:
 
 protected slots:
     void showPopupMenu( TQListViewItem * item, const TQPoint & p, int );
-    void slotExecuted(TQListViewItem * item =  0);
+    void slotExecuted(TQListViewItem * item =  nullptr);
     void slotDropped(TQDropEvent *e, TQListViewItem *after);
     void startDrag();
 };
diff --git a/kmail/stl_util.h b/kmail/stl_util.h
index f72512c59..fc49d763c 100644
--- a/kmail/stl_util.h
+++ b/kmail/stl_util.h
@@ -36,13 +36,13 @@
 
 template <typename T>
 struct DeleteAndSetToZero {
-  void operator()( const T * & t ) { delete t; t = 0; }
+  void operator()( const T * & t ) { delete t; t = nullptr; }
 };
 
 template <typename T>
 static inline void deleteAll( T & c ) {
   for ( typename T::iterator it = c.begin() ; it != c.end() ; ++it ) {
-    delete *it ; *it = 0;
+    delete *it ; *it = nullptr;
   }
 }
 
diff --git a/kmail/subscriptiondialog.cpp b/kmail/subscriptiondialog.cpp
index 8687096c2..5c730dd5d 100644
--- a/kmail/subscriptiondialog.cpp
+++ b/kmail/subscriptiondialog.cpp
@@ -96,7 +96,7 @@ void SubscriptionDialogBase::moveChildrenToNewParent( GroupItem *oldItem, GroupI
   }
   TQPtrListIterator<TQListViewItem> it( itemsToMove );
   TQListViewItem *cur;
-  while ((cur = it.current()))
+  while ((cur = it.current()) != nullptr)
   {
     oldItem->takeItem(cur);
     item->insertItem(cur);
@@ -110,11 +110,11 @@ void SubscriptionDialogBase::moveChildrenToNewParent( GroupItem *oldItem, GroupI
 
 void SubscriptionDialogBase::createListViewItem( int i )
 {
-  GroupItem *item = 0;
-  GroupItem *parent = 0;
+  GroupItem *item = nullptr;
+  GroupItem *parent = nullptr;
 
   // get the parent
-  GroupItem *oldItem = 0;
+  GroupItem *oldItem = nullptr;
   TQString parentPath;
   findParentItem( mFolderNames[i], mFolderPaths[i], parentPath, &parent, &oldItem );
 
@@ -144,7 +144,7 @@ void SubscriptionDialogBase::createListViewItem( int i )
       if (!path.endsWith("/"))
         path = path + "/";
       info.path = path;
-      item = 0;
+      item = nullptr;
       if (folders.count() > 1)
       {
         // we have to create more then one level, so better check if this
@@ -285,7 +285,7 @@ void SubscriptionDialogBase::processNext()
   }
 
 //  kdDebug(5006) << "process " << mCurrentNamespace << ",subscribed=" << mSubscribed << endl;
-  ListJob* job = new ListJob( ai, type, 0, ai->addPathToNamespace( mCurrentNamespace ), completeListing );
+  ListJob* job = new ListJob( ai, type, nullptr, ai->addPathToNamespace( mCurrentNamespace ), completeListing );
   connect( job, TQ_SIGNAL(receivedFolders(const TQStringList&, const TQStringList&,
           const TQStringList&, const TQStringList&, const ImapAccountBase::jobData&)),
       this, TQ_SLOT(slotListDirectory(const TQStringList&, const TQStringList&,
diff --git a/kmail/tdehtmlparthtmlwriter.cpp b/kmail/tdehtmlparthtmlwriter.cpp
index f75e17bf7..83103eed1 100644
--- a/kmail/tdehtmlparthtmlwriter.cpp
+++ b/kmail/tdehtmlparthtmlwriter.cpp
@@ -49,7 +49,7 @@ namespace KMail {
   KHtmlPartHtmlWriter::KHtmlPartHtmlWriter( TDEHTMLPart * part,
 					    TQObject * parent, const char * name )
     : TQObject( parent, name ), HtmlWriter(),
-      mHtmlPart( part ), mHtmlTimer( 0, "mHtmlTimer" ), mState( Ended )
+      mHtmlPart( part ), mHtmlTimer( nullptr, "mHtmlTimer" ), mState( Ended )
   {
     assert( part );
     connect( &mHtmlTimer, TQ_SIGNAL(timeout()), TQ_SLOT(slotWriteNextHtmlChunk()) );
diff --git a/kmail/tdehtmlparthtmlwriter.h b/kmail/tdehtmlparthtmlwriter.h
index dfbddea2e..f35643848 100644
--- a/kmail/tdehtmlparthtmlwriter.h
+++ b/kmail/tdehtmlparthtmlwriter.h
@@ -50,7 +50,7 @@ namespace KMail {
     // Key is Content-Id, value is URL
     typedef TQMap<TQString, TQString> EmbeddedPartMap;
     KHtmlPartHtmlWriter( TDEHTMLPart * part,
-			 TQObject * parent=0, const char * name = 0 );
+			 TQObject * parent=nullptr, const char * name = nullptr );
     virtual ~KHtmlPartHtmlWriter();
 
     void begin( const TQString & cssDefs );
diff --git a/kmail/tdelistboxdialog.h b/kmail/tdelistboxdialog.h
index 5a7e47f97..17231f210 100644
--- a/kmail/tdelistboxdialog.h
+++ b/kmail/tdelistboxdialog.h
@@ -15,8 +15,8 @@ public:
     TDEListBoxDialog( TQString& _selectedString,
                     const TQString& caption,
                     const TQString& labelText,
-                    TQWidget*    parent = 0,
-                    const char* name   = 0,
+                    TQWidget*    parent = nullptr,
+                    const char* name   = nullptr,
                     bool        modal  = true );
     ~TDEListBoxDialog();
 
diff --git a/kmail/tdelistviewindexedsearchline.h b/kmail/tdelistviewindexedsearchline.h
index b1d494570..8eb8bd017 100644
--- a/kmail/tdelistviewindexedsearchline.h
+++ b/kmail/tdelistviewindexedsearchline.h
@@ -53,7 +53,7 @@ class TDEUI_EXPORT TDEListViewIndexedSearchLine: public KMail::HeaderListQuickSe
 
 public:
 
-    explicit TDEListViewIndexedSearchLine(TQWidget *parent, TDEListView *listView, TDEActionCollection* action, const char *name = 0);
+    explicit TDEListViewIndexedSearchLine(TQWidget *parent, TDEListView *listView, TDEActionCollection* action, const char *name = nullptr);
     ~TDEListViewIndexedSearchLine();
 
 public slots:
diff --git a/kmail/teehtmlwriter.h b/kmail/teehtmlwriter.h
index 2aaa20d5a..fdaf68545 100644
--- a/kmail/teehtmlwriter.h
+++ b/kmail/teehtmlwriter.h
@@ -45,7 +45,7 @@ namespace KMail {
   **/
   class TeeHtmlWriter : public KMail::HtmlWriter {
   public:
-    TeeHtmlWriter( KMail::HtmlWriter * writer1=0, KMail::HtmlWriter * writer2=0  );
+    TeeHtmlWriter( KMail::HtmlWriter * writer1=nullptr, KMail::HtmlWriter * writer2=nullptr  );
     virtual ~TeeHtmlWriter();
 
     void addHtmlWriter( KMail::HtmlWriter * writer );
diff --git a/kmail/templateparser.cpp b/kmail/templateparser.cpp
index 0094b13b4..fe28aa628 100644
--- a/kmail/templateparser.cpp
+++ b/kmail/templateparser.cpp
@@ -54,9 +54,9 @@
 using namespace KMail;
 
 TemplateParser::TemplateParser( KMMessage *amsg, const Mode amode ) :
-  mMode( amode ), mFolder( 0 ), mIdentity( 0 ),
+  mMode( amode ), mFolder( nullptr ), mIdentity( 0 ),
   mAllowDecryption( false ),
-  mDebug( false ), mQuoteString( "> " ), mAppend( false ), mOrigRoot( 0 )
+  mDebug( false ), mQuoteString( "> " ), mAppend( false ), mOrigRoot( nullptr )
 {
   mMsg = amsg;
 }
@@ -80,7 +80,7 @@ bool TemplateParser::shouldStripSignature() const
 TemplateParser::~TemplateParser()
 {
   delete mOrigRoot;
-  mOrigRoot = 0;
+  mOrigRoot = nullptr;
 }
 
 int TemplateParser::parseQuotes( const TQString &prefix, const TQString &str,
@@ -259,7 +259,7 @@ void TemplateParser::processWithTemplate( const TQString &tmpl )
           TQString str = TQString::fromLocal8Bit( content, content.size() );
           body.append( str );
         } else if ( mDebug ) {
-          KMessageBox::error( 0,
+          KMessageBox::error( nullptr,
                               i18n( "Cannot insert content from file %1: %2" ).
                               arg( path ).arg( file.errorString() ) );
         }
@@ -292,7 +292,7 @@ void TemplateParser::processWithTemplate( const TQString &tmpl )
           TQByteArray content = file.readAll();
           body.append( TQString::fromLocal8Bit( content, content.size() ) );
         } else if ( mDebug ) {
-          KMessageBox::error( 0,
+          KMessageBox::error( nullptr,
                               i18n( "Cannot insert content from file %1: %2").
                               arg( path ).arg(file.errorString() ));
         }
@@ -952,7 +952,7 @@ void TemplateParser::addProcessedBodyToMessage( const TQString &body )
         // as well, which mimelib would do, therefore creating a mail with many
         // duplicate attachments (so many that KMail runs out of memory, in fact).
         // Body::AddBodyPart is very misleading here...
-        ( *it )->dwPart()->SetNext( 0 );
+        ( *it )->dwPart()->SetNext( nullptr );
 
         DwBodyPart *cloned = static_cast<DwBodyPart*>( ( *it )->dwPart()->Clone() );
 
@@ -1146,11 +1146,11 @@ TQString TemplateParser::pipe( const TQString &cmd, const TQString &buf )
           mPipeRc = proc.exitStatus();
           if ( mPipeRc != 0 && mDebug ) {
             if ( mPipeErr.isEmpty() ) {
-              KMessageBox::error( 0,
+              KMessageBox::error( nullptr,
                                   i18n( "Pipe command exit with status %1: %2").
                                   arg( mPipeRc ).arg( cmd ) );
             } else {
-              KMessageBox::detailedError( 0,
+              KMessageBox::detailedError( nullptr,
                                           i18n( "Pipe command exit with status %1: %2" ).
                                           arg( mPipeRc ).arg( cmd ), mPipeErr );
             }
@@ -1161,11 +1161,11 @@ TQString TemplateParser::pipe( const TQString &cmd, const TQString &buf )
           mPipeRc = -( proc.exitSignal() );
           if ( mPipeRc != 0 && mDebug ) {
             if ( mPipeErr.isEmpty() ) {
-              KMessageBox::error( 0,
+              KMessageBox::error( nullptr,
                                   i18n( "Pipe command killed by signal %1: %2" ).
                                   arg( -(mPipeRc) ).arg( cmd ) );
             } else {
-              KMessageBox::detailedError( 0,
+              KMessageBox::detailedError( nullptr,
                                           i18n( "Pipe command killed by signal %1: %2" ).
                                           arg( -(mPipeRc) ).arg( cmd ), mPipeErr );
             }
@@ -1177,7 +1177,7 @@ TQString TemplateParser::pipe( const TQString &cmd, const TQString &buf )
         proc.kill();
         proc.detach();
         if ( mDebug ) {
-          KMessageBox::error( 0,
+          KMessageBox::error( nullptr,
                               i18n( "Pipe command did not finish within %1 seconds: %2" ).
                               arg( PipeTimeout ).arg( cmd ) );
         }
@@ -1189,10 +1189,10 @@ TQString TemplateParser::pipe( const TQString &cmd, const TQString &buf )
       proc.detach();
       if ( mDebug ) {
         if ( mPipeErr.isEmpty() ) {
-          KMessageBox::error( 0,
+          KMessageBox::error( nullptr,
                               i18n( "Cannot write to process stdin: %1" ).arg( cmd ) );
         } else {
-          KMessageBox::detailedError( 0,
+          KMessageBox::detailedError( nullptr,
                                       i18n( "Cannot write to process stdin: %1" ).
                                       arg( cmd ), mPipeErr );
         }
@@ -1200,7 +1200,7 @@ TQString TemplateParser::pipe( const TQString &cmd, const TQString &buf )
     }
 
   } else if ( mDebug ) {
-    KMessageBox::error( 0,
+    KMessageBox::error( nullptr,
                         i18n( "Cannot start pipe command from template: %1" ).
                         arg( cmd ) );
   }
diff --git a/kmail/templateparser.h b/kmail/templateparser.h
index ae5560ecc..bfd1198eb 100644
--- a/kmail/templateparser.h
+++ b/kmail/templateparser.h
@@ -88,9 +88,9 @@ class TemplateParser : public TQObject
      */
     void setAllowDecryption( const bool allowDecryption );
 
-    virtual void process( KMMessage *aorig_msg, KMFolder *afolder = 0, bool append = false );
+    virtual void process( KMMessage *aorig_msg, KMFolder *afolder = nullptr, bool append = false );
     virtual void process( const TQString &tmplName, KMMessage *aorig_msg,
-                          KMFolder *afolder = 0, bool append = false );
+                          KMFolder *afolder = nullptr, bool append = false );
     virtual void processWithTemplate( const TQString &tmpl );
 
     /// This finds the template to use. Either the one from the folder, identity or
diff --git a/kmail/templatesconfiguration.cpp b/kmail/templatesconfiguration.cpp
index 3dc2d189a..90684f209 100644
--- a/kmail/templatesconfiguration.cpp
+++ b/kmail/templatesconfiguration.cpp
@@ -228,7 +228,7 @@ void TemplatesConfiguration::saveToIdentity( uint id )
 void TemplatesConfiguration::loadFromFolder( TQString id, uint identity )
 {
   Templates t( id );
-  Templates* tid = 0;
+  Templates* tid = nullptr;
 
   if ( identity ) {
     tid = new Templates( TQString("IDENTITY_%1").arg( identity ) );
diff --git a/kmail/templatesconfiguration.h b/kmail/templatesconfiguration.h
index 0fd8c6efe..c6b1d1f98 100644
--- a/kmail/templatesconfiguration.h
+++ b/kmail/templatesconfiguration.h
@@ -33,7 +33,7 @@ class TemplatesConfiguration : public TemplatesConfigurationBase
 
   public:
 
-    TemplatesConfiguration( TQWidget *parent = 0, const char *name = 0 );
+    TemplatesConfiguration( TQWidget *parent = nullptr, const char *name = nullptr );
 
     void loadFromGlobal();
     void saveToGlobal();
diff --git a/kmail/templatesinsertcommand.h b/kmail/templatesinsertcommand.h
index 257064b88..eeb0c2832 100644
--- a/kmail/templatesinsertcommand.h
+++ b/kmail/templatesinsertcommand.h
@@ -33,7 +33,7 @@ class TemplatesInsertCommand : public TQPushButton
   
 
   public:
-    TemplatesInsertCommand( TQWidget *parent, const char *name = 0 );
+    TemplatesInsertCommand( TQWidget *parent, const char *name = nullptr );
     ~TemplatesInsertCommand();
 
   public:
diff --git a/kmail/textsource.cpp b/kmail/textsource.cpp
index 2ac83d0c4..4fbcf5cc3 100644
--- a/kmail/textsource.cpp
+++ b/kmail/textsource.cpp
@@ -46,7 +46,7 @@ KMTextSource::~KMTextSource() {
 
 TQCString KMTextSource::text(TQ_UINT32 serialNumber) const {
     TQCString rc;
-    KMFolder *folder = 0;
+    KMFolder *folder = nullptr;
     int idx;
     KMMsgDict::instance()->getLocation(serialNumber, &folder, &idx);
     if (folder) {
diff --git a/kmail/treebase.cpp b/kmail/treebase.cpp
index f9b88c82e..f4c675f65 100644
--- a/kmail/treebase.cpp
+++ b/kmail/treebase.cpp
@@ -51,7 +51,7 @@ const KMFolder * TreeBase::folder() const
       const KMFolder * folder = base->folder();
       return folder;
     }
-    return 0;
+    return nullptr;
 }
 
 void TreeBase::setFolder( KMFolder *folder )
@@ -144,9 +144,9 @@ void TreeBase::reload( bool mustBeReadWrite, bool showOutbox, bool showImapFolde
       mLastShowOutbox = showOutbox;
       mLastShowImapFolders = showImapFolders;
 
-      TQListViewItem * lastItem = 0;
-      TQListViewItem * lastTopItem = 0;
-      TQListViewItem * selectedItem = 0;
+      TQListViewItem * lastItem = nullptr;
+      TQListViewItem * lastTopItem = nullptr;
+      TQListViewItem * selectedItem = nullptr;
       int lastDepth = 0;
 
       mFilter = "";
@@ -161,7 +161,7 @@ void TreeBase::reload( bool mustBeReadWrite, bool showOutbox, bool showImapFolde
         int depth = fti->depth();// - 1;
         //kdDebug( 5006 ) << "LastDepth=" << lastDepth << "\tdepth=" << depth
         //                << "\tname=" << fti->text( 0 ) << endl;
-        TQListViewItem * item = 0;
+        TQListViewItem * item = nullptr;
         if ( depth <= 0 ) {
           // top level - first top level item or after last existing top level item
           if ( lastTopItem )
diff --git a/kmail/undostack.cpp b/kmail/undostack.cpp
index 24db928c2..1bee92e13 100644
--- a/kmail/undostack.cpp
+++ b/kmail/undostack.cpp
@@ -36,8 +36,8 @@
 namespace KMail {
 
 UndoStack::UndoStack(int size)
-  : TQObject(0, "undostack"), mSize(size), mLastId(0),
-    mCachedInfo(0)
+  : TQObject(nullptr, "undostack"), mSize(size), mLastId(0),
+    mCachedInfo(nullptr)
 {
    mStack.setAutoDelete(true);
 }
diff --git a/kmail/urlhandlermanager.cpp b/kmail/urlhandlermanager.cpp
index 927f6a2e7..4855323d9 100644
--- a/kmail/urlhandlermanager.cpp
+++ b/kmail/urlhandlermanager.cpp
@@ -55,7 +55,7 @@ using std::for_each;
 using std::remove;
 using std::find;
 
-KMail::URLHandlerManager * KMail::URLHandlerManager::self = 0;
+KMail::URLHandlerManager * KMail::URLHandlerManager::self = nullptr;
 
 namespace {
   class KMailProtocolURLHandler : public KMail::URLHandler {
@@ -222,22 +222,22 @@ static partNode * partNodeFromXKMailUrl( const KURL & url, KMReaderWin * w, TQSt
   assert( path );
 
   if ( !w || url.protocol() != "x-kmail" )
-    return 0;
+    return nullptr;
   const TQString urlPath = url.path();
 
   // urlPath format is: /bodypart/<random number>/<part id>/<path>
 
   kdDebug( 5006 ) << "BodyPartURLHandler: urlPath == \"" << urlPath << "\"" << endl;
   if ( !urlPath.startsWith( "/bodypart/" ) )
-    return 0;
+    return nullptr;
 
   const TQStringList urlParts = TQStringList::split( '/', urlPath.mid( 10 ), true );
   if ( urlParts.size() != 3 )
-    return 0;
+    return nullptr;
   bool ok = false;
   const int part_id = urlParts[1].toInt( &ok );
   if ( !ok )
-    return 0;
+    return nullptr;
   *path = KURL::decode_string( urlParts[2] );
   return w->partNodeForId( part_id );
 }
@@ -588,14 +588,14 @@ namespace {
   partNode* AttachmentURLHandler::partNodeForUrl( const KURL &url, KMReaderWin *w ) const
   {
     if ( !w || !w->message() )
-      return 0;
+      return nullptr;
     if ( url.protocol() != "attachment" )
-      return 0;
+      return nullptr;
 
     bool ok;
     int nodeId = url.path().toInt( &ok );
     if ( !ok )
-      return 0;
+      return nullptr;
 
     partNode * node = w->partNodeForId( nodeId );
     return node;
@@ -641,7 +641,7 @@ namespace {
                                              KMReaderWin *window ) const
   {
     Q_UNUSED( imagePath );
-    return partNodeForUrl( url, window ) != 0;
+    return partNodeForUrl( url, window ) != nullptr;
   }
 
   bool AttachmentURLHandler::handleDrag( const KURL &url, const TQString& imagePath,
diff --git a/kmail/urlhandlermanager.h b/kmail/urlhandlermanager.h
index 191213b05..78c6d33d1 100644
--- a/kmail/urlhandlermanager.h
+++ b/kmail/urlhandlermanager.h
@@ -71,12 +71,12 @@ namespace KMail {
     void registerHandler( const Interface::BodyPartURLHandler * handler );
     void unregisterHandler( const Interface::BodyPartURLHandler * handler );
 
-    bool handleClick( const KURL & url, KMReaderWin * w=0 ) const;
-    bool handleShiftClick( const KURL &url, KMReaderWin *window = 0 ) const;
-    bool handleContextMenuRequest( const KURL & url, const TQPoint & p, KMReaderWin * w=0 ) const;
-    bool willHandleDrag( const KURL &url, const TQString& imagePath, KMReaderWin *window = 0 ) const;
-    bool handleDrag( const KURL &url, const TQString& imagePath, KMReaderWin *window = 0 ) const;
-    TQString statusBarMessage( const KURL & url, KMReaderWin * w=0 ) const;
+    bool handleClick( const KURL & url, KMReaderWin * w=nullptr ) const;
+    bool handleShiftClick( const KURL &url, KMReaderWin *window = nullptr ) const;
+    bool handleContextMenuRequest( const KURL & url, const TQPoint & p, KMReaderWin * w=nullptr ) const;
+    bool willHandleDrag( const KURL &url, const TQString& imagePath, KMReaderWin *window = nullptr ) const;
+    bool handleDrag( const KURL &url, const TQString& imagePath, KMReaderWin *window = nullptr ) const;
+    TQString statusBarMessage( const KURL & url, KMReaderWin * w=nullptr ) const;
 
   private:
     typedef TQValueVector<const URLHandler*> HandlerList;
diff --git a/kmail/vacation.cpp b/kmail/vacation.cpp
index 7ad0728c5..fe9cb2579 100644
--- a/kmail/vacation.cpp
+++ b/kmail/vacation.cpp
@@ -210,35 +210,35 @@ namespace {
 
   typedef GenericInformationExtractor GIE;
   static const GenericInformationExtractor::StateNode spamNodes[] = {
-    { 0, GIE::CommandStart, "if",  1, 0, 0 },              // 0
-    { 0,   GIE::TestStart, "header", 2, 0, 0 },            // 1
-    { 0,     GIE::TaggedArgument, "contains", 3, 0, 0 },   // 2
+    { 0, GIE::CommandStart, "if",  1, 0, nullptr },              // 0
+    { 0,   GIE::TestStart, "header", 2, 0, nullptr },            // 1
+    { 0,     GIE::TaggedArgument, "contains", 3, 0, nullptr },   // 2
 
     // accept both string and string-list:
     { 0,     GIE::StringArgument, "x-spam-flag", 9, 4, "x-spam-flag" },    // 3
-    { 0,     GIE::StringListArgumentStart, 0, 5, 0, 0 },                   // 4
+    { 0,     GIE::StringListArgumentStart, nullptr, 5, 0, nullptr },                   // 4
     { 0,       GIE::StringListEntry, "x-spam-flag", 6, 7, "x-spam-flag" }, // 5
-    { 0,       GIE::StringListEntry, 0, 6, 8, 0 },                         // 6
-    { 0,     GIE::StringListArgumentEnd, 0, 0, 5, 0 },                     // 7
-    { 0,     GIE::StringListArgumentEnd, 0, 9, 0, 0 },                     // 8
+    { 0,       GIE::StringListEntry, nullptr, 6, 8, nullptr },                         // 6
+    { 0,     GIE::StringListArgumentEnd, nullptr, 0, 5, nullptr },                     // 7
+    { 0,     GIE::StringListArgumentEnd, nullptr, 9, 0, nullptr },                     // 8
 
     // accept both string and string-list:
     { 0,     GIE::StringArgument, "yes", 15, 10, "spam-flag-yes" },    // 9
-    { 0,     GIE::StringListArgumentStart, 0, 11, 0, 0 },              // 10
+    { 0,     GIE::StringListArgumentStart, nullptr, 11, 0, nullptr },              // 10
     { 0,       GIE::StringListEntry, "yes", 12, 13, "spam-flag-yes" }, // 11
-    { 0,       GIE::StringListEntry, 0, 12, 14, 0 },                   // 12
-    { 0,     GIE::StringListArgumentEnd, 0, 0, 11, 0 },                // 13
-    { 0,     GIE::StringListArgumentEnd, 0, 15, 0, 0 },                // 14
+    { 0,       GIE::StringListEntry, nullptr, 12, 14, nullptr },                   // 12
+    { 0,     GIE::StringListArgumentEnd, nullptr, 0, 11, nullptr },                // 13
+    { 0,     GIE::StringListArgumentEnd, nullptr, 15, 0, nullptr },                // 14
 
-    { 0,   GIE::TestEnd, 0, 16, 0, 0 }, // 15
+    { 0,   GIE::TestEnd, nullptr, 16, 0, nullptr }, // 15
 
     // block of command, find "stop", take nested if's into account:
-    { 0,   GIE::BlockStart, 0, 17, 0, 0 },                // 16
+    { 0,   GIE::BlockStart, nullptr, 17, 0, nullptr },                // 16
     { 1,     GIE::CommandStart, "stop", 20, 19, "stop" }, // 17
-    { -1,    GIE::Any, 0, 17, 0, 0 },                     // 18
-    { 0,   GIE::BlockEnd, 0, 0, 18, 0 },                  // 19
+    { -1,    GIE::Any, nullptr, 17, 0, nullptr },                     // 18
+    { 0,   GIE::BlockEnd, nullptr, 0, 18, nullptr },                  // 19
 
-    { -1, GIE::Any, 0, 20, 20, 0 }, // 20 end state
+    { -1, GIE::Any, nullptr, 20, 20, nullptr }, // 20 end state
   };
   static const unsigned int numSpamNodes = sizeof spamNodes / sizeof *spamNodes ;
 
@@ -261,40 +261,40 @@ namespace {
   // libksieve/tests/parsertest
   //   'if not address :domain :contains ["from"] ["mydomain.org"] { keep; stop; }'
   static const GenericInformationExtractor::StateNode domainNodes[] = {
-    { 0, GIE::CommandStart, "if", 1, 0, 0 },       // 0
-    { 0,   GIE::TestStart, "not", 2, 0, 0, },      // 1
-    { 0,     GIE::TestStart, "address", 3, 0, 0 }, // 2
+    { 0, GIE::CommandStart, "if", 1, 0, nullptr },       // 0
+    { 0,   GIE::TestStart, "not", 2, 0, nullptr, },      // 1
+    { 0,     GIE::TestStart, "address", 3, 0, nullptr }, // 2
 
     // :domain and :contains in arbitrary order:
-    { 0,       GIE::TaggedArgument, "domain", 4, 5, 0 },     // 3
-    { 0,       GIE::TaggedArgument, "contains", 7, 0, 0 },   // 4
-    { 0,       GIE::TaggedArgument, "contains", 6, 0, 0 },   // 5
-    { 0,       GIE::TaggedArgument, "domain", 7, 0, 0 },     // 6
+    { 0,       GIE::TaggedArgument, "domain", 4, 5, nullptr },     // 3
+    { 0,       GIE::TaggedArgument, "contains", 7, 0, nullptr },   // 4
+    { 0,       GIE::TaggedArgument, "contains", 6, 0, nullptr },   // 5
+    { 0,       GIE::TaggedArgument, "domain", 7, 0, nullptr },     // 6
 
     // accept both string and string-list:
     { 0,       GIE::StringArgument, "from", 13, 8, "from" },     // 7
-    { 0,       GIE::StringListArgumentStart, 0, 9, 0, 0 },       // 8
+    { 0,       GIE::StringListArgumentStart, nullptr, 9, 0, nullptr },       // 8
     { 0,         GIE::StringListEntry, "from", 10, 11, "from" }, // 9
-    { 0,         GIE::StringListEntry, 0, 10, 12, 0 },           // 10
-    { 0,       GIE::StringListArgumentEnd, 0, 0, 9, 0 },         // 11
-    { 0,       GIE::StringListArgumentEnd, 0, 13, 0, 0 },        // 12
+    { 0,         GIE::StringListEntry, nullptr, 10, 12, nullptr },           // 10
+    { 0,       GIE::StringListArgumentEnd, nullptr, 0, 9, nullptr },         // 11
+    { 0,       GIE::StringListArgumentEnd, nullptr, 13, 0, nullptr },        // 12
 
     // string: save, string-list: save last
-    { 0,       GIE::StringArgument, 0, 17, 14, "domainName" },    // 13
-    { 0,       GIE::StringListArgumentStart, 0, 15, 0, 0 },       // 14
-    { 0,         GIE::StringListEntry, 0, 15, 16, "domainName" }, // 15
-    { 0,       GIE::StringListArgumentEnd, 0, 17, 0, 0 },         // 16
+    { 0,       GIE::StringArgument, nullptr, 17, 14, "domainName" },    // 13
+    { 0,       GIE::StringListArgumentStart, nullptr, 15, 0, nullptr },       // 14
+    { 0,         GIE::StringListEntry, nullptr, 15, 16, "domainName" }, // 15
+    { 0,       GIE::StringListArgumentEnd, nullptr, 17, 0, nullptr },         // 16
 
-    { 0,     GIE::TestEnd, 0, 18, 0, 0 },  // 17
-    { 0,   GIE::TestEnd, 0, 19, 0, 0 },    // 18
+    { 0,     GIE::TestEnd, nullptr, 18, 0, nullptr },  // 17
+    { 0,   GIE::TestEnd, nullptr, 19, 0, nullptr },    // 18
 
     // block of commands, find "stop", take nested if's into account:
-    { 0,   GIE::BlockStart, 0, 20, 0, 0 },                 // 19
+    { 0,   GIE::BlockStart, nullptr, 20, 0, nullptr },                 // 19
     { 1,     GIE::CommandStart, "stop", 23, 22, "stop" },  // 20
-    { -1,    GIE::Any, 0, 20, 0, 0 },                      // 21
-    { 0,   GIE::BlockEnd, 0, 0, 21, 0 },                   // 22
+    { -1,    GIE::Any, nullptr, 20, 0, nullptr },                      // 21
+    { 0,   GIE::BlockEnd, nullptr, 0, 21, nullptr },                   // 22
 
-    { -1, GIE::Any, 0, 23, 23, 0 }  // 23 end state
+    { -1, GIE::Any, nullptr, 23, 23, nullptr }  // 23 end state
   };
   static const unsigned int numDomainNodes = sizeof domainNodes / sizeof *domainNodes ;
 
@@ -429,7 +429,7 @@ namespace {
 namespace KMail {
 
   Vacation::Vacation( TQObject * parent, bool checkOnly, const char * name )
-    : TQObject( parent, name ), mSieveJob( 0 ), mDialog( 0 ), mWasActive( false ), mCheckOnly( checkOnly )
+    : TQObject( parent, name ), mSieveJob( nullptr ), mDialog( nullptr ), mWasActive( false ), mCheckOnly( checkOnly )
   {
     mUrl = findURL();
     kdDebug(5006) << "Vacation: found url \"" << mUrl.prettyURL() << "\"" << endl;
@@ -441,8 +441,8 @@ namespace KMail {
   }
 
   Vacation::~Vacation() {
-    if ( mSieveJob ) mSieveJob->kill(); mSieveJob = 0;
-    delete mDialog; mDialog = 0;
+    if ( mSieveJob ) mSieveJob->kill(); mSieveJob = nullptr;
+    delete mDialog; mDialog = nullptr;
     kdDebug(5006) << "~Vacation()" << endl;
   }
 
@@ -605,11 +605,11 @@ namespace KMail {
 	      << ", ?, " << active << " )" << endl
 	      << "script:" << endl
 	      << script << endl;
-    mSieveJob = 0; // job deletes itself after returning from this slot!
+    mSieveJob = nullptr; // job deletes itself after returning from this slot!
 
     if ( !mCheckOnly && mUrl.protocol() == "sieve" && !job->sieveCapabilities().isEmpty() &&
 	 !job->sieveCapabilities().contains("vacation") ) {
-      KMessageBox::sorry( 0, i18n("Your server did not list \"vacation\" in "
+      KMessageBox::sorry( nullptr, i18n("Your server did not list \"vacation\" in "
 				  "its list of supported Sieve extensions;\n"
 				  "without it, KMail cannot install out-of-"
 				  "office replies for you.\n"
@@ -619,7 +619,7 @@ namespace KMail {
     }
 
     if ( !mDialog && !mCheckOnly )
-      mDialog = new VacationDialog( i18n("Configure \"Out of Office\" Replies"), 0, 0, false );
+      mDialog = new VacationDialog( i18n("Configure \"Out of Office\" Replies"), nullptr, nullptr, false );
 
     TQString messageText = defaultMessageText();
     int notificationInterval = defaultNotificationInterval();
@@ -629,7 +629,7 @@ namespace KMail {
     if ( !success ) active = false; // default to inactive
 
     if ( !mCheckOnly && ( !success || !parseScript( script, messageText, notificationInterval, aliases, sendForSpam, domainName ) ) )
-      KMessageBox::information( 0, i18n("Someone (probably you) changed the "
+      KMessageBox::information( nullptr, i18n("Someone (probably you) changed the "
 					"vacation script on the server.\n"
 					"KMail is no longer able to determine "
 					"the parameters for the autoreplies.\n"
@@ -654,7 +654,7 @@ namespace KMail {
 
     emit scriptActive( mWasActive );
     if ( mCheckOnly && mWasActive ) {
-      if ( KMessageBox::questionYesNo( 0, i18n( "There is still an active out-of-office reply configured.\n"
+      if ( KMessageBox::questionYesNo( nullptr, i18n( "There is still an active out-of-office reply configured.\n"
                                         "Do you want to edit it?"), i18n("Out-of-office reply still active"),
                                         KGuiItem( i18n( "Edit"), "edit" ), KGuiItem( i18n("Ignore"), "button_cancel" ) )
            == KMessageBox::Yes ) {
@@ -697,13 +697,13 @@ namespace KMail {
 
     // destroy the dialog:
     mDialog->delayedDestruct();
-    mDialog = 0;
+    mDialog = nullptr;
   }
 
   void Vacation::slotDialogCancel() {
     kdDebug(5006) << "Vacation::slotDialogCancel()" << endl;
     mDialog->delayedDestruct();
-    mDialog = 0;
+    mDialog = nullptr;
     emit result( false );
   }
 
@@ -717,7 +717,7 @@ namespace KMail {
 
   void Vacation::handlePutResult( SieveJob *, bool success, bool activated ) {
     if ( success )
-      KMessageBox::information( 0, activated
+      KMessageBox::information( nullptr, activated
 				? i18n("Sieve script installed successfully on the server.\n"
 				       "Out of Office reply is now active.")
 				: i18n("Sieve script installed successfully on the server.\n"
@@ -725,7 +725,7 @@ namespace KMail {
 
     kdDebug(5006) << "Vacation::handlePutResult( ???, " << success << ", ? )"
 		  << endl;
-    mSieveJob = 0; // job deletes itself after returning from this slot!
+    mSieveJob = nullptr; // job deletes itself after returning from this slot!
     emit result( success );
     emit scriptActive( activated );
   }
diff --git a/kmail/vacation.h b/kmail/vacation.h
index 3581eff3f..172fc6cec 100644
--- a/kmail/vacation.h
+++ b/kmail/vacation.h
@@ -39,7 +39,7 @@ namespace KMail {
     TQ_OBJECT
   
   public:
-    Vacation( TQObject * parent=0, bool checkOnly = false, const char * name=0 );
+    Vacation( TQObject * parent=nullptr, bool checkOnly = false, const char * name=nullptr );
     virtual ~Vacation();
 
     bool isUsable() const { return !mUrl.isEmpty(); }
diff --git a/kmail/vacationdialog.h b/kmail/vacationdialog.h
index c97e164f9..30e4c8834 100644
--- a/kmail/vacationdialog.h
+++ b/kmail/vacationdialog.h
@@ -38,8 +38,8 @@ namespace KMail {
     TQ_OBJECT
   
   public:
-    VacationDialog( const TQString & caption, TQWidget * parent=0,
-		    const char * name=0, bool modal=true );
+    VacationDialog( const TQString & caption, TQWidget * parent=nullptr,
+		    const char * name=nullptr, bool modal=true );
     virtual ~VacationDialog();
 
     virtual void enableDomainAndSendForSpam( bool enable = true );
diff --git a/kmail/xfaceconfigurator.cpp b/kmail/xfaceconfigurator.cpp
index bc77041a8..6117ff695 100644
--- a/kmail/xfaceconfigurator.cpp
+++ b/kmail/xfaceconfigurator.cpp
@@ -277,7 +277,7 @@ namespace KMail {
       mXFaceLabel->setPixmap( p );
     }
     else
-      mXFaceLabel->setPixmap( 0L );
+      mXFaceLabel->setPixmap( nullptr );
   }
 
 } // namespace KMail
diff --git a/kmail/xfaceconfigurator.h b/kmail/xfaceconfigurator.h
index 2589400d8..74de25f30 100644
--- a/kmail/xfaceconfigurator.h
+++ b/kmail/xfaceconfigurator.h
@@ -33,7 +33,7 @@ namespace KMail {
     TQ_OBJECT
   
   public:
-    XFaceConfigurator( TQWidget * parent=0, const char * name=0 );
+    XFaceConfigurator( TQWidget * parent=nullptr, const char * name=nullptr );
     virtual ~XFaceConfigurator();
 
     bool isXFaceEnabled() const;
-- 
cgit v1.2.3

