From 864437a11403f025e0a71d9db4a2cbcd1090381d Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Wed, 18 Nov 2026 10:00:35 -0300
Subject: tdecore: use nullptr for pointer constants
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>
---
 kded/kbuildimageiofactory.cpp                      |   2 +-
 kded/kbuildimageiofactory.h                        |   2 +-
 kded/kbuildprotocolinfofactory.h                   |   2 +-
 kded/kbuildservicefactory.cpp                      |   6 +-
 kded/kbuildservicefactory.h                        |   2 +-
 kded/kbuildservicegroupfactory.cpp                 |  10 +-
 kded/kbuildservicegroupfactory.h                   |   2 +-
 kded/kbuildservicetypefactory.cpp                  |  12 +-
 kded/kbuildservicetypefactory.h                    |   2 +-
 kded/kctimefactory.h                               |   4 +-
 kded/kded.cpp                                      |  33 +--
 kded/kdedmodule.cpp                                |  10 +-
 kded/khostname.cpp                                 |   4 +-
 kded/tde-menu.cpp                                  |  12 +-
 kded/tdebuildsycoca.cpp                            |  80 +++----
 kded/vfolder_menu.cpp                              |  24 +-
 kded/vfolder_menu.h                                |   2 +-
 kglib/TGlibEventLoop.cpp                           |   2 +-
 kglib/TGlibEventLoop.h                             |   2 +-
 libtdescreensaver/main.cpp                         |   8 +-
 libtdescreensaver/tdescreensaver.cpp               |   2 +-
 libtdescreensaver/tdescreensaver.h                 |   2 +-
 libtdescreensaver/tdescreensaver_vroot.h           |   4 +-
 tdeconf_update/tdeconf_update.cpp                  |  24 +-
 tdecore/kallocator.cpp                             |  16 +-
 tdecore/kaudioplayer.h                             |   2 +-
 tdecore/kbufferedio.cpp                            |  12 +-
 tdecore/kcalendarsystem.h                          |   4 +-
 tdecore/kcalendarsystemfactory.h                   |   2 +-
 tdecore/kcalendarsystemgregorian.h                 |   4 +-
 tdecore/kcalendarsystemhebrew.h                    |   4 +-
 tdecore/kcalendarsystemhijri.cpp                   |   8 +-
 tdecore/kcalendarsystemhijri.h                     |   4 +-
 tdecore/kcalendarsystemjalali.cpp                  |   8 +-
 tdecore/kcalendarsystemjalali.h                    |   4 +-
 tdecore/kcatalogue.cpp                             |   6 +-
 tdecore/kcharsets.cpp                              |  24 +-
 tdecore/kcheckaccelerators.cpp                     |   4 +-
 tdecore/kclipboard.cpp                             |   8 +-
 tdecore/kclipboard.h                               |   2 +-
 tdecore/kcompletion.cpp                            |  20 +-
 tdecore/kcompletion_private.h                      |   8 +-
 tdecore/kcompletionbase.cpp                        |   2 +-
 tdecore/kdebug.cpp                                 |  20 +-
 tdecore/kdetcompmgr.cpp                            |   6 +-
 tdecore/kextsock.cpp                               |  92 ++++----
 tdecore/kextsock.h                                 |   4 +-
 tdecore/kgenericfactory.h                          |  22 +-
 tdecore/kgenericfactory.tcc                        |  10 +-
 tdecore/kiconeffect.cpp                            |   4 +-
 tdecore/kiconloader.cpp                            |  62 +++---
 tdecore/kiconloader.h                              |   4 +-
 tdecore/kicontheme.cpp                             |  18 +-
 tdecore/kipc.cpp                                   |   4 +-
 tdecore/kkeynative_x11.cpp                         |   4 +-
 tdecore/kkeyserver_x11.cpp                         |   6 +-
 tdecore/klibloader.cpp                             |  44 ++--
 tdecore/klibloader.h                               |   8 +-
 tdecore/klockfile.cpp                              |   2 +-
 tdecore/kmanagerselection.cpp                      |   2 +-
 tdecore/kmanagerselection.h                        |   8 +-
 tdecore/kmdcodec.cpp                               |   4 +-
 tdecore/kmimesourcefactory.cpp                     |   2 +-
 tdecore/kmountpoint.cpp                            |   6 +-
 tdecore/knotifyclient.cpp                          |   4 +-
 tdecore/kprotocolinfo_tdecore.cpp                  |   2 +-
 tdecore/kprotocolinfofactory.cpp                   |  16 +-
 tdecore/kprotocolinfofactory.h                     |   2 +-
 tdecore/kpty.cpp                                   |   2 +-
 tdecore/kpty.h                                     |   2 +-
 tdecore/kqiodevicegzip_p.cpp                       |   6 +-
 tdecore/kregexp.cpp                                |   8 +-
 tdecore/krfcdate.cpp                               |   4 +-
 tdecore/krootprop.cpp                              |   2 +-
 tdecore/krootprop.h                                |   4 +-
 tdecore/ksharedptr.h                               |   4 +-
 tdecore/kshell.h                                   |   2 +-
 tdecore/ksimpledirwatch.cpp                        |  52 ++---
 tdecore/ksimpledirwatch.h                          |   2 +-
 tdecore/ksock.cpp                                  |  28 +--
 tdecore/ksockaddr.cpp                              |  48 ++--
 tdecore/ksocks.cpp                                 |  54 ++---
 tdecore/kstaticdeleter.h                           |   8 +-
 tdecore/ktempdir.cpp                               |   4 +-
 tdecore/ktimezones.cpp                             |  10 +-
 tdecore/kurl.cpp                                   |   2 +-
 tdecore/kurl.h                                     |   2 +-
 tdecore/kurldrag.cpp                               |  10 +-
 tdecore/kurldrag.h                                 |   8 +-
 tdecore/kuser.cpp                                  |   4 +-
 tdecore/kvmallocator.cpp                           |  10 +-
 tdecore/kxerrorhandler.cpp                         |  14 +-
 tdecore/kxmessages.cpp                             |   8 +-
 tdecore/kxmessages.h                               |   2 +-
 tdecore/libintl.cpp                                |  26 +--
 tdecore/malloc/x86.h                               |   2 +-
 tdecore/netsupp.cpp                                | 176 +++++++--------
 tdecore/netwm.cpp                                  | 102 ++++-----
 tdecore/netwm_def.h                                |   2 +-
 tdecore/network/kbufferedsocket.cpp                |  12 +-
 tdecore/network/kbufferedsocket.h                  |   4 +-
 tdecore/network/kclientsocketbase.cpp              |   4 +-
 tdecore/network/kclientsocketbase.h                |   2 +-
 tdecore/network/kdatagramsocket.cpp                |   2 +-
 tdecore/network/kdatagramsocket.h                  |   2 +-
 tdecore/network/khttpproxysocketdevice.h           |   2 +-
 tdecore/network/kresolver.cpp                      |  74 +++----
 tdecore/network/kresolver.h                        |   6 +-
 tdecore/network/kresolvermanager.cpp               |  22 +-
 tdecore/network/kresolverstandardworkers.cpp       |  14 +-
 tdecore/network/kresolverworkerbase.cpp            |   4 +-
 tdecore/network/kreverseresolver.cpp               |  18 +-
 tdecore/network/kreverseresolver.h                 |   2 +-
 tdecore/network/kserversocket.cpp                  |  10 +-
 tdecore/network/kserversocket.h                    |   6 +-
 tdecore/network/ksockssocketdevice.cpp             |  26 +--
 tdecore/network/ksockssocketdevice.h               |   6 +-
 tdecore/network/ksrvresolverworker.cpp             |   8 +-
 tdecore/network/kstreamsocket.cpp                  |   4 +-
 tdecore/network/kstreamsocket.h                    |   2 +-
 tdecore/network/tdemulticastsocket.h               |   2 +-
 tdecore/network/tdemulticastsocketdevice.h         |   2 +-
 tdecore/network/tdesocketaddress.cpp               |  34 +--
 tdecore/network/tdesocketbase.cpp                  |  10 +-
 tdecore/network/tdesocketbase.h                    |   2 +-
 tdecore/network/tdesocketbuffer.cpp                |   6 +-
 tdecore/network/tdesocketdevice.cpp                |  46 ++--
 tdecore/network/tdesocketdevice.h                  |  12 +-
 tdecore/svgicons/ksvgiconengine.cpp                |   8 +-
 tdecore/svgicons/ksvgiconpainter.cpp               |  16 +-
 tdecore/tdeaboutdata.cpp                           |  16 +-
 tdecore/tdeaboutdata.h                             |  22 +-
 tdecore/tdeaccel.cpp                               |  16 +-
 tdecore/tdeaccel.h                                 |  12 +-
 tdecore/tdeaccelaction.cpp                         |  38 ++--
 tdecore/tdeaccelaction.h                           |   6 +-
 tdecore/tdeaccelbase.cpp                           |  12 +-
 tdecore/tdeaccelbase.h                             |   6 +-
 tdecore/tdeaccelmanager.cpp                        |  22 +-
 tdecore/tdeapplication.cpp                         | 246 ++++++++++-----------
 tdecore/tdeapplication.h                           |  18 +-
 tdecore/tdecmdlineargs.cpp                         |  44 ++--
 tdecore/tdecmdlineargs.h                           |  10 +-
 tdecore/tdeconfig.cpp                              |   4 +-
 tdecore/tdeconfig.h                                |   2 +-
 tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp  |  36 +--
 .../tests/tdeconfigcompiler_test.cpp               |   4 +-
 tdecore/tdeconfigbackend.cpp                       |  28 +--
 tdecore/tdeconfigbackend.h                         |   2 +-
 tdecore/tdeconfigbase.cpp                          |   8 +-
 tdecore/tdeconfigbase.h                            |  24 +-
 tdecore/tdeconfigdialogmanager.cpp                 |   4 +-
 tdecore/tdeconfigdialogmanager.h                   |   2 +-
 tdecore/tdecrash.cpp                               |  22 +-
 tdecore/tdecrash.h                                 |   2 +-
 tdecore/tdeglobal.cpp                              |  32 +--
 tdecore/tdeglobalaccel.h                           |   6 +-
 tdecore/tdeglobalaccel_win.cpp                     |   8 +-
 tdecore/tdeglobalaccel_x11.cpp                     |  18 +-
 tdecore/tdeglobalsettings.cpp                      |  90 ++++----
 .../network-manager/network-manager.cpp            |  24 +-
 .../network-manager/network-manager.h              |   2 +-
 tdecore/tdehw/tdecryptographiccarddevice.cpp       |  80 +++----
 tdecore/tdehw/tdecryptographiccarddevice.h         |   2 +-
 tdecore/tdehw/tdeeventdevice.cpp                   |   2 +-
 tdecore/tdehw/tdegenericdevice.cpp                 |   4 +-
 tdecore/tdehw/tdehardwaredevices.cpp               | 120 +++++-----
 tdecore/tdehw/tdehardwaredevices.h                 |   8 +-
 tdecore/tdehw/tdenetworkconnections.cpp            |  30 +--
 tdecore/tdehw/tdenetworkconnections.h              |   4 +-
 tdecore/tdehw/tdenetworkdevice.cpp                 |   2 +-
 tdecore/tdehw/tdestoragedevice.cpp                 |  18 +-
 tdecore/tdeinstance.cpp                            |  76 +++----
 tdecore/tdelocale.cpp                              |  38 ++--
 tdecore/tdelocale.h                                |  22 +-
 tdecore/tdemultipledrag.cpp                        |   2 +-
 tdecore/tdemultipledrag.h                          |   2 +-
 tdecore/tdeprocctrl.cpp                            |  14 +-
 tdecore/tdeprocess.cpp                             |  50 ++---
 tdecore/tdeprocess.h                               |   6 +-
 tdecore/tdeprocio.cpp                              |   2 +-
 tdecore/tdeprocio.h                                |   4 +-
 tdecore/tdeshortcut.cpp                            |   6 +-
 tdecore/tdeshortcut.h                              |   2 +-
 tdecore/tdeshortcutlist.cpp                        |   2 +-
 tdecore/tdeshortcutlist.h                          |   4 +-
 tdecore/tdeshortcutmenu.cpp                        |   2 +-
 tdecore/tdestandarddirs.cpp                        |  18 +-
 tdecore/tdestartupinfo.cpp                         |  72 +++---
 tdecore/tdestartupinfo.h                           |   4 +-
 tdecore/tdestdaccel.cpp                            |  64 +++---
 tdecore/tdesycoca.cpp                              |  46 ++--
 tdecore/tdesycocadict.cpp                          |  10 +-
 tdecore/tdesycocafactory.cpp                       |   6 +-
 tdecore/tdetempfile.cpp                            |  32 +--
 tdecore/tdeuniqueapplication.cpp                   |  18 +-
 tdecore/tests/kcalendartest.cpp                    |  10 +-
 tdecore/tests/kcmdlineargstest.cpp                 |   4 +-
 tdecore/tests/kdebugtest.cpp                       |   4 +-
 tdecore/tests/kglobaltest.cpp                      |   8 +-
 tdecore/tests/kipctest.cpp                         |   2 +-
 tdecore/tests/klocaletest.h                        |   2 +-
 tdecore/tests/kmdcodectest.cpp                     |  28 +--
 tdecore/tests/kmemtest.cpp                         |   4 +-
 tdecore/tests/kresolvertest.cpp                    |   6 +-
 tdecore/tests/kurltest.cpp                         |   2 +-
 tdecore/tests/kxerrorhandlertest.cpp               |   2 +-
 tdecore/tests/tdeapptest.cpp                       |   2 +-
 tdecore/tests/tdeconfigtestgui.cpp                 |  12 +-
 tdecore/tests/tdeconfigtestgui.h                   |   2 +-
 tdecore/tests/testqtargs.cpp                       |   2 +-
 tdecore/twin.cpp                                   |  36 +--
 tdecore/twinmodule.cpp                             |   6 +-
 tdecore/twinmodule.h                               |   2 +-
 tdeinit/autostart.cpp                              |   8 +-
 tdeinit/setproctitle.cpp                           |  16 +-
 tdeinit/tdeinit.cpp                                |  90 ++++----
 tdeinit/tdeioslave.cpp                             |   4 +-
 tdeinit/tdelauncher.cpp                            |  86 +++----
 tdeinit/tdelauncher_main.cpp                       |   2 +-
 tdeinit/tdestartupconfig.cpp                       |  10 +-
 tderandr/ktimerdialog.h                            |   4 +-
 tderandr/libtderandr.cpp                           |  38 ++--
 tderandr/randr.cpp                                 |  12 +-
 win/bootstrap.cpp                                  |   6 +-
 win/qeventloopex.cpp                               |  12 +-
 win/qeventloopex.h                                 |   2 +-
 win/win32_utils.h                                  |   2 +-
 win/win32_utils2.cpp                               |   4 +-
 229 files changed, 1858 insertions(+), 1857 deletions(-)

diff --git a/kded/kbuildimageiofactory.cpp b/kded/kbuildimageiofactory.cpp
index afb2c81a6..3eb0a9bfd 100644
--- a/kded/kbuildimageiofactory.cpp
+++ b/kded/kbuildimageiofactory.cpp
@@ -77,7 +77,7 @@ KBuildImageIOFactory::addEntry(KSycocaEntry *newEntry, const char *resource)
       if (format->mType == _format->mType)
       {
          // Already in list
-         format = 0;
+         format = nullptr;
          break;
       }
    }
diff --git a/kded/kbuildimageiofactory.h b/kded/kbuildimageiofactory.h
index 4a1caa81f..812dc5d21 100644
--- a/kded/kbuildimageiofactory.h
+++ b/kded/kbuildimageiofactory.h
@@ -51,7 +51,7 @@ public:
    */
   virtual KSycocaEntry* createEntry(const TQString &, const char *);
 
-  virtual KSycocaEntry * createEntry( int ) { assert(0); return 0L; }
+  virtual KSycocaEntry * createEntry( int ) { assert(0); return nullptr; }
 
   virtual void addEntry(KSycocaEntry *newEntry, const char *);
 
diff --git a/kded/kbuildprotocolinfofactory.h b/kded/kbuildprotocolinfofactory.h
index 4230670f4..426ca40db 100644
--- a/kded/kbuildprotocolinfofactory.h
+++ b/kded/kbuildprotocolinfofactory.h
@@ -42,7 +42,7 @@ public:
    */
   virtual KProtocolInfo* createEntry(const TQString &, const char *);
 
-  virtual KProtocolInfo* createEntry(int) { assert(0); return 0L; }
+  virtual KProtocolInfo* createEntry(int) { assert(0); return nullptr; }
 
   /**
    * Add a new entry
diff --git a/kded/kbuildservicefactory.cpp b/kded/kbuildservicefactory.cpp
index 54c09ac9c..d7de524d9 100644
--- a/kded/kbuildservicefactory.cpp
+++ b/kded/kbuildservicefactory.cpp
@@ -74,11 +74,11 @@ KBuildServiceFactory::createEntry( const TQString& file, const char *resource )
   }
 
   if (name.isEmpty())
-     return 0;
+     return nullptr;
 
   // Is it a .desktop file?
   if (!name.endsWith(".desktop") && !name.endsWith(".kdelnk"))
-      return 0;
+      return nullptr;
 
   TDEDesktopFile desktopFile(file, true, resource);
 
@@ -91,7 +91,7 @@ KBuildServiceFactory::createEntry( const TQString& file, const char *resource )
      if (!serv->isDeleted())
         kdWarning(7012) << "Invalid Service : " << file << endl;
      delete serv;
-     return 0L;
+     return nullptr;
   }
 }
 
diff --git a/kded/kbuildservicefactory.h b/kded/kbuildservicefactory.h
index e0497bb9e..f0376e7f8 100644
--- a/kded/kbuildservicefactory.h
+++ b/kded/kbuildservicefactory.h
@@ -50,7 +50,7 @@ public:
    */
   virtual KSycocaEntry * createEntry(const TQString &file, const char *resource);
 
-  virtual KService * createEntry( int ) { assert(0); return 0L; }
+  virtual KService * createEntry( int ) { assert(0); return nullptr; }
 
   /**
    * Add a new entry.
diff --git a/kded/kbuildservicegroupfactory.cpp b/kded/kbuildservicegroupfactory.cpp
index a28eab9e9..fdc689ab3 100644
--- a/kded/kbuildservicegroupfactory.cpp
+++ b/kded/kbuildservicegroupfactory.cpp
@@ -52,13 +52,13 @@ KBuildServiceGroupFactory::createEntry( const TQString&, const char * )
 {
   // Unused
   kdWarning("!!!! KBuildServiceGroupFactory::createEntry called!");
-  return 0; 
+  return nullptr;
 }
 
 
 void KBuildServiceGroupFactory::addNewEntryTo( const TQString &menuName, KService *newEntry)
 {
-  KServiceGroup *entry = 0;
+  KServiceGroup *entry = nullptr;
   KSycocaEntry::Ptr *ptr = m_entryDict->find(menuName);
   if (ptr)
      entry = dynamic_cast<KServiceGroup *>(ptr->data());
@@ -92,7 +92,7 @@ KBuildServiceGroupFactory::addNew( const TQString &menuName, const TQString& fil
   if (menuName != "/")
   {
      // Make sure parent dir exists.
-     KServiceGroup *parentEntry = 0;
+     KServiceGroup *parentEntry = nullptr;
      TQString parent = menuName.left(menuName.length()-1);
      int i = parent.findRev('/');
      if (i > 0) {
@@ -100,7 +100,7 @@ KBuildServiceGroupFactory::addNew( const TQString &menuName, const TQString& fil
      } else {
         parent = "/";
      }
-     parentEntry = 0;
+     parentEntry = nullptr;
      ptr = m_entryDict->find(parent);
      if (ptr)
         parentEntry = dynamic_cast<KServiceGroup *>(ptr->data());
@@ -122,7 +122,7 @@ KBuildServiceGroupFactory::addNewChild( const TQString &parent, const char *reso
 {
   TQString name = "#parent#"+parent;
 
-  KServiceGroup *entry = 0;
+  KServiceGroup *entry = nullptr;
   KSycocaEntry::Ptr *ptr = m_entryDict->find(name);
   if (ptr)
      entry = dynamic_cast<KServiceGroup *>(ptr->data());
diff --git a/kded/kbuildservicegroupfactory.h b/kded/kbuildservicegroupfactory.h
index 23b484cdb..aa7315ae1 100644
--- a/kded/kbuildservicegroupfactory.h
+++ b/kded/kbuildservicegroupfactory.h
@@ -42,7 +42,7 @@ public:
    */
   virtual KServiceGroup * createEntry(const TQString &, const char *);
 
-  virtual KServiceGroup * createEntry(int) { assert(0); return 0L; }
+  virtual KServiceGroup * createEntry(int) { assert(0); return nullptr; }
 
   /**
    * Adds the entry @p newEntry to the menu @p menuName
diff --git a/kded/kbuildservicetypefactory.cpp b/kded/kbuildservicetypefactory.cpp
index 7599c43a0..c11deedb3 100644
--- a/kded/kbuildservicetypefactory.cpp
+++ b/kded/kbuildservicetypefactory.cpp
@@ -60,7 +60,7 @@ KServiceType * KBuildServiceTypeFactory::findServiceTypeByName(const TQString &_
    // We're building a database - the service type must be in memory
    KSycocaEntry::Ptr * servType = (*m_entryDict)[ _name ];
    if (!servType)
-      return 0;
+      return nullptr;
    return (KServiceType *) ((KSycocaEntry*)*servType);
 }
 
@@ -76,12 +76,12 @@ KBuildServiceTypeFactory::createEntry(const TQString &file, const char *resource
   }
 
   if (name.isEmpty())
-     return 0;
+     return nullptr;
 
   TDEDesktopFile desktopFile(file, true, resource);
 
   if ( desktopFile.readBoolEntry( "Hidden", false ) == true )
-      return 0;
+      return nullptr;
 
   // TODO check Type field first
   TQString mime = desktopFile.readEntry( "MimeType" );
@@ -92,7 +92,7 @@ KBuildServiceTypeFactory::createEntry(const TQString &file, const char *resource
     TQString tmp = TQString("The service/mime type config file\n%1\n"
                   "does not contain a ServiceType=...\nor MimeType=... entry").arg( file );
     kdWarning(7012) << tmp << endl;
-    return 0;
+    return nullptr;
   }
 
   KServiceType* e;
@@ -116,14 +116,14 @@ KBuildServiceTypeFactory::createEntry(const TQString &file, const char *resource
   if (e->isDeleted())
   {
     delete e;
-    return 0;
+    return nullptr;
   }
 
   if ( !(e->isValid()) )
   {
     kdWarning(7012) << "Invalid ServiceType : " << file << endl;
     delete e;
-    return 0;
+    return nullptr;
   }
 
   return e;
diff --git a/kded/kbuildservicetypefactory.h b/kded/kbuildservicetypefactory.h
index 68fb6c8fb..ee7d90aaf 100644
--- a/kded/kbuildservicetypefactory.h
+++ b/kded/kbuildservicetypefactory.h
@@ -48,7 +48,7 @@ public:
    */
   virtual KSycocaEntry * createEntry(const TQString &file, const char *resource);
 
-  virtual KServiceType * createEntry( int ) { assert(0); return 0L; }
+  virtual KServiceType * createEntry( int ) { assert(0); return nullptr; }
 
   /**
    * Add entry 
diff --git a/kded/kctimefactory.h b/kded/kctimefactory.h
index d415545b1..becc91885 100644
--- a/kded/kctimefactory.h
+++ b/kded/kctimefactory.h
@@ -47,8 +47,8 @@ public:
    */
   virtual void save(TQDataStream &str);
 
-  KSycocaEntry * createEntry(const TQString &, const char *) { return 0; }
-  KSycocaEntry * createEntry(int) { return 0; }
+  KSycocaEntry * createEntry(const TQString &, const char *) { return nullptr; }
+  KSycocaEntry * createEntry(int) { return nullptr; }
   
   void addCTime(const TQString &path, TQ_UINT32 ctime);
 
diff --git a/kded/kded.cpp b/kded/kded.cpp
index 85d796652..f41c696f4 100644
--- a/kded/kded.cpp
+++ b/kded/kded.cpp
@@ -53,12 +53,12 @@
 #include <fixx11h.h>
 #endif
 
-Kded *Kded::_self = 0;
+Kded *Kded::_self = nullptr;
 
 static bool checkStamps = true;
 static bool delayedCheck = false;
 
-static void runBuildSycoca(TQObject *callBackObj=0, const char *callBackSlot=0)
+static void runBuildSycoca(TQObject *callBackObj=nullptr, const char *callBackSlot=nullptr)
 {
    TQStringList args;
    args.append("--incremental");
@@ -85,7 +85,7 @@ static void runBuildSycoca(TQObject *callBackObj=0, const char *callBackSlot=0)
 
 static void runKonfUpdate()
 {
-   TDEApplication::tdeinitExecWait( "tdeconf_update", TQStringList(), 0, 0, "0" /*no startup notification*/ );
+   TDEApplication::tdeinitExecWait( "tdeconf_update", TQStringList(), nullptr, nullptr, "0" /*no startup notification*/ );
 }
 
 static void runDontChangeHostname(const TQCString &oldName, const TQCString &newName)
@@ -114,7 +114,7 @@ Kded::Kded(bool checkUpdates, bool new_startup)
 
   TQTimer::singleShot(100, this, TQ_SLOT(installCrashHandler()));
 
-  m_pDirWatch = 0;
+  m_pDirWatch = nullptr;
 
   m_windowIdList.setAutoDelete(true);
 
@@ -124,7 +124,7 @@ Kded::Kded(bool checkUpdates, bool new_startup)
 
 Kded::~Kded()
 {
-  _self = 0;
+  _self = nullptr;
   m_pTimer->stop();
   delete m_pTimer;
   delete m_pDirWatch;
@@ -156,15 +156,16 @@ void Kded::initModules()
 {
      m_dontLoad.clear();
      TDEConfig *config = tdeApp->config();
-     bool tde_running = !( getenv( "TDE_FULL_SESSION" ) == NULL || getenv( "TDE_FULL_SESSION" )[ 0 ] == '\0' );
+     const char *fullSession = getenv( "TDE_FULL_SESSION" );
+     bool tde_running = fullSession && fullSession[ 0 ] != '\0';
     // not the same user like the one running the session (most likely we're run via sudo or something)
-    if( getenv( "TDE_SESSION_UID" ) != NULL && uid_t( atoi( getenv( "TDE_SESSION_UID" ))) != getuid())
+    if( getenv( "TDE_SESSION_UID" ) && uid_t( atoi( getenv( "TDE_SESSION_UID" ))) != getuid())
         tde_running = false;
      // Preload kded modules.
      KService::List kdedModules = KServiceType::offers("KDEDModule");
      TQString version = getenv( "KDE_SESSION_VERSION" );
      TQStringList blacklist;
-     if ( !(version == NULL) && version >= "4" )
+     if ( !version.isNull() && version >= "4" )
      {
          kdDebug(7020) << "KDE4 is running:" << endl;
          kdDebug(7020) << "  KDE_SESSION_VERSION: " << version << endl;
@@ -258,7 +259,7 @@ KDEDModule *Kded::loadModule(const TQCString &obj, bool onDemand)
 
 KDEDModule *Kded::loadModule(const KService *s, bool onDemand)
 {
-  KDEDModule *module = 0;
+  KDEDModule *module = nullptr;
   if (s && !s->library().isEmpty())
   {
     TQCString obj = s->desktopEntryName().latin1();
@@ -272,7 +273,7 @@ KDEDModule *Kded::loadModule(const KService *s, bool onDemand)
       if (p.isValid() && (p.toBool() == false))
       {
          noDemandLoad(s->desktopEntryName());
-         return 0;
+         return nullptr;
       }
     }
     // get the library loader instance
@@ -330,7 +331,7 @@ KDEDModule *Kded::loadModule(const KService *s, bool onDemand)
     }
     kdDebug(7020) << "Could not load module '" << obj << "'\n";
   }
-  return 0;
+  return nullptr;
 }
 
 bool Kded::unloadModule(const TQCString &obj)
@@ -536,7 +537,7 @@ void Kded::update(const TQString& )
   }
   else
   {
-    m_recreateRequests.append(0);
+    m_recreateRequests.append(nullptr);
   }
 }
 
@@ -609,7 +610,7 @@ void Kded::readDirectory( const TQString& _path )
 
 bool Kded::isWindowRegistered(long windowId)
 {
-  return m_globalWindowIdList.find(windowId) != 0;
+  return m_globalWindowIdList.find(windowId) != nullptr;
 
 }
 
@@ -738,8 +739,8 @@ void KHostnameD::checkHostname()
 
 static TDECmdLineOptions options[] =
 {
-  { "check", I18N_NOOP("Check Sycoca database only once"), 0 },
-  { "new-startup", "Internal", 0 },
+  { "check", I18N_NOOP("Check Sycoca database only once"), nullptr },
+  { "new-startup", "Internal", nullptr },
   TDECmdLineLastOption
 };
 
@@ -813,7 +814,7 @@ public:
       TQCString module;
       TQDataStream arg( data, IO_ReadOnly );
       arg >> module;
-      bool result = (Kded::self()->loadModule(module, false) != 0);
+      bool result = (Kded::self()->loadModule(module, false) != nullptr);
       replyType = "bool";
       TQDataStream _replyStream( replyData, IO_WriteOnly );
       _replyStream << result;
diff --git a/kded/kdedmodule.cpp b/kded/kdedmodule.cpp
index 230f08db2..5e03f3286 100644
--- a/kded/kdedmodule.cpp
+++ b/kded/kdedmodule.cpp
@@ -39,7 +39,7 @@ public:
 KDEDModule::KDEDModule(const TQCString &name) : TQObject(), DCOPObject(name)
 {
    d = new KDEDModulePrivate;
-   d->objMap = 0;
+   d->objMap = nullptr;
    d->timeout = 0;
    connect(&(d->timer), TQ_SIGNAL(timeout()), this, TQ_SLOT(idle()));
 }
@@ -47,7 +47,7 @@ KDEDModule::KDEDModule(const TQCString &name) : TQObject(), DCOPObject(name)
 KDEDModule::~KDEDModule()
 {
    emit moduleDeleted(this);
-   delete d; d = 0;
+   delete d; d = nullptr;
 }
   
 void KDEDModule::setIdleTimeout(int secs)
@@ -69,7 +69,7 @@ void KDEDModule::insert(const TQCString &app, const TQCString &key, TDEShared *o
 
    // appKey acts as a placeholder
    KEntryKey appKey(app, 0);
-   d->objMap->replace(appKey, 0);
+   d->objMap->replace(appKey, nullptr);
 
    KEntryKey indexKey(app, key);
 
@@ -83,12 +83,12 @@ void KDEDModule::insert(const TQCString &app, const TQCString &key, TDEShared *o
 TDEShared * KDEDModule::find(const TQCString &app, const TQCString &key)
 {
    if (!d->objMap)
-      return 0;
+      return nullptr;
    KEntryKey indexKey(app, key);
 
    KDEDObjectMap::Iterator it = d->objMap->find(indexKey);
    if (it == d->objMap->end())
-      return 0;
+      return nullptr;
 
    return it.data().data();
 }
diff --git a/kded/khostname.cpp b/kded/khostname.cpp
index ba9ba7d95..5422fcf0a 100644
--- a/kded/khostname.cpp
+++ b/kded/khostname.cpp
@@ -40,8 +40,8 @@
 #include <kde_file.h>
 
 static TDECmdLineOptions options[] = {
-   { "+old", I18N_NOOP("Old hostname"), 0 },
-   { "+new", I18N_NOOP("New hostname"), 0 },
+   { "+old", I18N_NOOP("Old hostname"), nullptr },
+   { "+new", I18N_NOOP("New hostname"), nullptr },
    TDECmdLineLastOption
 };
 
diff --git a/kded/tde-menu.cpp b/kded/tde-menu.cpp
index 945d70e91..380d0e72f 100644
--- a/kded/tde-menu.cpp
+++ b/kded/tde-menu.cpp
@@ -33,12 +33,12 @@
 #include "tdestandarddirs.h"
 
 static TDECmdLineOptions options[] = {
-   { "utf8", I18N_NOOP("Output data in UTF-8 instead of local encoding"), 0 },
-   { "print-menu-id", I18N_NOOP("Print menu-id of the menu that contains\nthe application"), 0 },
-   { "print-menu-name", I18N_NOOP("Print menu name (caption) of the menu that\ncontains the application"), 0 },
-   { "highlight", I18N_NOOP("Highlight the entry in the menu"), 0 },
-   { "nocache-update", I18N_NOOP("Do not check if sycoca database is up to date"), 0 },
-   { "+<application-id>", I18N_NOOP("The id of the menu entry to locate"), 0 },
+   { "utf8", I18N_NOOP("Output data in UTF-8 instead of local encoding"), nullptr },
+   { "print-menu-id", I18N_NOOP("Print menu-id of the menu that contains\nthe application"), nullptr },
+   { "print-menu-name", I18N_NOOP("Print menu name (caption) of the menu that\ncontains the application"), nullptr },
+   { "highlight", I18N_NOOP("Highlight the entry in the menu"), nullptr },
+   { "nocache-update", I18N_NOOP("Do not check if sycoca database is up to date"), nullptr },
+   { "+<application-id>", I18N_NOOP("The id of the menu entry to locate"), nullptr },
    TDECmdLineLastOption
 };
 
diff --git a/kded/tdebuildsycoca.cpp b/kded/tdebuildsycoca.cpp
index 830d8c31e..2cf2f83cb 100644
--- a/kded/tdebuildsycoca.cpp
+++ b/kded/tdebuildsycoca.cpp
@@ -70,22 +70,22 @@ typedef TQValueList<KSycocaEntry::List> KSycocaEntryListList;
 
 static TQ_UINT32 newTimestamp = 0;
 
-static KBuildServiceFactory *g_bsf = 0;
-static KBuildServiceGroupFactory *g_bsgf = 0;
-static KSycocaFactory *g_factory = 0;
-static KCTimeInfo *g_ctimeInfo = 0;
-static TQDict<TQ_UINT32> *g_ctimeDict = 0;
-static const char *g_resource = 0;
-static KBSEntryDict *g_entryDict = 0;
-static KBSEntryDict *g_serviceGroupEntryDict = 0;
-static KSycocaEntryListList *g_allEntries = 0;
-static TQStringList *g_changeList = 0;
-static TQStringList *g_allResourceDirs = 0;
+static KBuildServiceFactory *g_bsf = nullptr;
+static KBuildServiceGroupFactory *g_bsgf = nullptr;
+static KSycocaFactory *g_factory = nullptr;
+static KCTimeInfo *g_ctimeInfo = nullptr;
+static TQDict<TQ_UINT32> *g_ctimeDict = nullptr;
+static const char *g_resource = nullptr;
+static KBSEntryDict *g_entryDict = nullptr;
+static KBSEntryDict *g_serviceGroupEntryDict = nullptr;
+static KSycocaEntryListList *g_allEntries = nullptr;
+static TQStringList *g_changeList = nullptr;
+static TQStringList *g_allResourceDirs = nullptr;
 static bool g_changed = false;
 static KSycocaEntry::List g_tempStorage;
-static VFolderMenu *g_vfolder = 0;
+static VFolderMenu *g_vfolder = nullptr;
 
-static const char *cSycocaPath = 0;
+static const char *cSycocaPath = nullptr;
 
 static bool bGlobalDatabase = false;
 static bool bMenuTest = false;
@@ -191,7 +191,7 @@ KSycocaEntry *KBuildSycoca::createEntry(const TQString &file, bool addToFactory)
    {
       timeStamp = TDEGlobal::dirs()->calcResourceHash( g_resource, file, true);
    }
-   KSycocaEntry* entry = 0;
+   KSycocaEntry* entry = nullptr;
    if (g_allEntries)
    {
       assert(g_ctimeDict);
@@ -243,7 +243,7 @@ KSycocaEntry *KBuildSycoca::createEntry(const TQString &file, bool addToFactory)
          g_tempStorage.append(entry);
       return entry;
    }
-   return 0;
+   return nullptr;
 }
 
 void KBuildSycoca::slotCreateEntry(const TQString &file, KService **service)
@@ -256,8 +256,8 @@ void KBuildSycoca::slotCreateEntry(const TQString &file, KService **service)
 bool KBuildSycoca::build()
 {
   typedef TQPtrList<KBSEntryDict> KBSEntryDictList;
-  KBSEntryDictList *entryDictList = 0;
-  KBSEntryDict *serviceEntryDict = 0;
+  KBSEntryDictList *entryDictList = nullptr;
+  KBSEntryDict *serviceEntryDict = nullptr;
 
   entryDictList = new KBSEntryDictList();
   // Convert for each factory the entryList to a Dict.
@@ -381,7 +381,7 @@ bool KBuildSycoca::build()
              
      VFolderMenu::SubMenu *kdeMenu = g_vfolder->parseMenu("tde-applications.menu", true);
 
-     KServiceGroup *entry = g_bsgf->addNew("/", kdeMenu->directoryFile, 0, false);
+     KServiceGroup *entry = g_bsgf->addNew("/", kdeMenu->directoryFile, nullptr, false);
      entry->setLayoutInfo(kdeMenu->layoutList);
      createMenu(TQString::null, TQString::null, kdeMenu);
 
@@ -420,7 +420,7 @@ void KBuildSycoca::createMenu(TQString caption, TQString name, VFolderMenu::SubM
         timeStamp = TDEGlobal::dirs()->calcResourceHash( g_resource, directoryFile, true);
      }
 
-     KServiceGroup* entry = 0;
+     KServiceGroup* entry = nullptr;
      if (g_allEntries)
      {
         TQ_UINT32 *timeP = (*g_ctimeDict)[directoryFile];
@@ -430,7 +430,7 @@ void KBuildSycoca::createMenu(TQString caption, TQString name, VFolderMenu::SubM
         {
             entry = dynamic_cast<KServiceGroup *> (g_serviceGroupEntryDict->find(subName));
             if (entry && (entry->directoryEntryPath() != directoryFile))
-                entry = 0; // Can't reuse this one!
+                entry = nullptr; // Can't reuse this one!
         }
      }
      g_ctimeInfo->addCTime(directoryFile, timeStamp);
@@ -502,7 +502,7 @@ bool KBuildSycoca::recreate()
     save(); // Save database
     if (m_str->device()->status())
       database->abort(); // Error
-    m_str = 0L;
+    m_str = nullptr;
     if (!database->close())
     {
       fprintf(stderr, "[tdebuildsycoca] ERROR writing database '%s'!\n", database->name().local8Bit().data());
@@ -516,7 +516,7 @@ bool KBuildSycoca::recreate()
   }
   else
   {
-    m_str = 0L;
+    m_str = nullptr;
     database->abort();
     if (bMenuTest)
        return true;
@@ -544,8 +544,8 @@ void KBuildSycoca::save()
    m_str->device()->at(0);
 
    (*m_str) << (TQ_INT32) KSycoca::version();
-   KSycocaFactory * servicetypeFactory = 0L;
-   KSycocaFactory * serviceFactory = 0L;
+   KSycocaFactory * servicetypeFactory = nullptr;
+   KSycocaFactory * serviceFactory = nullptr;
    for(KSycocaFactory *factory = m_lstFactories->first();
        factory;
        factory = m_lstFactories->next())
@@ -619,7 +619,7 @@ bool KBuildSycoca::checkDirTimestamps( const TQString& dirname, const TQDateTime
       return true;
 
    for( TQFileInfoListIterator it( *list );
-        it.current() != NULL;
+        it.current() != nullptr;
         ++it )
    {
       TQFileInfo* fi = it.current();
@@ -658,8 +658,8 @@ bool KBuildSycoca::checkTimestamps( TQ_UINT32 timestamp, const TQStringList &dir
 
 TQStringList KBuildSycoca::existingResourceDirs()
 {
-   static TQStringList* dirs = NULL;
-   if( dirs != NULL )
+   static TQStringList* dirs = nullptr;
+   if( dirs )
        return *dirs;
    dirs = new TQStringList;
    g_allResourceDirs = new TQStringList;
@@ -692,13 +692,13 @@ TQStringList KBuildSycoca::existingResourceDirs()
 }
 
 static TDECmdLineOptions options[] = {
-   { "nosignal", I18N_NOOP("Do not signal applications to update"), 0 },
-   { "noincremental", I18N_NOOP("Disable incremental update, re-read everything"), 0 },
-   { "checkstamps", I18N_NOOP("Check file timestamps"), 0 },
-   { "nocheckfiles", I18N_NOOP("Disable checking files (dangerous)"), 0 },
-   { "global", I18N_NOOP("Create global database"), 0 },
-   { "menutest", I18N_NOOP("Perform menu generation test run only"), 0 },
-   { "track <menu-id>", I18N_NOOP("Track menu id for debug purposes"), 0 },
+   { "nosignal", I18N_NOOP("Do not signal applications to update"), nullptr },
+   { "noincremental", I18N_NOOP("Disable incremental update, re-read everything"), nullptr },
+   { "checkstamps", I18N_NOOP("Check file timestamps"), nullptr },
+   { "nocheckfiles", I18N_NOOP("Disable checking files (dangerous)"), nullptr },
+   { "global", I18N_NOOP("Create global database"), nullptr },
+   { "menutest", I18N_NOOP("Perform menu generation test run only"), nullptr },
+   { "track <menu-id>", I18N_NOOP("Track menu id for debug purposes"), nullptr },
 #ifdef KBUILDSYCOCA_GUI
    { "silent", I18N_NOOP("Silent - work without windows and stderr"), 0 },
    { "showprogress", I18N_NOOP("Show progress information (even if 'silent' mode is on)"), 0 },
@@ -856,18 +856,18 @@ extern "C" TDE_EXPORT int kdemain(int argc, char **argv)
        {
            checkstamps = false;
        }
-       cSycocaPath = 0;
+       cSycocaPath = nullptr;
    }
 
-   newTimestamp = (TQ_UINT32) time(0);
+   newTimestamp = (TQ_UINT32) time(nullptr);
 
    if( checkfiles && ( !checkstamps || !KBuildSycoca::checkTimestamps( filestamp, oldresourcedirs )))
    {
       TQCString qSycocaPath = TQFile::encodeName(sycocaPath());
       cSycocaPath = qSycocaPath.data();
 
-      g_allEntries = 0;
-      g_ctimeDict = 0;
+      g_allEntries = nullptr;
+      g_ctimeDict = nullptr;
       if (incremental)
       {
          tqWarning("[tdebuildsycoca] Reusing existing tdesycoca.");
@@ -892,12 +892,12 @@ extern "C" TDE_EXPORT int kdemain(int argc, char **argv)
              list = factory->allEntries();
              g_allEntries->append( list );
          }
-         delete factories; factories = 0;
+         delete factories; factories = nullptr;
          KCTimeInfo *ctimeInfo = new KCTimeInfo;
          ctimeInfo->fillCTimeDict(*g_ctimeDict);
          delete oldSycoca;
       }
-      cSycocaPath = 0;
+      cSycocaPath = nullptr;
 
       KBuildSycoca *sycoca= new KBuildSycoca; // Build data base
       if (args->isSet("track"))
diff --git a/kded/vfolder_menu.cpp b/kded/vfolder_menu.cpp
index 6faace11f..7657427cc 100644
--- a/kded/vfolder_menu.cpp
+++ b/kded/vfolder_menu.cpp
@@ -165,7 +165,7 @@ VFolderMenu::takeSubMenu(SubMenu *parentMenu, const TQString &menuName)
          }
       }
    }
-   return 0; // Not found
+   return nullptr; // Not found
 }
 
 void
@@ -302,7 +302,7 @@ VFolderMenu::insertService(SubMenu *parentMenu, const TQString &name, KService *
 
 VFolderMenu::VFolderMenu() : m_usedAppsDict(797), m_track(false)
 {
-   m_rootMenu = 0;
+   m_rootMenu = nullptr;
    initDirs();
 }
 
@@ -321,7 +321,7 @@ VFolderMenu::findApplication(const TQString &relPath)
       if (s)
          return s;
    }
-   return 0;
+   return nullptr;
 }
 
 void
@@ -406,7 +406,7 @@ VFolderMenu::unloadAppsInfo()
    }
 
    m_appsInfoStack.remove(m_appsInfo); // Remove
-   m_appsInfo = 0;
+   m_appsInfo = nullptr;
 }
 
 TQString
@@ -988,7 +988,7 @@ VFolderMenu::loadApplications(const TQString &dir, const TQString &prefix)
    TQString _dot(".");
    TQString _dotdot("..");
 
-   while( ( ep = readdir( dp ) ) != 0L )
+   while(( ep = readdir( dp ) ) != nullptr)
    {
       TQString fn( TQFile::decodeName(ep->d_name));
       if (fn == _dot || fn == _dotdot || TQChar(fn.at(fn.length() - 1)).latin1() == '~')
@@ -1008,7 +1008,7 @@ VFolderMenu::loadApplications(const TQString &dir, const TQString &prefix)
          if (!fn.endsWith(".desktop"))
             continue;
 
-         KService *service = 0;
+         KService *service = nullptr;
          emit newService(pathfn, &service);
          if (service)
             addApplication(prefix+fn, service);
@@ -1055,7 +1055,7 @@ kdDebug(7021) << "processKDELegacyDirs()" << endl;
       if (files.search(*it) != -1)
       {
          TQString name = *it;
-         KService *service = 0;
+         KService *service = nullptr;
          emit newService(name, &service);
 
          if (service && !m_forcedLegacyLoad)
@@ -1098,7 +1098,7 @@ kdDebug(7021) << "processLegacyDir(" << dir << ", " << relDir << ", " << prefix
    TQString _dot(".");
    TQString _dotdot("..");
 
-   while( ( ep = readdir( dp ) ) != 0L )
+   while(( ep = readdir( dp ) ) != nullptr)
    {
       TQString fn( TQFile::decodeName(ep->d_name));
       if (fn == _dot || fn == _dotdot || TQChar(fn.at(fn.length() - 1)).latin1() == '~')
@@ -1127,7 +1127,7 @@ kdDebug(7021) << "processLegacyDir(" << dir << ", " << relDir << ", " << prefix
          if (!fn.endsWith(".desktop"))
             continue;
 
-         KService *service = 0;
+         KService *service = nullptr;
          emit newService(pathfn, &service);
          if (service)
          {
@@ -1210,7 +1210,7 @@ VFolderMenu::processMenu(TQDomElement &docElem, int pass)
    // Setup current menu entry
    if (pass == 0)
    {
-      m_currentMenu = 0;
+      m_currentMenu = nullptr;
       // Look up menu
       if (parentMenu)
       {
@@ -1618,7 +1618,7 @@ VFolderMenu::parseMenu(const TQString &file, bool forceLegacyLoad)
 {
    m_forcedLegacyLoad = false;
    m_legacyLoaded = false;
-   m_appsInfo = 0;
+   m_appsInfo = nullptr;
 
    TQStringList dirs = TDEGlobal::dirs()->resourceDirs("xdgconf-menu");
    for(TQStringList::ConstIterator it=dirs.begin();
@@ -1630,7 +1630,7 @@ VFolderMenu::parseMenu(const TQString &file, bool forceLegacyLoad)
    loadMenu(file);
 
    delete m_rootMenu;
-   m_rootMenu = m_currentMenu = 0;
+   m_rootMenu = m_currentMenu = nullptr;
 
    TQDomElement docElem = m_doc.documentElement();
 
diff --git a/kded/vfolder_menu.h b/kded/vfolder_menu.h
index 98f09702c..1c22aade7 100644
--- a/kded/vfolder_menu.h
+++ b/kded/vfolder_menu.h
@@ -36,7 +36,7 @@ public:
   class appsInfo;
   class SubMenu {
   public:
-     SubMenu() : items(43),isDeleted(false),apps_info(0) { }
+     SubMenu() : items(43),isDeleted(false),apps_info(nullptr) { }
      ~SubMenu() { subMenus.setAutoDelete(true); }
   
   public:
diff --git a/kglib/TGlibEventLoop.cpp b/kglib/TGlibEventLoop.cpp
index 4c53883d7..6a53af2b7 100644
--- a/kglib/TGlibEventLoop.cpp
+++ b/kglib/TGlibEventLoop.cpp
@@ -44,6 +44,6 @@ TGlibEventLoop::~TGlibEventLoop()
 
 bool TGlibEventLoop::processEvents(ProcessEventsFlags flags)
 {
-	::g_main_context_iteration(NULL, false);
+	::g_main_context_iteration(nullptr, false);
 	return TQEventLoop::processEvents(flags);
 }
diff --git a/kglib/TGlibEventLoop.h b/kglib/TGlibEventLoop.h
index 14ef0d702..1e97d5ecb 100644
--- a/kglib/TGlibEventLoop.h
+++ b/kglib/TGlibEventLoop.h
@@ -30,7 +30,7 @@ Boston, MA 02110-1301, USA.
 
 class TGlibEventLoop : public TQEventLoop {
 public:
-	TGlibEventLoop(TQObject *parent = 0, const char *name = 0);
+	TGlibEventLoop(TQObject *parent = nullptr, const char *name = nullptr);
 	~TGlibEventLoop();
 
 	virtual bool processEvents(ProcessEventsFlags flags);
diff --git a/libtdescreensaver/main.cpp b/libtdescreensaver/main.cpp
index c0d0f3579..f04d1e71a 100644
--- a/libtdescreensaver/main.cpp
+++ b/libtdescreensaver/main.cpp
@@ -47,9 +47,9 @@ extern "C"
 
 static const TDECmdLineOptions options[] =
 {
-  { "setup", I18N_NOOP("Setup screen saver"), 0 },
-  { "window-id wid", I18N_NOOP("Run in the specified XWindow"), 0 },
-  { "root", I18N_NOOP("Run in the root XWindow"), 0 },
+  { "setup", I18N_NOOP("Setup screen saver"), nullptr },
+  { "window-id wid", I18N_NOOP("Run in the specified XWindow"), nullptr },
+  { "root", I18N_NOOP("Run in the root XWindow"), nullptr },
   { "demo", I18N_NOOP("Start screen saver in demo mode"), "default"},
   TDECmdLineLastOption
 };
@@ -111,7 +111,7 @@ TDE_EXPORT int main(int argc, char *argv[])
     TDEGlobal::locale()->insertCatalogue("klock");
     TDEGlobal::locale()->insertCatalogue("tdescreensaver");
 
-    DemoWindow *demoWidget = 0;
+    DemoWindow *demoWidget = nullptr;
     Window saveWin = 0;
     KScreenSaver *target;
 
diff --git a/libtdescreensaver/tdescreensaver.cpp b/libtdescreensaver/tdescreensaver.cpp
index cb0508eaa..6bcf8f89b 100644
--- a/libtdescreensaver/tdescreensaver.cpp
+++ b/libtdescreensaver/tdescreensaver.cpp
@@ -192,7 +192,7 @@ void KBlankEffect::blankSweepDown()
 
 void KBlankEffect::blankBlocks()
 {
-    static int *block = 0;
+    static int *block = nullptr;
 
     int bx = (d->widget->width()+63)/64;
     int by = (d->widget->height()+63)/64;
diff --git a/libtdescreensaver/tdescreensaver.h b/libtdescreensaver/tdescreensaver.h
index e5e3e39f2..baa887804 100644
--- a/libtdescreensaver/tdescreensaver.h
+++ b/libtdescreensaver/tdescreensaver.h
@@ -95,7 +95,7 @@ class KBlankEffect : public TQObject
 {
 	TQ_OBJECT
 public:
-	KBlankEffect( TQObject *parent=0 );
+	KBlankEffect( TQObject *parent=nullptr );
 	~KBlankEffect();
 
     enum Effect { Random=-1, Blank=0, SweepRight, SweepDown, Blocks,
diff --git a/libtdescreensaver/tdescreensaver_vroot.h b/libtdescreensaver/tdescreensaver_vroot.h
index adb98c964..04c8cf594 100644
--- a/libtdescreensaver/tdescreensaver_vroot.h
+++ b/libtdescreensaver/tdescreensaver_vroot.h
@@ -74,7 +74,7 @@ VirtualRootWindowOfScreen(Screen *screen)
 VirtualRootWindowOfScreen(screen) Screen *screen;
 #endif /* !__STDC__ */
 {
-	static Screen *save_screen = (Screen *)0;
+	static Screen *save_screen = nullptr;
 	static Window root = (Window)0;
 
 	if (screen != save_screen) {
@@ -94,7 +94,7 @@ VirtualRootWindowOfScreen(screen) Screen *screen;
 				Atom actual_type;
 				int actual_format;
 				unsigned long nitems, bytesafter;
-				unsigned char *newRoot = 0;
+				unsigned char *newRoot = nullptr;
 
 				if (XGetWindowProperty(dpy, children[i],
 					__SWM_VROOT, 0, 1, False, XA_WINDOW,
diff --git a/tdeconf_update/tdeconf_update.cpp b/tdeconf_update/tdeconf_update.cpp
index d074ff0b4..b97332f86 100644
--- a/tdeconf_update/tdeconf_update.cpp
+++ b/tdeconf_update/tdeconf_update.cpp
@@ -40,9 +40,9 @@
 
 static TDECmdLineOptions options[] =
 {
-        { "debug", I18N_NOOP("Keep output results from scripts"), 0 },
-	{ "check <update-file>", I18N_NOOP("Check whether config file itself requires updating"), 0 },
-	{ "+[file]", I18N_NOOP("File to read update instructions from"), 0 },
+        { "debug", I18N_NOOP("Keep output results from scripts"), nullptr },
+	{ "check <update-file>", I18N_NOOP("Check whether config file itself requires updating"), nullptr },
+	{ "+[file]", I18N_NOOP("File to read update instructions from"), nullptr },
         TDECmdLineLastOption
 };
 
@@ -106,12 +106,12 @@ protected:
 };
 
 KonfUpdate::KonfUpdate()
- : m_textStream(0), m_file(0)
+ : m_textStream(nullptr), m_file(nullptr)
 {
    bool updateAll = false;
-   oldConfig1 = 0;
-   oldConfig2 = 0;
-   newConfig = 0;
+   oldConfig1 = nullptr;
+   oldConfig2 = nullptr;
+   newConfig = nullptr;
 
    config = new TDEConfig("tdeconf_updaterc");
 
@@ -440,7 +440,7 @@ void KonfUpdate::gotFile(const TQString &_file)
    {
       // Close old file.
       delete oldConfig1;
-      oldConfig1 = 0;
+      oldConfig1 = nullptr;
 
       oldConfig2->setGroup("$Version");
       TQStringList ids = oldConfig2->readListEntry("update_info");
@@ -452,7 +452,7 @@ void KonfUpdate::gotFile(const TQString &_file)
       }
       oldConfig2->sync();
       delete oldConfig2;
-      oldConfig2 = 0;
+      oldConfig2 = nullptr;
       
       TQString file = locateLocal("config", oldFile);
       struct stat s_buf;
@@ -480,11 +480,11 @@ void KonfUpdate::gotFile(const TQString &_file)
       }
       newConfig->sync();
       delete newConfig;
-      newConfig = 0;
+      newConfig = nullptr;
 
       newFile = TQString::null;
    }
-   newConfig = 0; 
+   newConfig = nullptr;
 
    int i = _file.find(',');
    if (i == -1)
@@ -946,7 +946,7 @@ extern "C" TDE_EXPORT int kdemain(int argc, char **argv)
                         TDEAboutData::License_GPL,
                         "(c) 2001, Waldo Bastian");
 
-   aboutData.addAuthor("Waldo Bastian", 0, "bastian@kde.org");
+   aboutData.addAuthor("Waldo Bastian", nullptr, "bastian@kde.org");
 
    TDECmdLineArgs::init(argc, argv, &aboutData);
    TDECmdLineArgs::addCmdLineOptions(options);
diff --git a/tdecore/kallocator.cpp b/tdecore/kallocator.cpp
index 254088050..848f4e35a 100644
--- a/tdecore/kallocator.cpp
+++ b/tdecore/kallocator.cpp
@@ -33,7 +33,7 @@
 class TDEZoneAllocator::MemBlock
 {
   public:
-    MemBlock(size_t s) : size(s), ref(0), older(0), newer(0)
+    MemBlock(size_t s) : size(s), ref(0), older(nullptr), newer(nullptr)
       { begin = new char[s]; }
     ~MemBlock() { delete [] begin; }
     bool is_in(void *ptr) const {return !(begin > (char *)ptr
@@ -46,8 +46,8 @@ class TDEZoneAllocator::MemBlock
 };
 
 TDEZoneAllocator::TDEZoneAllocator(unsigned long _blockSize)
-: currentBlock(0), blockSize(1), blockOffset(0), log2(0), num_blocks(0), 
-  hashList(0), hashSize(0), hashDirty(true)
+: currentBlock(nullptr), blockSize(1), blockOffset(0), log2(0), num_blocks(0),
+  hashList(nullptr), hashSize(0), hashDirty(true)
 {
   while (blockSize < _blockSize)
     blockSize <<= 1, log2++;
@@ -65,7 +65,7 @@ TDEZoneAllocator::~TDEZoneAllocator()
     for (unsigned int i = 0; i < hashSize; i++)
       delete hashList[i];
     delete [] hashList;
-    hashList = 0;
+    hashList = nullptr;
   }
   MemBlock *next;
   for (; currentBlock; currentBlock = next) {
@@ -101,7 +101,7 @@ void TDEZoneAllocator::insertHash(MemBlock *b)
 */
 void TDEZoneAllocator::addBlock(MemBlock *b)
 {
-  b->newer = 0;
+  b->newer = nullptr;
   b->older = currentBlock;
   if (currentBlock)
     b->older->newer = b;
@@ -125,7 +125,7 @@ void TDEZoneAllocator::initHash()
     for (unsigned int i = 0; i < hashSize; i++)
       delete hashList[i];
     delete [] hashList;
-    hashList = 0;
+    hashList = nullptr;
   }
   hashSize = 1;
   while (hashSize < num_blocks)
@@ -173,7 +173,7 @@ void TDEZoneAllocator::delBlock(MemBlock *b)
   if (b->newer)
     b->newer->older = b->older;
   if (b == currentBlock) {
-    currentBlock = 0;
+    currentBlock = nullptr;
     blockOffset = blockSize;
   }
   delete b;
@@ -191,7 +191,7 @@ TDEZoneAllocator::allocate(size_t _size)
    {
       if (_size > blockSize) {
 	tqDebug("TDEZoneAllocator: allocating more than %lu bytes", blockSize);
-	return 0;
+	return nullptr;
       }
       addBlock(new MemBlock(blockSize));
       blockOffset = 0;
diff --git a/tdecore/kaudioplayer.h b/tdecore/kaudioplayer.h
index ce26a1e9a..c06b718b7 100644
--- a/tdecore/kaudioplayer.h
+++ b/tdecore/kaudioplayer.h
@@ -64,7 +64,7 @@ public:
 	 * @param name An internal name for this KAudioPlayer
 	 */
 	KAudioPlayer( const TQString& filename,
-			TQObject* parent = 0, const char* name = 0 );
+			TQObject* parent = nullptr, const char* name = nullptr );
 
 	/**
 	 * Destructor.
diff --git a/tdecore/kbufferedio.cpp b/tdecore/kbufferedio.cpp
index d1ba6dcf2..05082afad 100644
--- a/tdecore/kbufferedio.cpp
+++ b/tdecore/kbufferedio.cpp
@@ -134,13 +134,13 @@ bool TDEBufferedIO::canReadLine() const
   buf = buflist.first();
   char *p = buf->data() + inBufIndex;
   int n = buf->size() - inBufIndex;
-  while (buf != NULL)
+  while (buf)
     {
       while (n--)
 	if (*p++ == '\n')
 	  return true;
       buf = buflist.next();
-      if (buf != NULL)
+      if (buf)
 	{
 	  p = buf->data();
 	  n = buf->size();
@@ -214,7 +214,7 @@ unsigned TDEBufferedIO::consumeReadBuffer(unsigned nbytes, char *destbuffer, boo
 void TDEBufferedIO::consumeWriteBuffer(unsigned nbytes)
 {
   TQByteArray *buf = outBuf.first();
-  if (buf == NULL)
+  if (!buf)
     return;			// nothing to consume
 
   if (nbytes < buf->size() - outBufIndex)
@@ -226,7 +226,7 @@ void TDEBufferedIO::consumeWriteBuffer(unsigned nbytes)
       outBufIndex = 0;
       outBuf.remove();
 
-      while ((buf = outBuf.current()) != NULL)
+      while ((buf = outBuf.current()) != nullptr)
 	if (buf->size() <= nbytes)
 	  {
 	    nbytes -= buf->size();
@@ -271,7 +271,7 @@ unsigned TDEBufferedIO::readBufferSize() const
 {
   unsigned count = 0;
   TQByteArray *buf = ((TDEBufferedIO*)this)->inBuf.first();
-  while (buf != NULL)
+  while (buf)
     {
       count += buf->size();
       buf = ((TDEBufferedIO*)this)->inBuf.next();
@@ -284,7 +284,7 @@ unsigned TDEBufferedIO::writeBufferSize() const
 {
   unsigned count = 0;
   TQByteArray *buf = ((TDEBufferedIO*)this)->outBuf.first();
-  while (buf != NULL)
+  while (buf)
     {
       count += buf->size();
       buf = (const_cast<TDEBufferedIO*>(this))->outBuf.next();
diff --git a/tdecore/kcalendarsystem.h b/tdecore/kcalendarsystem.h
index bd3fbe4ff..4d25f73e0 100644
--- a/tdecore/kcalendarsystem.h
+++ b/tdecore/kcalendarsystem.h
@@ -47,7 +47,7 @@ public:
    *
    * @param locale It will use this locale for translations, 0 means global.
    */
-  KCalendarSystem(const TDELocale * locale = 0);
+  KCalendarSystem(const TDELocale * locale = nullptr);
 
   /**
    * Descructor.
@@ -227,7 +227,7 @@ public:
    * @param yearNum The year the date belongs to
    * @return week number
    */
-  virtual int weekNumber(const TQDate& date, int * yearNum = 0) const = 0;
+  virtual int weekNumber(const TQDate& date, int * yearNum = nullptr) const = 0;
 
   /**
    * Gets specific calendar type month name for a given month number
diff --git a/tdecore/kcalendarsystemfactory.h b/tdecore/kcalendarsystemfactory.h
index 96aef1c4a..11f1df857 100644
--- a/tdecore/kcalendarsystemfactory.h
+++ b/tdecore/kcalendarsystemfactory.h
@@ -50,7 +50,7 @@ public:
    * @return a KCalendarSystem object
    */
   static KCalendarSystem *create (const TQString & calType = TQString::fromLatin1("gregorian"),
-                                  const TDELocale * locale = 0);
+                                  const TDELocale * locale = nullptr);
 
   /**
    * Gets list of names of supported calendar systems
diff --git a/tdecore/kcalendarsystemgregorian.h b/tdecore/kcalendarsystemgregorian.h
index 34c9ecde3..85707251f 100644
--- a/tdecore/kcalendarsystemgregorian.h
+++ b/tdecore/kcalendarsystemgregorian.h
@@ -44,7 +44,7 @@ class TDECORE_EXPORT KCalendarSystemGregorian: public KCalendarSystem
 {
 public:
   /** Constructor. Just like KCalendarSystem::KCalendarSystem(). */
-  KCalendarSystemGregorian (const TDELocale * locale = 0);
+  KCalendarSystemGregorian (const TDELocale * locale = nullptr);
   virtual ~KCalendarSystemGregorian ();
 
   virtual int year (const TQDate & date) const;
@@ -64,7 +64,7 @@ public:
   virtual int daysInYear (const TQDate & date) const;
   virtual int daysInMonth (const TQDate & date) const;
   virtual int weeksInYear(int year) const;
-  virtual int weekNumber(const TQDate& date, int * yearNum = 0) const;
+  virtual int weekNumber(const TQDate& date, int * yearNum = nullptr) const;
 
   virtual int yearStringToInteger(const TQString & sNum, int & iLength) const;
 
diff --git a/tdecore/kcalendarsystemhebrew.h b/tdecore/kcalendarsystemhebrew.h
index 1482c1a80..956f44d92 100644
--- a/tdecore/kcalendarsystemhebrew.h
+++ b/tdecore/kcalendarsystemhebrew.h
@@ -46,7 +46,7 @@ class TDECORE_EXPORT KCalendarSystemHebrew : public KCalendarSystem
 {
 public:
   /** Constructor. Just like KCalendarSystem::KCalendarSystem(). */
-  KCalendarSystemHebrew(const TDELocale * locale = 0);
+  KCalendarSystemHebrew(const TDELocale * locale = nullptr);
   virtual ~KCalendarSystemHebrew();
 
   virtual int year (const TQDate & date) const;
@@ -65,7 +65,7 @@ public:
   virtual int daysInYear (const TQDate & date) const;
   virtual int daysInMonth (const TQDate & date) const;
   virtual int weeksInYear(int year) const;
-  virtual int weekNumber(const TQDate& date, int * yearNum = 0) const;
+  virtual int weekNumber(const TQDate& date, int * yearNum = nullptr) const;
 
   virtual TQString monthName (int month, int year, bool shortName = false) const;
   virtual TQString monthName (const TQDate & date, bool shortName = false ) const;
diff --git a/tdecore/kcalendarsystemhijri.cpp b/tdecore/kcalendarsystemhijri.cpp
index ef94b590f..e37c509f7 100644
--- a/tdecore/kcalendarsystemhijri.cpp
+++ b/tdecore/kcalendarsystemhijri.cpp
@@ -190,21 +190,21 @@ KCalendarSystemHijri::~KCalendarSystemHijri()
 int KCalendarSystemHijri::year(const TQDate& date) const
 {
   int y;
-  gregorianToHijri(date, &y, 0, 0);
+  gregorianToHijri(date, &y, nullptr, nullptr);
   return y;
 }
 
 int KCalendarSystemHijri::month(const TQDate& date) const
 {
   int m;
-  gregorianToHijri(date, 0, &m, 0);
+  gregorianToHijri(date, nullptr, &m, nullptr);
   return m;
 }
 
 int KCalendarSystemHijri::day(const TQDate& date) const
 {
   int d;
-  gregorianToHijri(date, 0, 0, &d);
+  gregorianToHijri(date, nullptr, nullptr, &d);
   return d;
 }
 
@@ -502,7 +502,7 @@ int KCalendarSystemHijri::dayOfYear(const TQDate & date) const
 int KCalendarSystemHijri::daysInMonth(const TQDate& date) const
 {
   int y, m;
-  gregorianToHijri(date, &y, &m, 0);
+  gregorianToHijri(date, &y, &m, nullptr);
 
   return lastDayOfIslamicMonth(m, y);
 }
diff --git a/tdecore/kcalendarsystemhijri.h b/tdecore/kcalendarsystemhijri.h
index 0ba1e52df..f25b006c7 100644
--- a/tdecore/kcalendarsystemhijri.h
+++ b/tdecore/kcalendarsystemhijri.h
@@ -44,7 +44,7 @@ class TDECORE_EXPORT KCalendarSystemHijri : public KCalendarSystem
 {
 public:
   /** Constructor. Just like KCalendarSystem::KCalendarSystem(). */
-  KCalendarSystemHijri(const TDELocale * locale = 0);
+  KCalendarSystemHijri(const TDELocale * locale = nullptr);
   virtual ~KCalendarSystemHijri();
 
   virtual int year (const TQDate & date) const;
@@ -63,7 +63,7 @@ public:
   virtual int daysInYear (const TQDate & date) const;
   virtual int daysInMonth (const TQDate & date) const;
   virtual int weeksInYear(int year) const;
-  virtual int weekNumber(const TQDate& date, int * yearNum = 0) const;
+  virtual int weekNumber(const TQDate& date, int * yearNum = nullptr) const;
 
   virtual TQString monthName (int month, int year, bool shortName = false) const;
   virtual TQString monthName (const TQDate & date, bool shortName = false ) const;
diff --git a/tdecore/kcalendarsystemjalali.cpp b/tdecore/kcalendarsystemjalali.cpp
index 3c71ca442..9cd7b64fb 100644
--- a/tdecore/kcalendarsystemjalali.cpp
+++ b/tdecore/kcalendarsystemjalali.cpp
@@ -214,7 +214,7 @@ int KCalendarSystemJalali::year(const TQDate& date) const
 {
   kdDebug(5400) << "Jalali year..." <<  endl;
 int y;
-  gregorianToJalali(date, &y, 0, 0);
+  gregorianToJalali(date, &y, nullptr, nullptr);
   return y;
 }
 
@@ -223,7 +223,7 @@ int KCalendarSystemJalali::month (const TQDate& date) const
 {
   kdDebug(5400) << "Jalali month..." <<  endl;
 int m;
-  gregorianToJalali(date, 0 , &m, 0);
+  gregorianToJalali(date, nullptr , &m, nullptr);
   return m;
 }
 
@@ -232,7 +232,7 @@ int KCalendarSystemJalali::day(const TQDate& date) const
 {
   kdDebug(5400) << "Jalali day..." <<  endl;
 int d;
-  gregorianToJalali(date, 0, 0, &d);
+  gregorianToJalali(date, nullptr, nullptr, &d);
   return d;
 }
 
@@ -449,7 +449,7 @@ TQString KCalendarSystemJalali::monthName(const TQDate& date, bool shortName)
   const
 {
   int mon;
-  gregorianToJalali(date,0,&mon,0);
+  gregorianToJalali(date,nullptr,&mon,nullptr);
   //SDATE *sd = gregorianToJalali(date.year(),date.month(),date.day());
   return (monthName(mon, 0, shortName));
 }
diff --git a/tdecore/kcalendarsystemjalali.h b/tdecore/kcalendarsystemjalali.h
index 8f9c4ddb9..0e78dd436 100644
--- a/tdecore/kcalendarsystemjalali.h
+++ b/tdecore/kcalendarsystemjalali.h
@@ -37,7 +37,7 @@ class TDECORE_EXPORT KCalendarSystemJalali : public KCalendarSystem
 {
 public:
   /** Constructor. Just like KCalendarSystem::KCalendarSystem(). */
-  KCalendarSystemJalali(const TDELocale * locale = 0);
+  KCalendarSystemJalali(const TDELocale * locale = nullptr);
   virtual ~KCalendarSystemJalali();
 
 
@@ -59,7 +59,7 @@ public:
   virtual int daysInYear (const TQDate & date) const;
   virtual int daysInMonth (const TQDate & date) const;
   virtual int weeksInYear(int year) const;
-  virtual int weekNumber(const TQDate& date, int * yearNum = 0) const;
+  virtual int weekNumber(const TQDate& date, int * yearNum = nullptr) const;
 
   virtual TQString monthName (const TQDate & date, bool shortName = false ) const;
   virtual TQString monthNamePossessive(const TQDate & date, bool shortName = false ) const;
diff --git a/tdecore/kcatalogue.cpp b/tdecore/kcatalogue.cpp
index d91338d1f..a96331ad4 100644
--- a/tdecore/kcatalogue.cpp
+++ b/tdecore/kcatalogue.cpp
@@ -38,7 +38,7 @@ struct kde_loaded_l10nfile
 
   const void *data;
 
-  kde_loaded_l10nfile() : filename(0), decided(0), data(0) {}
+  kde_loaded_l10nfile() : filename(nullptr), decided(0), data(nullptr) {}
 };
 #endif
 
@@ -151,11 +151,11 @@ void KCatalogue::doUnload()
   // use gettext's unloader
   if ( d->domain.data )
     ::k_nl_unload_domain( (struct loaded_domain *)d->domain.data );
-  d->domain.data = 0;
+  d->domain.data = nullptr;
 
   // free name
   delete [] const_cast<char *>(d->domain.filename);
-  d->domain.filename = 0;
+  d->domain.filename = nullptr;
 
   d->domain.decided = 0;
 }
diff --git a/tdecore/kcharsets.cpp b/tdecore/kcharsets.cpp
index 47053223f..9020e8ae8 100644
--- a/tdecore/kcharsets.cpp
+++ b/tdecore/kcharsets.cpp
@@ -110,7 +110,7 @@ static const char* const charsets_for_encoding[] = {
 //    "pt 154",
     "winsami2",
     "cp 874",
-    0 }; // extra 0 for end
+    nullptr }; // extra 0 for end
 
 // 0 other
 // 1 Arabic
@@ -185,7 +185,7 @@ static struct LanguageForEncoding
     { "ucs2", 15 },
     { "iso-10646-ucs-2", 15 },
     { "winsami2", 16},
-    { 0, 0 } };
+    { nullptr, 0 } };
 
 // defines some different names for codecs that are built into Qt.
 static struct Builtin
@@ -288,7 +288,7 @@ static struct Builtin
     { "csiso2022jp", "jis7" }, // See bug #77243
     { "big5-eten", "big5-hkscs" },
     { "cp950", "big5-hkscs" },
-    { 0, 0 }};
+    { nullptr, nullptr }};
 
 // some different names for the encodings defined in the charmaps files.
 // even though the charmap file names are all uppercase, the names are all lowercase here.
@@ -303,7 +303,7 @@ static struct Aliases
     { "windows852", "ibm852" },
     { "windows-852", "ibm852" },
     { "x-windows-852", "ibm852" },
-    { 0, 0 }};
+    { nullptr, nullptr }};
 
 // some last resort hints in case the charmap file couldn't be found. This gives at least a partial conversion
 // and helps making things readable.
@@ -320,20 +320,20 @@ static struct ConversionHints
     { "pt 154", "cp 1251" },
     { "paratype-154", "cp 1251" },
     { "pt-154", "cp 1251" },
-    { 0, 0 }};
+    { nullptr, nullptr }};
 
 
 // search an array of items index/data, index is const char*, data is T, find first matching index
-// and return data, or return 0
+// and return data, or a default-constructed data value
 template< typename T, typename Data >
 static Data kcharsets_array_search( const T* start, const char* entry )
 {
     for( const T* pos = start;
-         pos->index != 0;
+         pos->index;
          ++pos )
         if( qstrcmp( pos->index, entry ) == 0 )
             return pos->data;
-    return 0;
+    return Data();
 }
 
 
@@ -343,7 +343,7 @@ public:
     KCharsetsPrivate(KCharsets* _kc)
         : codecForNameDict(43, false) // case insensitive
     {
-        db = 0;
+        db = nullptr;
         kc = _kc;
     }
     ~KCharsetsPrivate()
@@ -431,7 +431,7 @@ TQString KCharsets::resolveEntities( const TQString &input )
     TQString text = input;
     const TQChar *p = text.unicode();
     const TQChar *end = p + text.length();
-    const TQChar *ampersand = 0;
+    const TQChar *ampersand = nullptr;
     bool scanForSemicolon = false;
 
     for ( ; p < end; ++p ) {
@@ -466,7 +466,7 @@ TQString KCharsets::resolveEntities( const TQString &input )
         text.remove( ampersandPos + 1, entityLength + 1 );
         p = text.unicode() + ampersandPos;
         end = text.unicode() + text.length();
-        ampersand = 0;
+        ampersand = nullptr;
     }
 
     return text;
@@ -540,7 +540,7 @@ TQTextCodec *KCharsets::codecForName(const TQString &n, bool &ok) const
 {
     ok = true;
 
-    TQTextCodec* codec = 0;
+    TQTextCodec* codec = nullptr;
     // dict lookup is case insensitive anyway
     if((codec = d->codecForNameDict[n.isEmpty() ? "->locale<-" : n.latin1()]))
         return codec; // cache hit, return
diff --git a/tdecore/kcheckaccelerators.cpp b/tdecore/kcheckaccelerators.cpp
index 93ed7f86a..fdffb90ae 100644
--- a/tdecore/kcheckaccelerators.cpp
+++ b/tdecore/kcheckaccelerators.cpp
@@ -77,7 +77,7 @@
 */
 
 KCheckAccelerators::KCheckAccelerators( TQObject* parent )
-    : TQObject( parent, "kapp_accel_filter" ), key(0), block( false ), drklash(0)
+    : TQObject( parent, "kapp_accel_filter" ), key(0), block( false ), drklash(nullptr)
 {
     parent->installEventFilter( this );
     TDEConfigGroupSaver saver( TDEGlobal::config(), "Development" );
@@ -150,7 +150,7 @@ void KCheckAccelerators::createDialog(TQWidget *actWin, bool automatic)
     TQVBoxLayout* layout = new TQVBoxLayout( drklash, 11, 6 );
     layout->setAutoAdd( true );
     drklash_view = new TQTextView( drklash );
-    TQCheckBox* disableAutoCheck = NULL;
+    TQCheckBox* disableAutoCheck = nullptr;
     if( automatic )  {
         disableAutoCheck = new TQCheckBox( i18n( "&Disable automatic checking" ), drklash );
         connect(disableAutoCheck, TQ_SIGNAL(toggled(bool)), TQ_SLOT(slotDisableCheck(bool)));
diff --git a/tdecore/kclipboard.cpp b/tdecore/kclipboard.cpp
index 369f88c3d..b5dac2259 100644
--- a/tdecore/kclipboard.cpp
+++ b/tdecore/kclipboard.cpp
@@ -69,7 +69,7 @@ public:
         if ( i < (int) m_formats.count() )
             return m_formats.at( i );
         else
-            return 0L;
+            return nullptr;
     }
     virtual bool provides( const char *mimeType ) const {
         return ( m_formats.find( mimeType ) > -1 );
@@ -89,7 +89,7 @@ private:
 };
 
 
-TDEClipboardSynchronizer * TDEClipboardSynchronizer::s_self = 0L;
+TDEClipboardSynchronizer * TDEClipboardSynchronizer::s_self = nullptr;
 bool TDEClipboardSynchronizer::s_sync = false;
 bool TDEClipboardSynchronizer::s_reverse_sync = false;
 bool TDEClipboardSynchronizer::s_blocked = false;
@@ -118,13 +118,13 @@ TDEClipboardSynchronizer::TDEClipboardSynchronizer( TQObject *parent, const char
 TDEClipboardSynchronizer::~TDEClipboardSynchronizer()
 {
     if ( s_self == this )
-        s_self = 0L;
+        s_self = nullptr;
 }
 
 void TDEClipboardSynchronizer::setupSignals()
 {
     TQClipboard *clip = TQApplication::clipboard();
-    disconnect( clip, NULL, this, NULL );
+    disconnect( clip, nullptr, this, nullptr );
     if( s_sync )
         connect( clip, TQ_SIGNAL( selectionChanged() ),
                  TQ_SLOT( slotSelectionChanged() ));
diff --git a/tdecore/kclipboard.h b/tdecore/kclipboard.h
index df45027f1..63c3ad09d 100644
--- a/tdecore/kclipboard.h
+++ b/tdecore/kclipboard.h
@@ -100,7 +100,7 @@ private slots:
     void slotClipboardChanged();
 
 private:
-    TDEClipboardSynchronizer( TQObject *parent = 0, const char *name = 0L );
+    TDEClipboardSynchronizer( TQObject *parent = nullptr, const char *name = nullptr );
     void setupSignals();
 
     static void setClipboard( TQMimeSource* data, TQClipboard::Mode mode );
diff --git a/tdecore/kcompletion.cpp b/tdecore/kcompletion.cpp
index 4a80d85df..6b575f4eb 100644
--- a/tdecore/kcompletion.cpp
+++ b/tdecore/kcompletion.cpp
@@ -456,7 +456,7 @@ TQString TDECompletion::findCompletion( const TQString& string )
                 // don't just find the "first" match, but the one with the
                 // highest priority
         
-                const TDECompTreeNode* temp_node = 0L;
+                const TDECompTreeNode* temp_node = nullptr;
                 while(1) {
                     int count = node->childrenCount();
                     temp_node = node->firstChild();
@@ -682,7 +682,7 @@ TDECompTreeNode * TDECompTreeNode::insert( const TQChar& ch, bool sorted )
 
         // FIXME, first (slow) sorted insertion implementation
         if ( sorted ) {
-            TDECompTreeNode * prev = 0;
+            TDECompTreeNode * prev = nullptr;
             TDECompTreeNode * cur = myChildren.begin();
             while ( cur ) {
                 if ( ch > *cur ) {
@@ -718,7 +718,7 @@ void TDECompTreeNode::remove( const TQString& str )
 
     TQPtrVector<TDECompTreeNode> deletables( string.length() + 1 );
 
-    TDECompTreeNode *child = 0L;
+    TDECompTreeNode *child = nullptr;
     TDECompTreeNode *parent = this;
     deletables.insert( 0, parent );
     
@@ -768,7 +768,7 @@ TDECompletionMatches::TDECompletionMatches( bool sort_P )
 TDECompletionMatches::TDECompletionMatches( const TDECompletionMatchesWrapper& matches )
     : _sorting( matches.sorting())
 {
-    if( matches.sortedList != 0L )
+    if( matches.sortedList )
         TDECompletionMatchesList::operator=( *matches.sortedList );
     else {
         TQStringList l = matches.list();
@@ -815,12 +815,12 @@ void TDECompTreeNodeList::append(TDECompTreeNode *item)
     m_count++;
     if (!last) {
         last = item;
-        last->next = 0;
+        last->next = nullptr;
         first = item;
         return;
     }
     last->next = item;
-    item->next = 0;
+    item->next = nullptr;
     last = item;
 }
 
@@ -829,7 +829,7 @@ void TDECompTreeNodeList::prepend(TDECompTreeNode *item)
     m_count++;
     if (!last) {
         last = item;
-        last->next = 0;
+        last->next = nullptr;
         first = item;
         return;
     }
@@ -856,8 +856,8 @@ void TDECompTreeNodeList::insert(TDECompTreeNode *after, TDECompTreeNode *item)
 TDECompTreeNode *TDECompTreeNodeList::remove(TDECompTreeNode *item)
 {
     if (!first || !item)
-        return 0;
-    TDECompTreeNode *cur = 0;
+        return nullptr;
+    TDECompTreeNode *cur = nullptr;
 
     if (item == first)
         first = first->next;
@@ -865,7 +865,7 @@ TDECompTreeNode *TDECompTreeNodeList::remove(TDECompTreeNode *item)
         cur = first;
         while (cur && cur->next != item) cur = cur->next;
         if (!cur)
-            return 0;
+            return nullptr;
         cur->next = item->next;
     }
     if (item == last)
diff --git a/tdecore/kcompletion_private.h b/tdecore/kcompletion_private.h
index 3d956f29d..a13d2e08b 100644
--- a/tdecore/kcompletion_private.h
+++ b/tdecore/kcompletion_private.h
@@ -34,7 +34,7 @@ class TDECompTreeNode;
 class TDECORE_EXPORT TDECompTreeNodeList
 {
 public:
-    TDECompTreeNodeList() : first(0), last(0), m_count(0) {}
+    TDECompTreeNodeList() : first(nullptr), last(nullptr), m_count(0) {}
     TDECompTreeNode *begin() const { return first; }
     TDECompTreeNode *end() const { return last; }
 
@@ -150,7 +150,7 @@ class TDECORE_EXPORT TDECompletionMatchesWrapper
 {
 public:
     TDECompletionMatchesWrapper( bool sort = false )
-        : sortedList( sort ? new TDECompletionMatchesList : 0L ),
+        : sortedList( sort ? new TDECompletionMatchesList : nullptr ),
           dirty( false )
     {}
     ~TDECompletionMatchesWrapper() {
@@ -162,14 +162,14 @@ public:
             sortedList = new TDECompletionMatchesList;
         else if ( !sort ) {
             delete sortedList;
-            sortedList = 0L;
+            sortedList = nullptr;
         }
         stringList.clear();
         dirty = false;
     }
 
     bool sorting() const {
-        return sortedList != 0L;
+        return sortedList != nullptr;
     }
 
     void append( int i, const TQString& string ) {
diff --git a/tdecore/kcompletionbase.cpp b/tdecore/kcompletionbase.cpp
index 8a67f4647..e17422fce 100644
--- a/tdecore/kcompletionbase.cpp
+++ b/tdecore/kcompletionbase.cpp
@@ -24,7 +24,7 @@
 
 TDECompletionBase::TDECompletionBase()
 {
-    m_delegate = 0L;
+    m_delegate = nullptr;
     // Assign the default completion type to use.
     m_iCompletionMode = TDEGlobalSettings::completionMode();
 
diff --git a/tdecore/kdebug.cpp b/tdecore/kdebug.cpp
index 64f59555f..c1e7a3d0e 100644
--- a/tdecore/kdebug.cpp
+++ b/tdecore/kdebug.cpp
@@ -187,7 +187,7 @@ enum DebugLevels {
 
 struct kDebugPrivate {
   kDebugPrivate() :
-  	oldarea(0), config(0) { }
+	oldarea(0), config(nullptr) { }
 
   ~kDebugPrivate() { delete config; }
 
@@ -196,10 +196,10 @@ struct kDebugPrivate {
   TDEConfig *config;
 };
 
-static kDebugPrivate *kDebug_data = 0;
+static kDebugPrivate *kDebug_data = nullptr;
 static KStaticDeleter<kDebugPrivate> pcd;
 static KStaticDeleter<KDebugDCOPIface> dcopsd;
-static KDebugDCOPIface* kDebugDCOPIface = 0;
+static KDebugDCOPIface* kDebugDCOPIface = nullptr;
 
 static void kDebugBackend( unsigned short nLevel, unsigned int nArea, const char *data)
 {
@@ -345,7 +345,7 @@ static void kDebugBackend( unsigned short nLevel, unsigned int nArea, const char
       // TQMessageBox instead
       if ( !kDebug_data->aAreaName.isEmpty() )
           aCaption += TQString("(%1)").arg( TQString(kDebug_data->aAreaName) );
-      TQMessageBox::warning( 0L, aCaption, data, i18n("&OK") );
+      TQMessageBox::warning( nullptr, aCaption, data, i18n("&OK") );
       break;
   }
   case 2: // Shell
@@ -407,7 +407,7 @@ kdbgstream::~kdbgstream() {
     if (!output.isEmpty()) {
 	fprintf(stderr, "ASSERT: debug output not ended with \\n\n");
         TQString backtrace = kdBacktrace();
-        if (backtrace.ascii() != NULL) {
+        if (backtrace.ascii()) {
                 fprintf(stderr, "%s", backtrace.latin1());
         }
 	*this << '\n';
@@ -447,14 +447,14 @@ kdbgstream& kdbgstream::operator<< (const TQWidget* widget)
 {
   TQString string, temp;
   // -----
-  if(widget==0)
+  if(!widget)
     {
       string=(TQString)"[Null pointer]";
     } else {
       temp.setNum((ulong)widget, 16);
       string=(TQString)"["+widget->className()+" pointer "
 	+ "(0x" + temp + ")";
-      if(widget->name(0)==0)
+      if(!widget->name(nullptr))
 	{
 	  string += " to unnamed widget, ";
 	} else {
@@ -693,7 +693,7 @@ void bfdFillAdditionalFunctionsInfo(BacktraceFunctionInfo &func) {
 	}
 
 	// found source file and line for given address
-	for (asection *sect = abfd->sections; sect != NULL; sect = sect->next) {
+	for (asection *sect = abfd->sections; sect; sect = sect->next) {
 #ifdef HAVE_LIBBFD_2_34_API
 		if (bfd_section_flags(sect) & SEC_ALLOC) {
 			bfd_vma sectStart = bfd_section_vma(sect);
@@ -747,7 +747,7 @@ void fillAdditionalFunctionsInfo(BacktraceFunctionInfo &func) {
 #ifdef HAVE_ABI_CXA_DEMANGLE
 	if(func.prettyName.isEmpty() && !func.functionName.isEmpty()) {
 		int status=0;
-		char *demangled = abi::__cxa_demangle(func.functionName.ascii(), 0, 0, &status);
+		char *demangled = abi::__cxa_demangle(func.functionName.ascii(), nullptr, nullptr, &status);
 		if (demangled) {
 			func.prettyName = demangled;
 			free(demangled);
@@ -864,7 +864,7 @@ void kdClearDebugConfig()
 {
     if (kDebug_data) {
         delete kDebug_data->config;
-        kDebug_data->config = 0;
+        kDebug_data->config = nullptr;
     }
 }
 
diff --git a/tdecore/kdetcompmgr.cpp b/tdecore/kdetcompmgr.cpp
index b5640c67e..84ca80aec 100644
--- a/tdecore/kdetcompmgr.cpp
+++ b/tdecore/kdetcompmgr.cpp
@@ -44,8 +44,8 @@ static TDECmdLineOptions options[] =
 int main(int argc, char **argv)
 {
     TDEAboutData about("kdetcompmgr", I18N_NOOP("kdetcompmgr"), version, description,
-		     TDEAboutData::License_GPL, "(C) 2011-2014 Timothy Pearson", 0, 0, "kb9vqf@pearsoncomputing.net");
-    about.addAuthor( "Timothy Pearson", 0, "kb9vqf@pearsoncomputing.net" );
+		     TDEAboutData::License_GPL, "(C) 2011-2014 Timothy Pearson", nullptr, nullptr, "kb9vqf@pearsoncomputing.net");
+    about.addAuthor( "Timothy Pearson", nullptr, "kb9vqf@pearsoncomputing.net" );
     TDECmdLineArgs::init(argc, argv, &about);
     TDECmdLineArgs::addCmdLineOptions( options );
 
@@ -86,7 +86,7 @@ int main(int argc, char **argv)
         }
 
         free(filename);
-        filename = NULL;
+        filename = nullptr;
 
         if (kompmgrpid) {
             kill(kompmgrpid, SIGTERM);
diff --git a/tdecore/kextsock.cpp b/tdecore/kextsock.cpp
index f78464287..dc3b91087 100644
--- a/tdecore/kextsock.cpp
+++ b/tdecore/kextsock.cpp
@@ -82,8 +82,8 @@ public:
 
   KExtendedSocketPrivate() :
     flags(0), status(0), syserror(0),
-    current(0), local(0), peer(0),
-    qsnIn(0), qsnOut(0), inMaxSize(-1), outMaxSize(-1), emitRead(false), emitWrite(false),
+    current(0), local(nullptr), peer(nullptr),
+    qsnIn(nullptr), qsnOut(nullptr), inMaxSize(-1), outMaxSize(-1), emitRead(false), emitWrite(false),
     addressReusable(false), ipv6only(false)
   {
     timeout.tv_sec = timeout.tv_usec = 0;
@@ -209,14 +209,14 @@ KExtendedSocket::~KExtendedSocket()
 {
   closeNow();
 
-  if (d->local != NULL)
+  if (d->local)
     delete d->local;
-  if (d->peer != NULL)
+  if (d->peer)
     delete d->peer;
 
-  if (d->qsnIn != NULL)
+  if (d->qsnIn)
     delete d->qsnIn;
-  if (d->qsnOut != NULL)
+  if (d->qsnOut)
     delete d->qsnOut;
 
   delete d;
@@ -636,7 +636,7 @@ bool KExtendedSocket::setBufferSize(int rsize, int wsize)
   // The input socket notifier is always enabled
   // That happens because we want to be notified of when the socket gets
   // closed
-  if (d->qsnIn == NULL)
+  if (!d->qsnIn)
     {
       d->qsnIn = new TQSocketNotifier(sockfd, TQSocketNotifier::Read);
       TQObject::connect(d->qsnIn, TQ_SIGNAL(activated(int)), this, TQ_SLOT(socketActivityRead()));
@@ -648,7 +648,7 @@ bool KExtendedSocket::setBufferSize(int rsize, int wsize)
       // user wants to disable input buffering
       d->flags &= ~inputBufferedSocket;
 
-      consumeReadBuffer(readBufferSize(), NULL, true);
+      consumeReadBuffer(readBufferSize(), nullptr, true);
       d->inMaxSize = 0;
     }
   else if (rsize != -2)
@@ -660,7 +660,7 @@ bool KExtendedSocket::setBufferSize(int rsize, int wsize)
 
       if (rsize > 0 && (unsigned)rsize < readBufferSize())
 	// input buffer has more data than the new size; discard
-	consumeReadBuffer(readBufferSize() - rsize, NULL, true);
+	consumeReadBuffer(readBufferSize() - rsize, nullptr, true);
 
     }
 
@@ -684,7 +684,7 @@ bool KExtendedSocket::setBufferSize(int rsize, int wsize)
 	// output buffer is bigger than it is to become; shrink
 	consumeWriteBuffer(writeBufferSize() - wsize);
 
-      if (d->qsnOut == NULL)
+      if (!d->qsnOut)
 	{
 	  d->qsnOut = new TQSocketNotifier(sockfd, TQSocketNotifier::Write);
 	  TQObject::connect(d->qsnOut, TQ_SIGNAL(activated(int)), this, TQ_SLOT(socketActivityWrite()));
@@ -699,7 +699,7 @@ bool KExtendedSocket::setBufferSize(int rsize, int wsize)
   setFlags((mode() & ~IO_Raw) | ((d->flags & bufferedSocket) ? 0 : IO_Raw));
 
   // check we didn't turn something off we shouldn't
-  if (d->emitWrite && d->qsnOut == NULL)
+  if (d->emitWrite && !d->qsnOut)
     {
       d->qsnOut = new TQSocketNotifier(sockfd, TQSocketNotifier::Write);
       TQObject::connect(d->qsnOut, TQ_SIGNAL(activated(int)), this, TQ_SLOT(socketActivityWrite()));
@@ -715,10 +715,10 @@ bool KExtendedSocket::setBufferSize(int rsize, int wsize)
  */
 const ::TDESocketAddress *KExtendedSocket::localAddress()
 {
-  if (d->local != NULL)
+  if (d->local)
     return d->local;
   if (d->status < bound)
-    return NULL;
+    return nullptr;
 
   return d->local = localAddress(sockfd);
 }
@@ -730,10 +730,10 @@ const ::TDESocketAddress *KExtendedSocket::localAddress()
  */
 const ::TDESocketAddress* KExtendedSocket::peerAddress()
 {
-  if (d->peer != NULL)
+  if (d->peer)
     return d->peer;
   if (d->flags & passiveSocket || d->status < connected)
-    return NULL;
+    return nullptr;
 
   return d->peer = peerAddress(sockfd);
 }
@@ -904,7 +904,7 @@ int KExtendedSocket::listen(int N)
 int KExtendedSocket::accept(KExtendedSocket *&sock)
 {
   cleanError();
-  sock = NULL;
+  sock = nullptr;
   if ((d->flags & passiveSocket) == 0 || d->status >= accepting)
     return -2;
   if (d->status < listening)
@@ -917,7 +917,7 @@ int KExtendedSocket::accept(KExtendedSocket *&sock)
   bool block = blockingMode();
   struct sockaddr sa;
   ksocklen_t len = sizeof(sa);
-  sock = NULL;
+  sock = nullptr;
 
   if (d->timeout.tv_sec > 0 || d->timeout.tv_usec > 0)
     {
@@ -930,7 +930,7 @@ int KExtendedSocket::accept(KExtendedSocket *&sock)
       //kdDebug(170).form("Accepting on %d with %d.%06d second timeout\n",
       //	     sockfd, d->timeout.tv_sec, d->timeout.tv_usec);
       // check if there is anything to accept now
-      int retval = KSocks::self()->select(sockfd + 1, &set, NULL, NULL, &d->timeout);
+      int retval = KSocks::self()->select(sockfd + 1, &set, nullptr, nullptr, &d->timeout);
       if (retval == -1)
 	{
 	  setError(IO_UnspecifiedError, errno);
@@ -1005,7 +1005,7 @@ int KExtendedSocket::connect()
       bool doingtimeout = d->timeout.tv_sec > 0 || d->timeout.tv_usec > 0;
       if (doingtimeout)
         {
-          gettimeofday(&end, NULL);
+          gettimeofday(&end, nullptr);
           end.tv_usec += d->timeout.tv_usec;
           end.tv_sec += d->timeout.tv_sec;
           if (end.tv_usec > 1000*1000)
@@ -1098,7 +1098,7 @@ int KExtendedSocket::connect()
 	      FD_SET(sockfd, &rd);
 	      FD_SET(sockfd, &wr);
 
-	      int retval = KSocks::self()->select(sockfd + 1, &rd, &wr, NULL, &d->timeout);
+	      int retval = KSocks::self()->select(sockfd + 1, &rd, &wr, nullptr, &d->timeout);
 	      if (retval == -1)
 		{
 		  setError(IO_FatalError, errno);
@@ -1125,7 +1125,7 @@ int KExtendedSocket::connect()
 		}
 
 	      // adjust remaining time
-	      gettimeofday(&now, NULL);
+	      gettimeofday(&now, nullptr);
 	      d->timeout.tv_sec = end.tv_sec - now.tv_sec;
 	      d->timeout.tv_usec = end.tv_usec - now.tv_usec;
 	      if (d->timeout.tv_usec < 0)
@@ -1249,7 +1249,7 @@ void KExtendedSocket::cancelAsyncConnect()
 	delete d->qsnIn;
       if (d->qsnOut)
 	delete d->qsnOut;
-      d->qsnIn = d->qsnOut = NULL;
+      d->qsnIn = d->qsnOut = nullptr;
 
       ::close(sockfd);
       sockfd = -1;
@@ -1282,7 +1282,7 @@ void KExtendedSocket::close()
       d->status = closing;
       if (d->qsnIn)
 	delete d->qsnIn;
-      d->qsnIn = NULL;
+      d->qsnIn = nullptr;
       // we keep the outgoing socket notifier because we want
       // to send data, but not receive
     }
@@ -1294,7 +1294,7 @@ void KExtendedSocket::close()
 	delete d->qsnIn;
       if (d->qsnOut)
 	delete d->qsnOut;
-      d->qsnIn = d->qsnOut = NULL;
+      d->qsnIn = d->qsnOut = nullptr;
 
       ::close(sockfd);
       d->status = done;
@@ -1312,7 +1312,7 @@ void KExtendedSocket::closeNow()
   // close the socket
   delete d->qsnIn;
   delete d->qsnOut;
-  d->qsnIn = d->qsnOut = NULL;
+  d->qsnIn = d->qsnOut = nullptr;
 
   if (d->status > connecting && sockfd != -1)
     {
@@ -1340,22 +1340,22 @@ void KExtendedSocket::release()
   d->resRemote.cancel(false);
   d->resLocal.cancel(false);
 
-  if (d->local != NULL)
+  if (d->local)
     delete d->local;
-  if (d->peer != NULL)
+  if (d->peer)
     delete d->peer;
 
-  d->peer = d->local = NULL;
+  d->peer = d->local = nullptr;
 
-  if (d->qsnIn != NULL)
+  if (d->qsnIn)
     delete d->qsnIn;
-  if (d->qsnOut != NULL)
+  if (d->qsnOut)
     delete d->qsnOut;
 
-  d->qsnIn = d->qsnOut = NULL;
+  d->qsnIn = d->qsnOut = nullptr;
 
   // now that the socket notificators are done with, we can flush out the buffers
-  consumeReadBuffer(readBufferSize(), NULL, true);
+  consumeReadBuffer(readBufferSize(), nullptr, true);
   consumeWriteBuffer(writeBufferSize());
 
   // don't delete d
@@ -1580,7 +1580,7 @@ int KExtendedSocket::waitForMore(int msecs)
   tv.tv_sec = msecs / 1000;
   tv.tv_usec = (msecs % 1000) * 1000;
 
-  int retval = KSocks::self()->select(sockfd + 1, &rd, NULL, NULL, &tv);
+  int retval = KSocks::self()->select(sockfd + 1, &rd, nullptr, nullptr, &tv);
   if (retval == -1)
     {
       setError(IO_FatalError, errno);
@@ -1692,7 +1692,7 @@ void KExtendedSocket::socketActivityRead()
 		  sockfd = -1;	// we're closed
 		  d->qsnIn->deleteLater();
 		  delete d->qsnOut;
-		  d->qsnIn = d->qsnOut = NULL;
+		  d->qsnIn = d->qsnOut = nullptr;
 		  d->status = done;
 		  emit closed(involuntary |
 			      (readBufferSize() ? availRead : 0) |
@@ -1771,7 +1771,7 @@ void KExtendedSocket::socketActivityWrite()
       delete d->qsnOut;
       ::close(sockfd);
 
-      d->qsnOut = NULL;
+      d->qsnOut = nullptr;
       sockfd = -1;
       emit closed(delayed | (readBufferSize() ? availRead : 0));
     }
@@ -1814,7 +1814,7 @@ void KExtendedSocket::connectionEvent()
 	  ::close(sockfd);
 
 	  sockfd = -1;
-	  d->qsnIn = d->qsnOut = NULL;
+	  d->qsnIn = d->qsnOut = nullptr;
 	  d->current++;
 	  setError(IO_ConnectError, errcode);
 	}
@@ -2045,7 +2045,7 @@ TQPtrList<KAddressInfo> KExtendedSocket::lookup(const TQString& host, const TQSt
 	}
       else
 	{
-	  ai->ai->ai_addr = 0;
+	  ai->ai->ai_addr = nullptr;
 	}
 
       ai->addr = ::TDESocketAddress::newAddress(ai->ai->ai_addr, ai->ai->ai_addrlen);
@@ -2070,7 +2070,7 @@ TQPtrList<KAddressInfo> KExtendedSocket::lookup(const TQString& host, const TQSt
    * a NULL pointer to the first call. Some systems are reported to
    * set len to 0 if we pass NULL as the sockaddr */
   if (KSocks::self()->getsockname(fd, sa, &len) == -1)
-    return NULL;		// error!
+    return nullptr;		// error!
 
   /* was it enough? */
   if (len > sizeof(static_sa)
@@ -2087,13 +2087,13 @@ TQPtrList<KAddressInfo> KExtendedSocket::lookup(const TQString& host, const TQSt
 #endif
 
       sa = (sockaddr*)malloc(len);
-      if (sa == NULL)
-	return NULL;		// out of memory
+      if (!sa)
+	return nullptr;		// out of memory
 
       if (KSocks::self()->getsockname(fd, sa, &len) == -1)
 	{
 	  free(sa);
-	  return NULL;
+	  return nullptr;
 	}
 
       local = ::TDESocketAddress::newAddress(sa, len);
@@ -2118,7 +2118,7 @@ TQPtrList<KAddressInfo> KExtendedSocket::lookup(const TQString& host, const TQSt
    * a NULL pointer to the first call. Some systems are reported to
    * set len to 0 if we pass NULL as the sockaddr */
   if (KSocks::self()->getpeername(fd, sa, &len) == -1)
-    return NULL;		// error!
+    return nullptr;		// error!
 
   /* was it enough? */
   if (len > sizeof(static_sa)
@@ -2135,13 +2135,13 @@ TQPtrList<KAddressInfo> KExtendedSocket::lookup(const TQString& host, const TQSt
 #endif
 
       sa = (sockaddr*)malloc(len);
-      if (sa == NULL)
-	return NULL;		// out of memory
+      if (!sa)
+	return nullptr;		// out of memory
 
       if (KSocks::self()->getpeername(fd, sa, &len) == -1)
 	{
 	  free(sa);
-	  return NULL;
+	  return nullptr;
 	}
 
       peer = ::TDESocketAddress::newAddress(sa, len);
@@ -2177,7 +2177,7 @@ KAddressInfo::KAddressInfo(addrinfo *p)
 {
    ai = (addrinfo *) malloc(sizeof(addrinfo));
    memcpy(ai, p, sizeof(addrinfo));
-   ai->ai_next = NULL;
+   ai->ai_next = nullptr;
    if (p->ai_canonname)
    {
       ai->ai_canonname = (char *) malloc(strlen(p->ai_canonname)+1);
diff --git a/tdecore/kextsock.h b/tdecore/kextsock.h
index 3b3018b59..f8f64a532 100644
--- a/tdecore/kextsock.h
+++ b/tdecore/kextsock.h
@@ -967,7 +967,7 @@ public:
    * @param error	pointer to a variable holding the error code
    * @return a list of KAddressInfos
    */
-  static TQPtrList<KAddressInfo> lookup(const TQString& host, const TQString& port, int flags = 0, int *error = 0) TDE_DEPRECATED;
+  static TQPtrList<KAddressInfo> lookup(const TQString& host, const TQString& port, int flags = 0, int *error = nullptr) TDE_DEPRECATED;
 
   /**
    * Returns the local socket address
@@ -1026,7 +1026,7 @@ private:
   addrinfo *ai;
   ::TDESocketAddress *addr;
 
-  inline KAddressInfo() : ai(0), addr(0)
+  inline KAddressInfo() : ai(nullptr), addr(nullptr)
   { }
 
   //  KAddressInfo(addrinfo *ai);
diff --git a/tdecore/kgenericfactory.h b/tdecore/kgenericfactory.h
index 1ed1b41ee..5f2481ebf 100644
--- a/tdecore/kgenericfactory.h
+++ b/tdecore/kgenericfactory.h
@@ -35,7 +35,7 @@ public:
     KGenericFactoryBase( const char *instanceName )
         : m_instanceName( instanceName )
     {
-        m_aboutData=0L;
+        m_aboutData=nullptr;
         s_self = this;
         m_catalogueInitialized = false;
     }
@@ -51,8 +51,8 @@ public:
         if ( s_instance )
             TDEGlobal::locale()->removeCatalogue( TQString::fromAscii( s_instance->instanceName() ) );
         delete s_instance;
-        s_instance = 0;
-        s_self = 0;
+        s_instance = nullptr;
+        s_self = nullptr;
     }
 
     static TDEInstance *instance();
@@ -64,7 +64,7 @@ protected:
             return new TDEInstance( m_aboutData );
         if ( m_instanceName.isEmpty() ) {
             kdWarning() << "KGenericFactory: instance requested but no instance name or about data passed to the constructor!" << endl;
-            return 0;
+            return nullptr;
         }
         return new TDEInstance( m_instanceName );
     }
@@ -95,11 +95,11 @@ private:
 
 /* @internal */
 template <class T>
-TDEInstance *KGenericFactoryBase<T>::s_instance = 0;
+TDEInstance *KGenericFactoryBase<T>::s_instance = nullptr;
 
 /* @internal */
 template <class T>
-KGenericFactoryBase<T> *KGenericFactoryBase<T>::s_self = 0;
+KGenericFactoryBase<T> *KGenericFactoryBase<T>::s_self = nullptr;
 
 /* @internal */
 template <class T>
@@ -173,7 +173,7 @@ template <class Product, class ParentType = TQObject>
 class KGenericFactory : public KLibFactory, public KGenericFactoryBase<Product>
 {
 public:
-    KGenericFactory( const char *instanceName = 0 )
+    KGenericFactory( const char *instanceName = nullptr )
         : KGenericFactoryBase<Product>( instanceName )
     {}
 
@@ -191,7 +191,7 @@ protected:
     {
         KGenericFactoryBase<Product>::initializeMessageCatalogue();
         return (KDEPrivate::ConcreteFactory<Product, ParentType>
-            ::create( 0, 0, parent, name, className, args ));
+            ::create( nullptr, nullptr, parent, name, className, args ));
     }
 };
 
@@ -268,7 +268,7 @@ class KGenericFactory< KTypeList<Product, ProductListTail>, TQObject >
       public KGenericFactoryBase< KTypeList<Product, ProductListTail> >
 {
 public:
-    KGenericFactory( const char *instanceName  = 0 )
+    KGenericFactory( const char *instanceName  = nullptr )
         : KGenericFactoryBase< KTypeList<Product, ProductListTail> >( instanceName )
     {}
 
@@ -286,7 +286,7 @@ protected:
     {
         this->initializeMessageCatalogue();
         return KDEPrivate::MultiFactory< KTypeList< Product, ProductListTail > >
-            ::create( 0, 0, parent, name, className, args );
+            ::create( nullptr, nullptr, parent, name, className, args );
     }
 };
 
@@ -365,7 +365,7 @@ class KGenericFactory< KTypeList<Product, ProductListTail>,
       public KGenericFactoryBase< KTypeList<Product, ProductListTail> >
 {
 public:
-    KGenericFactory( const char *instanceName  = 0 )
+    KGenericFactory( const char *instanceName  = nullptr )
         : KGenericFactoryBase< KTypeList<Product, ProductListTail> >( instanceName )
     {}
 	/**
diff --git a/tdecore/kgenericfactory.tcc b/tdecore/kgenericfactory.tcc
index dda6ec487..7c96b448d 100644
--- a/tdecore/kgenericfactory.tcc
+++ b/tdecore/kgenericfactory.tcc
@@ -132,7 +132,7 @@ namespace KDEPrivate
                                    parent, name, args, Type2Type<BaseType>() );
                 metaObject = metaObject->superClass();
             }
-            return 0;
+            return nullptr;
         }
     private:
         typedef typename If< TQWidgetInheritanceTest<ParentType>::Result,
@@ -152,7 +152,7 @@ namespace KDEPrivate
 
             WidgetParentType *p = dynamic_cast<WidgetParentType *>( parent );
             if ( parent && !p ) 
-                return 0;
+                return nullptr;
             return new Product( p, name, args );
         }
 
@@ -162,7 +162,7 @@ namespace KDEPrivate
         { 
             ParentType *p = dynamic_cast<ParentType *>( parent );
             if ( parent && !p )
-                return 0;
+                return nullptr;
             return new Product( p, name, args ); 
         }
     };
@@ -195,7 +195,7 @@ namespace KDEPrivate
         inline static TQObject *create( TQWidget *, const char *, TQObject *, 
                                         const char *, const char *, 
                                         const TQStringList & )
-        { return 0; }
+        { return nullptr; }
     };
 
      // this specialized template we 'reach' at the end of a typelist
@@ -207,7 +207,7 @@ namespace KDEPrivate
         inline static TQObject *create( TQWidget *, const char *, TQObject *, 
                                         const char *, const char *, 
                                         const TQStringList & )
-        { return 0; }
+        { return nullptr; }
     };
  
     template <class Product, class ProductListTail>
diff --git a/tdecore/kiconeffect.cpp b/tdecore/kiconeffect.cpp
index cd6b9bad7..6a9ed8fb0 100644
--- a/tdecore/kiconeffect.cpp
+++ b/tdecore/kiconeffect.cpp
@@ -58,7 +58,7 @@ TDEIconEffect::TDEIconEffect()
 TDEIconEffect::~TDEIconEffect()
 {
     delete d;
-    d = 0L;
+    d = nullptr;
 }
 
 void TDEIconEffect::init()
@@ -520,7 +520,7 @@ void TDEIconEffect::semiTransparent(TQPixmap &pix)
     }
 
     TQImage img;
-    if (pix.mask() != 0L)
+    if (pix.mask())
 	img = pix.mask()->convertToImage();
     else
     {
diff --git a/tdecore/kiconloader.cpp b/tdecore/kiconloader.cpp
index bda648d02..9b886996a 100644
--- a/tdecore/kiconloader.cpp
+++ b/tdecore/kiconloader.cpp
@@ -134,7 +134,7 @@ static TQValueList< TDEIconLoaderDebug > *kiconloaders;
 TDEIconLoader::TDEIconLoader(const TQString& _appname, TDEStandardDirs *_dirs)
 {
 #ifdef TDEICONLOADER_DEBUG
-    if( kiconloaders == NULL )
+    if( !kiconloaders )
         kiconloaders = new TQValueList< TDEIconLoaderDebug>();
     // check for the (very unlikely case) that new TDEIconLoader gets allocated
     // at exactly same address like some previous one
@@ -151,7 +151,7 @@ TDEIconLoader::TDEIconLoader(const TQString& _appname, TDEStandardDirs *_dirs)
 #endif
     d = new TDEIconLoaderPrivate;
     d->q = this;
-    d->mpGroups = 0L;
+    d->mpGroups = nullptr;
     d->imgDict.setAutoDelete(true);
     d->links.setAutoDelete(true);
 
@@ -179,7 +179,7 @@ void TDEIconLoader::init( const TQString& _appname, TDEStandardDirs *_dirs )
 {
     // If this is unequal to 0, the iconloader is initialized
     // successfully.
-    d->mpThemeRoot = 0L;
+    d->mpThemeRoot = nullptr;
 
     d->appname = _appname;
     d->extraDesktopIconsLoaded = false;
@@ -207,7 +207,7 @@ void TDEIconLoader::init( const TQString& _appname, TDEStandardDirs *_dirs )
             kdError(264) << "Error: standard icon theme"
                          << " \"" << TDEIconTheme::defaultThemeName() << "\" "
                          << " not found!" << endl;
-            d->mpGroups=0L;
+            d->mpGroups=nullptr;
             return;
         }
     }
@@ -217,7 +217,7 @@ void TDEIconLoader::init( const TQString& _appname, TDEStandardDirs *_dirs )
     addBaseThemes(d->mpThemeRoot, appname);
 
     // These have to match the order in kicontheme.h
-    static const char * const groups[] = { "Desktop", "Toolbar", "MainToolbar", "Small", "Panel", 0L };
+    static const char * const groups[] = { "Desktop", "Toolbar", "MainToolbar", "Small", "Panel", nullptr };
     TDEConfig *config = TDEGlobal::config();
     TDEConfigGroupSaver cs(config, "dummy");
 
@@ -225,7 +225,7 @@ void TDEIconLoader::init( const TQString& _appname, TDEStandardDirs *_dirs )
     d->mpGroups = new TDEIconGroup[(int) TDEIcon::LastGroup];
     for (TDEIcon::Group i=TDEIcon::FirstGroup; i<TDEIcon::LastGroup; i++)
     {
-	if (groups[i] == 0L)
+	if (!groups[i])
 	    break;
 	config->setGroup(TQString::fromLatin1(groups[i]) + "Icons");
 	d->mpGroups[i].size = config->readNumEntry("Size", 0);
@@ -281,7 +281,7 @@ TDEIconLoader::~TDEIconLoader()
 #endif
     /* antlarr: There's no need to delete d->mpThemeRoot as it's already
        deleted when the elements of d->links are deleted */
-    d->mpThemeRoot=0;
+    d->mpThemeRoot=nullptr;
     delete[] d->mpGroups;
     delete d;
 }
@@ -516,7 +516,7 @@ inline TQString TDEIconLoader::unknownIconPath( int size ) const
 TQString TDEIconLoader::iconPath(const TQString& _name, int group_or_size,
 			      bool canReturnNull) const
 {
-    if (d->mpThemeRoot == 0L)
+    if (!d->mpThemeRoot)
 	return TQString::null;
 
     if (!TQDir::isRelativePath(_name))
@@ -588,7 +588,7 @@ TQPixmap TDEIconLoader::loadIcon(const TQString& _name, TDEIcon::Group group, in
     TQString key;
     bool absolutePath=false, favIconOverlay=false;
 
-    if (d->mpThemeRoot == 0L)
+    if (!d->mpThemeRoot)
 	return pix;
 
     // Special case for absolute path icons.
@@ -608,7 +608,7 @@ TQPixmap TDEIconLoader::loadIcon(const TQString& _name, TDEIcon::Group group, in
         key += TQString::number(size); key += '_';
 	key += name;
 	bool inCache = TQPixmapCache::find(key, pix);
-	if (inCache && (path_store == 0L))
+	if (inCache && !path_store)
 	    return pix;
 
 	TQString path = (absolutePath) ? name :
@@ -626,7 +626,7 @@ TQPixmap TDEIconLoader::loadIcon(const TQString& _name, TDEIcon::Group group, in
 	    }
 	}
 
-	if (path_store != 0L)
+	if (path_store)
 	    *path_store = path;
 	if (inCache)
 	    return pix;
@@ -698,14 +698,14 @@ TQPixmap TDEIconLoader::loadIcon(const TQString& _name, TDEIcon::Group group, in
 
     // Is the icon in the cache?
     bool inCache = TQPixmapCache::find(key, pix);
-    if (inCache && (path_store == 0L))
+    if (inCache && !path_store)
 	return pix;
 
-    TQImage *img = 0;
+    TQImage *img = nullptr;
     int iconType;
     int iconThreshold;
 
-    if ( ( path_store != 0L ) ||
+    if ( path_store ||
          noEffectKey != d->lastImageKey )
     {
         // No? load it.
@@ -742,7 +742,7 @@ TQPixmap TDEIconLoader::loadIcon(const TQString& _name, TDEIcon::Group group, in
             }
         }
 
-        if (path_store != 0L)
+        if (path_store)
             *path_store = icon.path;
         if (inCache)
             return pix;
@@ -795,16 +795,16 @@ TQPixmap TDEIconLoader::loadIcon(const TQString& _name, TDEIcon::Group group, in
 	TQImage *ovl;
 	TDEIconTheme *theme = d->mpThemeRoot->theme;
 	if ((overlay & TDEIcon::LockOverlay) &&
-		((ovl = loadOverlay(theme->lockOverlay(), size)) != 0L))
+		((ovl = loadOverlay(theme->lockOverlay(), size)) != nullptr))
 	    TDEIconEffect::overlay(*img, *ovl);
 	if ((overlay & TDEIcon::LinkOverlay) &&
-		((ovl = loadOverlay(theme->linkOverlay(), size)) != 0L))
+		((ovl = loadOverlay(theme->linkOverlay(), size)) != nullptr))
 	    TDEIconEffect::overlay(*img, *ovl);
 	if ((overlay & TDEIcon::ZipOverlay) &&
-		((ovl = loadOverlay(theme->zipOverlay(), size)) != 0L))
+		((ovl = loadOverlay(theme->zipOverlay(), size)) != nullptr))
 	    TDEIconEffect::overlay(*img, *ovl);
 	if ((overlay & TDEIcon::ShareOverlay) &&
-	    ((ovl = loadOverlay(theme->shareOverlay(), size)) != 0L))
+	    ((ovl = loadOverlay(theme->shareOverlay(), size)) != nullptr))
 	  TDEIconEffect::overlay(*img, *ovl);
         if (overlay & TDEIcon::HiddenOverlay)
         {
@@ -876,14 +876,14 @@ TQImage *TDEIconLoader::loadOverlay(const TQString &name, int size) const
 {
     TQString key = name + '_' + TQString::number(size);
     TQImage *image = d->imgDict.find(key);
-    if (image != 0L)
+    if (image)
 	return image;
 
     TDEIcon icon = findMatchingIcon(name, size);
     if (!icon.isValid())
     {
 	kdDebug(264) << "Overlay " << name << "not found." << endl;
-	return 0L;
+	return nullptr;
     }
     image = new TQImage(icon.path);
     // In some cases (since size in findMatchingIcon() is more a hint than a
@@ -990,7 +990,7 @@ TQStringList TDEIconLoader::loadAnimated(const TQString& name, TDEIcon::Group gr
         return lst;
 
     struct dirent* ep;
-    while( ( ep = readdir( dp ) ) != 0L )
+    while(( ep = readdir( dp ) ) != nullptr)
     {
         TQString fn(TQFile::decodeName(ep->d_name));
         if(!(fn.left(4)).toUInt())
@@ -1006,7 +1006,7 @@ TQStringList TDEIconLoader::loadAnimated(const TQString& name, TDEIcon::Group gr
 TDEIconTheme *TDEIconLoader::theme() const
 {
     if (d->mpThemeRoot) return d->mpThemeRoot->theme;
-    return 0L;
+    return nullptr;
 }
 
 int TDEIconLoader::currentSize(TDEIcon::Group group) const
@@ -1183,7 +1183,7 @@ TQIconSet TDEIconLoader::loadIconSet( const TQString& name, TDEIcon::Group g, in
 
     if(canReturnNull && immediateExistenceCheck)
     { // we need to find out if the icon actually exists
-        TQPixmap pm = loadIcon( name, g, s, TDEIcon::DefaultState, NULL, true );
+        TQPixmap pm = loadIcon( name, g, s, TDEIcon::DefaultState, nullptr, true );
         if( pm.isNull())
             return TQIconSet();
 
@@ -1202,14 +1202,14 @@ TQIconSet TDEIconLoader::loadIconSetNonDelayed( const TQString& name,
                                              int s, bool canReturnNull )
 {
     TQIconSet iconset;
-    TQPixmap tmp = loadIcon(name, g, s, TDEIcon::ActiveState, NULL, canReturnNull);
+    TQPixmap tmp = loadIcon(name, g, s, TDEIcon::ActiveState, nullptr, canReturnNull);
     iconset.setPixmap( tmp, TQIconSet::Small, TQIconSet::Active );
     // we don't use QIconSet's resizing anyway
     iconset.setPixmap( tmp, TQIconSet::Large, TQIconSet::Active );
-    tmp = loadIcon(name, g, s, TDEIcon::DisabledState, NULL, canReturnNull);
+    tmp = loadIcon(name, g, s, TDEIcon::DisabledState, nullptr, canReturnNull);
     iconset.setPixmap( tmp, TQIconSet::Small, TQIconSet::Disabled );
     iconset.setPixmap( tmp, TQIconSet::Large, TQIconSet::Disabled );
-    tmp = loadIcon(name, g, s, TDEIcon::DefaultState, NULL, canReturnNull);
+    tmp = loadIcon(name, g, s, TDEIcon::DefaultState, nullptr, canReturnNull);
     iconset.setPixmap( tmp, TQIconSet::Small, TQIconSet::Normal );
     iconset.setPixmap( tmp, TQIconSet::Large, TQIconSet::Normal );
     return iconset;
@@ -1255,7 +1255,7 @@ TQPixmap* TDEIconFactory::createPixmap( const TQIconSet&, TQIconSet::Size, TQIco
                 kdWarning() << "Current:" << endl;
                 kdWarning() << kdBacktrace() << endl;
                 abort();
-                return NULL;
+                return nullptr;
 #endif
                 }
             break;
@@ -1271,7 +1271,7 @@ TQPixmap* TDEIconFactory::createPixmap( const TQIconSet&, TQIconSet::Size, TQIco
         kdWarning() << "Icon:" << iconName << endl;
         kdWarning() << kdBacktrace() << endl;
         abort();
-        return NULL;
+        return nullptr;
 #endif
         }
 #endif
@@ -1284,11 +1284,11 @@ TQPixmap* TDEIconFactory::createPixmap( const TQIconSet&, TQIconSet::Size, TQIco
     { // active and normal icon are usually the same
 	if( loader->iconEffect()->fingerprint(group, TDEIcon::ActiveState )
             == loader->iconEffect()->fingerprint(group, TDEIcon::DefaultState ))
-            return 0; // so let TQIconSet simply duplicate it
+            return nullptr; // so let TQIconSet simply duplicate it
     }
     // ignore passed size
     // ignore passed state (i.e. on/off)
-    TQPixmap pm = loader->loadIcon( iconName, group, size, state, 0, canReturnNull );
+    TQPixmap pm = loader->loadIcon( iconName, group, size, state, nullptr, canReturnNull );
     return new TQPixmap( pm );
     }
 
diff --git a/tdecore/kiconloader.h b/tdecore/kiconloader.h
index 3876efc02..48f9432d6 100644
--- a/tdecore/kiconloader.h
+++ b/tdecore/kiconloader.h
@@ -92,7 +92,7 @@ public:
      * @see TDEGlobal::iconLoader()
      * @see TDEInstance::iconLoader()
      */
-    TDEIconLoader(const TQString& appname=TQString::null, TDEStandardDirs *dirs = 0);
+    TDEIconLoader(const TQString& appname=TQString::null, TDEStandardDirs *dirs = nullptr);
 
     /**
      * Cleanup
@@ -127,7 +127,7 @@ public:
      *         @p canReturnNull.
      */
     TQPixmap loadIcon(const TQString& name, TDEIcon::Group group, int size=0,
-		     int state=TDEIcon::DefaultState, TQString *path_store=0L,
+		     int state=TDEIcon::DefaultState, TQString *path_store=nullptr,
 		     bool canReturnNull=false) const;
 
     /**
diff --git a/tdecore/kicontheme.cpp b/tdecore/kicontheme.cpp
index 15bad692a..396465662 100644
--- a/tdecore/kicontheme.cpp
+++ b/tdecore/kicontheme.cpp
@@ -183,7 +183,7 @@ TDEIconTheme::TDEIconTheme(const TQString& name, const TQString& appName)
     // Expand available sizes for scalable icons to their full range
     int i;
     TQMap<int,TQValueList<int> > scIcons;
-    for (TDEIconThemeDir *dir=mDirs.first(); dir!=0L; dir=mDirs.next())
+    for (TDEIconThemeDir *dir=mDirs.first(); dir != nullptr; dir=mDirs.next())
     {
         if ((dir->type() == TDEIcon::Scalable) && !scIcons.contains(dir->size()))
         {
@@ -297,7 +297,7 @@ TQStringList TDEIconTheme::queryIcons(int size, TDEIcon::Context context) const
     dirs.toFirst();
 
     // Find close match
-    TDEIconThemeDir *best = 0L;
+    TDEIconThemeDir *best = nullptr;
     for ( ; dirs.current(); ++dirs)
     {
         dir = dirs.current();
@@ -309,7 +309,7 @@ TQStringList TDEIconTheme::queryIcons(int size, TDEIcon::Context context) const
         delta = dw;
         best = dir;
     }
-    if (best == 0L)
+    if (!best)
         return TQStringList();
 
     return best->iconList();
@@ -435,16 +435,16 @@ TDEIcon TDEIconTheme::iconPath(const TQString& name, int size, TDEIcon::MatchTyp
 }
 
 // static
-TQString *TDEIconTheme::_theme = 0L;
+TQString *TDEIconTheme::_theme = nullptr;
 
 // static
-TQStringList *TDEIconTheme::_theme_list = 0L;
+TQStringList *TDEIconTheme::_theme_list = nullptr;
 
 // static
 TQString TDEIconTheme::current()
 {
     // Static pointer because of unloading problems wrt DSO's.
-    if (_theme != 0L)
+    if (_theme)
         return *_theme;
 
     _theme = new TQString();
@@ -466,7 +466,7 @@ TQString TDEIconTheme::current()
 TQStringList TDEIconTheme::list()
 {
     // Static pointer because of unloading problems wrt DSO's.
-    if (_theme_list != 0L)
+    if (_theme_list)
         return *_theme_list;
 
     _theme_list = new TQStringList();
@@ -503,9 +503,9 @@ TQStringList TDEIconTheme::list()
 void TDEIconTheme::reconfigure()
 {
     delete _theme;
-    _theme=0L;
+    _theme=nullptr;
     delete _theme_list;
-    _theme_list=0L;
+    _theme_list=nullptr;
 }
 
 // static
diff --git a/tdecore/kipc.cpp b/tdecore/kipc.cpp
index 8e6da23e2..12591fe33 100644
--- a/tdecore/kipc.cpp
+++ b/tdecore/kipc.cpp
@@ -46,7 +46,7 @@ static long getSimpleProperty(Window w, Atom a)
     int format;
     unsigned long n, extra, res = 0;
     int status;
-    unsigned char *p = 0;
+    unsigned char *p = nullptr;
 
     status = XGetWindowProperty(tqt_xdisplay(), w, a, 0L, 1L, False, a,
             &real_type, &format, &n, &extra, &p);
@@ -90,7 +90,7 @@ void KIPC::sendMessageAll(Message msg, int data)
 {
 #if defined TQ_WS_X11
     unsigned int i, nrootwins;
-    Window dw1, dw2, *rootwins = 0;
+    Window dw1, dw2, *rootwins = nullptr;
     Display *dpy = tqt_xdisplay();
     int screen_count = ScreenCount(dpy);
 
diff --git a/tdecore/kkeynative_x11.cpp b/tdecore/kkeynative_x11.cpp
index 8ab457a26..d78ff06fa 100644
--- a/tdecore/kkeynative_x11.cpp
+++ b/tdecore/kkeynative_x11.cpp
@@ -47,7 +47,7 @@
 
 //---------------------------------------------------------------------
 
-static KKeyNative* gx_pkey = 0;
+static KKeyNative* gx_pkey = nullptr;
 
 //---------------------------------------------------------------------
 // KKeyNative
@@ -83,7 +83,7 @@ bool KKeyNative::init( const XEvent* pEvent )
 	KeySym keySym;
 	m_code = pEvent->xkey.keycode;
 	m_mod = pEvent->xkey.state;
-	XLookupString( (XKeyEvent*) pEvent, 0, 0, &keySym, 0 );
+	XLookupString( (XKeyEvent*) pEvent, nullptr, 0, &keySym, nullptr );
 	m_sym = (uint) keySym;
 	return true;
 }
diff --git a/tdecore/kkeyserver_x11.cpp b/tdecore/kkeyserver_x11.cpp
index 77ca61763..d67feeb30 100644
--- a/tdecore/kkeyserver_x11.cpp
+++ b/tdecore/kkeyserver_x11.cpp
@@ -137,7 +137,7 @@ static const SymName g_rgSymNames[] = {
 	{ XK_F20,          I18N_NOOP("Cut") },
 	{ XK_F22,          I18N_NOOP("Print") },
 #endif
-	{ 0, 0 }
+	{ 0, nullptr }
 };
 
 #ifdef TQ_WS_X11
@@ -781,7 +781,7 @@ bool codeXToSym( uchar codeX, uint modX, uint& sym )
 	event.keycode = codeX;
 
 	char buffer[64];
-	XLookupString( &event, buffer, 63, &keySym, NULL );
+	XLookupString( &event, buffer, 63, &keySym, nullptr );
 	sym = (uint) keySym;
 	return true;
 }
@@ -829,7 +829,7 @@ uint stringUserToMod( const TQString& mod )
 	unsigned char	keyCodeX = 0;
 	uint	keyModX = 0;
 
-	const char *psKeySym = 0;
+	const char *psKeySym = nullptr;
 
 	if( !g_bInitialized )
 		Initialize();
diff --git a/tdecore/klibloader.cpp b/tdecore/klibloader.cpp
index ca77c5f8c..d621aa98f 100644
--- a/tdecore/klibloader.cpp
+++ b/tdecore/klibloader.cpp
@@ -66,7 +66,7 @@ public:
     TQString errorMessage;
 };
 
-KLibLoader* KLibLoader::s_self = 0;
+KLibLoader* KLibLoader::s_self = nullptr;
 
 // -------------------------------------------------------------------------
 
@@ -91,7 +91,7 @@ TQObject* KLibFactory::create( TQObject* parent, const char* name, const char* c
 
 TQObject* KLibFactory::createObject( TQObject*, const char*, const char*, const TQStringList &)
 {
-    return 0;
+    return nullptr;
 }
 
 
@@ -104,8 +104,8 @@ KLibrary::KLibrary( const TQString& libname, const TQString& filename, void * ha
     m_libname = libname;
     m_filename = filename;
     m_handle = handle;
-    m_factory = 0;
-    m_timer = 0;
+    m_factory = nullptr;
+    m_timer = nullptr;
 }
 
 KLibrary::~KLibrary()
@@ -131,7 +131,7 @@ KLibrary::~KLibrary()
     if ( m_factory ) {
 //	kdDebug(150) << " ... deleting the factory " << m_factory << endl;
 	delete m_factory;
-        m_factory = 0L;
+        m_factory = nullptr;
     }
 }
 
@@ -158,7 +158,7 @@ KLibFactory* KLibrary::factory()
     {
         KLibLoader::self()->d->errorMessage = i18n( "The library %1 does not offer an %2 function." ).arg( name(), "init_" + name() );
         kdWarning(150) << KLibLoader::self()->d->errorMessage << endl;
-        return 0;
+        return nullptr;
     }
 
     typedef KLibFactory* (*t_func)();
@@ -169,7 +169,7 @@ KLibFactory* KLibrary::factory()
     {
         KLibLoader::self()->d->errorMessage = i18n( "The library %1 does not offer a TDE compatible factory." ).arg( name() );
         kdWarning(150) << KLibLoader::self()->d->errorMessage << endl;
-        return 0;
+        return nullptr;
     }
 
     connect( m_factory, TQ_SIGNAL( objectCreated( TQObject * ) ),
@@ -185,7 +185,7 @@ void* KLibrary::symbol( const char* symname ) const
     {
         KLibLoader::self()->d->errorMessage = "KLibrary: " + TQString::fromLocal8Bit( lt_dlerror() ) + i18n( " %1 %2" ).arg( name() ).arg( symname );
         kdWarning(150) << KLibLoader::self()->d->errorMessage << endl;
-        return 0;
+        return nullptr;
     }
 
     return sym;
@@ -194,7 +194,7 @@ void* KLibrary::symbol( const char* symname ) const
 bool KLibrary::hasSymbol( const char* symname ) const
 {
     void* sym = lt_dlsym( (lt_dlhandle) m_handle, symname );
-    return (sym != 0L );
+    return (sym != nullptr );
 }
 
 void KLibrary::unload() const
@@ -277,10 +277,10 @@ KLibWrapPrivate::KLibWrapPrivate(KLibrary *l, lt_dlhandle h)
  : lib(l), ref_count(1), handle(h), name(l->name()), filename(l->fileName())
 {
     unload_mode = UNKNOWN;
-    if (lt_dlsym(handle, "__kde_do_not_unload") != 0) {
+    if (lt_dlsym(handle, "__kde_do_not_unload")) {
 //        kdDebug(150) << "Will not unload " << name << endl;
         unload_mode = DONT_UNLOAD;
-    } else if (lt_dlsym(handle, "__kde_do_unload") != 0) {
+    } else if (lt_dlsym(handle, "__kde_do_unload")) {
         unload_mode = UNLOAD;
     }
 }
@@ -298,7 +298,7 @@ void KLibLoader::cleanUp()
     return;
 
   delete s_self;
-  s_self = 0L;
+  s_self = nullptr;
 }
 
 KLibLoader::KLibLoader( TQObject* parent, const char* name )
@@ -308,9 +308,9 @@ KLibLoader::KLibLoader( TQObject* parent, const char* name )
     d = new KLibLoaderPrivate;
     lt_dlinit();
     d->unload_mode = KLibLoaderPrivate::UNKNOWN;
-    if (getenv("TDE_NOUNLOAD") != 0)
+    if (getenv("TDE_NOUNLOAD"))
         d->unload_mode = KLibLoaderPrivate::DONT_UNLOAD;
-    else if (getenv("TDE_DOUNLOAD") != 0)
+    else if (getenv("TDE_DOUNLOAD"))
         d->unload_mode = KLibLoaderPrivate::UNLOAD;
     d->loaded_stack.setAutoDelete( true );
 }
@@ -327,10 +327,10 @@ KLibLoader::~KLibLoader()
       d->pending_close.append(it.current());
     }
 
-    close_pending(0);
+    close_pending(nullptr);
 
     delete d;
-    d = 0L;
+    d = nullptr;
 }
 
 static inline TQCString makeLibName( const char* name )
@@ -392,7 +392,7 @@ return tmp;
 KLibrary* KLibLoader::library( const char *name )
 {
     if (!name)
-        return 0;
+        return nullptr;
 
     KLibWrapPrivate* wrap = m_libs[name];
     if (wrap) {
@@ -425,7 +425,7 @@ KLibrary* KLibLoader::library( const char *name )
         kdDebug(150) << "library=" << name << ": No file named " << libname << " found in paths." << endl;
 #endif
         d->errorMessage = i18n("Library files for \"%1\" not found in paths.").arg(TQString(libname));
-        return 0;
+        return nullptr;
       }
 
       lt_dlhandle handle = lt_dlopen( TQFile::encodeName(libfile) );
@@ -436,7 +436,7 @@ KLibrary* KLibLoader::library( const char *name )
             d->errorMessage = TQString::fromLocal8Bit(errmsg);
         else
             d->errorMessage = TQString::null;
-        return 0;
+        return nullptr;
       }
       else
         d->errorMessage = TQString::null;
@@ -479,7 +479,7 @@ KLibFactory* KLibLoader::factory( const char* name )
 {
     KLibrary* lib = library( name );
     if ( !lib )
-        return 0;
+        return nullptr;
 
     return lib->factory();
 }
@@ -493,7 +493,7 @@ void KLibLoader::slotLibraryDestroyed()
     if ( it.current()->lib == lib )
     {
       KLibWrapPrivate *wrap = it.current();
-      wrap->lib = 0;  /* the KLibrary object is already away */
+      wrap->lib = nullptr;  /* the KLibrary object is already away */
       m_libs.remove( it.currentKey() );
       close_pending( wrap );
       return;
@@ -514,7 +514,7 @@ void KLibLoader::close_pending(KLibWrapPrivate *wrap)
       disconnect( wrap->lib, TQ_SIGNAL( destroyed() ),
                   this, TQ_SLOT( slotLibraryDestroyed() ) );
       KLibrary* to_delete = wrap->lib;
-      wrap->lib = 0L; // unset first, because KLibrary dtor can cause
+      wrap->lib = nullptr; // unset first, because KLibrary dtor can cause
       delete to_delete; // recursive call to close_pending()
     }
   }
diff --git a/tdecore/klibloader.h b/tdecore/klibloader.h
index 813106164..2bb172500 100644
--- a/tdecore/klibloader.h
+++ b/tdecore/klibloader.h
@@ -276,7 +276,7 @@ public:
     static TQString findLibrary( const char * name, const TDEInstance * instance = TDEGlobal::instance() );
 
 protected:
-    KLibLoader( TQObject* parent = 0, const char* name = 0 );
+    KLibLoader( TQObject* parent = nullptr, const char* name = nullptr );
 
 private slots:
     void slotLibraryDestroyed();
@@ -339,7 +339,7 @@ public:
      * @param parent the parent of the TQObject, 0 for no parent
      * @param name the name of the TQObject, 0 for no name
      */
-    KLibFactory( TQObject* parent = 0, const char* name = 0 );
+    KLibFactory( TQObject* parent = nullptr, const char* name = nullptr );
     virtual ~KLibFactory();
 
     /**
@@ -363,7 +363,7 @@ public:
      * @param args a list of arguments
      */
 
-     TQObject* create( TQObject* parent = 0, const char* name = 0, const char* classname = "TQObject", const TQStringList &args = TQStringList() );
+     TQObject* create( TQObject* parent = nullptr, const char* name = nullptr, const char* classname = "TQObject", const TQStringList &args = TQStringList() );
 
 signals:
     /**
@@ -391,7 +391,7 @@ protected:
      * @param className the name of the class
      * @param args a list of arguments
      */
-    virtual TQObject* createObject( TQObject* parent = 0, const char* name = 0,
+    virtual TQObject* createObject( TQObject* parent = nullptr, const char* name = nullptr,
                                    const char* className = "TQObject",
                                    const TQStringList &args = TQStringList() ) = 0;
 
diff --git a/tdecore/klockfile.cpp b/tdecore/klockfile.cpp
index e7133a11e..799991793 100644
--- a/tdecore/klockfile.cpp
+++ b/tdecore/klockfile.cpp
@@ -341,7 +341,7 @@ TDELockFile::LockResult TDELockFile::lock(int options)
         n = n * 2;
      
 #ifdef Q_OS_UNIX
-     select(0, 0, 0, 0, &tv);
+     select(0, nullptr, nullptr, nullptr, &tv);
 #else
      //TODO for win32
 #endif
diff --git a/tdecore/kmanagerselection.cpp b/tdecore/kmanagerselection.cpp
index 8dc2f3f48..3ad4d765f 100644
--- a/tdecore/kmanagerselection.cpp
+++ b/tdecore/kmanagerselection.cpp
@@ -151,7 +151,7 @@ bool TDESelectionOwner::claim( bool force_P, bool force_kill_P )
             if( XCheckTypedWindowEvent( dpy, prev_owner, DestroyNotify, &ev ) == True )
                 break;
             struct timeval tm = { 0, 50000 }; // 50 ms
-            select( 0, NULL, NULL, NULL, &tm );
+            select( 0, nullptr, nullptr, nullptr, &tm );
             if( cnt == 19 )
                 {
                 if( force_kill_P )
diff --git a/tdecore/kmanagerselection.h b/tdecore/kmanagerselection.h
index 59cc35c56..0a3ed806c 100644
--- a/tdecore/kmanagerselection.h
+++ b/tdecore/kmanagerselection.h
@@ -56,7 +56,7 @@ class TDECORE_EXPORT TDESelectionOwner
          * @param screen X screen, or -1 for default
          * @param parent parent object, or NULL if there is none
          */
-        TDESelectionOwner( Atom selection, int screen = -1, TQObject* parent = NULL );
+        TDESelectionOwner( Atom selection, int screen = -1, TQObject* parent = nullptr );
         /**
          * @overload
          * This constructor accepts the selection name and creates the appropriate atom
@@ -66,7 +66,7 @@ class TDECORE_EXPORT TDESelectionOwner
          * @param screen X screen, or -1 for default
          * @param parent parent object, or NULL if there is none
          */
-        TDESelectionOwner( const char* selection, int screen = -1, TQObject* parent = NULL );
+        TDESelectionOwner( const char* selection, int screen = -1, TQObject* parent = nullptr );
         /**
          * Destructor. Calls release().
          */
@@ -179,7 +179,7 @@ class TDECORE_EXPORT TDESelectionWatcher
          * @param screen X screen, or -1 for default
          * @param parent parent object, or NULL if there is none
          */
-        TDESelectionWatcher( Atom selection, int screen = -1, TQObject* parent = NULL );
+        TDESelectionWatcher( Atom selection, int screen = -1, TQObject* parent = nullptr );
         /**
          * @overload
          * This constructor accepts the selection name and creates the appropriate atom
@@ -189,7 +189,7 @@ class TDECORE_EXPORT TDESelectionWatcher
          * @param screen X screen, or -1 for default
          * @param parent parent object, or NULL if there is none
          */
-        TDESelectionWatcher( const char* selection, int screen = -1, TQObject* parent = NULL );
+        TDESelectionWatcher( const char* selection, int screen = -1, TQObject* parent = nullptr );
 	virtual ~TDESelectionWatcher();
         /**
          * Return the current owner of the manager selection, if any.
diff --git a/tdecore/kmdcodec.cpp b/tdecore/kmdcodec.cpp
index b5d540f53..9d5b479a7 100644
--- a/tdecore/kmdcodec.cpp
+++ b/tdecore/kmdcodec.cpp
@@ -935,7 +935,7 @@ TQCString KMD5::base64Digest()
 
 void KMD5::init()
 {
-    d = 0;
+    d = nullptr;
     reset();
 }
 
@@ -1357,7 +1357,7 @@ TQCString KMD4::base64Digest()
 
 void KMD4::init()
 {
-    d = 0;
+    d = nullptr;
     reset();
 }
 
diff --git a/tdecore/kmimesourcefactory.cpp b/tdecore/kmimesourcefactory.cpp
index c13c22e2d..66973fcaf 100644
--- a/tdecore/kmimesourcefactory.cpp
+++ b/tdecore/kmimesourcefactory.cpp
@@ -28,7 +28,7 @@
 class KMimeSourceFactoryPrivate
 {
 public:
-  inline KMimeSourceFactoryPrivate (TDEIconLoader* loader) : m_iconLoader(loader), m_instance(0L) {}
+  inline KMimeSourceFactoryPrivate (TDEIconLoader* loader) : m_iconLoader(loader), m_instance(nullptr) {}
   inline TDEIconLoader *iconLoader()
   {
     // If we don't have either of these, things are looking grim.
diff --git a/tdecore/kmountpoint.cpp b/tdecore/kmountpoint.cpp
index e5a67e0f3..b39aed2ad 100644
--- a/tdecore/kmountpoint.cpp
+++ b/tdecore/kmountpoint.cpp
@@ -110,7 +110,7 @@ KMountPoint::~KMountPoint()
 #define ENDMNTENT endmntent
 #define STRUCT_MNTENT struct mntent *
 #define STRUCT_SETMNTENT FILE *
-#define GETMNTENT(file, var) ((var = getmntent(file)) != 0)
+#define GETMNTENT(file, var) ((var = getmntent(file)) != nullptr)
 #define MOUNTPOINT(var) var->mnt_dir
 #define MOUNTTYPE(var) var->mnt_type
 #define MOUNTOPTIONS(var) var->mnt_opts
@@ -133,7 +133,7 @@ KMountPoint::List KMountPoint::possibleMountPoints(int infoNeeded)
   
 #ifdef HAVE_SETMNTENT
    STRUCT_SETMNTENT fstab;
-   if ((fstab = SETMNTENT(FSTAB, "r")) == 0)
+   if (!(fstab = SETMNTENT(FSTAB, "r")))
       return result;
 
    STRUCT_MNTENT fe;
@@ -333,7 +333,7 @@ KMountPoint::List KMountPoint::currentMountPoints(int infoNeeded)
     //TODO?
 #else
    STRUCT_SETMNTENT mnttab;
-   if ((mnttab = SETMNTENT(MNTTAB, "r")) == 0)
+   if (!(mnttab = SETMNTENT(MNTTAB, "r")))
       return result;
 
    STRUCT_MNTENT fe;
diff --git a/tdecore/knotifyclient.cpp b/tdecore/knotifyclient.cpp
index 7d4c675d7..b5679be83 100644
--- a/tdecore/knotifyclient.cpp
+++ b/tdecore/knotifyclient.cpp
@@ -285,7 +285,7 @@ TDEInstance * KNotifyClient::instance() {
 class KNotifyClient::InstanceStack
 {
 public:
-	InstanceStack() { m_defaultInstance = 0; }
+	InstanceStack() { m_defaultInstance = nullptr; }
 	virtual ~InstanceStack() { delete m_defaultInstance; }
 	void push(Instance *instance) { m_instances.push(instance); }
 
@@ -317,7 +317,7 @@ private:
 	Instance *m_defaultInstance;
 };
 
-KNotifyClient::InstanceStack * KNotifyClient::Instance::s_instances = 0L;
+KNotifyClient::InstanceStack * KNotifyClient::Instance::s_instances = nullptr;
 static KStaticDeleter<KNotifyClient::InstanceStack > instancesDeleter;
 
 struct KNotifyClient::InstancePrivate
diff --git a/tdecore/kprotocolinfo_tdecore.cpp b/tdecore/kprotocolinfo_tdecore.cpp
index 482181784..469d6ad48 100644
--- a/tdecore/kprotocolinfo_tdecore.cpp
+++ b/tdecore/kprotocolinfo_tdecore.cpp
@@ -294,7 +294,7 @@ bool KProtocolInfo::isHelperProtocol( const TQString& _protocol )
 bool KProtocolInfo::isKnownProtocol( const TQString& _protocol )
 {
   KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
-  return ( prot != 0);
+  return ( prot != nullptr);
 }
 
 bool KProtocolInfo::supportsListing( const TQString& _protocol )
diff --git a/tdecore/kprotocolinfofactory.cpp b/tdecore/kprotocolinfofactory.cpp
index 19efdc465..00811e58e 100644
--- a/tdecore/kprotocolinfofactory.cpp
+++ b/tdecore/kprotocolinfofactory.cpp
@@ -27,7 +27,7 @@
 #include "kprotocolinfofactory.h"
 
 
-KProtocolInfoFactory* KProtocolInfoFactory::_self = 0;
+KProtocolInfoFactory* KProtocolInfoFactory::_self = nullptr;
 
 KProtocolInfoFactory::KProtocolInfoFactory() : KSycocaFactory( KST_KProtocolInfoFactory )
 {
@@ -36,14 +36,14 @@ KProtocolInfoFactory::KProtocolInfoFactory() : KSycocaFactory( KST_KProtocolInfo
 
 KProtocolInfoFactory::~KProtocolInfoFactory()
 {
-  _self = 0;
+  _self = nullptr;
 }
 
 
 KProtocolInfo*
 KProtocolInfoFactory::createEntry(int offset)
 {
-   KProtocolInfo *info = 0;
+   KProtocolInfo *info = nullptr;
    KSycocaType type;
    TQDataStream *str = KSycoca::self()->findEntry(offset, type);
    switch (type)
@@ -52,12 +52,12 @@ KProtocolInfoFactory::createEntry(int offset)
        info = new KProtocolInfo(*str, offset);
        break;
      default:
-       return 0;
+       return nullptr;
    }
    if (!info->isValid())
    {
       delete info;
-      info = 0;
+      info = nullptr;
    }
    return info;
 }
@@ -84,7 +84,7 @@ TQStringList KProtocolInfoFactory::protocols()
 KProtocolInfo *
 KProtocolInfoFactory::findProtocol(const TQString &protocol)
 {
-  if (!m_sycocaDict) return 0; // Error!
+  if (!m_sycocaDict) return nullptr; // Error!
 
   TQMap<TQString,KProtocolInfo::Ptr>::iterator it = m_cache.find(protocol);
   if (it != m_cache.end())
@@ -94,7 +94,7 @@ KProtocolInfoFactory::findProtocol(const TQString &protocol)
 
   offset = m_sycocaDict->find_string( protocol );
 
-  if (!offset) return 0; // Not found;
+  if (!offset) return nullptr; // Not found;
 
   KProtocolInfo *info = createEntry(offset);
 
@@ -102,7 +102,7 @@ KProtocolInfoFactory::findProtocol(const TQString &protocol)
   {
      // No it wasn't...
      delete info;
-     info = 0; // Not found
+     info = nullptr; // Not found
   }
   m_cache.insert(protocol,info);
   return info;
diff --git a/tdecore/kprotocolinfofactory.h b/tdecore/kprotocolinfofactory.h
index 89ba330a9..4f5b4719c 100644
--- a/tdecore/kprotocolinfofactory.h
+++ b/tdecore/kprotocolinfofactory.h
@@ -71,7 +71,7 @@ protected:
    * @internal Not used.
    */
   virtual KSycocaEntry *createEntry(const TQString &, const char *)
-    { return 0; }                                                    
+    { return nullptr; }
 
   /**
    * @internal
diff --git a/tdecore/kpty.cpp b/tdecore/kpty.cpp
index 76a84585c..33fe8017b 100644
--- a/tdecore/kpty.cpp
+++ b/tdecore/kpty.cpp
@@ -306,7 +306,7 @@ bool KPty::open()
 #if defined(HAVE_OPENPTY)
   char cpty[16];
 
-  if (openpty(&d->masterFd, &d->slaveFd, cpty, NULL, &d->winSize) == 0) {
+  if (openpty(&d->masterFd, &d->slaveFd, cpty, nullptr, &d->winSize) == 0) {
     d->ttyName = cpty;
   } else {
     kdWarning(175) << "Can't open slave pseudo teletype" << endl;
diff --git a/tdecore/kpty.h b/tdecore/kpty.h
index 6cff274a8..00551d3f6 100644
--- a/tdecore/kpty.h
+++ b/tdecore/kpty.h
@@ -89,7 +89,7 @@ public:
    *  of the client. For local logins from inside an X session it should
    *  be the name of the X display. Otherwise it should be empty.
    */
-  void login(const char *user = 0, const char *remotehost = 0);
+  void login(const char *user = nullptr, const char *remotehost = nullptr);
 
   /**
    * Removes the utmp entry for this tty.
diff --git a/tdecore/kqiodevicegzip_p.cpp b/tdecore/kqiodevicegzip_p.cpp
index 9ad82a653..6e0010b65 100644
--- a/tdecore/kqiodevicegzip_p.cpp
+++ b/tdecore/kqiodevicegzip_p.cpp
@@ -24,7 +24,7 @@
 
 KQIODeviceGZip::KQIODeviceGZip(const TQString& filename)
 {
-    m_gzfile=0;
+    m_gzfile=nullptr;
     m_ungetchar=-1;
     m_filename=filename;
     setFlags(IO_Sequential); // We have no direct access, so it is sequential!
@@ -57,7 +57,7 @@ bool KQIODeviceGZip::open(int mode)
         // We only support read only or write only, nothing else!
         return false;
     }
-    return (m_gzfile!=0);
+    return (m_gzfile!=nullptr);
 }
 
 void KQIODeviceGZip::close(void)
@@ -65,7 +65,7 @@ void KQIODeviceGZip::close(void)
     if (m_gzfile)
     {
         gzclose(m_gzfile);
-        m_gzfile=0;
+        m_gzfile=nullptr;
     }
 }
 
diff --git a/tdecore/kregexp.cpp b/tdecore/kregexp.cpp
index 22db51dfa..2657a14df 100644
--- a/tdecore/kregexp.cpp
+++ b/tdecore/kregexp.cpp
@@ -31,7 +31,7 @@ KRegExpPrivate::KRegExpPrivate()
   m_bInit = false;
 
   for ( int i = 0; i < 10; i++ )
-    m_strMatches[i] = 0L;
+    m_strMatches[i] = nullptr;
 }
 
 KRegExpPrivate::KRegExpPrivate( const char *_pattern, const char *_mode )
@@ -39,7 +39,7 @@ KRegExpPrivate::KRegExpPrivate( const char *_pattern, const char *_mode )
   m_bInit = false;
 
   for ( int i = 0; i < 10; i++ )
-    m_strMatches[i] = 0L;
+    m_strMatches[i] = nullptr;
 
   compile( _pattern, _mode );
 }
@@ -59,7 +59,7 @@ bool KRegExpPrivate::compile( const char *_pattern, const char *_mode )
   if ( m_bInit )
     regfree( &m_pattern );
 
-  int res = regcomp( &m_pattern, _pattern, ( strchr( _mode, 'i' ) != 0L ? REG_ICASE : 0 ) | REG_EXTENDED );
+  int res = regcomp( &m_pattern, _pattern, ( strchr( _mode, 'i' ) ? REG_ICASE : 0 ) | REG_EXTENDED );
   if ( res == 0 )
     m_bInit = true;
 
@@ -81,7 +81,7 @@ bool KRegExpPrivate::match( const char *_string )
     if ( m_strMatches[i] )
     {
       free( m_strMatches[i] );
-      m_strMatches[i] = 0L;
+      m_strMatches[i] = nullptr;
     }
   }
 
diff --git a/tdecore/krfcdate.cpp b/tdecore/krfcdate.cpp
index 08691fd15..91d834abe 100644
--- a/tdecore/krfcdate.cpp
+++ b/tdecore/krfcdate.cpp
@@ -314,7 +314,7 @@ KRFCDate::parseDate(const TQString &_date)
            offset = abs(offset);
            offset = ((offset / 100)*60 + (offset % 100))*sgn;
         } else {
-           for (int i=0; known_zones[i].tzName != 0; i++) {
+           for (int i=0; known_zones[i].tzName; i++) {
               if (0 == strncasecmp(dateString, known_zones[i].tzName, strlen(known_zones[i].tzName))) {
                  offset = known_zones[i].tzOffset;
                  break;
@@ -461,7 +461,7 @@ KRFCDate::parseDateISO8601( const TQString& input_ )
 
 int KRFCDate::localUTCOffset()
 {
-  time_t timeNow = time((time_t*) 0);
+  time_t timeNow = time(nullptr);
 
   tm *tM = gmtime(&timeNow);
   unsigned int timeUTC = ymdhms_to_seconds(tM->tm_year+1900, tM->tm_mon+1, tM->tm_mday,
diff --git a/tdecore/krootprop.cpp b/tdecore/krootprop.cpp
index 72fd5ae78..ac685c7b2 100644
--- a/tdecore/krootprop.cpp
+++ b/tdecore/krootprop.cpp
@@ -95,7 +95,7 @@ void KRootProp::setProp( const TQString& rProp )
   offset = 0; bytes_after = 1;
   while (bytes_after != 0)
   {
-    unsigned char *buf = 0; 
+    unsigned char *buf = nullptr;
     if (XGetWindowProperty( tqt_xdisplay(), tqt_xrootwin(), atom, offset, 256,
                         False, XA_STRING, &type, &format, &nitems, &bytes_after,
                         &buf) == Success && buf) 
diff --git a/tdecore/krootprop.h b/tdecore/krootprop.h
index f1a72d265..aef761db3 100644
--- a/tdecore/krootprop.h
+++ b/tdecore/krootprop.h
@@ -120,7 +120,7 @@ public:
   * @return The value for this key or a default font if no value was found.
   */
  TQFont readFontEntry( const TQString& rKey,
-		      const TQFont* pDefault = 0 ) const;
+		      const TQFont* pDefault = nullptr ) const;
  
  /**
   * Reads a TQColor.
@@ -134,7 +134,7 @@ public:
   * was found.
   */					
  TQColor readColorEntry( const TQString& rKey,
-			const TQColor* pDefault = 0 ) const;
+			const TQColor* pDefault = nullptr ) const;
 							
 	
  /**
diff --git a/tdecore/ksharedptr.h b/tdecore/ksharedptr.h
index 60a06a55f..5c71799b4 100644
--- a/tdecore/ksharedptr.h
+++ b/tdecore/ksharedptr.h
@@ -104,7 +104,7 @@ public:
  * Creates a null pointer.
  */
   TDESharedPtr()
-    : ptr(0) { }
+    : ptr(nullptr) { }
   /**
    * Creates a new pointer.
    * @param t the pointer
@@ -143,7 +143,7 @@ public:
   bool operator!= ( const TDESharedPtr<T>& p ) const { return ( ptr != p.ptr ); }
   bool operator== ( const T* p ) const { return ( ptr == p ); }
   bool operator!= ( const T* p ) const { return ( ptr != p ); }
-  bool operator!() const { return ( ptr == 0 ); }
+  bool operator!() const { return ( ptr == nullptr ); }
   operator T*() const { return ptr; }
 
   /**
diff --git a/tdecore/kshell.h b/tdecore/kshell.h
index e60df848f..7821d1576 100644
--- a/tdecore/kshell.h
+++ b/tdecore/kshell.h
@@ -90,7 +90,7 @@ namespace KShell {
      *  target, see Errors
      * @return a list of unquoted words or an empty list if an error occurred
      */
-    TDECORE_EXPORT TQStringList splitArgs( const TQString &cmd, int flags = 0, int *err = 0 );
+    TDECORE_EXPORT TQStringList splitArgs( const TQString &cmd, int flags = 0, int *err = nullptr );
 
     /**
      * Quotes and joins @p args together according to POSIX shell rules.
diff --git a/tdecore/ksimpledirwatch.cpp b/tdecore/ksimpledirwatch.cpp
index 7d9cfa70c..e1f60a766 100644
--- a/tdecore/ksimpledirwatch.cpp
+++ b/tdecore/ksimpledirwatch.cpp
@@ -106,7 +106,7 @@
 
 #define NO_NOTIFY (time_t) 0
 
-static KSimpleDirWatchPrivate* dwp_self = 0;
+static KSimpleDirWatchPrivate* dwp_self = nullptr;
 
 #ifdef HAVE_DNOTIFY
 
@@ -210,7 +210,7 @@ void KSimpleDirWatchPrivate::dnotify_sigio_handler(int sig, siginfo_t *si, void
  */
 
 KSimpleDirWatchPrivate::KSimpleDirWatchPrivate()
-  : rescan_timer(0, "KSimpleDirWatchPrivate::rescan_timer")
+  : rescan_timer(nullptr, "KSimpleDirWatchPrivate::rescan_timer")
 {
   timer = new TQTimer(this, "KSimpleDirWatchPrivate::timer");
   connect (timer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotRescan()));
@@ -320,7 +320,7 @@ KSimpleDirWatchPrivate::KSimpleDirWatchPrivate()
 #ifdef SA_RESTART
        act.sa_flags |= SA_RESTART;
 #endif
-       sigaction(dnotify_signal, &act, NULL);
+       sigaction(dnotify_signal, &act, nullptr);
 
        act.sa_sigaction = KSimpleDirWatchPrivate::dnotify_sigio_handler;
        sigaction(SIGIO, &act, &old_sigio_act);
@@ -342,7 +342,7 @@ KSimpleDirWatchPrivate::~KSimpleDirWatchPrivate()
   timer->stop();
 
   /* remove all entries being watched */
-  removeEntries(0);
+  removeEntries(nullptr);
 
 #ifdef HAVE_FAM
   if (use_fam) {
@@ -422,9 +422,9 @@ void KSimpleDirWatchPrivate::slotActivated()
               kdDebug(7001) << "-->got deleteself signal for " << e->path << endl;
               e->m_status = NonExistent;
               if (e->isDir)
-                addEntry(0, TQDir::cleanDirPath(e->path+"/.."), e, true);
+                addEntry(nullptr, TQDir::cleanDirPath(e->path+"/.."), e, true);
               else
-                addEntry(0, TQFileInfo(e->path).dirPath(true), e, true);
+                addEntry(nullptr, TQFileInfo(e->path).dirPath(true), e, true);
             }
             if ( event->mask & IN_IGNORED ) {
               e->wd = 0;
@@ -435,7 +435,7 @@ void KSimpleDirWatchPrivate::slotActivated()
                 if (sub_entry->path == e->path + "/" + path) break;
 
               if (sub_entry /*&& sub_entry->isDir*/) {
-                removeEntry(0,e->path, sub_entry);
+                removeEntry(nullptr,e->path, sub_entry);
                 KDE_struct_stat stat_buf;
                 TQCString tpath = TQFile::encodeName(path);
                 KDE_stat(tpath, &stat_buf);
@@ -536,7 +536,7 @@ KSimpleDirWatchPrivate::Entry* KSimpleDirWatchPrivate::entry(const TQString& _pa
 {
 // we only support absolute paths
   if (TQDir::isRelativePath(_path)) {
-    return 0;
+    return nullptr;
   }
 
   TQString path = _path;
@@ -546,7 +546,7 @@ KSimpleDirWatchPrivate::Entry* KSimpleDirWatchPrivate::entry(const TQString& _pa
 
   EntryMap::Iterator it = m_mapEntries.find( path );
   if ( it == m_mapEntries.end() )
-    return 0;
+    return nullptr;
   else
     return &(*it);
 }
@@ -724,9 +724,9 @@ bool KSimpleDirWatchPrivate::useINotify( Entry* e )
 
   if ( e->m_status == NonExistent ) {
     if (e->isDir) 
-      addEntry(0, TQDir::cleanDirPath(e->path+"/.."), e, true);
+      addEntry(nullptr, TQDir::cleanDirPath(e->path+"/.."), e, true);
     else
-      addEntry(0, TQFileInfo(e->path).dirPath(true), e, true);
+      addEntry(nullptr, TQFileInfo(e->path).dirPath(true), e, true);
     return true;
   }
 
@@ -946,9 +946,9 @@ void KSimpleDirWatchPrivate::removeEntry( KSimpleDirWatch* instance,
     }
     else {
       if (e->isDir)
-	removeEntry(0, TQDir::cleanDirPath(e->path+"/.."), e);
+	removeEntry(nullptr, TQDir::cleanDirPath(e->path+"/.."), e);
       else
-	removeEntry(0, TQFileInfo(e->path).dirPath(true), e);
+	removeEntry(nullptr, TQFileInfo(e->path).dirPath(true), e);
     }
   }
 #endif
@@ -1017,7 +1017,7 @@ void KSimpleDirWatchPrivate::removeEntries( KSimpleDirWatch* instance )
   }
 
   for(Entry* e=list.first();e;e=list.next())
-    removeEntry(instance, e->path, 0);
+    removeEntry(instance, e->path, nullptr);
 
   if (minfreq > freq) {
     // we can decrease the global polling frequency
@@ -1229,7 +1229,7 @@ void KSimpleDirWatchPrivate::emitEvent(Entry* e, int event, const TQString &file
   {
     Client* c = cit.current();
 
-    if (c->instance==0 || c->count==0) continue;
+    if (!c->instance || c->count==0) continue;
 
     if (c->watchingStopped) {
       // add event to pending...
@@ -1267,7 +1267,7 @@ void KSimpleDirWatchPrivate::slotRemoveDelayed()
   Entry* e;
   delayRemove = false;
   for(e=removeList.first();e;e=removeList.next())
-    removeEntry(0, e->path, 0);
+    removeEntry(nullptr, e->path, nullptr);
   removeList.clear();
 }
 
@@ -1362,11 +1362,11 @@ void KSimpleDirWatchPrivate::slotRescan()
   // Scan parent of deleted directories for new creation
   Entry* e;
   for(e=dList.first();e;e=dList.next())
-    addEntry(0, TQDir::cleanDirPath( e->path+"/.."), e, true);
+    addEntry(nullptr, TQDir::cleanDirPath( e->path+"/.."), e, true);
 
   // Remove watch of parent of new created directories
   for(e=cList.first();e;e=cList.next())
-    removeEntry(0, TQDir::cleanDirPath( e->path+"/.."), e);
+    removeEntry(nullptr, TQDir::cleanDirPath( e->path+"/.."), e);
 #endif
 
   if ( timerRunning )
@@ -1434,7 +1434,7 @@ void KSimpleDirWatchPrivate::checkFAMEvent(FAMEvent* fe)
   if ( isNoisyFile( fe->filename ) )
     return;
 
-  Entry* e = 0;
+  Entry* e = nullptr;
   EntryMap::Iterator it = m_mapEntries.begin();
   for( ; it != m_mapEntries.end(); ++it )
     if (FAMREQUEST_GETREQNUM(&( (*it).fr )) ==
@@ -1581,7 +1581,7 @@ void KSimpleDirWatchPrivate::statistics()
 //
 
 static KStaticDeleter<KSimpleDirWatch> sd_dw;
-KSimpleDirWatch* KSimpleDirWatch::s_pSelf = 0L;
+KSimpleDirWatch* KSimpleDirWatch::s_pSelf = nullptr;
 
 KSimpleDirWatch* KSimpleDirWatch::self()
 {
@@ -1594,7 +1594,7 @@ KSimpleDirWatch* KSimpleDirWatch::self()
 
 bool KSimpleDirWatch::exists()
 {
-  return s_pSelf != 0;
+  return s_pSelf != nullptr;
 }
 
 KSimpleDirWatch::KSimpleDirWatch (TQObject* parent, const char* name)
@@ -1622,7 +1622,7 @@ KSimpleDirWatch::~KSimpleDirWatch()
   {
     // delete it if it's the last one
     delete d;
-    dwp_self = 0L;
+    dwp_self = nullptr;
   }
 }
 
@@ -1634,12 +1634,12 @@ void KSimpleDirWatch::addDir( const TQString& _path,
   if (watchFiles || recursive) {
     kdDebug(7001) << "addDir - recursive/watchFiles not supported yet in KDE 3.x" << endl;
   }
-  if (d) d->addEntry(this, _path, 0, true);
+  if (d) d->addEntry(this, _path, nullptr, true);
 }
 
 void KSimpleDirWatch::addFile( const TQString& _path )
 {
-  if (d) d->addEntry(this, _path, 0, false);
+  if (d) d->addEntry(this, _path, nullptr, false);
 }
 
 TQDateTime KSimpleDirWatch::ctime( const TQString &_path )
@@ -1656,12 +1656,12 @@ TQDateTime KSimpleDirWatch::ctime( const TQString &_path )
 
 void KSimpleDirWatch::removeDir( const TQString& _path )
 {
-  if (d) d->removeEntry(this, _path, 0);
+  if (d) d->removeEntry(this, _path, nullptr);
 }
 
 void KSimpleDirWatch::removeFile( const TQString& _path )
 {
-  if (d) d->removeEntry(this, _path, 0);
+  if (d) d->removeEntry(this, _path, nullptr);
 }
 
 bool KSimpleDirWatch::stopDirScan( const TQString& _path )
diff --git a/tdecore/ksimpledirwatch.h b/tdecore/ksimpledirwatch.h
index 41934aa26..0c901d8bf 100644
--- a/tdecore/ksimpledirwatch.h
+++ b/tdecore/ksimpledirwatch.h
@@ -76,7 +76,7 @@ class TDEIO_EXPORT KSimpleDirWatch : public TQObject
     * @param parent the parent of the TQObject (or 0 for parent-less KDataTools)
     * @param name the name of the TQObject, can be 0
     */
-   KSimpleDirWatch (TQObject* parent = 0, const char* name = 0);
+   KSimpleDirWatch (TQObject* parent = nullptr, const char* name = nullptr);
 
    /**
     * Destructor.
diff --git a/tdecore/ksock.cpp b/tdecore/ksock.cpp
index 8de28f476..3a8e03421 100644
--- a/tdecore/ksock.cpp
+++ b/tdecore/ksock.cpp
@@ -101,7 +101,7 @@ public:
   TQSocketNotifier *writeNotifier;
 
   TDESocketPrivate() :
-    readNotifier(0), writeNotifier(0)
+    readNotifier(nullptr), writeNotifier(nullptr)
   { }
 };
 
@@ -217,10 +217,10 @@ unsigned long TDESocket::ipv4_addr()
 {
   unsigned long retval = 0;
   TDESocketAddress *sa = KExtendedSocket::peerAddress(sock);
-  if (sa == NULL)
+  if (!sa)
     return 0;
 
-  if (sa->address() != NULL && (sa->address()->sa_family == PF_INET
+  if (sa->address() && (sa->address()->sa_family == PF_INET
 #ifdef PF_INET6
 				|| sa->address()->sa_family == PF_INET6
 #endif
@@ -228,7 +228,7 @@ unsigned long TDESocket::ipv4_addr()
     {
       KInetSocketAddress *ksin = (KInetSocketAddress*)sa;
       const sockaddr_in *sin = ksin->addressV4();
-      if (sin != NULL)
+      if (sin)
 	retval = sin->sin_addr.s_addr;
     }
   delete sa;
@@ -256,7 +256,7 @@ bool TDESocket::initSockaddr (ksockaddr_in *server_name, const char *hostname, u
 
   // We are sure that only KInetSocketAddress objects are in the list
   KInetSocketAddress *sin = (KInetSocketAddress*)list.getFirst()->address();
-  if (sin == NULL)
+  if (!sin)
     return false;
 
   memcpy(server_name, sin->addressV4(), sizeof(*server_name));
@@ -337,7 +337,7 @@ bool TDEServerSocket::init( unsigned short int _port )
 
 bool TDEServerSocket::bindAndListen(bool suppressFailureMessages)
 {
-  if (d == NULL || d->ks == NULL)
+  if (!d || !d->ks)
     return false;
 
 
@@ -349,7 +349,7 @@ bool TDEServerSocket::bindAndListen(bool suppressFailureMessages)
 		kdWarning(170) << "Error listening on socket for port " << d->ks->port() << ": " << ret << "\n";
 	    }
 	delete d->ks;
-	d->ks = NULL;
+	d->ks = nullptr;
 	sock = -1;
 	return false;
     }
@@ -364,10 +364,10 @@ bool TDEServerSocket::bindAndListen(bool suppressFailureMessages)
 
 unsigned short int TDEServerSocket::port()
 {
-  if (d == NULL || d->ks == NULL || sock == -1)
+  if (!d || !d->ks || sock == -1)
     return 0;
   const TDESocketAddress *sa = d->ks->localAddress();
-  if (sa == NULL)
+  if (!sa)
     return 0;
 
   // we can use sockaddr_in here even if it isn't IPv4
@@ -388,7 +388,7 @@ unsigned short int TDEServerSocket::port()
 
 unsigned long TDEServerSocket::ipv4_addr()
 {
-  if (d == NULL || d->ks == NULL || sock == -1)
+  if (!d || !d->ks || sock == -1)
     return 0;
   const TDESocketAddress *sa = d->ks->localAddress();
 
@@ -402,7 +402,7 @@ unsigned long TDEServerSocket::ipv4_addr()
     {
       KInetSocketAddress *ksin = (KInetSocketAddress*)sa;
       sin = ksin->addressV4();
-      if (sin != NULL)
+      if (sin)
 	return sin->sin_addr.s_addr;
     }
 #endif
@@ -411,7 +411,7 @@ unsigned long TDEServerSocket::ipv4_addr()
 
 void TDEServerSocket::slotAccept( int )
 {
-  if (d == NULL || d->ks == NULL || sock == -1)
+  if (!d || !d->ks || sock == -1)
     return;			// nothing!
 
   KExtendedSocket *s;
@@ -430,9 +430,9 @@ void TDEServerSocket::slotAccept( int )
 
 TDEServerSocket::~TDEServerSocket()
 {
-  if (d != NULL)
+  if (d)
     {
-      if (d->ks != NULL)
+      if (d->ks)
 	delete d->ks;
       delete d;
     }
diff --git a/tdecore/ksockaddr.cpp b/tdecore/ksockaddr.cpp
index a645b3aa9..e4a7f3cb2 100644
--- a/tdecore/ksockaddr.cpp
+++ b/tdecore/ksockaddr.cpp
@@ -53,21 +53,21 @@
 
 #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
 # define MY_MAX(a, b)  			((a) > (b) ? (a) : (b))
-# define MIN_SOCKADDR_LEN		MY_MAX(offsetof(sockaddr, sa_family) + sizeof(((sockaddr*)0)->sa_family), \
-					       offsetof(sockaddr, sa_len) + sizeof(((sockaddr*)0)->sa_len))
+# define MIN_SOCKADDR_LEN		MY_MAX(offsetof(sockaddr, sa_family) + sizeof(((sockaddr*)nullptr)->sa_family), \
+					       offsetof(sockaddr, sa_len) + sizeof(((sockaddr*)nullptr)->sa_len))
 #else
-# define MIN_SOCKADDR_LEN		(offsetof(sockaddr, sa_family) + sizeof(((sockaddr*)0)->sa_family))
+# define MIN_SOCKADDR_LEN		(offsetof(sockaddr, sa_family) + sizeof(((sockaddr*)nullptr)->sa_family))
 #endif
 
 // Minimum size accepted for sockaddr_in6 sockets. 
 // The scopeid field is missing from some implementations
 // that conform to the obsoleted RFC 2133, e.g. Linux glibc 2.1
-#define	MIN_SOCKADDR_IN6_LEN		(offsetof(sockaddr_in6, sin6_addr) + sizeof(((sockaddr_in6*)0)->sin6_addr))
+#define	MIN_SOCKADDR_IN6_LEN		(offsetof(sockaddr_in6, sin6_addr) + sizeof(((sockaddr_in6*)nullptr)->sin6_addr))
 
 #ifdef offsetof
 #undef offsetof
 #endif
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)nullptr)->MEMBER)
 
 // This is how it is
 // 46 == strlen("1234:5678:9abc:def0:1234:5678:255.255.255.255")
@@ -86,7 +86,7 @@ TDESocketAddress::TDESocketAddress(const sockaddr* sa, ksocklen_t size)
         init();
     else {
         data = (sockaddr*)malloc(size);
-        if (data == NULL)
+        if (!data)
             return;
         memcpy(data, sa, size);
         datasize = size;
@@ -96,14 +96,14 @@ TDESocketAddress::TDESocketAddress(const sockaddr* sa, ksocklen_t size)
 
 void TDESocketAddress::init()
 {
-  data = NULL;
+  data = nullptr;
   datasize = 0;
   owndata = false;
 }
 
 TDESocketAddress::~TDESocketAddress()
 {
-  if (owndata && data != NULL)
+  if (owndata && data)
     free(data);
 }
 
@@ -114,7 +114,7 @@ TQString TDESocketAddress::pretty() const
 
 int TDESocketAddress::family() const
 {
-  if (data != NULL)
+  if (data)
     return data->sa_family;
   return AF_UNSPEC;
 }
@@ -125,14 +125,14 @@ TDESocketAddress* TDESocketAddress::newAddress(const struct sockaddr* sa, ksockl
   if (size == 0)
     {
       kdWarning() << "TDESocketAddress::newAddress called with size = 0!\n";
-      return NULL;
+      return nullptr;
     }
 
   // make sure we have the right stuff
   if (size < MIN_SOCKADDR_LEN)
     {
       kdWarning() << "TDESocketAddress::newAddress called with invalid size\n";
-      return NULL;
+      return nullptr;
     }
 
   switch (sa->sa_family)
@@ -140,13 +140,13 @@ TDESocketAddress* TDESocketAddress::newAddress(const struct sockaddr* sa, ksockl
     case AF_INET:
       if (size >= sizeof(sockaddr_in))
 	return new KInetSocketAddress((const sockaddr_in*)sa, size);
-      return NULL;
+      return nullptr;
 
 #ifdef AF_INET6
     case AF_INET6:
       if (size >= MIN_SOCKADDR_IN6_LEN)
 	return new KInetSocketAddress((const sockaddr_in6*)sa, size);
-      return NULL;
+      return nullptr;
 #endif
 
     case AF_UNIX:		// AF_LOCAL
@@ -521,12 +521,12 @@ const sockaddr_in* KInetSocketAddress::addressV4() const
       if (V6_CAN_CONVERT_TO_V4(&d->sin6.sin6_addr))
 	return &d->sin;
       else
-	return NULL;		// there was loss, so return nothing
+	return nullptr;		// there was loss, so return nothing
     }
 #endif
 
   kdWarning() << "KInetSocketAddress::addressV4() called on uninitialized socket\n";
-  return NULL;
+  return nullptr;
 }
 
 const sockaddr_in6* KInetSocketAddress::addressV6() const
@@ -534,7 +534,7 @@ const sockaddr_in6* KInetSocketAddress::addressV6() const
 #ifdef AF_INET6
   return &d->sin6;
 #else
-  return NULL;
+  return nullptr;
 #endif
 }
 
@@ -734,7 +734,7 @@ class KUnixSocketAddressPrivate
 public:
   sockaddr_un *m_sun;
 
-  KUnixSocketAddressPrivate() : m_sun(NULL)
+  KUnixSocketAddressPrivate() : m_sun(nullptr)
   { }
 };
 
@@ -768,19 +768,19 @@ bool KUnixSocketAddress::setAddress(const sockaddr_un* _sun, ksocklen_t _size)
       return false;
     }
 
-  if (owndata && (d->m_sun != NULL) && (datasize >= _size))
+  if (owndata && d->m_sun && (datasize >= _size))
     {
       // reuse this without reallocating
       memcpy(d->m_sun, _sun, _size);
     }
   else
     {
-      if (owndata && (d->m_sun != NULL))
+      if (owndata && d->m_sun)
 	free(d->m_sun);
 
       d->m_sun = (sockaddr_un*)malloc(_size);
 
-      if (d->m_sun == NULL)
+      if (!d->m_sun)
 	{
 	  // problems
 	  owndata = false;
@@ -804,7 +804,7 @@ bool KUnixSocketAddress::setAddress(TQCString path)
   // the +1 is necessary for the ending zero
   ksocklen_t newsize = offsetof(sockaddr_un, sun_path) + path.length() + 1;
 
-  if (owndata && (d->m_sun != NULL) && (datasize >= newsize))
+  if (owndata && d->m_sun && (datasize >= newsize))
     {
       // we can reuse this
       strcpy(d->m_sun->sun_path, path);
@@ -815,11 +815,11 @@ bool KUnixSocketAddress::setAddress(TQCString path)
     }
 
   // nah, we have to do better
-  if (owndata && (d->m_sun != NULL))
+  if (owndata && d->m_sun)
     free(d->m_sun);
 
   d->m_sun = (sockaddr_un*) malloc(newsize);
-  if (d->m_sun == NULL)
+  if (!d->m_sun)
     {
       owndata = false;
       return false;
@@ -837,7 +837,7 @@ bool KUnixSocketAddress::setAddress(TQCString path)
 
 TQCString KUnixSocketAddress::pathname() const
 {
-  if (d->m_sun != NULL)
+  if (d->m_sun)
     {
       if (datasize > offsetof(sockaddr_un, sun_path))
 	return d->m_sun->sun_path;
diff --git a/tdecore/ksocks.cpp b/tdecore/ksocks.cpp
index 835cfd618..9df7d3d93 100644
--- a/tdecore/ksocks.cpp
+++ b/tdecore/ksocks.cpp
@@ -60,23 +60,23 @@ enum SymbolKeys {
 
 extern "C" {
 // Function pointer table
-static int     (*F_SOCKSinit)   (char *) = 0L;
-static int     (*F_connect)     (int, const struct sockaddr *, ksocklen_t) = 0L;
-static signed long int (*F_read)        (int, void *, unsigned long int) = 0L;
-static signed long int (*F_write)       (int, const void *, unsigned long int) = 0L;
+static int     (*F_SOCKSinit)   (char *) = nullptr;
+static int     (*F_connect)     (int, const struct sockaddr *, ksocklen_t) = nullptr;
+static signed long int (*F_read)        (int, void *, unsigned long int) = nullptr;
+static signed long int (*F_write)       (int, const void *, unsigned long int) = nullptr;
 static int     (*F_recvfrom)    (int, void *, unsigned long int, int, struct sockaddr *,
-                                 ksocklen_t *) = 0L;
+                                 ksocklen_t *) = nullptr;
 static int     (*F_sendto)      (int, const void *, unsigned long int, int,
-                                 const struct sockaddr *, ksocklen_t) = 0L;
-static int     (*F_recv)        (int, void *, unsigned long int, int) = 0L;
-static int     (*F_send)        (int, const void *, unsigned long int, int) = 0L;
-static int     (*F_getsockname) (int, struct sockaddr *, ksocklen_t *) = 0L;
-static int     (*F_getpeername) (int, struct sockaddr *, ksocklen_t *) = 0L;
-static int     (*F_accept)      (int, struct sockaddr *, ksocklen_t *) = 0L;
+                                 const struct sockaddr *, ksocklen_t) = nullptr;
+static int     (*F_recv)        (int, void *, unsigned long int, int) = nullptr;
+static int     (*F_send)        (int, const void *, unsigned long int, int) = nullptr;
+static int     (*F_getsockname) (int, struct sockaddr *, ksocklen_t *) = nullptr;
+static int     (*F_getpeername) (int, struct sockaddr *, ksocklen_t *) = nullptr;
+static int     (*F_accept)      (int, struct sockaddr *, ksocklen_t *) = nullptr;
 static int     (*F_select)      (int, fd_set *, fd_set *, fd_set *,
-                                                     struct timeval *) = 0L;
-static int     (*F_listen)      (int, int) = 0L;
-static int     (*F_bind)        (int, const struct sockaddr *, ksocklen_t) = 0L;
+                                                     struct timeval *) = nullptr;
+static int     (*F_listen)      (int, int) = nullptr;
+static int     (*F_bind)        (int, const struct sockaddr *, ksocklen_t) = nullptr;
 }
 
 
@@ -195,7 +195,7 @@ KDanteSocksTable::~KDanteSocksTable() {
 //////////////////////////////////////////////////////////////////
 
 
-KSocks *KSocks::_me = 0;
+KSocks *KSocks::_me = nullptr;
 #ifdef __CYGWIN__
 bool KSocks::_disabled = true;
 #else 
@@ -217,7 +217,7 @@ KSocks *KSocks::self() {
         _me = new KSocks(&cfg);
      } else {
         _disabled = true;
-        _me = new KSocks(0);
+        _me = new KSocks(nullptr);
      }
   }
   return _me;
@@ -229,17 +229,17 @@ void KSocks::setConfig(TDEConfigBase *config)
   // but not the other way around.
   if (_me && _disabled) {
      delete _me;
-     _me = 0;
+     _me = nullptr;
      _disabled = false;
   }
   if (!_me)
     _me = new KSocks(config);
 }
 
-bool KSocks::activated() { return (_me != 0L); }
+bool KSocks::activated() { return (_me != nullptr); }
 
 
-KSocks::KSocks(TDEConfigBase *config) : _socksLib(0L), _st(0L) {
+KSocks::KSocks(TDEConfigBase *config) : _socksLib(nullptr), _st(nullptr) {
    _hasSocks = false;
    _useSocks = false;
 
@@ -302,7 +302,7 @@ KSocks::KSocks(TDEConfigBase *config) : _socksLib(0L), _st(0L) {
          _hasSocks = true;
       } else if (_socksLib) {
          _socksLib->unload();
-         _socksLib = 0L;
+         _socksLib = nullptr;
       }
    } else              // leave this here   "else for {}"
    for (TQStringList::Iterator pit  = _libPaths.begin();
@@ -314,14 +314,14 @@ KSocks::KSocks(TDEConfigBase *config) : _socksLib(0L), _st(0L) {
       _socksLib = ll->library((*pit + *it).latin1());
       if (_socksLib) {
          if ((_meth == 1 || _meth == 2) &&
-             _socksLib->symbol("S5LogShowThreadIDS") != 0L) {  // NEC SOCKS
+             _socksLib->symbol("S5LogShowThreadIDS")) {  // NEC SOCKS
             kdDebug(171) << "Found NEC SOCKS" << endl;
             _st = new KNECSocksTable;
             _useSocks = true;
             _hasSocks = true;
             break;
          } else if ((_meth == 1 || _meth == 3) &&
-                    _socksLib->symbol("sockaddr2ruleaddress") != 0L) { //Dante
+                    _socksLib->symbol("sockaddr2ruleaddress")) { //Dante
             kdDebug(171) << "Found Dante SOCKS" << endl;
             _st = new KDanteSocksTable;
             _useSocks = true;
@@ -329,7 +329,7 @@ KSocks::KSocks(TDEConfigBase *config) : _socksLib(0L), _st(0L) {
             break;
          } else {
            _socksLib->unload();
-           _socksLib = 0L;
+           _socksLib = nullptr;
          }
       }
    }
@@ -419,12 +419,12 @@ KSocks::KSocks(TDEConfigBase *config) : _socksLib(0L), _st(0L) {
 
 KSocks::~KSocks() {
    stopSocks();
-   _me = 0;
+   _me = nullptr;
 }
 
 void KSocks::die() {
    if (_me == this) {
-      _me = 0;
+      _me = nullptr;
       delete this;
    }
 }
@@ -437,10 +437,10 @@ void KSocks::stopSocks() {
       _hasSocks = false;
       if (_socksLib) {
          _socksLib->unload();
-         _socksLib = 0L;
+         _socksLib = nullptr;
       }
       delete _st;
-      _st = 0L;
+      _st = nullptr;
    }
 }
 
diff --git a/tdecore/kstaticdeleter.h b/tdecore/kstaticdeleter.h
index 28c2d89e2..397a58de1 100644
--- a/tdecore/kstaticdeleter.h
+++ b/tdecore/kstaticdeleter.h
@@ -73,7 +73,7 @@ public:
  */
 template<class type> class KStaticDeleter : public KStaticDeleterBase {
 public:
-    KStaticDeleter() { deleteit = 0; globalReference = 0; array = false; }
+    KStaticDeleter() { deleteit = nullptr; globalReference = nullptr; array = false; }
     /**
      * Sets the object to delete and registers the object to be
      * deleted to TDEGlobal. If the given object is 0, the former
@@ -84,7 +84,7 @@ public:
      **/
     TDE_DEPRECATED type *setObject( type *obj, bool isArray = false) {
         deleteit = obj;
-        globalReference = 0;
+        globalReference = nullptr;
 	array = isArray;
 	if (obj)
             TDEGlobal::registerStaticDeleter(this);
@@ -119,12 +119,12 @@ public:
      */
     virtual void destructObject() {
         if (globalReference)
-           *globalReference = 0;
+           *globalReference = nullptr;
 	if (array)
 	   delete [] deleteit;
 	else
 	   delete deleteit;
-    	deleteit = 0;
+	deleteit = nullptr;
     }
     virtual ~KStaticDeleter() {
     	TDEGlobal::unregisterStaticDeleter(this);
diff --git a/tdecore/ktempdir.cpp b/tdecore/ktempdir.cpp
index 045695c07..02a7ff10f 100644
--- a/tdecore/ktempdir.cpp
+++ b/tdecore/ktempdir.cpp
@@ -76,7 +76,7 @@ KTempDir::create(const TQString &directoryPrefix, int mode)
 
    TQCString nme = TQFile::encodeName(directoryPrefix) + "XXXXXX";
    char *realName;
-   if((realName=mkdtemp(nme.data())) == 0)
+   if(!(realName=mkdtemp(nme.data())))
    {
        // Recreate it for the warning, mkdtemps emptied it
        TQCString nme = TQFile::encodeName(directoryPrefix) + "XXXXXX";
@@ -134,7 +134,7 @@ TQDir *
 KTempDir::qDir()
 {
    if (bExisting) return new TQDir(mTmpName);
-   return 0;
+   return nullptr;
 }
 
 void
diff --git a/tdecore/ktimezones.cpp b/tdecore/ktimezones.cpp
index bf8a370fb..3c1969346 100644
--- a/tdecore/ktimezones.cpp
+++ b/tdecore/ktimezones.cpp
@@ -212,7 +212,7 @@ KTimezone::KTimezone(
     m_latitude(latitude),
     m_longitude(longitude),
     m_comment(comment),
-    d(0)
+    d(nullptr)
 {
     // Detect duff values.
     if (m_latitude * m_latitude > 90 * 90)
@@ -327,8 +327,8 @@ bool KTimezone::parse(KTimezoneDetails &dataReceiver) const
 
 KTimezones::KTimezones() :
     m_zoneinfoDir(),
-    m_zones(0),
-    d(0)
+    m_zones(nullptr),
+    d(nullptr)
 {
     // Create the database (and resolve m_zoneinfoDir!).
     allZones();
@@ -479,7 +479,7 @@ float KTimezones::convertCoordinate(const TQString &coordinate)
 
 const KTimezone *KTimezones::local()
 {
-    const KTimezone *local = 0;
+    const KTimezone *local = nullptr;
 
     // First try the simplest solution of checking for well-formed TZ setting.
     char *envZone = ::getenv("TZ");
@@ -628,7 +628,7 @@ const KTimezone *KTimezones::zone(const TQString &name)
         return it.data();
 
     // Error.
-    return 0;
+    return nullptr;
 }
 
 KTimezoneDetails::KTimezoneDetails()
diff --git a/tdecore/kurl.cpp b/tdecore/kurl.cpp
index 5ddb7426d..111db76f8 100644
--- a/tdecore/kurl.cpp
+++ b/tdecore/kurl.cpp
@@ -213,7 +213,7 @@ static void decode( const TQString& segment, TQString &decoded, TQString &encode
   if ( !old_length )
     return;
 
-  TQTextCodec *textCodec = 0;
+  TQTextCodec *textCodec = nullptr;
   if (encoding_hint)
       textCodec = codecForHint( encoding_hint );
 
diff --git a/tdecore/kurl.h b/tdecore/kurl.h
index ca30a3b0a..d64df186b 100644
--- a/tdecore/kurl.h
+++ b/tdecore/kurl.h
@@ -1719,7 +1719,7 @@ public:
    *
    * @see relativeURL()
    */
-  static TQString relativePath(const TQString &base_dir, const TQString &path, bool *isParent=0);
+  static TQString relativePath(const TQString &base_dir, const TQString &path, bool *isParent=nullptr);
 
   /**
    * @brief Determines which URI mode is suitable for processing URIs of a
diff --git a/tdecore/kurldrag.cpp b/tdecore/kurldrag.cpp
index 72447486a..8be5a8e53 100644
--- a/tdecore/kurldrag.cpp
+++ b/tdecore/kurldrag.cpp
@@ -34,14 +34,14 @@ public:
 };
 
 KURLDrag::KURLDrag( const KURL::List &urls, TQWidget* dragSource, const char * name )
-    : TQUriDrag(dragSource, name), m_metaData(), d( 0 )
+    : TQUriDrag(dragSource, name), m_metaData(), d( nullptr )
 {
     init(urls);
 }
 
 KURLDrag::KURLDrag( const KURL::List &urls, const TQMap<TQString,TQString>& metaData,
                     TQWidget* dragSource, const char * name )
-    : TQUriDrag(dragSource, name), m_metaData(metaData), d( 0 )
+    : TQUriDrag(dragSource, name), m_metaData(metaData), d( nullptr )
 {
     init(urls);
 }
@@ -176,14 +176,14 @@ const char * KURLDrag::format( int i ) const
     else if ( i == 1 )
         return "application/x-tdeio-metadata";
     if ( d && d->m_exportAsText == false )
-        return 0;
+        return nullptr;
     if ( i == 2 )
         return "text/plain";
     else if ( i == 3 ) //Support this for apps that use plain XA_STRING clipboard
         return "text/plain;charset=ISO-8859-1";
     else if ( i == 4 ) //Support this for apps that use the UTF_STRING clipboard
         return "text/plain;charset=UTF-8";
-    else return 0;
+    else return nullptr;
 }
 
 TQByteArray KURLDrag::encodedData( const char* mime ) const
@@ -290,4 +290,4 @@ TQString KURLDrag::urlToString(const KURL &url)
 // deprecated ctor
 KURLDrag::KURLDrag( const TQStrList & urls, const TQMap<TQString,TQString>& metaData,
                     TQWidget * dragSource, const char* name ) :
-TQUriDrag( urls, dragSource, name ), m_urls( urls ), m_metaData( metaData ), d( 0 ) {}
+TQUriDrag( urls, dragSource, name ), m_urls( urls ), m_metaData( metaData ), d( nullptr ) {}
diff --git a/tdecore/kurldrag.h b/tdecore/kurldrag.h
index a578ff74c..ae0cfbb31 100644
--- a/tdecore/kurldrag.h
+++ b/tdecore/kurldrag.h
@@ -54,7 +54,7 @@ public:
    * but should be 0 when copying to the clipboard
    * @param name the name of the TQObject
    */
-  KURLDrag( const KURL::List &urls, TQWidget* dragSource = 0, const char * name = 0 );
+  KURLDrag( const KURL::List &urls, TQWidget* dragSource = nullptr, const char * name = nullptr );
   /**
    * Constructs an object to drag the list of URLs in @p urls.
    * This version also includes metadata.
@@ -66,7 +66,7 @@ public:
    * @see metaData()
    */
   KURLDrag( const KURL::List &urls, const TQMap<TQString, TQString>& metaData,
-            TQWidget* dragSource = 0, const char * name = 0 );
+            TQWidget* dragSource = nullptr, const char * name = nullptr );
 
   virtual ~KURLDrag();
 
@@ -82,13 +82,13 @@ public:
   /**
    * @deprecated Is equivalent with "new KURLDrag(urls, dragSource, name)".
    */
-  static KURLDrag * newDrag( const KURL::List &urls, TQWidget* dragSource = 0, const char * name = 0 ) TDE_DEPRECATED;
+  static KURLDrag * newDrag( const KURL::List &urls, TQWidget* dragSource = nullptr, const char * name = nullptr ) TDE_DEPRECATED;
 
   /**
    * @deprecated Is equivalent with "new KURLDrag(urls, metaData, dragSource, name)".
    */
   static KURLDrag * newDrag( const KURL::List &urls, const TQMap<TQString, TQString>& metaData,
-                             TQWidget* dragSource = 0, const char * name = 0 ) TDE_DEPRECATED;
+                             TQWidget* dragSource = nullptr, const char * name = nullptr ) TDE_DEPRECATED;
 
   /**
    * Meta-data to associate with those URLs.
diff --git a/tdecore/kuser.cpp b/tdecore/kuser.cpp
index 6bad14bd0..20ab133fd 100644
--- a/tdecore/kuser.cpp
+++ b/tdecore/kuser.cpp
@@ -120,7 +120,7 @@ bool KUser::operator !=(const KUser& user) const {
 }
 
 void KUser::fillName(const char *name) {
-	fillPasswd(name ? ::getpwnam( name ) : 0);
+	fillPasswd(name ? ::getpwnam( name ) : nullptr);
 }
 
 void KUser::fillPasswd(struct passwd *p) {
@@ -336,7 +336,7 @@ bool KUserGroup::operator !=(const KUserGroup& user) const {
 }
 
 void KUserGroup::fillName(const char *name) {
-  fillGroup(name ? ::getgrnam( name ) : 0);
+  fillGroup(name ? ::getgrnam( name ) : nullptr);
 }
 
 void KUserGroup::fillGroup(struct group *p) {
diff --git a/tdecore/kvmallocator.cpp b/tdecore/kvmallocator.cpp
index 3b887eeee..a15491d10 100644
--- a/tdecore/kvmallocator.cpp
+++ b/tdecore/kvmallocator.cpp
@@ -63,7 +63,7 @@ public:
 KVMAllocator::KVMAllocator()
 {
    d = new KVMAllocatorPrivate;
-   d->tempfile = 0;
+   d->tempfile = nullptr;
    d->max_length = 0;
 }
 
@@ -101,7 +101,7 @@ KVMAllocator::allocate(size_t _size)
          block.start = free_block.start;
          block.length = _size;
          block.size = (_size + KVM_ALIGN) & ~KVM_ALIGN;
-         block.mmap = 0;
+         block.mmap = nullptr;
          free_block.size -= block.size;
          free_block.start += block.size;
          if (!free_block.size)
@@ -118,7 +118,7 @@ KVMAllocator::allocate(size_t _size)
    block.start = d->max_length;
    block.length = _size;
    block.size = (_size + KVM_ALIGN) & ~KVM_ALIGN;
-   block.mmap = 0;
+   block.mmap = nullptr;
    kdDebug(180)<<"VM alloc: using new block "<<(long)block.start<<" size ="<<(long)block.size<<" request = "<<_size<< endl;
    it = d->used_blocks.replace(block.start, block);
    d->max_length += block.size;
@@ -255,7 +255,7 @@ KVMAllocator::map(Block *block)
    if (block->mmap)
       return block->mmap;
 
-   void *result = mmap(0, block->length, PROT_READ| PROT_WRITE,
+   void *result = mmap(nullptr, block->length, PROT_READ| PROT_WRITE,
                        MAP_SHARED, d->tempfile->handle(), block->start);
    block->mmap = result;
    return block->mmap;
@@ -270,5 +270,5 @@ KVMAllocator::unmap(Block *block)
    // The following cast is necassery for Solaris.
    // (touch it and die). --Waba
    munmap((char *)block->mmap, block->length);
-   block->mmap = 0;
+   block->mmap = nullptr;
 }
diff --git a/tdecore/kxerrorhandler.cpp b/tdecore/kxerrorhandler.cpp
index ce9197bf6..7d9035b7d 100644
--- a/tdecore/kxerrorhandler.cpp
+++ b/tdecore/kxerrorhandler.cpp
@@ -30,13 +30,13 @@
 #include <stdlib.h>
 #include <netwm_def.h>
 
-KXErrorHandler** KXErrorHandler::handlers = NULL;
+KXErrorHandler** KXErrorHandler::handlers = nullptr;
 int KXErrorHandler::pos = 0;
 int KXErrorHandler::size = 0;
     
 KXErrorHandler::KXErrorHandler( Display* dpy )
-    :   user_handler1( NULL ),
-        user_handler2( NULL ),
+    :   user_handler1( nullptr ),
+        user_handler2( nullptr ),
         old_handler( XSetErrorHandler( handler_wrapper )),
         first_request( XNextRequest( dpy )),
         display( dpy ),
@@ -47,7 +47,7 @@ KXErrorHandler::KXErrorHandler( Display* dpy )
 
 KXErrorHandler::KXErrorHandler( bool (*handler)( int request, int error_code, unsigned long resource_id ), Display* dpy )
     :   user_handler1( handler ),
-        user_handler2( NULL ),
+        user_handler2( nullptr ),
         old_handler( XSetErrorHandler( handler_wrapper )),
         first_request( XNextRequest( dpy )),
         display( dpy ),
@@ -57,7 +57,7 @@ KXErrorHandler::KXErrorHandler( bool (*handler)( int request, int error_code, un
     }
 
 KXErrorHandler::KXErrorHandler( int (*handler)( Display*, XErrorEvent* ), Display* dpy )
-    :   user_handler1( NULL ),
+    :   user_handler1( nullptr ),
         user_handler2( handler ),
         old_handler( XSetErrorHandler( handler_wrapper )),
         first_request( XNextRequest( dpy )),
@@ -106,9 +106,9 @@ int KXErrorHandler::handle( Display* dpy, XErrorEvent* e )
         && NET::timestampCompare( e->serial, first_request ) >= 0 )
         { // it's for us
         //tqDebug( "Handling: %p", static_cast< void* >( this ));
-        if( user_handler1 != NULL && user_handler1( e->request_code, e->error_code, e->resourceid ))
+        if( user_handler1 && user_handler1( e->request_code, e->error_code, e->resourceid ))
             was_error = true;
-        if( user_handler2 != NULL && user_handler2( dpy, e ) != 0 )
+        if( user_handler2 && user_handler2( dpy, e ) != 0 )
             was_error = true;
         else // no handler set, simply set that there was an error
             was_error = true;
diff --git a/tdecore/kxmessages.cpp b/tdecore/kxmessages.cpp
index 37c15bcf9..0b6343e4e 100644
--- a/tdecore/kxmessages.cpp
+++ b/tdecore/kxmessages.cpp
@@ -40,7 +40,7 @@ const long BROADCAST_MASK = PropertyChangeMask;
 KXMessages::KXMessages( const char* accept_broadcast_P, TQWidget* parent_P )
     : TQWidget( parent_P )
     {
-    if( accept_broadcast_P != NULL )
+    if( accept_broadcast_P )
         {
         ( void ) tdeApp->desktop(); //trigger desktop widget creation to select root window events
         tdeApp->installX11EventFilter( this ); // i.e. PropertyChangeMask
@@ -57,7 +57,7 @@ KXMessages::KXMessages( const char* accept_broadcast_P, TQWidget* parent_P )
 KXMessages::KXMessages( const char* accept_broadcast_P, TQWidget* parent_P, bool obsolete_P )
     : TQWidget( parent_P )
     {
-    if( accept_broadcast_P != NULL )
+    if( accept_broadcast_P )
         {
         ( void ) tdeApp->desktop(); //trigger desktop widget creation to select root window events
         tdeApp->installX11EventFilter( this ); // i.e. PropertyChangeMask
@@ -115,7 +115,7 @@ bool KXMessages::broadcastMessageX( Display* disp, const char* msg_type_P,
 bool KXMessages::broadcastMessageX( Display* disp, const char* msg_type_P,
     const TQString& message_P, int screen_P, bool obsolete_P )
     {
-    if( disp == NULL )
+    if( !disp )
         return false;
     Atom a2 = XInternAtom( disp, msg_type_P, false );
     Atom a1 = obsolete_P ? a2 : XInternAtom( disp, TQCString( msg_type_P ) + "_BEGIN", false );
@@ -138,7 +138,7 @@ bool KXMessages::sendMessageX( Display* disp, WId w_P, const char* msg_type_P,
 bool KXMessages::sendMessageX( Display* disp, WId w_P, const char* msg_type_P,
     const TQString& message_P, bool obsolete_P )
     {
-    if( disp == NULL )
+    if( !disp )
         return false;
     Atom a2 = XInternAtom( disp, msg_type_P, false );
     Atom a1 = obsolete_P ? a2 : XInternAtom( disp, TQCString( msg_type_P ) + "_BEGIN", false );
diff --git a/tdecore/kxmessages.h b/tdecore/kxmessages.h
index d3787f6bb..82416d12d 100644
--- a/tdecore/kxmessages.h
+++ b/tdecore/kxmessages.h
@@ -64,7 +64,7 @@ class TDECORE_EXPORT KXMessages
          * @deprecated
          * This method is equivalent to the other constructor with obsolete = true.
          */
-        KXMessages( const char* accept_broadcast = NULL, TQWidget* parent = NULL );
+        KXMessages( const char* accept_broadcast = nullptr, TQWidget* parent = nullptr );
 
         virtual ~KXMessages();
 	/**
diff --git a/tdecore/libintl.cpp b/tdecore/libintl.cpp
index c7b8c7ee6..676322f87 100644
--- a/tdecore/libintl.cpp
+++ b/tdecore/libintl.cpp
@@ -101,7 +101,7 @@ struct kde_loaded_l10nfile
 
   const void *data;
 
-  kde_loaded_l10nfile() : filename(0), decided(0), data(0) {}
+  kde_loaded_l10nfile() : filename(nullptr), decided(0), data(nullptr) {}
 };
 
 void k_nl_load_domain(struct kde_loaded_l10nfile *__domain);
@@ -169,13 +169,13 @@ k_nl_find_msg (struct kde_loaded_l10nfile *domain_file, const char *msgid)
   if (domain_file->decided == 0)
     k_nl_load_domain (domain_file);
 
-  if (domain_file->data == NULL)
-    return NULL;
+  if (!domain_file->data)
+    return nullptr;
 
   domain = (struct loaded_domain *) domain_file->data;
 
   /* Locate the MSGID and its translation.  */
-  if (domain->hash_size > 2 && domain->hash_tab != NULL)
+  if (domain->hash_size > 2 && domain->hash_tab)
     {
       /* Use the hashing table.  */
       nls_uint32 len = strlen (msgid);
@@ -186,7 +186,7 @@ k_nl_find_msg (struct kde_loaded_l10nfile *domain_file, const char *msgid)
 
       if (nstr == 0)
 	/* Hash table entry is empty.  */
-	return NULL;
+	return nullptr;
 
       if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
 	  && strcmp (msgid,
@@ -205,7 +205,7 @@ k_nl_find_msg (struct kde_loaded_l10nfile *domain_file, const char *msgid)
 	  nstr = W (domain->must_swap, domain->hash_tab[idx]);
 	  if (nstr == 0)
 	    /* Hash table entry is empty.  */
-	    return NULL;
+	    return nullptr;
 
 	  if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
 	      && strcmp (msgid,
@@ -240,7 +240,7 @@ k_nl_find_msg (struct kde_loaded_l10nfile *domain_file, const char *msgid)
     }
 
   /* If an translation is found return this.  */
-  return bottom >= top ? NULL : (char *) domain->data
+  return bottom >= top ? nullptr : (char *) domain->data
                                 + W (domain->must_swap,
 				     domain->trans_tab[act].offset);
 }
@@ -285,13 +285,13 @@ k_nl_load_domain (struct kde_loaded_l10nfile *domain_file)
   struct loaded_domain *domain;
 
   domain_file->decided = 1;
-  domain_file->data = NULL;
+  domain_file->data = nullptr;
 
   /* If the record does not represent a valid locale the FILENAME
      might be NULL.  This can happen when according to the given
      specification the locale file name is different for XPG and CEN
      syntax.  */
-  if (domain_file->filename == NULL)
+  if (!domain_file->filename)
     return;
 
   /* Try to open the addressed file.  */
@@ -311,7 +311,7 @@ k_nl_load_domain (struct kde_loaded_l10nfile *domain_file)
 #if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP)
   /* Now we are ready to load the file.  If mmap() is available we try
      this first.  If not available or it failed we try to load it.  */
-  data = (struct mo_file_header *) mmap (NULL, st.st_size, PROT_READ,
+  data = (struct mo_file_header *) mmap (nullptr, st.st_size, PROT_READ,
 					 MAP_PRIVATE, fd, 0);
 
   if (data != (struct mo_file_header *) -1)
@@ -330,7 +330,7 @@ k_nl_load_domain (struct kde_loaded_l10nfile *domain_file)
       char *read_ptr;
 
       data = (struct mo_file_header *) malloc (st.st_size);
-      if (data == NULL)
+      if (!data)
 	return;
 
       to_read = st.st_size;
@@ -368,7 +368,7 @@ k_nl_load_domain (struct kde_loaded_l10nfile *domain_file)
 
   domain_file->data
     = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
-  if (domain_file->data == NULL)
+  if (!domain_file->data)
     return;
 
   domain = (struct loaded_domain *) domain_file->data;
@@ -401,7 +401,7 @@ k_nl_load_domain (struct kde_loaded_l10nfile *domain_file)
 #endif
 	free (data);
       free (domain);
-      domain_file->data = NULL;
+      domain_file->data = nullptr;
       return;
     }
 }
diff --git a/tdecore/malloc/x86.h b/tdecore/malloc/x86.h
index b21517374..2cf9269b1 100644
--- a/tdecore/malloc/x86.h
+++ b/tdecore/malloc/x86.h
@@ -29,7 +29,7 @@ static __inline__ int lock(mutex_t *m) {
         {
       tm.tv_sec = 0;
       tm.tv_nsec = 2000001;
-      nanosleep(&tm, NULL);
+      nanosleep(&tm, nullptr);
       cnt = 0;
     }
   }
diff --git a/tdecore/netsupp.cpp b/tdecore/netsupp.cpp
index 25f73d0c5..b464e5274 100644
--- a/tdecore/netsupp.cpp
+++ b/tdecore/netsupp.cpp
@@ -62,7 +62,7 @@
 #ifdef offsetof
 #undef offsetof
 #endif
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)nullptr)->MEMBER)
 
 /*
  * These constants tell the flags in KDE::resolverFlags
@@ -83,10 +83,10 @@ static void dofreeaddrinfo(struct addrinfo *ai)
   while (ai)
     {
       struct addrinfo *ai2 = ai;
-      if (ai->ai_canonname != NULL)
+      if (ai->ai_canonname)
 	free(ai->ai_canonname);
 
-      if (ai->ai_addr != NULL)
+      if (ai->ai_addr)
 	free(ai->ai_addr);
 
       ai = ai->ai_next;
@@ -98,7 +98,7 @@ void kde_freeaddrinfo(struct kde_addrinfo *ai)
 {
   if (ai->origin == KAI_LOCALUNIX)
     {
-      struct addrinfo *p, *last = NULL;
+      struct addrinfo *p, *last = nullptr;
       /* We've added one AF_UNIX socket in here, to the
        * tail of the linked list. We have to find it */
       for (p = ai->data; p; p = p->ai_next)
@@ -107,7 +107,7 @@ void kde_freeaddrinfo(struct kde_addrinfo *ai)
 	    {
 	      if (last)
 		{
-		  last->ai_next = NULL;
+		  last->ai_next = nullptr;
 		  freeaddrinfo(ai->data);
 		}
 	      dofreeaddrinfo(p);
@@ -131,11 +131,11 @@ make_unix(const char *name, const char *serv)
   int len;
 
   p = (addrinfo*)malloc(sizeof(*p));
-  if (p == NULL)
-    return NULL;
+  if (!p)
+    return nullptr;
   memset(p, 0, sizeof(*p));
 
-  if (name != NULL)
+  if (name)
     buf = name;
   else
     buf = serv;
@@ -146,11 +146,11 @@ make_unix(const char *name, const char *serv)
     len += 5;			// strlen("/tmp/");
 
   _sun = (sockaddr_un*)malloc(len);
-  if (_sun == NULL)
+  if (!_sun)
     {
       // Oops
       free(p);
-      return NULL;
+      return nullptr;
     }
 
   _sun->sun_family = AF_UNIX;
@@ -237,23 +237,23 @@ int kde_getaddrinfo(const char *name, const char *service,
 
   // allocate memory for results
   res = (kde_addrinfo*)malloc(sizeof(*res));
-  if (res == NULL)
+  if (!res)
     return EAI_MEMORY;
-  res->data = NULL;
+  res->data = nullptr;
   res->origin = KAI_SYSTEM;	// at first, it'll be only system data
 
-  struct addrinfo* last = NULL;
+  struct addrinfo* last = nullptr;
   
   // Skip the getaddrinfo call and the ipv6 check for a UNIX socket.
   if (hint && (hint->ai_family == PF_UNIX))
   {
-     if (service == NULL || *service == '\0')
+     if (!service || *service == '\0')
        goto out;		// can't be Unix if no service was requested
 
      // Unix sockets must be localhost
      // That is, either name is NULL or, if it's not, it must be empty,
      // "*" or "localhost"
-     if (name != NULL && !(name[0] == '\0' || (name[0] == '*' && name[1] == '\0') ||
+     if (name && !(name[0] == '\0' || (name[0] == '*' && name[1] == '\0') ||
 		strcmp("localhost", name) == 0))
        goto out;		// isn't localhost
 
@@ -272,7 +272,7 @@ int kde_getaddrinfo(const char *name, const char *service,
       // here we have modes 1 and 2 (no lookups)
       // this is shared code
       struct addrinfo our_hint;
-      if (hint != NULL)
+      if (hint)
 	{
 	  memcpy(&our_hint, hint, sizeof(our_hint));
 	  if (our_hint.ai_family == AF_UNSPEC)
@@ -298,19 +298,19 @@ int kde_getaddrinfo(const char *name, const char *service,
 
   // Now we have to check whether the user could want a Unix socket
 
-  if (service == NULL || *service == '\0')
+  if (!service || *service == '\0')
     goto out;			// can't be Unix if no service was requested
 
   // Unix sockets must be localhost
   // That is, either name is NULL or, if it's not, it must be empty,
   // "*" or "localhost"
-  if (name != NULL && !(name[0] == '\0' || (name[0] == '*' && name[1] == '\0') ||
+  if (name && !(name[0] == '\0' || (name[0] == '*' && name[1] == '\0') ||
 			strcmp("localhost", name) == 0))
     goto out;			// isn't localhost
 
   // Unix sockets can only be returned if the user asked for a PF_UNSPEC
   // or PF_UNIX socket type or gave us a NULL hint
-  if (hint != NULL && (hint->ai_family != PF_UNSPEC && hint->ai_family != PF_UNIX))
+  if (hint && hint->ai_family != PF_UNSPEC && hint->ai_family != PF_UNIX)
     goto out;			// user doesn't want Unix
 
   // If we got here, then it means that the user might be expecting Unix
@@ -328,13 +328,13 @@ int kde_getaddrinfo(const char *name, const char *service,
 
  do_unix:
   // So, give the user a PF_UNIX socket
-  p = make_unix(NULL, service);
-  if (p == NULL)
+  p = make_unix(nullptr, service);
+  if (!p)
     {
       err = EAI_MEMORY;
       goto out;
     }
-  if (hint != NULL)
+  if (hint)
     p->ai_socktype = hint->ai_socktype;
   if (p->ai_socktype == 0)
     p->ai_socktype = SOCK_STREAM; // default
@@ -348,7 +348,7 @@ int kde_getaddrinfo(const char *name, const char *service,
   return 0;
 
  out:
-  if (res->data != NULL)
+  if (res->data)
       freeaddrinfo(res->data);
   free(res);
   return err;
@@ -378,7 +378,7 @@ static int inet_lookup(const char *name, int portnum, int protonum,
 {
   struct addrinfo *q;
   struct hostent *h;
-  struct sockaddr **psa = NULL;
+  struct sockaddr **psa = nullptr;
   int len;
 
   // TODO
@@ -386,7 +386,7 @@ static int inet_lookup(const char *name, int portnum, int protonum,
 # ifdef AF_INET6
   if (hint->ai_family == AF_INET6)
     {
-      if (p != NULL)
+      if (p)
 	{
 	  *result = p;
 	  return 0;
@@ -396,16 +396,16 @@ static int inet_lookup(const char *name, int portnum, int protonum,
 # endif
 
   q = (addrinfo*)malloc(sizeof(*q));
-  if (q == NULL)
+  if (!q)
     {
       freeaddrinfo(p);
       return EAI_MEMORY;
     }
 
   h = gethostbyname(name);
-  if (h == NULL)
+  if (!h)
     {
-      if (p != NULL)
+      if (p)
 	{
 	  // There already is a suitable result
 	  *result = p;
@@ -440,7 +440,7 @@ static int inet_lookup(const char *name, int portnum, int protonum,
     {
       // We don't know what to do with these addresses
       // Or gethostbyname returned information we don't want
-      if (p != NULL)
+      if (p)
 	{
 	  *result = p;
 	  return 0;
@@ -455,7 +455,7 @@ static int inet_lookup(const char *name, int portnum, int protonum,
   q->ai_addrlen = len;
 
   q->ai_addr = (sockaddr*)malloc(len);
-  if (q->ai_addr == NULL)
+  if (!q->ai_addr)
     {
       free(q);
       freeaddrinfo(p);
@@ -489,7 +489,7 @@ static int inet_lookup(const char *name, int portnum, int protonum,
   if (hint->ai_flags & AI_CANONNAME)
     q->ai_canonname = strdup(h->h_name);
   else
-    q->ai_canonname = NULL;
+    q->ai_canonname = nullptr;
 
   q->ai_next = p;
   p = q;
@@ -498,7 +498,7 @@ static int inet_lookup(const char *name, int portnum, int protonum,
   for (psa = (sockaddr**)h->h_addr_list + 1; *psa; psa++)
     {
       q = (addrinfo*)malloc(sizeof(*q));
-      if (q == NULL)
+      if (!q)
 	{
 	  freeaddrinfo(p);
 	  return EAI_MEMORY;
@@ -506,7 +506,7 @@ static int inet_lookup(const char *name, int portnum, int protonum,
       memcpy(q, p, sizeof(*q));
 
       q->ai_addr = (sockaddr*)malloc(h->h_length);
-      if (q->ai_addr == NULL)
+      if (!q->ai_addr)
 	{
 	  freeaddrinfo(p);
 	  free(q);
@@ -537,7 +537,7 @@ static int inet_lookup(const char *name, int portnum, int protonum,
 	}
 # endif
 
-      if (q->ai_canonname != NULL)
+      if (q->ai_canonname)
 	q->ai_canonname = strdup(q->ai_canonname);
 
       q->ai_next = p;
@@ -557,7 +557,7 @@ static int make_inet(const char *name, int portnum, int protonum, struct addrinf
     {
       // This 'do' is here just so that we can 'break' out of it
 
-      if (name != NULL)
+      if (name)
 	{
 	  // first, try to use inet_pton before resolving
 	  // it will catch IP addresses given without having to go to lookup
@@ -568,7 +568,7 @@ static int make_inet(const char *name, int portnum, int protonum, struct addrinf
 	  struct in6_addr in6;
 
 	  if (hint->ai_family == AF_INET6 || (hint->ai_family == AF_UNSPEC &&
-					      strchr(name, ':') != NULL))
+					      strchr(name, ':')))
 	    {
 	      // yes, this is IPv6
 	      if (inet_pton(AF_INET6, name, &in6) != 1)
@@ -582,23 +582,23 @@ static int make_inet(const char *name, int portnum, int protonum, struct addrinf
 		}
 
 	      sin6 = (sockaddr_in6*)malloc(sizeof(*sin6));
-	      if (sin6 == NULL)
+	      if (!sin6)
 		{
 		  freeaddrinfo(p);
 		  return EAI_MEMORY;
 		}
 	      memcpy(&sin6->sin6_addr, &in6, sizeof(in6));
 
-	      if (strchr(name, '%') != NULL)
+	      if (strchr(name, '%'))
 		{
 		  errno = 0;
-		  sin6->sin6_scope_id = strtoul(strchr(name, '%') + 1, NULL, 10);
+		  sin6->sin6_scope_id = strtoul(strchr(name, '%') + 1, nullptr, 10);
 		  if (errno != 0)
 		    sin6->sin6_scope_id = 0; // no interface
 		}
 
 	      q = (addrinfo*)malloc(sizeof(*q));
-	      if (q == NULL)
+	      if (!q)
 		{
 		  freeaddrinfo(p);
 		  free(sin6);
@@ -617,7 +617,7 @@ static int make_inet(const char *name, int portnum, int protonum, struct addrinf
 	      q->ai_socktype = hint->ai_socktype;
 	      q->ai_protocol = protonum;
 	      q->ai_addrlen = sizeof(*sin6);
-	      q->ai_canonname = NULL;
+	      q->ai_canonname = nullptr;
 	      q->ai_addr = (sockaddr*)sin6;
 	      q->ai_next = p;
 
@@ -640,14 +640,14 @@ static int make_inet(const char *name, int portnum, int protonum, struct addrinf
 		}
 
 	      sin = (sockaddr_in*)malloc(sizeof(*sin));
-	      if (sin == NULL)
+	      if (!sin)
 		{
 		  freeaddrinfo(p);
 		  return EAI_MEMORY;
 		}
 
 	      q = (addrinfo*)malloc(sizeof(*q));
-	      if (q == NULL)
+	      if (!q)
 		{
 		  freeaddrinfo(p);
 		  free(sin);
@@ -666,7 +666,7 @@ static int make_inet(const char *name, int portnum, int protonum, struct addrinf
 	      q->ai_socktype = hint->ai_socktype;
 	      q->ai_protocol = protonum;
 	      q->ai_addrlen = sizeof(*sin);
-	      q->ai_canonname = NULL;
+	      q->ai_canonname = nullptr;
 	      q->ai_addr = (sockaddr*)sin;
 	      q->ai_next = p;
 	      *result = q;
@@ -680,7 +680,7 @@ static int make_inet(const char *name, int portnum, int protonum, struct addrinf
     } while (false);
 
   // This means localhost
-  if (name == NULL)
+  if (!name)
     {
       struct sockaddr_in *sin = (sockaddr_in*)malloc(sizeof(*sin));
 # ifdef AF_INET6
@@ -689,7 +689,7 @@ static int make_inet(const char *name, int portnum, int protonum, struct addrinf
 
       if (hint->ai_family == AF_INET || hint->ai_family == AF_UNSPEC)
 	{
-	  if (sin == NULL)
+	  if (!sin)
 	    {
 	      free(sin);
 	      freeaddrinfo(p);
@@ -698,7 +698,7 @@ static int make_inet(const char *name, int portnum, int protonum, struct addrinf
 
 	  // Do IPv4 first
 	  q = (addrinfo*)malloc(sizeof(*q));
-	  if (q == NULL)
+	  if (!q)
 	    {
 	      free(sin);
 	      freeaddrinfo(p);
@@ -719,7 +719,7 @@ static int make_inet(const char *name, int portnum, int protonum, struct addrinf
 	  q->ai_socktype = hint->ai_socktype;
 	  q->ai_protocol = protonum;
 	  q->ai_addrlen = sizeof(*sin);
-	  q->ai_canonname = NULL;
+	  q->ai_canonname = nullptr;
 	  q->ai_addr = (sockaddr*)sin;
 	  q->ai_next = p;
 	  p = q;
@@ -732,7 +732,7 @@ static int make_inet(const char *name, int portnum, int protonum, struct addrinf
 	{
 	  sin6 = (sockaddr_in6*)malloc(sizeof(*sin6));
 	  q = (addrinfo*)malloc(sizeof(*q));
-	  if (q == NULL || sin6 == NULL)
+	  if (!q || !sin6)
 	    {
 	      free(sin6);
 	      free(q);
@@ -758,7 +758,7 @@ static int make_inet(const char *name, int portnum, int protonum, struct addrinf
 	  q->ai_socktype = hint->ai_socktype;
 	  q->ai_protocol = protonum;
 	  q->ai_addrlen = sizeof(*sin6);
-	  q->ai_canonname = NULL;
+	  q->ai_canonname = nullptr;
 	  q->ai_addr = (sockaddr*)sin6;
 	  q->ai_next = p;
 	  p = q;
@@ -781,10 +781,10 @@ int getaddrinfo(const char *name, const char *serv,
   unsigned short portnum;	// remember to store in network byte order
   int protonum = IPPROTO_TCP;
   const char *proto = "tcp";
-  struct addrinfo *p = NULL;
+  struct addrinfo *p = nullptr;
 
   // Sanity checks:
-  if (hint == NULL || result == NULL)
+  if (!hint || !result)
     return EAI_BADFLAGS;
   if (hint->ai_family != AF_UNSPEC && hint->ai_family != AF_UNIX &&
       hint->ai_family != AF_INET
@@ -798,25 +798,25 @@ int getaddrinfo(const char *name, const char *serv,
     return EAI_SOCKTYPE;
 
   // Treat hostname of "*" as NULL, which means localhost
-  if (name != NULL && ((*name == '*' && name[1] == '\0') || *name == '\0'))
-    name = NULL;
+  if (name && ((*name == '*' && name[1] == '\0') || *name == '\0'))
+    name = nullptr;
   // Treat service of "*" as NULL, which I guess means no port (0)
-  if (serv != NULL && ((*serv == '*' && serv[1] == '\0') || *serv == '\0'))
-    serv = NULL;
+  if (serv && ((*serv == '*' && serv[1] == '\0') || *serv == '\0'))
+    serv = nullptr;
 
-  if (name == NULL && serv == NULL) // what the hell do you want?
+  if (!name && !serv) // what the hell do you want?
     return EAI_NONAME;
 
   // This is just to make it easier
-  if (name != NULL && strcmp(name, "localhost") == 0)
-     name = NULL;
+  if (name && strcmp(name, "localhost") == 0)
+     name = nullptr;
 
   // First, check for a Unix socket
   // family must be either AF_UNIX or AF_UNSPEC
   // either of name or serv must be set, the other must be NULL or empty
   if (hint->ai_family == AF_UNIX || hint->ai_family == AF_UNSPEC)
     {
-      if (name != NULL && serv != NULL)
+      if (name && serv)
 	{
 	  // This is not allowed
 	  if (hint->ai_family == AF_UNIX)
@@ -825,14 +825,14 @@ int getaddrinfo(const char *name, const char *serv,
       else
 	{
 	  p = make_unix(name, serv);
-	  if (p == NULL)
+	  if (!p)
 	    return EAI_MEMORY;
 
 	  p->ai_socktype = hint->ai_socktype;
 	  // If the name/service started with a slash, then this *IS*
 	  // only a Unix socket. Return.
-	  if (hint->ai_family == AF_UNIX || ((name != NULL && *name == '/') ||
-					      (serv != NULL && *serv == '/')))
+	  if (hint->ai_family == AF_UNIX || ((name && *name == '/') ||
+					      (serv && *serv == '/')))
 	    {
 	      *result = p;
 	      return 0;		// successful lookup
@@ -841,7 +841,7 @@ int getaddrinfo(const char *name, const char *serv,
     }
 
   // Lookup the service name, if required
-  if (serv != NULL)
+  if (serv)
     {
       char *tail;
       struct servent *sent;
@@ -857,9 +857,9 @@ int getaddrinfo(const char *name, const char *serv,
 	    }
 
 	  sent = getservbyname(serv, proto);
-	  if (sent == NULL)	// no service?
+	  if (!sent)	// no service?
 	    {
-	      if (p == NULL)
+	      if (!p)
 		return EAI_NONAME;
 	      else
 		return 0;	// a Unix socket available
@@ -898,7 +898,7 @@ char *gai_strerror(int errorcode)
   };
 
   if (errorcode > EAI_SYSTEM || errorcode < 0)
-    return NULL;
+    return nullptr;
 
   static char buffer[200];
   strcpy(buffer, i18n(messages[errorcode]).local8Bit());
@@ -907,14 +907,14 @@ char *gai_strerror(int errorcode)
 
 static void findport(unsigned short port, char *serv, size_t servlen, int flags)
 {
-  if (serv == NULL)
+  if (!serv)
     return;
 
   if ((flags & NI_NUMERICSERV) == 0)
     {
       struct servent *sent;
       sent = getservbyport(ntohs(port), flags & NI_DGRAM ? "udp" : "tcp");
-      if (sent != NULL && servlen > strlen(sent->s_name))
+      if (sent && servlen > strlen(sent->s_name))
 	{
 	  strcpy(serv, sent->s_name);
 	  return;
@@ -936,7 +936,7 @@ int getnameinfo(const struct sockaddr *sa, ksocklen_t salen,
       const sockaddr_in6 *sin6;
   } s;
 
-  if ((host == NULL || hostlen == 0) && (serv == NULL || servlen == 0))
+  if ((!host || hostlen == 0) && (!serv || servlen == 0))
     return 1;
 
   s.sa = sa;
@@ -945,9 +945,9 @@ int getnameinfo(const struct sockaddr *sa, ksocklen_t salen,
       if (salen < offsetof(struct sockaddr_un, sun_path) + strlen(s._sun->sun_path) + 1)
 	return 1;		// invalid socket
 
-      if (servlen && serv != NULL)
+      if (servlen && serv)
 	*serv = '\0';
-      if (host != NULL && hostlen > strlen(s._sun->sun_path))
+      if (host && hostlen > strlen(s._sun->sun_path))
 	strcpy(host, s._sun->sun_path);
 
       return 0;
@@ -964,11 +964,11 @@ int getnameinfo(const struct sockaddr *sa, ksocklen_t salen,
 	  // have to do lookup
 	  struct hostent *h = gethostbyaddr((const char*)&s.sin->sin_addr, sizeof(s.sin->sin_addr),
 					    AF_INET);
-	  if (h == NULL && flags & NI_NAMEREQD)
+	  if (!h && flags & NI_NAMEREQD)
 	    return 1;
-	  else if (h == NULL)
+	  else if (!h)
 	    inet_ntop(AF_INET, &s.sin->sin_addr, host, hostlen);
-	  else if (host != NULL && hostlen > strlen(h->h_name))
+	  else if (host && hostlen > strlen(h->h_name))
 	    strcpy(host, h->h_name);
 	  else
 	    return 1;		// error
@@ -989,11 +989,11 @@ int getnameinfo(const struct sockaddr *sa, ksocklen_t salen,
 	  // have to do lookup
 	  struct hostent *h = gethostbyaddr((const char*)&s.sin->sin_addr, sizeof(s.sin->sin_addr),
 					    AF_INET6);
-	  if (h == NULL && flags & NI_NAMEREQD)
+	  if (!h && flags & NI_NAMEREQD)
 	    return 1;
-	  else if (h == NULL)
+	  else if (!h)
 	    inet_ntop(AF_INET6, &s.sin6->sin6_addr, host, hostlen);
-	  else if (host != NULL && hostlen > strlen(h->h_name))
+	  else if (host && hostlen > strlen(h->h_name))
 	    strcpy(host, h->h_name);
 	  else
 	    return 1;		// error
@@ -1036,14 +1036,14 @@ const char* inet_ntop(int af, const void *cp, char *buf, size_t len)
 	}
 
       errno = ENOSPC;
-      return NULL;		// failed
+      return nullptr;		// failed
     }
 
 # ifdef AF_INET6
   if (af == AF_INET6)
     {
       TQ_UINT16 *p = (TQ_UINT16*)data;
-      TQ_UINT16 *longest = NULL, *cur = NULL;
+      TQ_UINT16 *longest = nullptr, *cur = nullptr;
       int longest_length = 0, cur_length;
       int i;
 
@@ -1055,16 +1055,16 @@ const char* inet_ntop(int af, const void *cp, char *buf, size_t len)
 	{
 	  // find the longest sequence of zeroes
 	  for (i = 0; i < 8; i++)
-	    if (cur == NULL && p[i] == 0)
+	    if (!cur && p[i] == 0)
 	      {
 		// a zero, start the sequence
 		cur = p + i;
 		cur_length = 1;
 	      }
-	    else if (cur != NULL && p[i] == 0)
+	    else if (cur && p[i] == 0)
 	      // part of the sequence
 	      cur_length++;
-	    else if (cur != NULL && p[i] != 0)
+	    else if (cur && p[i] != 0)
 	      {
 		// end of the sequence
 		if (cur_length > longest_length)
@@ -1072,9 +1072,9 @@ const char* inet_ntop(int af, const void *cp, char *buf, size_t len)
 		    longest_length = cur_length;
 		    longest = cur;
 		  }
-		cur = NULL;		// restart sequence
+		cur = nullptr;		// restart sequence
 	      }
-	  if (cur != NULL && cur_length > longest_length)
+	  if (cur && cur_length > longest_length)
 	    {
 	      longest_length = cur_length;
 	      longest = cur;
@@ -1105,12 +1105,12 @@ const char* inet_ntop(int af, const void *cp, char *buf, size_t len)
 	}
 
       errno = ENOSPC;
-      return NULL;
+      return nullptr;
     }
 # endif
 
   errno = EAFNOSUPPORT;
-  return NULL;			// a family we don't know about
+  return nullptr;			// a family we don't know about
 }
 
 #else	// HAVE_INET_NTOP
@@ -1149,7 +1149,7 @@ int inet_pton(int af, const char *cp, void *buf)
       TQ_UINT16 addr[8];
       const char *p = cp;
       int n = 0, start = 8;
-      bool has_v4 = strchr(p, '.') != NULL;
+      bool has_v4 = strchr(p, '.') != nullptr;
 
       memset(addr, 0, sizeof(addr));
 
diff --git a/tdecore/netwm.cpp b/tdecore/netwm.cpp
index 1e0670333..7f6bb4da4 100644
--- a/tdecore/netwm.cpp
+++ b/tdecore/netwm.cpp
@@ -157,7 +157,7 @@ const unsigned long netwm_sendevent_mask = (SubstructureRedirectMask|
 const long MAX_PROP_SIZE = 100000;
 
 static char *nstrdup(const char *s1) {
-    if (! s1) return (char *) 0;
+    if (! s1) return nullptr;
 
     int l = strlen(s1) + 1;
     char *s2 = new char[l];
@@ -167,7 +167,7 @@ static char *nstrdup(const char *s1) {
 
 
 static char *nstrndup(const char *s1, int l) {
-    if (! s1 || l == 0) return (char *) 0;
+    if (! s1 || l == 0) return nullptr;
 
     char *s2 = new char[l+1];
     strncpy(s2, s1, l);
@@ -177,7 +177,7 @@ static char *nstrndup(const char *s1, int l) {
 
 
 static Window *nwindup(Window *w1, int n) {
-    if (! w1 || n == 0) return (Window *) 0;
+    if (! w1 || n == 0) return nullptr;
 
     Window *w2 = new Window[n];
     while (n--)	w2[n] = w1[n];
@@ -461,7 +461,7 @@ static void readIcon(Display* display, Window window, Atom property, NETRArray<N
     Atom type_ret;
     int format_ret;
     unsigned long nitems_ret = 0, after_ret = 0;
-    unsigned char *data_ret = 0;
+    unsigned char *data_ret = nullptr;
 
     // reset
     for (int i = 0; i < icons.size(); i++)
@@ -470,7 +470,7 @@ static void readIcon(Display* display, Window window, Atom property, NETRArray<N
     icon_count = 0;
 
     // allocate buffers
-    unsigned char *buffer = 0;
+    unsigned char *buffer = nullptr;
     unsigned long offset = 0;
     unsigned long buffer_offset = 0;
     unsigned long bufsize = 0;
@@ -619,9 +619,9 @@ NETRootInfo::NETRootInfo(Display *display, Window supportWindow, const char *wmN
     p->supportwindow = supportWindow;
     p->number_of_desktops = p->current_desktop = 0;
     p->active = None;
-    p->clients = p->stacking = p->virtual_roots = (Window *) 0;
+    p->clients = p->stacking = p->virtual_roots = nullptr;
     p->clients_count = p->stacking_count = p->virtual_roots_count = 0;
-    p->kde_system_tray_windows = 0;
+    p->kde_system_tray_windows = nullptr;
     p->kde_system_tray_windows_count = 0;
     p->showing_desktop = false;
     p->desktop_layout_orientation = OrientationHorizontal;
@@ -671,9 +671,9 @@ NETRootInfo::NETRootInfo(Display *display, Window supportWindow, const char *wmN
     p->supportwindow = supportWindow;
     p->number_of_desktops = p->current_desktop = 0;
     p->active = None;
-    p->clients = p->stacking = p->virtual_roots = (Window *) 0;
+    p->clients = p->stacking = p->virtual_roots = nullptr;
     p->clients_count = p->stacking_count = p->virtual_roots_count = 0;
-    p->kde_system_tray_windows = 0;
+    p->kde_system_tray_windows = nullptr;
     p->kde_system_tray_windows_count = 0;
     p->showing_desktop = false;
     setDefaultProperties();
@@ -703,7 +703,7 @@ NETRootInfo::NETRootInfo(Display *display, const unsigned long properties[], int
     p = new NETRootInfoPrivate;
     p->ref = 1;
 
-    p->name = 0;
+    p->name = nullptr;
 
     p->display = display;
 
@@ -720,9 +720,9 @@ NETRootInfo::NETRootInfo(Display *display, const unsigned long properties[], int
     p->supportwindow = None;
     p->number_of_desktops = p->current_desktop = 0;
     p->active = None;
-    p->clients = p->stacking = p->virtual_roots = (Window *) 0;
+    p->clients = p->stacking = p->virtual_roots = nullptr;
     p->clients_count = p->stacking_count = p->virtual_roots_count = 0;
-    p->kde_system_tray_windows = 0;
+    p->kde_system_tray_windows = nullptr;
     p->kde_system_tray_windows_count = 0;
     p->showing_desktop = false;
     p->desktop_layout_orientation = OrientationHorizontal;
@@ -764,7 +764,7 @@ NETRootInfo::NETRootInfo(Display *display, unsigned long properties, int screen,
     p = new NETRootInfoPrivate;
     p->ref = 1;
 
-    p->name = 0;
+    p->name = nullptr;
 
     p->display = display;
 
@@ -781,9 +781,9 @@ NETRootInfo::NETRootInfo(Display *display, unsigned long properties, int screen,
     p->supportwindow = None;
     p->number_of_desktops = p->current_desktop = 0;
     p->active = None;
-    p->clients = p->stacking = p->virtual_roots = (Window *) 0;
+    p->clients = p->stacking = p->virtual_roots = nullptr;
     p->clients_count = p->stacking_count = p->virtual_roots_count = 0;
-    p->kde_system_tray_windows = 0;
+    p->kde_system_tray_windows = nullptr;
     p->kde_system_tray_windows_count = 0;
     p->showing_desktop = false;
     p->desktop_layout_orientation = OrientationHorizontal;
@@ -1038,7 +1038,7 @@ void NETRootInfo::setDesktopName(int desktop, const char *desktopName) {
 	num = ((p->number_of_desktops > p->desktop_names.size()) ?
 	       p->number_of_desktops : p->desktop_names.size());
     for (i = 0, proplen = 0; i < num; i++)
-	proplen += (p->desktop_names[i] != 0 ? strlen(p->desktop_names[i])+1 : 1 );
+	proplen += (p->desktop_names[i] ? strlen(p->desktop_names[i])+1 : 1 );
 
     char *prop = new char[proplen], *propp = prop;
 
@@ -2278,7 +2278,7 @@ void NETRootInfo::update( const unsigned long dirty_props[] )
 	        removeClient(p->clients[i]);
             p->clients_count = 0;
             delete[] p->clients;
-            p->clients = NULL;
+            p->clients = nullptr;
         }
 
 #ifdef    NETWMDEBUG
@@ -2346,14 +2346,14 @@ void NETRootInfo::update( const unsigned long dirty_props[] )
                 removeSystemTrayWin(p->kde_system_tray_windows[i]);
             p->kde_system_tray_windows_count = 0;
 	    delete [] p->kde_system_tray_windows;
-            p->kde_system_tray_windows = NULL;
+            p->kde_system_tray_windows = nullptr;
         }
     }
 
     if (dirty & ClientListStacking) {
         p->stacking_count = 0;
         delete[] p->stacking;
-        p->stacking = NULL;
+        p->stacking = nullptr;
 	if (XGetWindowProperty(p->display, p->root, net_client_list_stacking,
 			       0, MAX_PROP_SIZE, False, XA_WINDOW, &type_ret,
 			       &format_ret, &nitems_ret, &unused, &data_ret)
@@ -2552,7 +2552,7 @@ void NETRootInfo::update( const unsigned long dirty_props[] )
     if (dirty & SupportingWMCheck) {
         p->supportwindow = None;
         delete[] p->name;
-        p->name = NULL;
+        p->name = nullptr;
 	if (XGetWindowProperty(p->display, p->root, net_supporting_wm_check,
 			       0l, 1l, False, XA_WINDOW, &type_ret, &format_ret,
 			       &nitems_ret, &unused, &data_ret)
@@ -2587,7 +2587,7 @@ void NETRootInfo::update( const unsigned long dirty_props[] )
     if (dirty & VirtualRoots) {
         p->virtual_roots_count = 0;
         delete[] p->virtual_roots;
-        p->virtual_roots = NULL;
+        p->virtual_roots = nullptr;
 	if (XGetWindowProperty(p->display, p->root, net_virtual_roots,
 			       0, MAX_PROP_SIZE, False, XA_WINDOW, &type_ret,
 			       &format_ret, &nitems_ret, &unused, &data_ret)
@@ -2776,7 +2776,7 @@ NETRect NETRootInfo::workArea(int desktop) const {
 
 const char *NETRootInfo::desktopName(int desktop) const {
     if (desktop < 1) {
-	return 0;
+	return nullptr;
     }
 
     return p->desktop_names[desktop - 1];
@@ -2847,21 +2847,21 @@ NETWinInfo::NETWinInfo(Display *display, Window window, Window rootWindow,
     p->mapping_state_dirty = True;
     p->state = 0;
     p->types[ 0 ] = Unknown;
-    p->name = (char *) 0;
-    p->visible_name = (char *) 0;
-    p->icon_name = (char *) 0;
-    p->visible_icon_name = (char *) 0;
+    p->name = nullptr;
+    p->visible_name = nullptr;
+    p->icon_name = nullptr;
+    p->visible_icon_name = nullptr;
     p->desktop = p->pid = p->handled_icons = 0;
     p->user_time = -1U;
-    p->startup_id = NULL;
+    p->startup_id = nullptr;
     p->transient_for = None;
     p->window_group = None;
     p->allowed_actions = 0;
     p->has_net_support = false;
-    p->class_class = (char*) 0;
-    p->class_name = (char*) 0;
-    p->role = (char*) 0;
-    p->client_machine = (char*) 0;
+    p->class_class = nullptr;
+    p->class_name = nullptr;
+    p->role = nullptr;
+    p->client_machine = nullptr;
 
     // p->strut.left = p->strut.right = p->strut.top = p->strut.bottom = 0;
     // p->frame_strut.left = p->frame_strut.right = p->frame_strut.top =
@@ -2909,21 +2909,21 @@ NETWinInfo::NETWinInfo(Display *display, Window window, Window rootWindow,
     p->mapping_state_dirty = True;
     p->state = 0;
     p->types[ 0 ] = Unknown;
-    p->name = (char *) 0;
-    p->visible_name = (char *) 0;
-    p->icon_name = (char *) 0;
-    p->visible_icon_name = (char *) 0;
+    p->name = nullptr;
+    p->visible_name = nullptr;
+    p->icon_name = nullptr;
+    p->visible_icon_name = nullptr;
     p->desktop = p->pid = p->handled_icons = 0;
     p->user_time = -1U;
-    p->startup_id = NULL;
+    p->startup_id = nullptr;
     p->transient_for = None;
     p->window_group = None;
     p->allowed_actions = 0;
     p->has_net_support = false;
-    p->class_class = (char*) 0;
-    p->class_name = (char*) 0;
-    p->role = (char*) 0;
-    p->client_machine = (char*) 0;
+    p->class_class = nullptr;
+    p->class_name = nullptr;
+    p->role = nullptr;
+    p->client_machine = nullptr;
 
     // p->strut.left = p->strut.right = p->strut.top = p->strut.bottom = 0;
     // p->frame_strut.left = p->frame_strut.right = p->frame_strut.top =
@@ -2995,7 +2995,7 @@ void NETWinInfo::setIconInternal(NETRArray<NETIcon>& icons, int& icon_count, Ato
 
 	for (i = 0; i < icons.size(); i++) {
 	    delete [] icons[i].data;
-	    icons[i].data = 0;
+	    icons[i].data = nullptr;
 	    icons[i].size.width = 0;
 	    icons[i].size.height = 0;
 	}
@@ -3647,7 +3647,7 @@ NETIcon NETWinInfo::iconInternal(NETRArray<NETIcon>& icons, int icon_count, int
     if ( !icon_count ) {
 	result.size.width = 0;
 	result.size.height = 0;
-	result.data = 0;
+	result.data = nullptr;
 	return result;
     }
 
@@ -4033,7 +4033,7 @@ void NETWinInfo::update(const unsigned long dirty_props[]) {
 
     if (dirty & WMName) {
         delete[] p->name;
-        p->name = NULL;
+        p->name = nullptr;
 	if (XGetWindowProperty(p->display, p->window, net_wm_name, 0l,
 			       MAX_PROP_SIZE, False, UTF8_STRING, &type_ret,
 			       &format_ret, &nitems_ret, &unused, &data_ret)
@@ -4049,7 +4049,7 @@ void NETWinInfo::update(const unsigned long dirty_props[]) {
 
     if (dirty & WMVisibleName) {
         delete[] p->visible_name;
-        p->visible_name = NULL;
+        p->visible_name = nullptr;
 	if (XGetWindowProperty(p->display, p->window, net_wm_visible_name, 0l,
 			       MAX_PROP_SIZE, False, UTF8_STRING, &type_ret,
 			       &format_ret, &nitems_ret, &unused, &data_ret)
@@ -4065,7 +4065,7 @@ void NETWinInfo::update(const unsigned long dirty_props[]) {
 
     if (dirty & WMIconName) {
         delete[] p->icon_name;
-        p->icon_name = NULL;
+        p->icon_name = nullptr;
 	if (XGetWindowProperty(p->display, p->window, net_wm_icon_name, 0l,
 			       MAX_PROP_SIZE, False, UTF8_STRING, &type_ret,
 			       &format_ret, &nitems_ret, &unused, &data_ret)
@@ -4082,7 +4082,7 @@ void NETWinInfo::update(const unsigned long dirty_props[]) {
     if (dirty & WMVisibleIconName)
     {
         delete[] p->visible_icon_name;
-        p->visible_icon_name = NULL;
+        p->visible_icon_name = nullptr;
 	if (XGetWindowProperty(p->display, p->window, net_wm_visible_icon_name, 0l,
 			       MAX_PROP_SIZE, False, UTF8_STRING, &type_ret,
 			       &format_ret, &nitems_ret, &unused, &data_ret)
@@ -4307,7 +4307,7 @@ void NETWinInfo::update(const unsigned long dirty_props[]) {
     if (dirty2 & WM2StartupId)
     {
         delete[] p->startup_id;
-        p->startup_id = NULL;
+        p->startup_id = nullptr;
 	if (XGetWindowProperty(p->display, p->window, net_startup_id, 0l,
 			       MAX_PROP_SIZE, False, UTF8_STRING, &type_ret,
 			       &format_ret, &nitems_ret, &unused, &data_ret)
@@ -4408,8 +4408,8 @@ void NETWinInfo::update(const unsigned long dirty_props[]) {
     if( dirty2 & WM2WindowClass ) {
         delete[] p->class_class;
         delete[] p->class_name;
-        p->class_class = NULL;
-        p->class_name = NULL;
+        p->class_class = nullptr;
+        p->class_name = nullptr;
         XClassHint hint;
         if( XGetClassHint( p->display, p->window, &hint )) {
             p->class_class = strdup( hint.res_class );
@@ -4421,7 +4421,7 @@ void NETWinInfo::update(const unsigned long dirty_props[]) {
 
     if( dirty2 & WM2WindowRole ) {
         delete[] p->role;
-        p->role = NULL;
+        p->role = nullptr;
 	if (XGetWindowProperty(p->display, p->window, wm_window_role, 0l,
 			       MAX_PROP_SIZE, False, XA_STRING, &type_ret,
 			       &format_ret, &nitems_ret, &unused, &data_ret)
@@ -4436,7 +4436,7 @@ void NETWinInfo::update(const unsigned long dirty_props[]) {
 
     if( dirty2 & WM2ClientMachine ) {
         delete[] p->client_machine;
-        p->client_machine = NULL;
+        p->client_machine = nullptr;
 	if (XGetWindowProperty(p->display, p->window, XA_WM_CLIENT_MACHINE, 0l,
 			       MAX_PROP_SIZE, False, XA_STRING, &type_ret,
 			       &format_ret, &nitems_ret, &unused, &data_ret)
diff --git a/tdecore/netwm_def.h b/tdecore/netwm_def.h
index 0ce12d915..ea3b4bcfb 100644
--- a/tdecore/netwm_def.h
+++ b/tdecore/netwm_def.h
@@ -123,7 +123,7 @@ struct NETIcon {
     /**
        Constructor to initialize this icon to 0x0 with data=0
     **/
-    NETIcon() : data(0) { }
+    NETIcon() : data(nullptr) { }
 
     /**
        Size of the icon.
diff --git a/tdecore/network/kbufferedsocket.cpp b/tdecore/network/kbufferedsocket.cpp
index 08f899c8a..946caeb70 100644
--- a/tdecore/network/kbufferedsocket.cpp
+++ b/tdecore/network/kbufferedsocket.cpp
@@ -42,8 +42,8 @@ public:
 
   TDEBufferedSocketPrivate()
   {
-    input = 0L;
-    output = 0L;
+    input = nullptr;
+    output = nullptr;
   }
 };
 
@@ -247,9 +247,9 @@ void TDEBufferedSocket::setInputBuffering(bool enable)
   if (!enable)
     {
       delete d->input;
-      d->input = 0L;
+      d->input = nullptr;
     }
-  else if (d->input == 0L)
+  else if (!d->input)
     {
       d->input = new TDESocketBuffer;
     }
@@ -266,9 +266,9 @@ void TDEBufferedSocket::setOutputBuffering(bool enable)
   if (!enable)
     {
       delete d->output;
-      d->output = 0L;
+      d->output = nullptr;
     }
-  else if (d->output == 0L)
+  else if (!d->output)
     {
       d->output = new TDESocketBuffer;
     }
diff --git a/tdecore/network/kbufferedsocket.h b/tdecore/network/kbufferedsocket.h
index 641d35cd1..a7eed2e4b 100644
--- a/tdecore/network/kbufferedsocket.h
+++ b/tdecore/network/kbufferedsocket.h
@@ -69,7 +69,7 @@ public:
    * @param name        the internal name for this object
    */
   TDEBufferedSocket(const TQString& node = TQString::null, const TQString& service = TQString::null,
-		  TQObject* parent = 0L, const char *name = 0L);
+		  TQObject* parent = nullptr, const char *name = nullptr);
 
   /**
    * Destructor.
@@ -104,7 +104,7 @@ public:
   /**
    * Make use of buffers.
    */
-  virtual TQ_LONG waitForMore(int msecs, bool *timeout = 0L);
+  virtual TQ_LONG waitForMore(int msecs, bool *timeout = nullptr);
 
   /**
    * Reads data from the socket. Make use of buffers.
diff --git a/tdecore/network/kclientsocketbase.cpp b/tdecore/network/kclientsocketbase.cpp
index 25eb34d8e..bc6a97b7a 100644
--- a/tdecore/network/kclientsocketbase.cpp
+++ b/tdecore/network/kclientsocketbase.cpp
@@ -427,8 +427,8 @@ void KClientSocketBase::lookupFinishedSlot()
   if (d->peerResolver.isRunning() || d->localResolver.isRunning() || state() != HostLookup)
     return;
 
-  TQObject::disconnect(&d->peerResolver, 0L, this, TQ_SLOT(lookupFinishedSlot()));
-  TQObject::disconnect(&d->localResolver, 0L, this, TQ_SLOT(lookupFinishedSlot()));
+  TQObject::disconnect(&d->peerResolver, nullptr, this, TQ_SLOT(lookupFinishedSlot()));
+  TQObject::disconnect(&d->localResolver, nullptr, this, TQ_SLOT(lookupFinishedSlot()));
   if (d->peerResolver.status() < 0 || d->localResolver.status() < 0)
     {
       setState(Idle);		// backtrack
diff --git a/tdecore/network/kclientsocketbase.h b/tdecore/network/kclientsocketbase.h
index a6f9eaf92..bd45c822e 100644
--- a/tdecore/network/kclientsocketbase.h
+++ b/tdecore/network/kclientsocketbase.h
@@ -298,7 +298,7 @@ public:
   /**
    * Waits for more data. Reimplemented from TDESocketBase.
    */
-  virtual TQ_LONG waitForMore(int msecs, bool *timeout = 0L);
+  virtual TQ_LONG waitForMore(int msecs, bool *timeout = nullptr);
 
   /**
    * Reads data from a socket. Reimplemented from TDESocketBase.
diff --git a/tdecore/network/kdatagramsocket.cpp b/tdecore/network/kdatagramsocket.cpp
index 5fa631560..011babaf4 100644
--- a/tdecore/network/kdatagramsocket.cpp
+++ b/tdecore/network/kdatagramsocket.cpp
@@ -42,7 +42,7 @@ using namespace KNetwork;
  */
 
 KDatagramSocket::KDatagramSocket(TQObject* parent, const char *name)
-  : KClientSocketBase(parent, name), d(0L)
+  : KClientSocketBase(parent, name), d(nullptr)
 {
   peerResolver().setFamily(KResolver::KnownFamily);
   localResolver().setFamily(KResolver::KnownFamily);
diff --git a/tdecore/network/kdatagramsocket.h b/tdecore/network/kdatagramsocket.h
index b99938e8b..cb094c401 100644
--- a/tdecore/network/kdatagramsocket.h
+++ b/tdecore/network/kdatagramsocket.h
@@ -186,7 +186,7 @@ public:
   /**
    * Default constructor.
    */
-  KDatagramSocket(TQObject* parent = 0L, const char *name = 0L);
+  KDatagramSocket(TQObject* parent = nullptr, const char *name = nullptr);
 
   /**
    * Destructor. This closes the socket.
diff --git a/tdecore/network/khttpproxysocketdevice.h b/tdecore/network/khttpproxysocketdevice.h
index f6b05ef9e..8f8d181c2 100644
--- a/tdecore/network/khttpproxysocketdevice.h
+++ b/tdecore/network/khttpproxysocketdevice.h
@@ -46,7 +46,7 @@ public:
   /**
    * Constructor.
    */
-  KHttpProxySocketDevice(const TDESocketBase* = 0L);
+  KHttpProxySocketDevice(const TDESocketBase* = nullptr);
 
   /**
    * Constructor with proxy server's address.
diff --git a/tdecore/network/kresolver.cpp b/tdecore/network/kresolver.cpp
index f80b9209e..f47ec6259 100644
--- a/tdecore/network/kresolver.cpp
+++ b/tdecore/network/kresolver.cpp
@@ -92,7 +92,7 @@ public:
 
 // default constructor
 KResolverEntry::KResolverEntry() :
-  d(0L)
+  d(nullptr)
 {
 }
 
@@ -123,7 +123,7 @@ KResolverEntry::KResolverEntry(const struct sockaddr* sa, TQ_UINT16 salen, int s
 
 // copy constructor
 KResolverEntry::KResolverEntry(const KResolverEntry& that) :
-  d(0L)
+  d(nullptr)
 {
   *this = that;
 }
@@ -131,7 +131,7 @@ KResolverEntry::KResolverEntry(const KResolverEntry& that) :
 // destructor
 KResolverEntry::~KResolverEntry()
 {
-  if (d == 0L)
+  if (!d)
     return;
 
   if (d->deref())
@@ -289,7 +289,7 @@ void KResolverResults::virtual_hook( int, void* )
 ///////////////////////
 // class KResolver
 
-TQStringList *KResolver::idnDomains = 0;
+TQStringList *KResolver::idnDomains = nullptr;
 
 
 // default constructor
@@ -429,7 +429,7 @@ void KResolver::setProtocol(int protonum, const char *name)
   // case the given protocol name doesn't exist
 
   d->input.protocolName = name;
-  if (protonum == 0 && name != 0L && *name != '\0')
+  if (protonum == 0 && name && *name != '\0')
     {
       // must look up the protocol number
       d->input.protocol = KResolver::protocolNumber(name);
@@ -452,7 +452,7 @@ bool KResolver::start()
 	  emitFinished();
 	}
       else
-	KResolverManager::manager()->enqueue(this, 0L);
+	KResolverManager::manager()->enqueue(this, nullptr);
     }
 
   return true;
@@ -613,7 +613,7 @@ bool KResolver::resolveAsync(TQObject* userObj, const char *userSlot,
 
 TQStrList KResolver::protocolName(int protonum)
 {
-  struct protoent *pe = 0L;
+  struct protoent *pe = nullptr;
 #ifndef HAVE_GETPROTOBYNAME_R
   TQMutexLocker locker(&getXXbyYYmutex);
 
@@ -628,7 +628,7 @@ TQStrList KResolver::protocolName(int protonum)
   if (getprotobynumber_r(protonum, &protobuf, &pdata) == 0)
     pe = &protobuf;
   else
-    pe = 0;
+    pe = nullptr;
 
 # else
   size_t buflen = 1024;
@@ -643,20 +643,20 @@ TQStrList KResolver::protocolName(int protonum)
       if (getprotobynumber_r(protonum, &protobuf, buf, buflen, &pe) == ERANGE)
 #  endif
 	{
-          pe = 0L;
+          pe = nullptr;
 	  buflen += 1024;
 	  delete [] buf;
 	}
       else
 	break;
     }
-  while (pe == 0L);
+  while (!pe);
 # endif
 #endif
 
   // Do common processing
   TQStrList lst(true);	// use deep copies
-  if (pe != NULL)
+  if (pe)
     {
       lst.append(pe->p_name);
       for (char **p = pe->p_aliases; *p; p++)
@@ -674,7 +674,7 @@ TQStrList KResolver::protocolName(int protonum)
 
 TQStrList KResolver::protocolName(const char *protoname)
 {
-  struct protoent *pe = 0L;
+  struct protoent *pe = nullptr;
 #ifndef HAVE_GETPROTOBYNAME_R
   TQMutexLocker locker(&getXXbyYYmutex);
 
@@ -689,7 +689,7 @@ TQStrList KResolver::protocolName(const char *protoname)
   if (getprotobyname_r(protoname, &protobuf, &pdata) == 0)
     pe = &protobuf;
   else
-    pe = 0;
+    pe = nullptr;
 
 # else
   size_t buflen = 1024;
@@ -704,20 +704,20 @@ TQStrList KResolver::protocolName(const char *protoname)
       if (getprotobyname_r(protoname, &protobuf, buf, buflen, &pe) == ERANGE)
 #  endif
 	{
-          pe = 0L;
+          pe = nullptr;
 	  buflen += 1024;
 	  delete [] buf;
 	}
       else
 	break;
     }
-  while (pe == 0L);
+  while (!pe);
 # endif
 #endif
 
   // Do common processing
   TQStrList lst(true);	// use deep copies
-  if (pe != NULL)
+  if (pe)
     {
       lst.append(pe->p_name);
       for (char **p = pe->p_aliases; *p; p++)
@@ -735,7 +735,7 @@ TQStrList KResolver::protocolName(const char *protoname)
 
 int KResolver::protocolNumber(const char *protoname)
 {
-  struct protoent *pe = 0L;
+  struct protoent *pe = nullptr;
 #ifndef HAVE_GETPROTOBYNAME_R
   TQMutexLocker locker(&getXXbyYYmutex);
 
@@ -750,7 +750,7 @@ int KResolver::protocolNumber(const char *protoname)
   if (getprotobyname_r(protoname, &protobuf, &pdata) == 0)
     pe = &protobuf;
   else
-    pe = 0;
+    pe = nullptr;
 
 # else
   size_t buflen = 1024;
@@ -765,20 +765,20 @@ int KResolver::protocolNumber(const char *protoname)
       if (getprotobyname_r(protoname, &protobuf, buf, buflen, &pe) == ERANGE)
 #  endif
 	{
-          pe = 0L;
+          pe = nullptr;
 	  buflen += 1024;
 	  delete [] buf;
 	}
       else
 	break;
     }
-  while (pe == 0L);
+  while (!pe);
 # endif
 #endif
 
   // Do common processing
   int protonum = -1;
-  if (pe != NULL)
+  if (pe)
     protonum = pe->p_proto;
 
 #ifdef HAVE_GETPROTOBYNAME_R
@@ -792,7 +792,7 @@ int KResolver::protocolNumber(const char *protoname)
 
 int KResolver::servicePort(const char *servname, const char *protoname)
 {
-  struct servent *se = 0L;
+  struct servent *se = nullptr;
 #ifndef HAVE_GETSERVBYNAME_R
   TQMutexLocker locker(&getXXbyYYmutex);
 
@@ -806,7 +806,7 @@ int KResolver::servicePort(const char *servname, const char *protoname)
   if (getservbyname_r(servname, protoname, &servbuf, &sdata) == 0)
     se = &servbuf;
   else
-    se = 0;
+    se = nullptr;
 
 # else
   size_t buflen = 1024;
@@ -821,20 +821,20 @@ int KResolver::servicePort(const char *servname, const char *protoname)
       if (getservbyname_r(servname, protoname, &servbuf, buf, buflen, &se) == ERANGE)
 #  endif
 	{
-          se = 0L;
+          se = nullptr;
 	  buflen += 1024;
 	  delete [] buf;
 	}
       else
 	break;
     }
-  while (se == 0L);
+  while (!se);
 # endif
 #endif
 
   // Do common processing
   int servport = -1;
-  if (se != NULL)
+  if (se)
     servport = ntohs(se->s_port);
 
 #ifdef HAVE_GETSERVBYNAME_R
@@ -848,7 +848,7 @@ int KResolver::servicePort(const char *servname, const char *protoname)
 
 TQStrList KResolver::serviceName(const char* servname, const char *protoname)
 {
-  struct servent *se = 0L;
+  struct servent *se = nullptr;
 #ifndef HAVE_GETSERVBYNAME_R
   TQMutexLocker locker(&getXXbyYYmutex);
 
@@ -862,7 +862,7 @@ TQStrList KResolver::serviceName(const char* servname, const char *protoname)
   if (getservbyname_r(servname, protoname, &servbuf, &sdata) == 0)
     se = &servbuf;
   else
-    se = 0;
+    se = nullptr;
 
 # else
   size_t buflen = 1024;
@@ -877,20 +877,20 @@ TQStrList KResolver::serviceName(const char* servname, const char *protoname)
       if (getservbyname_r(servname, protoname, &servbuf, buf, buflen, &se) == ERANGE)
 #  endif
 	{
-          se = 0L;
+          se = nullptr;
 	  buflen += 1024;
 	  delete [] buf;
 	}
       else
 	break;
     }
-  while (se == 0L);
+  while (!se);
 # endif
 #endif
 
   // Do common processing
   TQStrList lst(true);	// use deep copies
-  if (se != NULL)
+  if (se)
     {
       lst.append(se->s_name);
       for (char **p = se->s_aliases; *p; p++)
@@ -908,7 +908,7 @@ TQStrList KResolver::serviceName(const char* servname, const char *protoname)
 
 TQStrList KResolver::serviceName(int port, const char *protoname)
 {
-  struct servent *se = 0L;
+  struct servent *se = nullptr;
 #ifndef HAVE_GETSERVBYPORT_R
   TQMutexLocker locker(&getXXbyYYmutex);
 
@@ -922,7 +922,7 @@ TQStrList KResolver::serviceName(int port, const char *protoname)
   if (getservbyport_r(port, protoname, &servbuf, &sdata) == 0)
     se = &servbuf;
   else
-    se = 0;
+    se = nullptr;
 
 # else
   size_t buflen = 1024;
@@ -937,20 +937,20 @@ TQStrList KResolver::serviceName(int port, const char *protoname)
       if (getservbyport_r(port, protoname, &servbuf, buf, buflen, &se) == ERANGE)
 #  endif
 	{
-          se = 0L;
+          se = nullptr;
 	  buflen += 1024;
 	  delete [] buf;
 	}
       else
 	break;
     }
-  while (se == 0L);
+  while (!se);
 # endif
 #endif
 
   // Do common processing
   TQStrList lst(true);	// use deep copies
-  if (se != NULL)
+  if (se)
     {
       lst.append(se->s_name);
       for (char **p = se->s_aliases; *p; p++)
@@ -1173,7 +1173,7 @@ static TQCString ToASCII(const TQString& label)
   // function :)
 
   if (label.length() > 64)
-    return (char*)0L;		// invalid label
+    return nullptr;		// invalid label
 
   if (label.length() == 0)
     // this is allowed
diff --git a/tdecore/network/kresolver.h b/tdecore/network/kresolver.h
index 51e605704..e1a3043aa 100644
--- a/tdecore/network/kresolver.h
+++ b/tdecore/network/kresolver.h
@@ -436,7 +436,7 @@ public:
    * names and flags using the member functions before starting
    * the name resolution.
    */
-  KResolver(TQObject * = 0L, const char * = 0L);
+  KResolver(TQObject * = nullptr, const char * = nullptr);
 
   /**
    * Constructor with host and service names.
@@ -449,7 +449,7 @@ public:
    * @param servicename	The service name associated, like "http".
    */
   KResolver(const TQString& nodename, const TQString& servicename = TQString::null,
-	    TQObject * = 0L, const char * = 0L);
+	    TQObject * = nullptr, const char * = nullptr);
 
   /**
    * Destructor.
@@ -603,7 +603,7 @@ public:
    * @param protonum		the protocol number we want
    * @param name		the protocol name
    */
-  void setProtocol(int protonum, const char *name = 0L);
+  void setProtocol(int protonum, const char *name = nullptr);
 
   /**
    * Starts the name resolution asynchronously.
diff --git a/tdecore/network/kresolvermanager.cpp b/tdecore/network/kresolvermanager.cpp
index 61f8290e5..be9aca327 100644
--- a/tdecore/network/kresolvermanager.cpp
+++ b/tdecore/network/kresolvermanager.cpp
@@ -254,7 +254,7 @@ static const int maxThreads = 5;
 static pid_t pid;		// FIXME -- disable when everything is ok
 
 KResolverThread::KResolverThread()
-  : data(0L)
+  : data(nullptr)
 {
 }
 
@@ -322,7 +322,7 @@ static KResolverManager *globalManager;
 
 KResolverManager* KResolverManager::manager()
 {
-  if (globalManager == 0L)
+  if (!globalManager)
     new KResolverManager();
   return globalManager;
 }
@@ -405,7 +405,7 @@ RequestData* KResolverManager::findData(KResolverThread* th)
       }
 
   // found nothing!
-  return 0L;
+  return nullptr;
 }
 
 // this function is called by KResolverThread::run
@@ -424,7 +424,7 @@ void KResolverManager::releaseData(KResolverThread *, RequestData* data)
     }
       
   data->worker->m_finished = true;
-  data->worker->th = 0L;	// this releases the object
+  data->worker->th = nullptr;	// this releases the object
 
   // handle finished requests
   handleFinished();
@@ -444,7 +444,7 @@ void KResolverManager::handleFinished()
   RequestData *curr = currentRequests.last();
   while (curr)
     {
-      if (curr->worker->th == 0L)
+      if (!curr->worker->th)
 	{
 	  if (handleFinishedItem(curr))
 	    {
@@ -543,7 +543,7 @@ KResolverWorkerBase* KResolverManager::findWorker(KResolverPrivate* p)
     }
 
   // found no worker
-  return 0L;
+  return nullptr;
 }
 
 void KResolverManager::doNotifying(RequestData *p)
@@ -655,7 +655,7 @@ void KResolverManager::enqueue(KResolver *obj, RequestData *requestor)
 
   // when processing a new request, find the most
   // suitable worker
-  if ((newrequest->worker = findWorker(obj->d)) == 0L)
+  if (!(newrequest->worker = findWorker(obj->d)))
     {
       // oops, problem
       // cannot find a worker class for this guy
@@ -733,7 +733,7 @@ void KResolverManager::dispatch(RequestData *data)
       while (th && th->running())
 	th = workers.next();
 
-      if (th == 0L)
+      if (!th)
 	// no, create one
 	th = new KResolverThread;
       else
@@ -800,10 +800,10 @@ bool KResolverManager::dequeueNew(KResolver* obj)
 	d->syserror = 0;
 
 	// disengage from the running threads
-	curr->obj = 0L;
-	curr->input = 0L;
+	curr->obj = nullptr;
+	curr->input = nullptr;
 	if (curr->worker)
-	  curr->worker->input = 0L;
+	  curr->worker->input = nullptr;
 
 	d->mutex.unlock();
       }
diff --git a/tdecore/network/kresolverstandardworkers.cpp b/tdecore/network/kresolverstandardworkers.cpp
index ed083f541..8e2abd2e4 100644
--- a/tdecore/network/kresolverstandardworkers.cpp
+++ b/tdecore/network/kresolverstandardworkers.cpp
@@ -63,7 +63,7 @@ static bool hasIPv6()
 #ifndef AF_INET6
   return false;
 #else
-  if (getenv("TDE_NO_IPV6") != 0L)
+  if (getenv("TDE_NO_IPV6"))
     return false;
 
   int fd = ::socket(AF_INET6, SOCK_STREAM, 0);
@@ -238,7 +238,7 @@ namespace
     unsigned buflen = 1024;
     int res;
     int my_h_errno;
-    char *buf = 0L;
+    char *buf = nullptr;
 
     // tqDebug("ResolveThread::run(): started threaded gethostbyname for %s (af = %d)", 
     //	   m_hostname.data(), m_af);
@@ -267,7 +267,7 @@ namespace
 				  &resultptr, &my_h_errno);
 	  }
 	else
-	  resultptr = 0;		// signal error
+	  resultptr = nullptr;		// signal error
 
 # elif defined(USE_GETHOSTBYNAME2)
 	// must lock mutex
@@ -282,10 +282,10 @@ namespace
 	    my_h_errno = h_errno;
 	  }
 	else
-	  resultptr = 0;
+	  resultptr = nullptr;
 # endif
 
-	if (resultptr != 0L)
+	if (resultptr)
 	  my_h_errno = 0;
 	// tqDebug("GetHostByNameThread::run(): gethostbyname for %s (af = %d) returned: %d",
 	//       m_hostname.data(), m_af, my_h_errno);
@@ -341,7 +341,7 @@ namespace
 	    return;
 	  }
       }
-    else if (he == 0L)
+	else if (!he)
       {
 	results.setError(KResolver::NoName);
 	return;			// this was an error
@@ -511,7 +511,7 @@ namespace
 
 	// if we are here, lookup succeeded
 	TQString canon;
-	const char *previous_canon = 0L;
+	const char *previous_canon = nullptr;
 
 	for (addrinfo* p = result; p; p = p->ai_next)
 	  {
diff --git a/tdecore/network/kresolverworkerbase.cpp b/tdecore/network/kresolverworkerbase.cpp
index 5f39e4975..15004977a 100644
--- a/tdecore/network/kresolverworkerbase.cpp
+++ b/tdecore/network/kresolverworkerbase.cpp
@@ -37,7 +37,7 @@ using namespace KNetwork;
 using namespace KNetwork::Internal;
 
 KResolverWorkerBase::KResolverWorkerBase()
-  : th(0L), input(0L), m_finished(0), m_reserved(0)
+  : th(nullptr), input(nullptr), m_finished(0), m_reserved(0)
 {
 }
 
@@ -115,7 +115,7 @@ bool KResolverWorkerBase::enqueue(KResolverWorkerBase* worker)
 {
   RequestData *myself = th->data;
   RequestData *newrequest = new RequestData;
-  newrequest->obj = 0;
+  newrequest->obj = nullptr;
   newrequest->input = input; // same input
   newrequest->requestor = myself;
   newrequest->nRequests = 0;
diff --git a/tdecore/network/kreverseresolver.cpp b/tdecore/network/kreverseresolver.cpp
index 6dffb1840..35224e884 100644
--- a/tdecore/network/kreverseresolver.cpp
+++ b/tdecore/network/kreverseresolver.cpp
@@ -56,7 +56,7 @@ namespace
   {
   public:
     ReverseThread(const TDESocketAddress& addr, int flags)
-      : m_addr(addr), m_flags(flags), m_parent(0L)
+      : m_addr(addr), m_flags(flags), m_parent(nullptr)
     { }
 
     virtual ~ReverseThread()
@@ -106,7 +106,7 @@ public:
   bool success;
 
   inline KReverseResolverPrivate(const TDESocketAddress& _addr)
-    : addr(_addr), worker(0L), success(false)
+    : addr(_addr), worker(nullptr), success(false)
   { }
 };
 
@@ -120,12 +120,12 @@ KReverseResolver::KReverseResolver(const TDESocketAddress& addr, int flags,
 KReverseResolver::~KReverseResolver()
 {
   if (d->worker)
-    d->worker->m_parent = 0L;
+    d->worker->m_parent = nullptr;
 }
 
 bool KReverseResolver::isRunning() const
 {
-  return d->worker != 0L;
+  return d->worker != nullptr;
 }
 
 bool KReverseResolver::success() const
@@ -155,16 +155,16 @@ const TDESocketAddress& KReverseResolver::address() const
 
 bool KReverseResolver::start()
 {
-  if (d->worker != 0L)
+  if (d->worker)
     return true;		// already started
 
   d->worker = new ReverseThread(d->addr, d->flags);
   d->worker->m_parent = this;
 
   RequestData *req = new RequestData;
-  req->obj = 0L;
-  req->input = 0L;
-  req->requestor = 0L;
+  req->obj = nullptr;
+  req->input = nullptr;
+  req->requestor = nullptr;
   req->worker = d->worker;
   KResolverManager::manager()->dispatch(req);
   return true;
@@ -182,7 +182,7 @@ bool KReverseResolver::event(TQEvent *e)
 
   // don't delete d->worker!
   // KResolverManager::doNotifying takes care of that, if it hasn't already
-  d->worker = 0L;
+  d->worker = nullptr;
 
   // emit signal
   emit finished(*this);
diff --git a/tdecore/network/kreverseresolver.h b/tdecore/network/kreverseresolver.h
index 41dc38e90..e339c2161 100644
--- a/tdecore/network/kreverseresolver.h
+++ b/tdecore/network/kreverseresolver.h
@@ -89,7 +89,7 @@ public:
    * @param flags	the flags to use, see @ref Flags
    */
   KReverseResolver(const TDESocketAddress& addr, int flags = 0,
-		   TQObject * = 0L, const char * = 0L);
+		   TQObject * = nullptr, const char * = nullptr);
 
   /**
    * Destructor.
diff --git a/tdecore/network/kserversocket.cpp b/tdecore/network/kserversocket.cpp
index 0cfba8fa5..1039dbe95 100644
--- a/tdecore/network/kserversocket.cpp
+++ b/tdecore/network/kserversocket.cpp
@@ -288,11 +288,11 @@ KActiveSocketBase* TDEServerSocket::accept()
 	{
 	  listen();
 	  setError(WouldBlock);
-	  return NULL;
+	  return nullptr;
 	}
       else if (!listen())
 	// error happened during listen
-	return 0L;
+	return nullptr;
     }
 
   // check to see if we're doing a timeout
@@ -302,11 +302,11 @@ KActiveSocketBase* TDEServerSocket::accept()
       if (!socketDevice()->poll(d->timeout, &timedout))
 	{
 	  copyError();
-	  return NULL;
+	  return nullptr;
 	}
 
       if (timedout)
-	return 0L;
+	return nullptr;
     }
 
   // we're listening here
@@ -315,7 +315,7 @@ KActiveSocketBase* TDEServerSocket::accept()
     {
       // error happened during accept
       copyError();
-      return NULL;
+      return nullptr;
     }
 
   KStreamSocket* streamsocket;
diff --git a/tdecore/network/kserversocket.h b/tdecore/network/kserversocket.h
index 637dc92d0..1972d3d60 100644
--- a/tdecore/network/kserversocket.h
+++ b/tdecore/network/kserversocket.h
@@ -119,7 +119,7 @@ public:
    * @param parent		the parent TQObject object
    * @param name		the name of this object
    */
-  TDEServerSocket(TQObject* parent = 0L, const char *name = 0L);
+  TDEServerSocket(TQObject* parent = nullptr, const char *name = nullptr);
 
   /**
    * Construct this object specifying the service to listen on.
@@ -138,7 +138,7 @@ public:
    * @param parent		the parent TQObject object
    * @param name		the name of this object
    */
-  TDEServerSocket(const TQString& service, TQObject* parent = 0L, const char *name = 0L);
+  TDEServerSocket(const TQString& service, TQObject* parent = nullptr, const char *name = nullptr);
 
   /**
    * Construct this object specifying the node and service names to listen on.
@@ -159,7 +159,7 @@ public:
    * @param name		the name of this object
    */
   TDEServerSocket(const TQString& node, const TQString& service,
-		TQObject* parent = 0L, const char *name = 0L);
+		TQObject* parent = nullptr, const char *name = nullptr);
 
   /**
    * Destructor. This will close the socket, if open.
diff --git a/tdecore/network/ksockssocketdevice.cpp b/tdecore/network/ksockssocketdevice.cpp
index f4388251f..7ace2fccb 100644
--- a/tdecore/network/ksockssocketdevice.cpp
+++ b/tdecore/network/ksockssocketdevice.cpp
@@ -172,7 +172,7 @@ KSocksSocketDevice* KSocksSocketDevice::accept()
     {
       // can't accept without a socket
       setError(IO_AcceptError, NotCreated);
-      return 0L;
+      return nullptr;
     }
 
   struct sockaddr sa;
@@ -184,7 +184,7 @@ KSocksSocketDevice* KSocksSocketDevice::accept()
 	setError(IO_AcceptError, WouldBlock);
       else
 	setError(IO_AcceptError, UnknownError);
-      return NULL;
+      return nullptr;
     }
 
   return new KSocksSocketDevice(newfd);
@@ -199,7 +199,7 @@ static int socks_read_common(int sockfd, char *data, TQ_ULONG maxlen, TDESocketA
       retval = KSocks::self()->recvfrom(sockfd, data, maxlen, peek ? MSG_PEEK : 0, from->address(), &len);
     }
   else
-    retval = KSocks::self()->recvfrom(sockfd, data, maxlen, peek ? MSG_PEEK : 0, NULL, NULL);
+    retval = KSocks::self()->recvfrom(sockfd, data, maxlen, peek ? MSG_PEEK : 0, nullptr, nullptr);
 
   if (retval == -1)
     {
@@ -220,11 +220,11 @@ TQ_LONG KSocksSocketDevice::readBlock(char *data, TQ_ULONG maxlen)
   if (m_sockfd == -1)
     return -1;
 
-  if (maxlen == 0 || data == 0L)
+  if (maxlen == 0 || !data)
     return 0;			// can't read
 
   ssize_t retval;
-  int err = socks_read_common(m_sockfd, data, maxlen, 0L, retval);
+  int err = socks_read_common(m_sockfd, data, maxlen, nullptr, retval);
 
   if (err)
     {
@@ -241,7 +241,7 @@ TQ_LONG KSocksSocketDevice::readBlock(char *data, TQ_ULONG maxlen, TDESocketAddr
   if (m_sockfd == -1)
     return -1;			// nothing to do here
 
-  if (data == 0L || maxlen == 0)
+  if (!data || maxlen == 0)
     return 0;			// user doesn't want to read
 
   ssize_t retval;
@@ -262,11 +262,11 @@ TQ_LONG KSocksSocketDevice::peekBlock(char *data, TQ_ULONG maxlen)
   if (m_sockfd == -1)
     return -1;
 
-  if (maxlen == 0 || data == 0L)
+  if (maxlen == 0 || !data)
     return 0;			// can't read
 
   ssize_t retval;
-  int err = socks_read_common(m_sockfd, data, maxlen, 0L, retval, true);
+  int err = socks_read_common(m_sockfd, data, maxlen, nullptr, retval, true);
 
   if (err)
     {
@@ -283,7 +283,7 @@ TQ_LONG KSocksSocketDevice::peekBlock(char *data, TQ_ULONG maxlen, TDESocketAddr
   if (m_sockfd == -1)
     return -1;			// nothing to do here
 
-  if (data == 0L || maxlen == 0)
+  if (!data || maxlen == 0)
     return 0;			// user doesn't want to read
 
   ssize_t retval;
@@ -309,7 +309,7 @@ TQ_LONG KSocksSocketDevice::writeBlock(const char *data, TQ_ULONG len, const TDE
   if (m_sockfd == -1)
     return -1;			// can't write to unopen socket
 
-  if (data == 0L || len == 0)
+  if (!data || len == 0)
     return 0;			// nothing to be written
 
   ssize_t retval = KSocks::self()->sendto(m_sockfd, data, len, 0, to.address(), to.length());
@@ -400,7 +400,7 @@ bool KSocksSocketDevice::poll(bool *input, bool *output, bool *exception,
 
   resetError();
   fd_set readfds, writefds, exceptfds;
-  fd_set *preadfds = 0L, *pwritefds = 0L, *pexceptfds = 0L;
+  fd_set *preadfds = nullptr, *pwritefds = nullptr, *pexceptfds = nullptr;
 
   if (input)
     {
@@ -426,7 +426,7 @@ bool KSocksSocketDevice::poll(bool *input, bool *output, bool *exception,
 
   int retval;
   if (timeout < 0)
-    retval = KSocks::self()->select(m_sockfd + 1, preadfds, pwritefds, pexceptfds, 0L);
+    retval = KSocks::self()->select(m_sockfd + 1, preadfds, pwritefds, pexceptfds, nullptr);
   else
     {
       // convert the milliseconds to timeval
@@ -467,7 +467,7 @@ void KSocksSocketDevice::initSocks()
   if (init)
     return;
 
-  if (tdeApp == 0L)
+  if (!tdeApp)
     return;			// no TDEApplication, so don't initialise
                                 // this should, however, test for TDEInstance
 
diff --git a/tdecore/network/ksockssocketdevice.h b/tdecore/network/ksockssocketdevice.h
index 760038143..9f663466f 100644
--- a/tdecore/network/ksockssocketdevice.h
+++ b/tdecore/network/ksockssocketdevice.h
@@ -43,7 +43,7 @@ public:
   /** 
    * Constructor.
    */
-  KSocksSocketDevice(const TDESocketBase* = 0L);
+  KSocksSocketDevice(const TDESocketBase* = nullptr);
 
   /**
    * Construct from a file descriptor.
@@ -116,8 +116,8 @@ public:
   /**
    * Overrides polling.
    */
-  virtual bool poll(bool* input, bool* output, bool* exception = 0L,
-		    int timeout = -1, bool* timedout = 0L);
+  virtual bool poll(bool* input, bool* output, bool* exception = nullptr,
+		    int timeout = -1, bool* timedout = nullptr);
 
 private:
   static void initSocks();
diff --git a/tdecore/network/ksrvresolverworker.cpp b/tdecore/network/ksrvresolverworker.cpp
index 732de02a4..ea701593f 100644
--- a/tdecore/network/ksrvresolverworker.cpp
+++ b/tdecore/network/ksrvresolverworker.cpp
@@ -115,7 +115,7 @@ bool KSrvResolverWorker::run()
   // block
   (*sem)++;
   delete sem;
-  sem = 0L;
+  sem = nullptr;
 
   if (rawResults.isEmpty())
     {
@@ -157,7 +157,7 @@ bool KSrvResolverWorker::run()
 	  e.name = srv.name;
 	  e.port = srv.port;
 	  e.weight = srv.weight;
-	  e.resolver = 0L;
+	  e.resolver = nullptr;
 	  r.entries.append(e);
 
 	  ++it;
@@ -234,7 +234,7 @@ void KSrvResolverWorker::dnsResultsReady()
   (*sem)--;
   rawResults = dns->servers();
   dns->deleteLater();
-  dns = 0L;
+  dns = nullptr;
 }
 
 namespace KNetwork
@@ -245,7 +245,7 @@ namespace KNetwork
     void initSrvWorker() TDE_NO_EXPORT;
     void initSrvWorker()
     {
-      if (getenv("TDE_NO_SRV") != NULL)
+      if (getenv("TDE_NO_SRV"))
 	return;
       
       KResolverWorkerFactoryBase::registerNewWorker(new KResolverWorkerFactory<KSrvResolverWorker>);
diff --git a/tdecore/network/kstreamsocket.cpp b/tdecore/network/kstreamsocket.cpp
index a36f8cc78..b737de352 100644
--- a/tdecore/network/kstreamsocket.cpp
+++ b/tdecore/network/kstreamsocket.cpp
@@ -350,8 +350,8 @@ bool KStreamSocket::bindLocallyFor(const KResolverEntry& peer)
 
 void KStreamSocket::connectionSucceeded(const KResolverEntry& peer)
 {
-  TQObject::disconnect(socketDevice()->readNotifier(), 0, this, TQ_SLOT(connectionEvent()));
-  TQObject::disconnect(socketDevice()->writeNotifier(), 0, this, TQ_SLOT(connectionEvent()));
+  TQObject::disconnect(socketDevice()->readNotifier(), nullptr, this, TQ_SLOT(connectionEvent()));
+  TQObject::disconnect(socketDevice()->writeNotifier(), nullptr, this, TQ_SLOT(connectionEvent()));
 
   resetError();
   setFlags(IO_Sequential | IO_Raw | IO_ReadWrite | IO_Open | IO_Async);
diff --git a/tdecore/network/kstreamsocket.h b/tdecore/network/kstreamsocket.h
index a7557d585..ca24ce49c 100644
--- a/tdecore/network/kstreamsocket.h
+++ b/tdecore/network/kstreamsocket.h
@@ -109,7 +109,7 @@ public:
    * @param name        name for this object
    */
   KStreamSocket(const TQString& node = TQString::null, const TQString& service = TQString::null,
-		TQObject* parent = 0L, const char *name = 0L);
+		TQObject* parent = nullptr, const char *name = nullptr);
 
   /**
    * Destructor. This closes the socket.
diff --git a/tdecore/network/tdemulticastsocket.h b/tdecore/network/tdemulticastsocket.h
index a5345315a..fbb6b8d8f 100644
--- a/tdecore/network/tdemulticastsocket.h
+++ b/tdecore/network/tdemulticastsocket.h
@@ -52,7 +52,7 @@ public:
   /**
    * Constructor.
    */
-  KMulticastSocket(TQObject* parent = 0L, const char *name = 0L);
+  KMulticastSocket(TQObject* parent = nullptr, const char *name = nullptr);
 
   /**
    * Destructor.
diff --git a/tdecore/network/tdemulticastsocketdevice.h b/tdecore/network/tdemulticastsocketdevice.h
index a87c7fc98..34e166d16 100644
--- a/tdecore/network/tdemulticastsocketdevice.h
+++ b/tdecore/network/tdemulticastsocketdevice.h
@@ -48,7 +48,7 @@ public:
   /**
    * Constructor.
    */
-  KMulticastSocketImpl(const TDESocketBase* = 0L);
+  KMulticastSocketImpl(const TDESocketBase* = nullptr);
 
   /**
    * Destructor
diff --git a/tdecore/network/tdesocketaddress.cpp b/tdecore/network/tdesocketaddress.cpp
index 36adaa631..5a4a8bc3a 100644
--- a/tdecore/network/tdesocketaddress.cpp
+++ b/tdecore/network/tdesocketaddress.cpp
@@ -70,8 +70,8 @@ static const char localhostV6_data[] = { 0,0, 0,0,  0,0, 0,0,  0,0, 0,0,  0,0, 0
 
 const KIpAddress KIpAddress::localhostV4(&localhostV4_data, 4);
 const KIpAddress KIpAddress::localhostV6(&localhostV6_data, 6);
-const KIpAddress KIpAddress::anyhostV4(0L, 4);
-const KIpAddress KIpAddress::anyhostV6(0L, 6);
+const KIpAddress KIpAddress::anyhostV4(nullptr, 4);
+const KIpAddress KIpAddress::anyhostV6(nullptr, 6);
 
 // helper function to test if an IPv6 v4-mapped address is equal to its IPv4 counterpart
 static bool check_v4mapped(const TQ_UINT32* v6addr, TQ_UINT32 v4addr)
@@ -177,7 +177,7 @@ bool KIpAddress::setAddress(const void* raw, int version)
     return false;
 
   m_version = version;
-  if (raw != 0L)
+  if (raw)
     memcpy(m_data, raw, version == 4 ? 4 : 16);
   else
     memset(m_data, 0, 16);
@@ -235,7 +235,7 @@ struct our_sockaddr_in6
 // useful definitions
 #define MIN_SOCKADDR_LEN	sizeof(TQ_UINT16)
 #define SOCKADDR_IN_LEN		sizeof(sockaddr_in)
-#define MIN_SOCKADDR_IN6_LEN	((unsigned long) &(((our_sockaddr_in6*)0)->sin6_scope_id))
+#define MIN_SOCKADDR_IN6_LEN	((unsigned long) &(((our_sockaddr_in6*)nullptr)->sin6_scope_id))
 #define SOCKADDR_IN6_LEN	sizeof(our_sockaddr_in6)
 #define MIN_SOCKADDR_UN_LEN	(sizeof(TQ_UINT16) + sizeof(char))
 
@@ -270,14 +270,14 @@ public:
   TDESocketAddressData()
     : ref(this)
   {
-    addr.generic = 0L;
+    addr.generic = nullptr;
     curlen = 0;
     invalidate();
   }
 
   ~TDESocketAddressData()
   {
-    if (addr.generic != 0L)
+    if (addr.generic)
       free(addr.generic);
   }
 
@@ -309,7 +309,7 @@ public:
 	}
 
     // create new space
-    dup(0L, SOCKADDR_IN_LEN);
+    dup(nullptr, SOCKADDR_IN_LEN);
 
     addr.in->sin_family = AF_INET;
 #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
@@ -339,7 +339,7 @@ public:
 	}
 
     // make room
-    dup(0L, SOCKADDR_IN6_LEN);
+    dup(nullptr, SOCKADDR_IN6_LEN);
 #ifdef AF_INET6
     addr.in6->sin6_family = AF_INET6;
 #endif
@@ -384,7 +384,7 @@ void TDESocketAddressData::dup(const sockaddr* sa, TQ_UINT16 len, bool clear)
       addr.generic = (sockaddr*)realloc(addr.generic, curlen);
     }
 
-  if (sa != 0L)
+  if (sa)
     {
       memcpy(addr.generic, sa, len); // copy
 
@@ -443,8 +443,8 @@ TDESocketAddress::~TDESocketAddress()
   // prevent double-deletion, since we're already being deleted
   if (d)
     {
-      d->ref.KInetSocketAddress::d = 0L;
-      d->ref.KUnixSocketAddress::d = 0L;
+      d->ref.KInetSocketAddress::d = nullptr;
+      d->ref.KUnixSocketAddress::d = nullptr;
       delete d;
     }
 }
@@ -461,20 +461,20 @@ TDESocketAddress& TDESocketAddress::operator =(const TDESocketAddress& other)
 const sockaddr* TDESocketAddress::address() const
 {
   if (d->invalid())
-    return 0L;
+    return nullptr;
   return d->addr.generic;
 }
 
 sockaddr* TDESocketAddress::address()
 {
   if (d->invalid())
-    return 0L;
+    return nullptr;
   return d->addr.generic;
 }
 
 TDESocketAddress& TDESocketAddress::setAddress(const sockaddr* sa, TQ_UINT16 len)
 {
-  if (sa != 0L && len >= MIN_SOCKADDR_LEN)
+  if (sa && len >= MIN_SOCKADDR_LEN)
     d->dup(sa, len);
   else
     d->invalidate();
@@ -491,7 +491,7 @@ TQ_UINT16 TDESocketAddress::length() const
 
 TDESocketAddress& TDESocketAddress::setLength(TQ_UINT16 len)
 {
-  d->dup((sockaddr*)0L, len, false);
+  d->dup(nullptr, len, false);
 
   return *this;
 }
@@ -506,7 +506,7 @@ int TDESocketAddress::family() const
 TDESocketAddress& TDESocketAddress::setFamily(int family)
 {
   if (d->invalid())
-    d->dup((sockaddr*)0L, MIN_SOCKADDR_LEN);
+    d->dup(nullptr, MIN_SOCKADDR_LEN);
   d->addr.generic->sa_family = family;
 
   return *this;
@@ -984,7 +984,7 @@ TQString KUnixSocketAddress::pathname() const
 
 KUnixSocketAddress& KUnixSocketAddress::setPathname(const TQString& path)
 {
-  d->dup(0L, MIN_SOCKADDR_UN_LEN + path.length());
+  d->dup(nullptr, MIN_SOCKADDR_UN_LEN + path.length());
   d->addr.un->sun_family = AF_UNIX;
   strcpy(d->addr.un->sun_path, TQFile::encodeName(path));
 
diff --git a/tdecore/network/tdesocketbase.cpp b/tdecore/network/tdesocketbase.cpp
index 0b2ef90d7..485c9daf3 100644
--- a/tdecore/network/tdesocketbase.cpp
+++ b/tdecore/network/tdesocketbase.cpp
@@ -52,7 +52,7 @@ TDESocketBase::TDESocketBase()
 {
   d->socketOptions = Blocking;
   d->socketError = 0;
-  d->device = 0L;
+  d->device = nullptr;
   d->capabilities = 0;
 }
 
@@ -124,7 +124,7 @@ TDESocketDevice* TDESocketBase::socketDevice() const
     return d->device;
 
   TDESocketBase* that = const_cast<TDESocketBase*>(this);
-  TDESocketDevice* dev = 0;
+  TDESocketDevice* dev = nullptr;
   if (d->capabilities)
     dev = TDESocketDevice::createDefault(that, d->capabilities);
   if (!dev)
@@ -136,7 +136,7 @@ TDESocketDevice* TDESocketBase::socketDevice() const
 void TDESocketBase::setSocketDevice(TDESocketDevice* device)
 {
   TQMutexLocker locker(mutex());
-  if (d->device == 0L)
+  if (!d->device)
     d->device = device;
 }
 
@@ -149,7 +149,7 @@ int TDESocketBase::setRequestedCapabilities(int add, int remove)
 
 bool TDESocketBase::hasDevice() const
 {
-  return d->device != 0L;
+  return d->device != nullptr;
 }
 
 void TDESocketBase::setError(SocketError error)
@@ -272,7 +272,7 @@ bool TDESocketBase::isFatalError(int code)
 
 void TDESocketBase::unsetSocketDevice()
 {
-  d->device = 0L;
+  d->device = nullptr;
 }
 
 TQMutex* TDESocketBase::mutex() const
diff --git a/tdecore/network/tdesocketbase.h b/tdecore/network/tdesocketbase.h
index d2a213300..d9b2a2fda 100644
--- a/tdecore/network/tdesocketbase.h
+++ b/tdecore/network/tdesocketbase.h
@@ -545,7 +545,7 @@ public:
    *
    * @returns the number of bytes available
    */
-  virtual TQ_LONG waitForMore(int msecs, bool *timeout = 0L) = 0;
+  virtual TQ_LONG waitForMore(int msecs, bool *timeout = nullptr) = 0;
 
   /**
    * Reads data from the socket.
diff --git a/tdecore/network/tdesocketbuffer.cpp b/tdecore/network/tdesocketbuffer.cpp
index 36e64e0f0..1a1a98836 100644
--- a/tdecore/network/tdesocketbuffer.cpp
+++ b/tdecore/network/tdesocketbuffer.cpp
@@ -144,12 +144,12 @@ bool TDESocketBuffer::setSize(TQ_LONG size)
     return true;
 
   // discard from the beginning
-  return (m_length - m_size) == consumeBuffer(0L, m_length - m_size, true);
+  return (m_length - m_size) == consumeBuffer(nullptr, m_length - m_size, true);
 }
 
 TQ_LONG TDESocketBuffer::feedBuffer(const char *data, TQ_LONG len)
 {
-  if (data == 0L || len == 0)
+  if (!data || len == 0)
     return 0;			// nothing to write
   if (isFull())
     return -1;			// can't write
@@ -289,7 +289,7 @@ TQ_LONG TDESocketBuffer::sendTo(KActiveSocketBase* dev, TQ_LONG len)
   // discard data that has been written
   // this updates m_length too
   if (written)
-    consumeBuffer(0L, written);
+    consumeBuffer(nullptr, written);
 
   return written;
 }
diff --git a/tdecore/network/tdesocketdevice.cpp b/tdecore/network/tdesocketdevice.cpp
index b5aef0943..79a247428 100644
--- a/tdecore/network/tdesocketdevice.cpp
+++ b/tdecore/network/tdesocketdevice.cpp
@@ -69,7 +69,7 @@ public:
 
   inline TDESocketDevicePrivate()
   {
-    input = output = exception = 0L;
+    input = output = exception = nullptr;
     af = 0;
   }
 };
@@ -186,7 +186,7 @@ void TDESocketDevice::close()
       delete d->output;
       delete d->exception;
 
-      d->input = d->output = d->exception = 0L;
+      d->input = d->output = d->exception = nullptr;
 
       d->local.setFamily(AF_UNSPEC);
       d->peer.setFamily(AF_UNSPEC);
@@ -312,7 +312,7 @@ TDESocketDevice* TDESocketDevice::accept()
     {
       // can't accept without a socket
       setError(IO_AcceptError, NotCreated);
-      return 0L;
+      return nullptr;
     }
 
   struct sockaddr sa;
@@ -324,7 +324,7 @@ TDESocketDevice* TDESocketDevice::accept()
 	setError(IO_AcceptError, WouldBlock);
       else
 	setError(IO_AcceptError, UnknownError);
-      return NULL;
+      return nullptr;
     }
 
   return new TDESocketDevice(newfd);
@@ -382,7 +382,7 @@ TQ_LONG TDESocketDevice::waitForMore(int msecs, bool *timeout)
     return -1;			// there won't ever be anything to read...
 
   bool input;
-  if (!poll(&input, 0, 0, msecs, timeout))
+  if (!poll(&input, nullptr, nullptr, msecs, timeout))
     return -1;			// failed polling
 
   return bytesAvailable();
@@ -397,7 +397,7 @@ static int do_read_common(int sockfd, char *data, TQ_ULONG maxlen, TDESocketAddr
       retval = ::recvfrom(sockfd, data, maxlen, peek ? MSG_PEEK : 0, from->address(), &len);
     }
   else
-    retval = ::recvfrom(sockfd, data, maxlen, peek ? MSG_PEEK : 0, NULL, NULL);
+    retval = ::recvfrom(sockfd, data, maxlen, peek ? MSG_PEEK : 0, nullptr, nullptr);
 
   if (retval == -1)
     {
@@ -420,11 +420,11 @@ TQ_LONG TDESocketDevice::readBlock(char *data, TQ_ULONG maxlen)
   if (m_sockfd == -1)
     return -1;
 
-  if (maxlen == 0 || data == 0L)
+  if (maxlen == 0 || !data)
     return 0;			// can't read
 
   ssize_t retval;
-  int err = do_read_common(m_sockfd, data, maxlen, 0L, retval);
+  int err = do_read_common(m_sockfd, data, maxlen, nullptr, retval);
 
   if (err)
     {
@@ -441,7 +441,7 @@ TQ_LONG TDESocketDevice::readBlock(char *data, TQ_ULONG maxlen, TDESocketAddress
   if (m_sockfd == -1)
     return -1;			// nothing to do here
 
-  if (data == 0L || maxlen == 0)
+  if (!data || maxlen == 0)
     return 0;			// user doesn't want to read
 
   ssize_t retval;
@@ -462,11 +462,11 @@ TQ_LONG TDESocketDevice::peekBlock(char *data, TQ_ULONG maxlen)
   if (m_sockfd == -1)
     return -1;
 
-  if (maxlen == 0 || data == 0L)
+  if (maxlen == 0 || !data)
     return 0;			// can't read
 
   ssize_t retval;
-  int err = do_read_common(m_sockfd, data, maxlen, 0L, retval, true);
+  int err = do_read_common(m_sockfd, data, maxlen, nullptr, retval, true);
 
   if (err)
     {
@@ -483,7 +483,7 @@ TQ_LONG TDESocketDevice::peekBlock(char *data, TQ_ULONG maxlen, TDESocketAddress
   if (m_sockfd == -1)
     return -1;			// nothing to do here
 
-  if (data == 0L || maxlen == 0)
+  if (!data || maxlen == 0)
     return 0;			// user doesn't want to read
 
   ssize_t retval;
@@ -509,7 +509,7 @@ TQ_LONG TDESocketDevice::writeBlock(const char *data, TQ_ULONG len, const TDESoc
   if (m_sockfd == -1)
     return -1;			// can't write to unopen socket
 
-  if (data == 0L || len == 0)
+  if (!data || len == 0)
     return 0;			// nothing to be written
 
   ssize_t retval = ::sendto(m_sockfd, data, len, 0, to.address(), to.length());
@@ -618,7 +618,7 @@ TQSocketNotifier* TDESocketDevice::readNotifier() const
   if (m_sockfd == -1)
     {
       // socket doesn't exist; can't create notifier
-      return 0L;
+      return nullptr;
     }
 
   return d->input = createNotifier(TQSocketNotifier::Read);
@@ -636,7 +636,7 @@ TQSocketNotifier* TDESocketDevice::writeNotifier() const
   if (m_sockfd == -1)
     {
       // socket doesn't exist; can't create notifier
-      return 0L;
+      return nullptr;
     }
 
   return d->output = createNotifier(TQSocketNotifier::Write);
@@ -654,7 +654,7 @@ TQSocketNotifier* TDESocketDevice::exceptionNotifier() const
   if (m_sockfd == -1)
     {
       // socket doesn't exist; can't create notifier
-      return 0L;
+      return nullptr;
     }
 
   return d->exception = createNotifier(TQSocketNotifier::Exception);
@@ -721,7 +721,7 @@ bool TDESocketDevice::poll(bool *input, bool *output, bool *exception,
    */
 
   fd_set readfds, writefds, exceptfds;
-  fd_set *preadfds = 0L, *pwritefds = 0L, *pexceptfds = 0L;
+  fd_set *preadfds = nullptr, *pwritefds = nullptr, *pexceptfds = nullptr;
 
   if (input)
     {
@@ -747,7 +747,7 @@ bool TDESocketDevice::poll(bool *input, bool *output, bool *exception,
 
   int retval;
   if (timeout < 0)
-    retval = select(m_sockfd + 1, preadfds, pwritefds, pexceptfds, 0L);
+    retval = select(m_sockfd + 1, preadfds, pwritefds, pexceptfds, nullptr);
   else
     {
       // convert the milliseconds to timeval
@@ -791,7 +791,7 @@ bool TDESocketDevice::poll(int timeout, bool *timedout)
 TQSocketNotifier* TDESocketDevice::createNotifier(TQSocketNotifier::Type type) const
 {
   if (m_sockfd == -1)
-    return 0L;
+    return nullptr;
 
   return new TQSocketNotifier(m_sockfd, type);
 }
@@ -827,7 +827,7 @@ namespace
     operator T*() const { return obj; }
 
     bool isNull() const
-    { return obj == 0; }
+    { return obj == nullptr; }
   };
 }
 
@@ -839,7 +839,7 @@ static factoryMap factories;
 TDESocketDevice* TDESocketDevice::createDefault(TDESocketBase* parent)
 {
   TDESocketDevice* device = dynamic_cast<TDESocketDevice*>(parent);
-  if (device != 0L)
+  if (device)
     return device;
 
   KSocksSocketDevice::initSocks();
@@ -854,7 +854,7 @@ TDESocketDevice* TDESocketDevice::createDefault(TDESocketBase* parent)
 TDESocketDevice* TDESocketDevice::createDefault(TDESocketBase* parent, int capabilities)
 {
   TDESocketDevice* device = dynamic_cast<TDESocketDevice*>(parent);
-  if (device != 0L)
+  if (device)
     return device;
 
   TQMutexLocker locker(&defaultImplFactoryMutex);
@@ -864,7 +864,7 @@ TDESocketDevice* TDESocketDevice::createDefault(TDESocketBase* parent, int capab
       // found a match
       return it.data()->create(parent);
 
-  return 0L;			// no default
+  return nullptr;			// no default
 }
 
 TDESocketDeviceFactoryBase*
diff --git a/tdecore/network/tdesocketdevice.h b/tdecore/network/tdesocketdevice.h
index 2196e9d3f..913fc1e6e 100644
--- a/tdecore/network/tdesocketdevice.h
+++ b/tdecore/network/tdesocketdevice.h
@@ -101,7 +101,7 @@ public:
    * The parameter is used to specify which socket this object is used as
    * a device for.
    */
-  explicit TDESocketDevice(const TDESocketBase* = 0L);
+  explicit TDESocketDevice(const TDESocketBase* = nullptr);
 
   /**
    * Constructs a new object around an already-open socket.
@@ -206,7 +206,7 @@ public:
    * This function is a wrapper against @ref poll. This function will wait
    * for any read events.
    */
-  virtual TQ_LONG waitForMore(int msecs, bool *timeout = 0L);
+  virtual TQ_LONG waitForMore(int msecs, bool *timeout = nullptr);
 
   /**
    * Reads data from this socket.
@@ -308,8 +308,8 @@ public:
    * @param timedout	on exit, will contain true if the polling timed out
    * @return true if the poll call succeeded and false if an error occurred
    */
-  virtual bool poll(bool* input, bool* output, bool* exception = 0L,
-		    int timeout = -1, bool* timedout = 0L);
+  virtual bool poll(bool* input, bool* output, bool* exception = nullptr,
+		    int timeout = -1, bool* timedout = nullptr);
 
   /**
    * Shorter version to poll for any events in a socket. This call
@@ -322,7 +322,7 @@ public:
    * @param timedout	on exit, will contain true if the polling timed out
    * @return true if the poll call succeeded and false if an error occurred
    */
-  bool poll(int timeout = -1, bool* timedout = 0L);
+  bool poll(int timeout = -1, bool* timedout = nullptr);
 
 protected:
   /**
@@ -332,7 +332,7 @@ protected:
    *
    * @param parent	the parent, if any
    */
-  TDESocketDevice(bool, const TDESocketBase* parent = 0L);
+  TDESocketDevice(bool, const TDESocketBase* parent = nullptr);
 
   /**
    * Creates a socket notifier of the given type.
diff --git a/tdecore/svgicons/ksvgiconengine.cpp b/tdecore/svgicons/ksvgiconengine.cpp
index 79f34d806..d05dad037 100644
--- a/tdecore/svgicons/ksvgiconengine.cpp
+++ b/tdecore/svgicons/ksvgiconengine.cpp
@@ -52,7 +52,7 @@ public:
 	ArtGradientStop *parseGradientStops(TQDomElement element, int &offsets)
 	{
 		if (!element.hasChildNodes())
-			return 0;
+			return nullptr;
 
 		TQValueList<ArtGradientStop> stopList;
 
@@ -150,7 +150,7 @@ public:
 		}
 
 		if (stopList.isEmpty())
-			return 0;
+			return nullptr;
 
 		ArtGradientStop *stops = new ArtGradientStop[stopList.count()];
 
@@ -226,7 +226,7 @@ public:
 			applyList.prepend(new TQDomNamedNodeMap(shape.attributes()));
 
 		// Apply parent attributes
-		for(TQDomNamedNodeMap *map = applyList.first(); map != 0; map = applyList.next())
+		for(TQDomNamedNodeMap *map = applyList.first(); map != nullptr; map = applyList.next())
 		{
 			TQDomNamedNodeMap attr = *map;
 
@@ -519,7 +519,7 @@ struct KSVGIconEngine::Private
 
 KSVGIconEngine::KSVGIconEngine() : d(new Private())
 {
-	d->painter = 0;
+	d->painter = nullptr;
 	d->helper = new KSVGIconEngineHelper(this);
 
 	d->width = 0.0;
diff --git a/tdecore/svgicons/ksvgiconpainter.cpp b/tdecore/svgicons/ksvgiconpainter.cpp
index 7c2859656..bb3db28cd 100644
--- a/tdecore/svgicons/ksvgiconpainter.cpp
+++ b/tdecore/svgicons/ksvgiconpainter.cpp
@@ -55,7 +55,7 @@ public:
 	{
 		m_painter = painter;
 
-		m_clipSVP = 0;
+		m_clipSVP = nullptr;
 
 		m_fillColor = TQt::black;
 
@@ -91,7 +91,7 @@ public:
 		m_buffer = art_new(art_u8, m_rowstride * m_height);
 		memset(m_buffer, 0, m_rowstride * m_height);
 
-		m_tempBuffer = 0;
+		m_tempBuffer = nullptr;
 	}
 
 	~KSVGIconPainterHelper()
@@ -182,7 +182,7 @@ public:
 		m_tempBuffer = temp;
 
 		art_free(m_tempBuffer);
-		m_tempBuffer = 0;
+		m_tempBuffer = nullptr;
 	}
 
 	TQ_UINT32 toArtColor(const TQColor &color)
@@ -216,7 +216,7 @@ public:
 		if(!svp)
 			return;
 
-		ArtRender *render = art_render_new(0, 0, m_width, m_height, m_buffer, m_rowstride, 3, 8, ART_ALPHA_SEPARATE, 0);
+		ArtRender *render = art_render_new(0, 0, m_width, m_height, m_buffer, m_rowstride, 3, 8, ART_ALPHA_SEPARATE, nullptr);
 		art_render_svp(render, svp);
 
 		art_render_mask_solid(render, (opacity << 8) + opacity + (opacity >> 7));
@@ -265,7 +265,7 @@ public:
 	void drawPathInternal(ArtVpath *vec, double *affine)
 	{
 		ArtSVP *svp;
-		ArtSVP *fillSVP = 0, *strokeSVP = 0;
+		ArtSVP *fillSVP = nullptr, *strokeSVP = nullptr;
 
 		TQ_UINT32 fillColor = 0, strokeColor = 0;
 
@@ -411,7 +411,7 @@ public:
 		if(m_clipSVP)
 		{
 			art_svp_free(m_clipSVP);
-			m_clipSVP = 0;
+			m_clipSVP = nullptr;
 		}
 
 		if(fillSVP)
@@ -474,7 +474,7 @@ public:
 			linear->b = dy * scale;
 			linear->c = -(x1n * linear->a + y1n * linear->b);
 
-			ArtRender *render = art_render_new(0, 0, m_width, m_height, m_buffer, m_rowstride, 3, 8, ART_ALPHA_SEPARATE, 0);
+			ArtRender *render = art_render_new(0, 0, m_width, m_height, m_buffer, m_rowstride, 3, 8, ART_ALPHA_SEPARATE, nullptr);
 			art_render_svp(render, svp);
 
 			art_render_gradient_linear(render, linear, ART_FILTER_HYPER);
@@ -545,7 +545,7 @@ public:
 			art_affine_multiply(aff1, aff1, radial->affine);
 			art_affine_invert(radial->affine, aff1);
 
-			ArtRender *render = art_render_new(0, 0, m_width, m_height, m_buffer, m_rowstride, 3, 8, ART_ALPHA_SEPARATE, 0);
+			ArtRender *render = art_render_new(0, 0, m_width, m_height, m_buffer, m_rowstride, 3, 8, ART_ALPHA_SEPARATE, nullptr);
 			art_render_svp(render, svp);
 
 			art_render_gradient_radial(render, radial, ART_FILTER_HYPER);
diff --git a/tdecore/tdeaboutdata.cpp b/tdecore/tdeaboutdata.cpp
index 318a38d50..89828c12f 100644
--- a/tdecore/tdeaboutdata.cpp
+++ b/tdecore/tdeaboutdata.cpp
@@ -77,10 +77,10 @@ public:
     TDEAboutDataPrivate()
         : translatorName("_: NAME OF TRANSLATORS\nYour names")
         , translatorEmail("_: EMAIL OF TRANSLATORS\nYour emails")
-        , productName(0)
-        , programLogo(0)
+        , productName(nullptr)
+        , programLogo(nullptr)
         , customAuthorTextEnabled(false)
-        , mTranslatedProgramName( 0 )
+        , mTranslatedProgramName( nullptr )
         {}
     ~TDEAboutDataPrivate()
         {
@@ -115,8 +115,8 @@ TDEAboutData::TDEAboutData( const char *appName,
   mCopyrightStatement( copyrightStatement ),
   mOtherText( text ),
   mHomepageAddress( homePageAddress ),
-  mBugEmailAddress( (bugsEmailAddress!=0)?bugsEmailAddress:defaultBugTracker ),
-  mLicenseText (0)
+  mBugEmailAddress( bugsEmailAddress ?bugsEmailAddress:defaultBugTracker ),
+  mLicenseText (nullptr)
 {
    d = new TDEAboutDataPrivate;
 
@@ -127,7 +127,7 @@ TDEAboutData::TDEAboutData( const char *appName,
      else
 	 mAppName = appName;
    } else
-     mAppName = 0;
+     mAppName = nullptr;
 }
 
 TDEAboutData::~TDEAboutData()
@@ -273,7 +273,7 @@ void
 TDEAboutData::translateInternalProgramName() const
 {
   delete[] d->mTranslatedProgramName;
-  d->mTranslatedProgramName = 0;
+  d->mTranslatedProgramName = nullptr;
   if( TDEGlobal::locale() )
       d->mTranslatedProgramName = tqstrdup( programName().utf8());
 }
@@ -337,7 +337,7 @@ TDEAboutData::translators() const
 {
     TQValueList<TDEAboutTranslator> personList;
 
-    if(d->translatorName == 0)
+    if(!d->translatorName)
         return personList;
 
     TQStringList nameList;
diff --git a/tdecore/tdeaboutdata.h b/tdecore/tdeaboutdata.h
index 071da368b..2ee5abf8b 100644
--- a/tdecore/tdeaboutdata.h
+++ b/tdecore/tdeaboutdata.h
@@ -241,12 +241,12 @@ class TDECORE_EXPORT TDEAboutData
     TDEAboutData( const char *appName,
                 const char *programName,
 		const char *version,
-		const char *shortDescription = 0,
+		const char *shortDescription = nullptr,
 		int licenseType = License_Unknown,
-		const char *copyrightStatement = 0,
-		const char *text = 0,
-		const char *homePageAddress = 0,
-		const char *bugsEmailAddress = 0
+		const char *copyrightStatement = nullptr,
+		const char *text = nullptr,
+		const char *homePageAddress = nullptr,
+		const char *bugsEmailAddress = nullptr
 		);
 
      ~TDEAboutData();
@@ -271,9 +271,9 @@ class TDECORE_EXPORT TDEAboutData
      *
      */
     void addAuthor( const char *name,
-		    const char *task=0,
-		    const char *emailAddress=0,
-		    const char *webAddress=0 );
+		    const char *task=nullptr,
+		    const char *emailAddress=nullptr,
+		    const char *webAddress=nullptr );
 
     /**
      * Defines a person that deserves credit. You can call this function
@@ -295,9 +295,9 @@ class TDECORE_EXPORT TDEAboutData
      *
      */
     void addCredit( const char *name,
-                    const char *task=0,
-		    const char *emailAddress=0,
-		    const char *webAddress=0 );
+                    const char *task=nullptr,
+		    const char *emailAddress=nullptr,
+		    const char *webAddress=nullptr );
 
     /**
      * Sets the name of the translator of the gui. Since this depends
diff --git a/tdecore/tdeaccel.cpp b/tdecore/tdeaccel.cpp
index 5796bf060..797c8d44b 100644
--- a/tdecore/tdeaccel.cpp
+++ b/tdecore/tdeaccel.cpp
@@ -103,11 +103,11 @@ class TDEAccelEventHandler : public TQWidget
 	static bool g_bAccelActivated;
 };
 
-TDEAccelEventHandler* TDEAccelEventHandler::g_pSelf = 0;
+TDEAccelEventHandler* TDEAccelEventHandler::g_pSelf = nullptr;
 bool TDEAccelEventHandler::g_bAccelActivated = false;
 
 TDEAccelEventHandler::TDEAccelEventHandler()
-    : TQWidget( 0, "TDEAccelEventHandler" )
+    : TQWidget( nullptr, "TDEAccelEventHandler" )
 {
 #	ifdef TQ_WS_X11
 	if ( tdeApp )
@@ -480,7 +480,7 @@ TDEAccelAction* TDEAccel::insert( TDEStdAccel::StdAccel id,
 {
 	TQString sAction = TDEStdAccel::name( id );
 	if( sAction.isEmpty() )
-		return 0;
+		return nullptr;
 
 	TDEAccelAction* pAction = d->insert( sAction, TDEStdAccel::label( id ), TDEStdAccel::whatsThis( id ),
 		TDEStdAccel::shortcutDefault3( id ), TDEStdAccel::shortcutDefault4( id ),
@@ -554,8 +554,8 @@ bool TDEAccel::insertItem( const TQString& sLabel, const TQString& sAction,
 	TDEShortcut cut( cutsDef );
 	bool b = d->insert( sAction, sLabel, TQString::null,
 		cut, cut,
-		0, 0,
-		bConfigurable ) != 0;
+		nullptr, nullptr,
+		bConfigurable ) != nullptr;
 	return b;
 }
 
@@ -567,9 +567,9 @@ bool TDEAccel::insertItem( const TQString& sLabel, const TQString& sAction,
 	cut.init( TQKeySequence(key) );
 	TDEAccelAction* pAction = d->insert( sAction, sLabel, TQString::null,
 		cut, cut,
-		0, 0,
+		nullptr, nullptr,
 		bConfigurable );
-	return pAction != 0;
+	return pAction != nullptr;
 }
 
 // Used in tdeutils/kjots
@@ -577,7 +577,7 @@ bool TDEAccel::insertStdItem( TDEStdAccel::StdAccel id, const TQString& sLabel )
 {
 	TDEAccelAction* pAction = d->insert( TDEStdAccel::name( id ), sLabel, TQString::null,
 		TDEStdAccel::shortcutDefault3( id ), TDEStdAccel::shortcutDefault4( id ),
-		0, 0 );
+		nullptr, nullptr );
 	if( pAction )
 		pAction->setShortcut( TDEStdAccel::shortcut( id ) );
 
diff --git a/tdecore/tdeaccel.h b/tdecore/tdeaccel.h
index c8114059d..278af029f 100644
--- a/tdecore/tdeaccel.h
+++ b/tdecore/tdeaccel.h
@@ -101,7 +101,7 @@ class TDECORE_EXPORT TDEAccel : public TQAccel
 	 * @param pParent the parent and widget to watch for key strokes
 	 * @param psName the name of the TQObject
 	 */
-	TDEAccel( TQWidget* pParent, const char* psName = 0 );
+	TDEAccel( TQWidget* pParent, const char* psName = nullptr );
 
 	/**
 	 * Creates a new TDEAccel that watches @p watch.
@@ -110,7 +110,7 @@ class TDECORE_EXPORT TDEAccel : public TQAccel
 	 * @param parent the parent of the TQObject
 	 * @param psName the name of the TQObject
 	 */
-	TDEAccel( TQWidget* watch, TQObject* parent, const char* psName = 0 );
+	TDEAccel( TQWidget* watch, TQObject* parent, const char* psName = nullptr );
 	virtual ~TDEAccel();
 
 	/**
@@ -289,7 +289,7 @@ class TDECORE_EXPORT TDEAccel : public TQAccel
 	 *         configuration file
 	 * @return true if successful, false otherwise
 	 */
-	bool readSettings( TDEConfigBase* pConfig = 0 );
+	bool readSettings( TDEConfigBase* pConfig = nullptr );
 	/**
 	 * Write the current shortcuts to @p pConfig,
 	 * or (if @p pConfig is zero) to the application's
@@ -298,7 +298,7 @@ class TDECORE_EXPORT TDEAccel : public TQAccel
 	 *         configuration file
 	 * @return true if successful, false otherwise
 	 */
-	bool writeSettings( TDEConfigBase* pConfig = 0 ) const;
+	bool writeSettings( TDEConfigBase* pConfig = nullptr ) const;
 
 	/**
 	 * Emits the keycodeChanged() signal.
@@ -319,13 +319,13 @@ class TDECORE_EXPORT TDEAccel : public TQAccel
 	 */
 	bool insertItem( const TQString& sLabel, const TQString& sAction,
 	                 const char* psKey,
-	                 int nIDMenu = 0, TQPopupMenu* pMenu = 0, bool bConfigurable = true ) TDE_DEPRECATED;
+	                 int nIDMenu = 0, TQPopupMenu* pMenu = nullptr, bool bConfigurable = true ) TDE_DEPRECATED;
 	/**
 	 * @deprecated use insert
 	 */
 	bool insertItem( const TQString& sLabel, const TQString& sAction,
 	                 int key,
-	                 int nIDMenu = 0, TQPopupMenu* pMenu = 0, bool bConfigurable = true ) TDE_DEPRECATED;
+	                 int nIDMenu = 0, TQPopupMenu* pMenu = nullptr, bool bConfigurable = true ) TDE_DEPRECATED;
 	/**
 	 * @deprecated use insert
 	 */
diff --git a/tdecore/tdeaccelaction.cpp b/tdecore/tdeaccelaction.cpp
index 89d8efaa2..edd9c9188 100644
--- a/tdecore/tdeaccelaction.cpp
+++ b/tdecore/tdeaccelaction.cpp
@@ -47,8 +47,8 @@ TDEAccelAction::TDEAccelAction()
 {
 	//kdDebug(125) << "TDEAccelAction(): this = " << this << endl;
 	d = new TDEAccelActionPrivate;
-	m_pObjSlot = 0;
-	m_psMethodSlot = 0;
+	m_pObjSlot = nullptr;
+	m_psMethodSlot = nullptr;
 	m_bConfigurable = true;
 	m_bEnabled = true;
 	m_nIDAccel = 0;
@@ -84,8 +84,8 @@ TDEAccelAction::~TDEAccelAction()
 void TDEAccelAction::clear()
 {
 	m_cut.clear();
-	m_pObjSlot = 0;
-	m_psMethodSlot = 0;
+	m_pObjSlot = nullptr;
+	m_psMethodSlot = nullptr;
 	m_bConfigurable = true;
 	m_bEnabled = true;
 	m_nIDAccel = 0;
@@ -237,13 +237,13 @@ class TDEAccelActionsPrivate
 TDEAccelActions::TDEAccelActions()
 {
 	kdDebug(125) << "TDEAccelActions(): this = " << this << endl;
-	initPrivate( 0 );
+	initPrivate( nullptr );
 }
 
 TDEAccelActions::TDEAccelActions( const TDEAccelActions& actions )
 {
 	kdDebug(125) << "TDEAccelActions( actions = " << &actions << " ): this = " << this << endl;
-	initPrivate( 0 );
+	initPrivate( nullptr );
 	init( actions );
 }
 
@@ -264,7 +264,7 @@ void TDEAccelActions::initPrivate( TDEAccelBase* pTDEAccelBase )
 {
 	m_pTDEAccelBase = pTDEAccelBase;
 	m_nSizeAllocated = m_nSize = 0;
-	m_prgActions = 0;
+	m_prgActions = nullptr;
 	//d = new TDEAccelActionsPrivate;
 }
 
@@ -276,7 +276,7 @@ void TDEAccelActions::clear()
 	delete[] m_prgActions;
 
 	m_nSizeAllocated = m_nSize = 0;
-	m_prgActions = 0;
+	m_prgActions = nullptr;
 }
 
 bool TDEAccelActions::init( const TDEAccelActions& actions )
@@ -288,7 +288,7 @@ bool TDEAccelActions::init( const TDEAccelActions& actions )
 		if( pAction )
 			m_prgActions[i] = new TDEAccelAction( *pAction );
 		else
-			m_prgActions[i] = 0;
+			m_prgActions[i] = nullptr;
 	}
 
 	return true;
@@ -311,7 +311,7 @@ bool TDEAccelActions::init( TDEConfigBase& config, const TQString& sGroup )
 
 		m_prgActions[i] = new TDEAccelAction( it.key(), it.key(), it.key(),
 			cuts, cuts,
-			0, 0,          // pObjSlot, psMethodSlot,
+			nullptr, nullptr,          // pObjSlot, psMethodSlot,
 			true, false ); // bConfigurable, bEnabled
 	}
 
@@ -330,7 +330,7 @@ void TDEAccelActions::resize( uint nSize )
 
 		// Null out new pointers
 		for( uint i = m_nSizeAllocated; i < nSizeAllocated; i++ )
-			prgActions[i] = 0;
+			prgActions[i] = nullptr;
 
 		delete[] m_prgActions;
 		m_prgActions = prgActions;
@@ -374,7 +374,7 @@ void TDEAccelActions::updateShortcuts( TDEAccelActions& actions2 )
 int TDEAccelActions::actionIndex( const TQString& sAction ) const
 {
 	for( uint i = 0; i < m_nSize; i++ ) {
-		if( m_prgActions[i] == 0 )
+		if( !m_prgActions[i] )
 			kdWarning(125) << "TDEAccelActions::actionPtr( " << sAction << " ): encountered null pointer at m_prgActions[" << i << "]" << endl;
 		else if( m_prgActions[i]->m_sName == sAction )
 			return (int) i;
@@ -395,24 +395,24 @@ const TDEAccelAction* TDEAccelActions::actionPtr( uint i ) const
 TDEAccelAction* TDEAccelActions::actionPtr( const TQString& sAction )
 {
 	int i = actionIndex( sAction );
-	return (i >= 0) ? m_prgActions[i] : 0;
+	return (i >= 0) ? m_prgActions[i] : nullptr;
 }
 
 const TDEAccelAction* TDEAccelActions::actionPtr( const TQString& sAction ) const
 {
 	int i = actionIndex( sAction );
-	return (i >= 0) ? m_prgActions[i] : 0;
+	return (i >= 0) ? m_prgActions[i] : nullptr;
 }
 
 TDEAccelAction* TDEAccelActions::actionPtr( KKeySequence cut )
 {
 	for( uint i = 0; i < m_nSize; i++ ) {
-		if( m_prgActions[i] == 0 )
+		if( !m_prgActions[i] )
 			kdWarning(125) << "TDEAccelActions::actionPtr( " << cut.toStringInternal() << " ): encountered null pointer at m_prgActions[" << i << "]" << endl;
 		else if( m_prgActions[i]->contains( cut ) )
 			return m_prgActions[i];
 	}
-	return 0;
+	return nullptr;
 }
 
 TDEAccelAction& TDEAccelActions::operator []( uint i )
@@ -429,7 +429,7 @@ TDEAccelAction* TDEAccelActions::insert( const TQString& sName, const TQString&
 {
 	if( actionPtr( sName ) ) {
 		kdWarning(125) << "TDEAccelActions::insertLabel( " << sName << ", " << sLabel << " ): action with same name already present." << endl;
-		return 0;
+		return nullptr;
 	}
 
 	TDEAccelAction* pAction = new TDEAccelAction;
@@ -450,7 +450,7 @@ TDEAccelAction* TDEAccelActions::insert( const TQString& sAction, const TQString
 	//kdDebug(125) << "TDEAccelActions::insert()2 begin" << endl;
 	if( actionPtr( sAction ) ) {
 		kdWarning(125) << "TDEAccelActions::insert( " << sAction << " ): action with same name already present." << endl;
-		return 0;
+		return nullptr;
 	}
 
 	TDEAccelAction* pAction = new TDEAccelAction(
@@ -511,7 +511,7 @@ bool TDEAccelActions::writeActions( const TQString &sGroup, TDEConfigBase* pConf
 	TDEConfigGroupSaver cs( pConfig, sGroup );
 
 	for( uint i = 0; i < m_nSize; i++ ) {
-		if( m_prgActions[i] == 0 ) {
+		if( !m_prgActions[i] ) {
 			kdWarning(125) << "TDEAccelActions::writeActions(): encountered null pointer at m_prgActions[" << i << "]" << endl;
 			continue;
 		}
diff --git a/tdecore/tdeaccelaction.h b/tdecore/tdeaccelaction.h
index 1c719541f..d9220b024 100644
--- a/tdecore/tdeaccelaction.h
+++ b/tdecore/tdeaccelaction.h
@@ -496,7 +496,7 @@ class TDECORE_EXPORT TDEAccelActions
 	 */
 	TDEAccelAction* insert( const TQString& sAction, const TQString& sLabel, const TQString& sWhatsThis,
 			const TDEShortcut& rgCutDefaults3, const TDEShortcut& rgCutDefaults4,
-			const TQObject* pObjSlot = 0, const char* psMethodSlot = 0,
+			const TQObject* pObjSlot = nullptr, const char* psMethodSlot = nullptr,
 			bool bConfigurable = true, bool bEnabled = true );
 
 	/**
@@ -521,7 +521,7 @@ class TDECORE_EXPORT TDEAccelActions
 	 * @param pConfig the configuration file to load from
 	 * @return true if successful, false otherwise
 	 */
-	bool readActions( const TQString& sConfigGroup = "Shortcuts", TDEConfigBase* pConfig = 0 );
+	bool readActions( const TQString& sConfigGroup = "Shortcuts", TDEConfigBase* pConfig = nullptr );
 
 	/**
 	 * Writes the actions to the given configuration file.
@@ -532,7 +532,7 @@ class TDECORE_EXPORT TDEAccelActions
 	 * @param bGlobal true to write to the global configuration file
 	 * @return true if successful, false otherwise
 	 */
-	bool writeActions( const TQString& sConfigGroup = "Shortcuts", TDEConfigBase* pConfig = 0,
+	bool writeActions( const TQString& sConfigGroup = "Shortcuts", TDEConfigBase* pConfig = nullptr,
 			bool bWriteAll = false, bool bGlobal = false ) const;
 
 	/**
diff --git a/tdecore/tdeaccelbase.cpp b/tdecore/tdeaccelbase.cpp
index a3fc23e3e..c2e3221ba 100644
--- a/tdecore/tdeaccelbase.cpp
+++ b/tdecore/tdeaccelbase.cpp
@@ -52,7 +52,7 @@ TDEAccelBase::TDEAccelBase( int fInitCode )
 	m_sConfigGroup = "Shortcuts";
 	m_bConfigIsGlobal = false;
 	m_bAutoUpdate = false;
-	mtemp_pActionRemoving = 0;
+	mtemp_pActionRemoving = nullptr;
 }
 
 TDEAccelBase::~TDEAccelBase()
@@ -78,7 +78,7 @@ const TDEAccelAction* TDEAccelBase::actionPtr( const TQString& sAction ) const
 TDEAccelAction* TDEAccelBase::actionPtr( const KKeyServer::Key& key )
 {
 	if( !m_mapKeyToAction.contains( key ) )
-		return 0;
+		return nullptr;
 	// Note: If more than one action is connected to a single key, nil will be returned.
 	return m_mapKeyToAction[key].pAction;
 }
@@ -367,7 +367,7 @@ bool TDEAccelBase::updateConnections()
 			}
 			// Indicate that no single action is associated with this key.
 			m_rgActionsNonUnique.append( info.pAction );
-			info.pAction = 0;
+			info.pAction = nullptr;
 		}
 
 		kdDebug(125) << "mapKeyToAction[" << key.key().toStringInternal() << "] = " << info.pAction << endl;
@@ -483,7 +483,7 @@ bool TDEAccelBase::insertConnection( TDEAccelAction* pAction )
 					}
 					// Else this is a multi-key shortcut,
 					else {
-						m_mapKeyToAction[key] = ActionInfo( 0, 0, 0 );
+						m_mapKeyToAction[key] = ActionInfo( nullptr, 0, 0 );
 						// Insert into non-unique list if it's not already there.
 						if( m_rgActionsNonUnique.findIndex( pAction ) == -1 )
 							m_rgActionsNonUnique.append( pAction );
@@ -495,7 +495,7 @@ bool TDEAccelBase::insertConnection( TDEAccelAction* pAction )
 					//  check is necessary.
 					// TODO: make this more efficient where possible.
 					if( m_mapKeyToAction[key].pAction != pAction
-					    && m_mapKeyToAction[key].pAction != 0 ) {
+					    && m_mapKeyToAction[key].pAction ) {
 						kdDebug(125) << "Key conflict with action = " << m_mapKeyToAction[key].pAction->name() 
 							<< " key = " << key.key().toStringInternal() << " : call updateConnections()" << endl;
 						return updateConnections();
@@ -530,7 +530,7 @@ bool TDEAccelBase::removeConnection( TDEAccelAction* pAction )
 	if( m_rgActionsNonUnique.findIndex( pAction ) >= 0 ) {
 		mtemp_pActionRemoving = pAction;
 		bool b = updateConnections();
-		mtemp_pActionRemoving = 0;
+		mtemp_pActionRemoving = nullptr;
 		return b;
 	}
 
diff --git a/tdecore/tdeaccelbase.h b/tdecore/tdeaccelbase.h
index 7a2955b66..7990d9901 100644
--- a/tdecore/tdeaccelbase.h
+++ b/tdecore/tdeaccelbase.h
@@ -205,14 +205,14 @@ class TDECORE_EXPORT TDEAccelBase
 	 * The group in which the configuration is stored can be
 	 * set with setConfigGroup().
 	 */
-	void readSettings( TDEConfigBase* pConfig = 0 );
+	void readSettings( TDEConfigBase* pConfig = nullptr );
 
 	/**
 	 * Write the current configurable associations to @p config,
          * or (if @p config is zero) to the application's
 	 * configuration file.
 	 */
-	void writeSettings( TDEConfigBase* pConfig = 0 ) const;
+	void writeSettings( TDEConfigBase* pConfig = nullptr ) const;
 
 	TQPopupMenu* createPopupMenu( TQWidget* pParent, const KKeySequence& );
 
@@ -257,7 +257,7 @@ class TDECORE_EXPORT TDEAccelBase
 		uint iSeq, iVariation;
 		//ActionInfo* pInfoNext; // nil if only one action uses this key.
 
-		ActionInfo() { pAction = 0; iSeq = 0xffff; iVariation = 0xffff; }
+		ActionInfo() { pAction = nullptr; iSeq = 0xffff; iVariation = 0xffff; }
 		ActionInfo( TDEAccelAction* _pAction, uint _iSeq, uint _iVariation )
 			{ pAction = _pAction; iSeq = _iSeq; iVariation = _iVariation; }
 	};
diff --git a/tdecore/tdeaccelmanager.cpp b/tdecore/tdeaccelmanager.cpp
index 3cc7eb22e..c8ef120e5 100644
--- a/tdecore/tdeaccelmanager.cpp
+++ b/tdecore/tdeaccelmanager.cpp
@@ -118,7 +118,7 @@ private:
   {
   public:
 
-    Item() : m_widget(0), m_children(0), m_index(-1) {}
+    Item() : m_widget(nullptr), m_children(nullptr), m_index(-1) {}
     ~Item();
 
     void addChild(Item *item);
@@ -136,7 +136,7 @@ bool TDEAcceleratorManagerPrivate::programmers_mode = false;
 TQString TDEAcceleratorManagerPrivate::changed_string;
 TQString TDEAcceleratorManagerPrivate::added_string;
 TQString TDEAcceleratorManagerPrivate::removed_string;
-static TQStringList *kaccmp_sns = 0;
+static TQStringList *kaccmp_sns = nullptr;
 static KStaticDeleter<TQStringList> kaccmp_sns_d;
 TQMap<TQWidget*, int> TDEAcceleratorManagerPrivate::ignored_widgets;
 
@@ -195,7 +195,7 @@ void TDEAcceleratorManagerPrivate::calculateAccelerators(Item *item, TQString &u
 
     // collect the contents
     TDEAccelStringList contents;
-    for (Item *it = item->m_children->first(); it != 0;
+    for (Item *it = item->m_children->first(); it;
          it = item->m_children->next())
     {
         contents << it->m_content;
@@ -206,7 +206,7 @@ void TDEAcceleratorManagerPrivate::calculateAccelerators(Item *item, TQString &u
 
     // write them back into the widgets
     int cnt = -1;
-    for (Item *it = item->m_children->first(); it != 0;
+    for (Item *it = item->m_children->first(); it;
          it = item->m_children->next())
     {
         cnt++;
@@ -251,7 +251,7 @@ void TDEAcceleratorManagerPrivate::calculateAccelerators(Item *item, TQString &u
     }
 
     // calculate the accelerators for the children
-    for (Item *it = item->m_children->first(); it != 0;
+    for (Item *it = item->m_children->first(); it;
          it = item->m_children->next())
     {
         if (it->m_widget && it->m_widget->isVisibleTo( item->m_widget ) )
@@ -262,12 +262,12 @@ void TDEAcceleratorManagerPrivate::calculateAccelerators(Item *item, TQString &u
 
 void TDEAcceleratorManagerPrivate::traverseChildren(TQWidget *widget, Item *item)
 {
-  TQObjectList *childList = widget->queryList("TQWidget", 0, false, false);
+  TQObjectList *childList = widget->queryList("TQWidget", nullptr, false, false);
   for ( TQObject *it = childList->first(); it; it = childList->next() )
   {
     TQWidget *w = static_cast<TQWidget*>(it);
 
-    if ( !w->isVisibleTo( widget ) || ( w->isTopLevel() && dynamic_cast<TQPopupMenu*>(w) == NULL ) )
+    if ( !w->isVisibleTo( widget ) || ( w->isTopLevel() && dynamic_cast<TQPopupMenu*>(w) == nullptr ) )
         continue;
 
     if ( TDEAcceleratorManagerPrivate::ignored_widgets.find( w ) != TDEAcceleratorManagerPrivate::ignored_widgets.end() )
@@ -327,12 +327,12 @@ void TDEAcceleratorManagerPrivate::manageWidget(TQWidget *w, Item *item)
   TQLabel *label =  dynamic_cast<TQLabel*>(w);
   if ( label  ) {
       if ( !label->buddy() )
-          label = 0;
+          label = nullptr;
       else {
           if ( label->textFormat() == TQt::RichText ||
                ( label->textFormat() == TQt::AutoText &&
                  TQStyleSheet::mightBeRichText( label->text() ) ) )
-              label = 0;
+              label = nullptr;
       }
   }
 
@@ -826,13 +826,13 @@ void TDEPopupAccelManager::setMenuEntries(const TDEAccelStringList &list)
 void TDEPopupAccelManager::manage(TQPopupMenu *popup)
 {
   // don't add more than one manager to a popup
-  if (popup->child(0, "TDEPopupAccelManager", false) == 0 )
+  if (!popup->child(nullptr, "TDEPopupAccelManager", false) )
     new TDEPopupAccelManager(popup);
 }
 
 void QWidgetStackAccelManager::manage( TQWidgetStack *stack )
 {
-    if ( stack->child( 0, "QWidgetStackAccelManager", false ) == 0 )
+    if ( !stack->child( nullptr, "QWidgetStackAccelManager", false ) )
         new QWidgetStackAccelManager( stack );
 }
 
diff --git a/tdecore/tdeapplication.cpp b/tdecore/tdeapplication.cpp
index 0c27098f5..575148554 100644
--- a/tdecore/tdeapplication.cpp
+++ b/tdecore/tdeapplication.cpp
@@ -321,16 +321,16 @@ public:
   TDEApplicationPrivate()
     :   actionRestrictions( false ),
 	refCount( 1 ),
-	oldIceIOErrorHandler( 0 ),
-	checkAccelerators( 0 ),
+	oldIceIOErrorHandler( nullptr ),
+	checkAccelerators( nullptr ),
 	overrideStyle( TQString::null ),
 	startup_id( "0" ),
-	app_started_timer( NULL ),
-	m_TDEAppDCOPInterface( 0L ),
+	app_started_timer( nullptr ),
+	m_TDEAppDCOPInterface( nullptr ),
 	session_save( false )
 #ifdef TQ_WS_X11
-	,oldXErrorHandler( NULL )
-	,oldXIOErrorHandler( NULL )
+	,oldXErrorHandler( nullptr )
+	,oldXIOErrorHandler( nullptr )
 #elif defined TQ_WS_WIN
 	,qassistantclient( 0 )
 #endif
@@ -513,7 +513,7 @@ public:
 };
 
 
-static TQPtrList<TQWidget>*x11Filter = 0;
+static TQPtrList<TQWidget>*x11Filter = nullptr;
 static bool autoDcopRegistration = true;
 
 void TDEApplication::installX11EventFilter( TQWidget* filter )
@@ -538,7 +538,7 @@ void TDEApplication::removeX11EventFilter( const TQWidget* filter )
     x11Filter->removeRef( filter );
     if ( x11Filter->isEmpty() ) {
         delete x11Filter;
-        x11Filter = 0;
+        x11Filter = nullptr;
     }
 }
 
@@ -633,7 +633,7 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event)
 #endif
         if( w->isTopLevel() && !w->testWFlags( WX11BypassWM ) && !w->isPopup() && !event->spontaneous())
         {
-            if( d->app_started_timer == NULL )
+            if( !d->app_started_timer )
             {
                 d->app_started_timer = new TQTimer( this, "app_started_timer" );
                 connect( d->app_started_timer, TQ_SIGNAL( timeout()), TQ_SLOT( checkAppStartedSlot()));
@@ -641,13 +641,13 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event)
             if( !d->app_started_timer->isActive())
                 d->app_started_timer->start( 0, true );
         }
-        if( w->isTopLevel() && ( w->icon() == NULL || w->icon()->isNull()))
+        if( w->isTopLevel() && ( !w->icon() || w->icon()->isNull()))
         {
             // icon() cannot be null pixmap, it'll be the "unknown" icon - so check if there is this application icon
-            static TQPixmap* ic = NULL;
-            if( ic == NULL )
+            static TQPixmap* ic = nullptr;
+            if( !ic )
                 ic = new TQPixmap( TDEGlobal::iconLoader()->loadIcon( iconName(),
-                    TDEIcon::NoGroup, 0, TDEIcon::DefaultState, NULL, true ));
+                    TDEIcon::NoGroup, 0, TDEIcon::DefaultState, nullptr, true ));
             if( !ic->isNull())
             {
                 w->setIcon( *ic );
@@ -670,7 +670,7 @@ void TDEApplication::checkAppStartedSlot()
 // the help class for session management communication
 static TQPtrList<KSessionManaged>* sessionClients()
 {
-    static TQPtrList<KSessionManaged>* session_clients = 0L;
+    static TQPtrList<KSessionManaged>* session_clients = nullptr;
     if ( !session_clients )
         session_clients = new TQPtrList<KSessionManaged>;
     return session_clients;
@@ -690,25 +690,25 @@ TQString TDEApplication::sessionConfigName() const
 }
 
 #ifdef TQ_WS_X11
-static SmcConn mySmcConnection = 0;
-static SmcConn tmpSmcConnection = 0;
+static SmcConn mySmcConnection = nullptr;
+static SmcConn tmpSmcConnection = nullptr;
 #else
 // FIXME(E): Implement for Qt Embedded
 // Possibly "steal" XFree86's libSM?
 #endif
-static TQTime* smModificationTime = 0;
+static TQTime* smModificationTime = nullptr;
 
 TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppName,
                             bool allowStyles, bool GUIenabled, bool SMenabled ) :
   TQApplication( argc, argv, GUIenabled, SMenabled ), TDEInstance(rAppName),
 #ifdef TQ_WS_X11
-  display(0L),
+  display(nullptr),
   argb_visual(false),
 #endif
   d (new TDEApplicationPrivate())
 {
-    aIconPixmap.pm.icon = 0L;
-    aIconPixmap.pm.miniIcon = 0L;
+    aIconPixmap.pm.icon = nullptr;
+    aIconPixmap.pm.miniIcon = nullptr;
     read_app_startup_id();
     if (!GUIenabled)
        allowStyles = false;
@@ -730,13 +730,13 @@ TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppNam
                             bool allowStyles, bool GUIenabled ) :
   TQApplication( argc, argv, GUIenabled ), TDEInstance(rAppName),
 #ifdef TQ_WS_X11
-  display(0L),
+  display(nullptr),
   argb_visual(false),
 #endif
   d (new TDEApplicationPrivate())
 {
-    aIconPixmap.pm.icon = 0L;
-    aIconPixmap.pm.miniIcon = 0L;
+    aIconPixmap.pm.icon = nullptr;
+    aIconPixmap.pm.miniIcon = nullptr;
     read_app_startup_id();
     if (!GUIenabled)
        allowStyles = false;
@@ -755,13 +755,13 @@ TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, bool SMenable
   TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), GUIenabled, SMenabled ),	// We need to be able to run command line apps
   TDEInstance( TDECmdLineArgs::about),
 #ifdef TQ_WS_X11
-  display(0L),
+  display(nullptr),
   argb_visual(false),
 #endif
   d (new TDEApplicationPrivate)
 {
-    aIconPixmap.pm.icon = 0L;
-    aIconPixmap.pm.miniIcon = 0L;
+    aIconPixmap.pm.icon = nullptr;
+    aIconPixmap.pm.miniIcon = nullptr;
     read_app_startup_id();
     if (!GUIenabled)
        allowStyles = false;
@@ -781,13 +781,13 @@ TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled ) :
   TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), GUIenabled ),	// We need to be able to run command line apps
   TDEInstance( TDECmdLineArgs::about),
 #ifdef TQ_WS_X11
-  display(0L),
+  display(nullptr),
   argb_visual(false),
 #endif
   d (new TDEApplicationPrivate)
 {
-    aIconPixmap.pm.icon = 0L;
-    aIconPixmap.pm.miniIcon = 0L;
+    aIconPixmap.pm.icon = nullptr;
+    aIconPixmap.pm.miniIcon = nullptr;
     read_app_startup_id();
     if (!GUIenabled)
        allowStyles = false;
@@ -804,10 +804,10 @@ TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled ) :
 TDEApplication::TDEApplication( Display *dpy, bool allowStyles ) :
   TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),
                 getX11RGBAVisual(dpy), getX11RGBAColormap(dpy) ),
-  TDEInstance( TDECmdLineArgs::about), display(0L), d (new TDEApplicationPrivate)
+  TDEInstance( TDECmdLineArgs::about), display(nullptr), d (new TDEApplicationPrivate)
 {
-    aIconPixmap.pm.icon = 0L;
-    aIconPixmap.pm.miniIcon = 0L;
+    aIconPixmap.pm.icon = nullptr;
+    aIconPixmap.pm.miniIcon = nullptr;
     read_app_startup_id();
     useStyles = allowStyles;
     setName( instanceName() );
@@ -820,10 +820,10 @@ TDEApplication::TDEApplication( Display *dpy, bool allowStyles ) :
 TDEApplication::TDEApplication( Display *dpy, bool disable_argb, TQt::HANDLE visual, TQt::HANDLE colormap, bool allowStyles ) :
   TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),
                 disable_argb?visual:getX11RGBAVisual(dpy), disable_argb?colormap:getX11RGBAColormap(dpy) ),
-  TDEInstance( TDECmdLineArgs::about), display(0L), d (new TDEApplicationPrivate)
+  TDEInstance( TDECmdLineArgs::about), display(nullptr), d (new TDEApplicationPrivate)
 {
-    aIconPixmap.pm.icon = 0L;
-    aIconPixmap.pm.miniIcon = 0L;
+    aIconPixmap.pm.icon = nullptr;
+    aIconPixmap.pm.miniIcon = nullptr;
     read_app_startup_id();
     useStyles = allowStyles;
     if (disable_argb) argb_visual = false;
@@ -838,12 +838,12 @@ TDEApplication::TDEApplication( Display *dpy, TQt::HANDLE visual, TQt::HANDLE co
 		            bool allowStyles ) :
   TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),
                 visual?visual:getX11RGBAVisual(dpy), colormap?colormap:getX11RGBAColormap(dpy) ),
-  TDEInstance( TDECmdLineArgs::about), display(0L), d (new TDEApplicationPrivate)
+  TDEInstance( TDECmdLineArgs::about), display(nullptr), d (new TDEApplicationPrivate)
 {
     if ((visual) && (colormap))
         getX11RGBAInformation(dpy);
-    aIconPixmap.pm.icon = 0L;
-    aIconPixmap.pm.miniIcon = 0L;
+    aIconPixmap.pm.icon = nullptr;
+    aIconPixmap.pm.miniIcon = nullptr;
     read_app_startup_id();
     useStyles = allowStyles;
     setName( instanceName() );
@@ -857,12 +857,12 @@ TDEApplication::TDEApplication( Display *dpy, TQt::HANDLE visual, TQt::HANDLE co
 		            bool allowStyles, TDEInstance * _instance ) :
   TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),
                 visual?visual:getX11RGBAVisual(dpy), colormap?colormap:getX11RGBAColormap(dpy) ),
-  TDEInstance( _instance ), display(0L), d (new TDEApplicationPrivate)
+  TDEInstance( _instance ), display(nullptr), d (new TDEApplicationPrivate)
 {
     if ((visual) && (colormap))
         getX11RGBAInformation(dpy);
-    aIconPixmap.pm.icon = 0L;
-    aIconPixmap.pm.miniIcon = 0L;
+    aIconPixmap.pm.icon = nullptr;
+    aIconPixmap.pm.miniIcon = nullptr;
     read_app_startup_id();
     useStyles = allowStyles;
     setName( instanceName() );
@@ -878,13 +878,13 @@ TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, TDEInstance*
                 GUIenabled ),
   TDEInstance( _instance ),
 #ifdef TQ_WS_X11
-  display(0L),
+  display(nullptr),
 #endif
   argb_visual(false),
   d (new TDEApplicationPrivate)
 {
-    aIconPixmap.pm.icon = 0L;
-    aIconPixmap.pm.miniIcon = 0L;
+    aIconPixmap.pm.icon = nullptr;
+    aIconPixmap.pm.miniIcon = nullptr;
     read_app_startup_id();
     if (!GUIenabled)
        allowStyles = false;
@@ -901,12 +901,12 @@ TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, TDEInstance*
 TDEApplication::TDEApplication(Display *display, int& argc, char** argv, const TQCString& rAppName,
                            bool allowStyles, bool GUIenabled ) :
   TQApplication( display ), TDEInstance(rAppName),
-  display(0L),
+  display(nullptr),
   argb_visual(false),
   d (new TDEApplicationPrivate())
 {
-    aIconPixmap.pm.icon = 0L;
-    aIconPixmap.pm.miniIcon = 0L;
+    aIconPixmap.pm.icon = nullptr;
+    aIconPixmap.pm.miniIcon = nullptr;
     read_app_startup_id();
     if (!GUIenabled)
        allowStyles = false;
@@ -956,7 +956,7 @@ void TDEApplication::iceIOErrorHandler( _IceConn *conn )
     emit shutDown();
 
 #ifdef TQ_WS_X11
-    if ( d->oldIceIOErrorHandler != NULL )
+    if ( d->oldIceIOErrorHandler )
       (*d->oldIceIOErrorHandler)( conn );
 #endif
     exit( 1 );
@@ -1028,7 +1028,7 @@ void TDEApplication::init(bool GUIenabled)
   dcopAutoRegistration();
   dcopClientPostInit();
 
-  smw = 0;
+  smw = nullptr;
 
   // Initial KIPC event mask.
 #if defined TQ_WS_X11
@@ -1105,7 +1105,7 @@ void TDEApplication::init(bool GUIenabled)
 #ifdef TQ_WS_MACX
   if (GUIenabled) {
       TQPixmap pixmap = TDEGlobal::iconLoader()->loadIcon( TDECmdLineArgs::appName(),
-              TDEIcon::NoGroup, TDEIcon::SizeLarge, TDEIcon::DefaultState, 0L, false );
+              TDEIcon::NoGroup, TDEIcon::SizeLarge, TDEIcon::DefaultState, nullptr, false );
       if (!pixmap.isNull()) {
           TQImage i = pixmap.convertToImage().convertDepth(32).smoothScale(40, 40);
           for(int y = 0; y < i.height(); y++) {
@@ -1114,8 +1114,8 @@ void TDEApplication::init(bool GUIenabled)
                   *(l+x) = 255;
           }
           CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB();
-          CGDataProviderRef dp = CGDataProviderCreateWithData(NULL,
-                  i.bits(), i.numBytes(), NULL);
+          CGDataProviderRef dp = CGDataProviderCreateWithData(nullptr,
+                  i.bits(), i.numBytes(), nullptr);
           CGImageRef ir = CGImageCreate(i.width(), i.height(), 8, 32, i.bytesPerLine(),
                   cs, kCGImageAlphaNoneSkipFirst, dp,
                   0, 0, kCGRenderingIntentDefault);
@@ -1142,14 +1142,14 @@ void TDEApplication::init(bool GUIenabled)
   // install appdata resource type
   TDEGlobal::dirs()->addResourceType("appdata", TDEStandardDirs::kde_default("data")
                                    + TQString::fromLatin1(name()) + '/');
-  pSessionConfig = 0L;
+  pSessionConfig = nullptr;
   bSessionManagement = true;
 
 #ifdef TQ_WS_X11
   // register a communication window for desktop changes (Matthias)
   if (GUIenabled && kde_have_kipc )
   {
-    smw = new TQWidget(0,0);
+    smw = new TQWidget(nullptr,nullptr);
     long data = 1;
     XChangeProperty(tqt_xdisplay(), smw->winId(),
 		    atom_DesktopWindow, atom_DesktopWindow,
@@ -1171,7 +1171,7 @@ static int my_system (const char *command) {
       return -1;
    if (pid == 0) {
       const char* shell = "/bin/sh";
-      execl(shell, shell, "-c", command, (void *)0);
+      execl(shell, shell, "-c", command, (void *)nullptr);
       ::_exit(127);
    }
    do {
@@ -1345,10 +1345,10 @@ bool TDEApplication::requestShutDown(
 
     if (! tmpSmcConnection) {
 	char cerror[256];
-	char* myId = 0;
-	char* prevId = 0;
+	char* myId = nullptr;
+	char* prevId = nullptr;
 	SmcCallbacks cb;
-	tmpSmcConnection = SmcOpenConnection( 0, 0, 1, 0,
+	tmpSmcConnection = SmcOpenConnection( nullptr, nullptr, 1, 0,
 					      0, &cb,
 					      prevId,
 					      &myId,
@@ -1459,12 +1459,12 @@ static void checkRestartVersion( TQSessionManager& sm )
     unsigned char* data;
     if( XGetWindowProperty( dpy, RootWindow( dpy, 0 ), XInternAtom( dpy, "TDE_FULL_SESSION", False ),
         0, 1, False, AnyPropertyType, &type, &format, &nitems, &after, &data ) == Success ) {
-        if( data != NULL )
+        if( data )
             XFree( data );
         if( type == XA_STRING && format == 8 ) { // session set, check if TDE_SESSION_VERSION is not set (meaning KDE3)
             if( XGetWindowProperty( dpy, RootWindow( dpy, 0 ), XInternAtom( dpy, "TDE_SESSION_VERSION", False ),
                 0, 1, False, AnyPropertyType, &type, &format, &nitems, &after, &data ) == Success ) {
-                if( data != NULL )
+                if( data )
                     XFree( data ); // KDE4 or newer
                 if( type == None )
                     return; // we run in our native session, no need to wrap
@@ -1508,7 +1508,7 @@ void TDEApplication::saveState( TQSessionManager& sm )
     // name, meaning the user still might need it eventually.
     if ( pSessionConfig ) {
         delete pSessionConfig;
-        pSessionConfig = 0;
+        pSessionConfig = nullptr;
     }
 
     // tell the session manager about our new lifecycle
@@ -1636,51 +1636,51 @@ static const TDECmdLineOptions qt_options[] =
 {
   //FIXME: Check if other options are specific to Qt/X11
 #ifdef TQ_WS_X11
-   { "display <displayname>", I18N_NOOP("Use the X-server display 'displayname'"), 0},
+   { "display <displayname>", I18N_NOOP("Use the X-server display 'displayname'"), nullptr},
 #else
    { "display <displayname>", I18N_NOOP("Use the QWS display 'displayname'"), 0},
 #endif
-   { "session <sessionId>", I18N_NOOP("Restore the application for the given 'sessionId'"), 0},
-   { "cmap", I18N_NOOP("Causes the application to install a private color\nmap on an 8-bit display"), 0},
-   { "ncols <count>", I18N_NOOP("Limits the number of colors allocated in the color\ncube on an 8-bit display, if the application is\nusing the TQApplication::ManyColor color\nspecification"), 0},
-   { "nograb", I18N_NOOP("tells TQt to never grab the mouse or the keyboard"), 0},
-   { "dograb", I18N_NOOP("running under a debugger can cause an implicit\n-nograb, use -dograb to override"), 0},
-   { "sync", I18N_NOOP("switches to synchronous mode for debugging"), 0},
-   { "fn", 0, 0},
-   { "font <fontname>", I18N_NOOP("defines the application font"), 0},
-   { "bg", 0, 0},
-   { "background <color>", I18N_NOOP("sets the default background color and an\napplication palette (light and dark shades are\ncalculated)"), 0},
-   { "fg", 0, 0},
-   { "foreground <color>", I18N_NOOP("sets the default foreground color"), 0},
-   { "btn", 0, 0},
-   { "button <color>", I18N_NOOP("sets the default button color"), 0},
-   { "name <name>", I18N_NOOP("sets the application name"), 0},
-   { "title <title>", I18N_NOOP("sets the application title (caption)"), 0},
+   { "session <sessionId>", I18N_NOOP("Restore the application for the given 'sessionId'"), nullptr},
+   { "cmap", I18N_NOOP("Causes the application to install a private color\nmap on an 8-bit display"), nullptr},
+   { "ncols <count>", I18N_NOOP("Limits the number of colors allocated in the color\ncube on an 8-bit display, if the application is\nusing the TQApplication::ManyColor color\nspecification"), nullptr},
+   { "nograb", I18N_NOOP("tells TQt to never grab the mouse or the keyboard"), nullptr},
+   { "dograb", I18N_NOOP("running under a debugger can cause an implicit\n-nograb, use -dograb to override"), nullptr},
+   { "sync", I18N_NOOP("switches to synchronous mode for debugging"), nullptr},
+   { "fn", nullptr, nullptr},
+   { "font <fontname>", I18N_NOOP("defines the application font"), nullptr},
+   { "bg", nullptr, nullptr},
+   { "background <color>", I18N_NOOP("sets the default background color and an\napplication palette (light and dark shades are\ncalculated)"), nullptr},
+   { "fg", nullptr, nullptr},
+   { "foreground <color>", I18N_NOOP("sets the default foreground color"), nullptr},
+   { "btn", nullptr, nullptr},
+   { "button <color>", I18N_NOOP("sets the default button color"), nullptr},
+   { "name <name>", I18N_NOOP("sets the application name"), nullptr},
+   { "title <title>", I18N_NOOP("sets the application title (caption)"), nullptr},
 #ifdef TQ_WS_X11
-   { "visual TrueColor", I18N_NOOP("forces the application to use a TrueColor visual on\nan 8-bit display"), 0},
-   { "inputstyle <inputstyle>", I18N_NOOP("sets XIM (X Input Method) input style. Possible\nvalues are onthespot, overthespot, offthespot and\nroot"), 0 },
-   { "im <XIM server>", I18N_NOOP("set XIM server"),0},
-   { "noxim", I18N_NOOP("disable XIM"), 0 },
+   { "visual TrueColor", I18N_NOOP("forces the application to use a TrueColor visual on\nan 8-bit display"), nullptr},
+   { "inputstyle <inputstyle>", I18N_NOOP("sets XIM (X Input Method) input style. Possible\nvalues are onthespot, overthespot, offthespot and\nroot"), nullptr },
+   { "im <XIM server>", I18N_NOOP("set XIM server"),nullptr},
+   { "noxim", I18N_NOOP("disable XIM"), nullptr },
 #endif
 #ifdef TQ_WS_QWS
    { "qws", I18N_NOOP("forces the application to run as QWS Server"), 0},
 #endif
-   { "reverse", I18N_NOOP("mirrors the whole layout of widgets"), 0},
+   { "reverse", I18N_NOOP("mirrors the whole layout of widgets"), nullptr},
    TDECmdLineLastOption
 };
 
 static const TDECmdLineOptions kde_options[] =
 {
-   { "caption <caption>",       I18N_NOOP("Use 'caption' as name in the titlebar"), 0},
-   { "icon <icon>",             I18N_NOOP("Use 'icon' as the application icon"), 0},
-   { "miniicon <icon>",         I18N_NOOP("Use 'icon' as the icon in the titlebar"), 0},
-   { "config <filename>",       I18N_NOOP("Use alternative configuration file"), 0},
-   { "dcopserver <server>",     I18N_NOOP("Use the DCOP Server specified by 'server'"), 0},
-   { "nocrashhandler",          I18N_NOOP("Disable crash handler, to get core dumps"), 0},
-   { "waitforwm",          I18N_NOOP("Waits for a WM_NET compatible windowmanager"), 0},
-   { "style <style>", I18N_NOOP("sets the application GUI style"), 0},
-   { "geometry <geometry>", I18N_NOOP("sets the client geometry of the main widget - see man X for the argument format"), 0},
-   { "smkey <sessionKey>", 0, 0}, // this option is obsolete and exists only to allow smooth upgrades from sessions
+   { "caption <caption>",       I18N_NOOP("Use 'caption' as name in the titlebar"), nullptr},
+   { "icon <icon>",             I18N_NOOP("Use 'icon' as the application icon"), nullptr},
+   { "miniicon <icon>",         I18N_NOOP("Use 'icon' as the icon in the titlebar"), nullptr},
+   { "config <filename>",       I18N_NOOP("Use alternative configuration file"), nullptr},
+   { "dcopserver <server>",     I18N_NOOP("Use the DCOP Server specified by 'server'"), nullptr},
+   { "nocrashhandler",          I18N_NOOP("Disable crash handler, to get core dumps"), nullptr},
+   { "waitforwm",          I18N_NOOP("Waits for a WM_NET compatible windowmanager"), nullptr},
+   { "style <style>", I18N_NOOP("sets the application GUI style"), nullptr},
+   { "geometry <geometry>", I18N_NOOP("sets the client geometry of the main widget - see man X for the argument format"), nullptr},
+   { "smkey <sessionKey>", nullptr, nullptr}, // this option is obsolete and exists only to allow smooth upgrades from sessions
                                   // saved under Qt 3.0.x -- Qt 3.1.x includes the session key now automatically in
 				  // the session id (Simon)
    TDECmdLineLastOption
@@ -1769,12 +1769,12 @@ void TDEApplication::parseCommandLine( )
        }
     }
 
-    bool nocrashhandler = (getenv("TDE_DEBUG") != NULL);
+    bool nocrashhandler = (getenv("TDE_DEBUG") != nullptr);
     if (!nocrashhandler && args->isSet("crashhandler"))
     {
         // set default crash handler / set emergency save function to nothing
         TDECrash::setCrashHandler(TDECrash::defaultCrashHandler);
-        TDECrash::setEmergencySaveFunction(NULL);
+        TDECrash::setEmergencySaveFunction(nullptr);
 
         TDECrash::setApplicationName(TQString(args->appName()));
     }
@@ -1855,9 +1855,9 @@ extern void kDebugCleanup();
 TDEApplication::~TDEApplication()
 {
   delete aIconPixmap.pm.miniIcon;
-  aIconPixmap.pm.miniIcon = 0L;
+  aIconPixmap.pm.miniIcon = nullptr;
   delete aIconPixmap.pm.icon;
-  aIconPixmap.pm.icon = 0L;
+  aIconPixmap.pm.icon = nullptr;
   delete d->m_TDEAppDCOPInterface;
 
   // First call the static deleters and then call KLibLoader::cleanup()
@@ -1875,11 +1875,11 @@ TDEApplication::~TDEApplication()
   TDEProcessController::deref();
 
 #ifdef TQ_WS_X11
-  if ( d->oldXErrorHandler != NULL )
+  if ( d->oldXErrorHandler )
       XSetErrorHandler( d->oldXErrorHandler );
-  if ( d->oldXIOErrorHandler != NULL )
+  if ( d->oldXIOErrorHandler )
       XSetIOErrorHandler( d->oldXIOErrorHandler );
-  if ( d->oldIceIOErrorHandler != NULL )
+  if ( d->oldIceIOErrorHandler )
       IceSetIOErrorHandler( d->oldIceIOErrorHandler );
 #endif
 
@@ -1887,14 +1887,14 @@ TDEApplication::~TDEApplication()
   TDEApp = nullptr;
 
 #ifdef TQ_WS_X11
-  mySmcConnection = 0;
+  mySmcConnection = nullptr;
   delete smModificationTime;
-  smModificationTime = 0;
+  smModificationTime = nullptr;
 
   // close the temporary smc connection
   if (tmpSmcConnection) {
-      SmcCloseConnection( tmpSmcConnection, 0, 0 );
-      tmpSmcConnection = 0;
+      SmcCloseConnection( tmpSmcConnection, 0, nullptr );
+      tmpSmcConnection = nullptr;
   }
 #else
   // FIXME(E): Implement for Qt Embedded
@@ -1936,7 +1936,7 @@ bool TDEApplication::isCompositionManagerAvailable() {
 	}
 
 	free(filename);
-	filename = NULL;
+	filename = nullptr;
 
 	return have_manager;
 }
@@ -1949,7 +1949,7 @@ bool TDEApplication::detectCompositionManagerAvailable(bool force_available, boo
 	else {
 		// See if compositing has been enabled
 		TDECmdLineArgs *qtargs = TDECmdLineArgs::parsedArgs("qt");
-		char *displayname = 0;
+		char *displayname = nullptr;
 		if ( qtargs->isSet("display"))
 			displayname = qtargs->getOption( "display" ).data();
 
@@ -1959,7 +1959,7 @@ bool TDEApplication::detectCompositionManagerAvailable(bool force_available, boo
 		compositing_manager_available = false;
 		XSetErrorHandler(x11_error);
 		if (!XQueryExtension (dpy, COMPOSITE_NAME, &composite_opcode, &composite_event, &composite_error)) {
-			XSetErrorHandler(NULL);
+			XSetErrorHandler(nullptr);
 			compositing_manager_available = false;
 		}
 		else {
@@ -1974,7 +1974,7 @@ bool TDEApplication::detectCompositionManagerAvailable(bool force_available, boo
 					XCompositeUnredirectSubwindows(dpy, root_window, CompositeRedirectManual);
 					compositing_manager_available = false;
 				}
-				XSetErrorHandler(NULL);
+				XSetErrorHandler(nullptr);
 				XCloseDisplay(dpy);
 			}
 			else {
@@ -2012,14 +2012,14 @@ bool TDEApplication::detectCompositionManagerAvailable(bool force_available, boo
 	}
 
 	free(filename);
-	filename = NULL;
+	filename = nullptr;
 
 	return compositing_manager_available;
 }
 
 Display* TDEApplication::openX11RGBADisplay() {
 	TDECmdLineArgs *qtargs = TDECmdLineArgs::parsedArgs("qt");
-	char *display = 0;
+	char *display = nullptr;
 	if ( qtargs->isSet("display"))
 		display = qtargs->getOption( "display" ).data();
 
@@ -2038,7 +2038,7 @@ TQt::HANDLE TDEApplication::getX11RGBAVisual(Display *dpy) {
 		return argb_x11_visual;
 	}
 	else {
-		return (TQt::HANDLE)NULL;
+		return (TQt::HANDLE)nullptr;
 	}
 }
 
@@ -2048,7 +2048,7 @@ TQt::HANDLE TDEApplication::getX11RGBAColormap(Display *dpy) {
 		return argb_x11_colormap;
 	}
 	else {
-		return (TQt::HANDLE)NULL;
+		return (TQt::HANDLE)nullptr;
 	}
 }
 
@@ -2064,7 +2064,7 @@ void TDEApplication::getX11RGBAInformation(Display *dpy) {
 
 	int screen = DefaultScreen( dpy );
 	Colormap colormap = 0;
-	Visual *visual = 0;
+	Visual *visual = nullptr;
 	int event_base, error_base;
 	
 	if ( XRenderQueryExtension( dpy, &event_base, &error_base ) ) {
@@ -2135,7 +2135,7 @@ bool TDEApplication::detectCompositionManagerAvailable(bool force_available, boo
 	}
 
 	free(filename);
-	filename = NULL;
+	filename = nullptr;
 
 	return false;
 }
@@ -2317,7 +2317,7 @@ void TDEApplication::invokeEditSlot( const char *slot )
   if( idx < 0 )
     return;
 
-  object->tqt_invoke( idx, 0 );
+  object->tqt_invoke( idx, nullptr );
 }
 
 void TDEApplication::addKipcEventMask(int id)
@@ -2676,7 +2676,7 @@ void TDEApplication::invokeHelp( const TQString& anchor,
    TQString error;
    if ( !dcopClient()->isApplicationRegistered("khelpcenter") )
    {
-       if (startServiceByDesktopName("khelpcenter", url, &error, 0, 0, startup_id, false))
+       if (startServiceByDesktopName("khelpcenter", url, &error, nullptr, nullptr, startup_id, false))
        {
            if (Tty != tdeApp->type())
                TQMessageBox::critical(tdeApp->mainWidget(), i18n("Could not Launch Help Center"),
@@ -2711,7 +2711,7 @@ void TDEApplication::invokeHTMLHelp( const TQString& _filename, const TQString&
    TQString error;
    if ( !dcopClient()->isApplicationRegistered("khelpcenter") )
    {
-       if (startServiceByDesktopName("khelpcenter", url, &error, 0, 0, "", false))
+       if (startServiceByDesktopName("khelpcenter", url, &error, nullptr, nullptr, "", false))
        {
            if (Tty != tdeApp->type())
                TQMessageBox::critical(tdeApp->mainWidget(), i18n("Could not Launch Help Center"),
@@ -2983,7 +2983,7 @@ void TDEApplication::invokeMailer(const TQString &_to, const TQString &_cc, cons
    TQString error;
    // TODO this should check if cmd has a .desktop file, and use data from it, together
    // with sending more ASN data
-   if (tdeinitExec(cmd, cmdTokens, &error, NULL, startup_id )) {
+   if (tdeinitExec(cmd, cmdTokens, &error, nullptr, startup_id )) {
      if (Tty != tdeApp->type()) {
        TQMessageBox::critical(tdeApp->mainWidget(), i18n("Could not Launch Mail Client"),
              i18n("Could not launch the mail client:\n\n%1").arg(error), i18n("&OK"));
@@ -3007,7 +3007,7 @@ void TDEApplication::invokeBrowser( const TQString &url, const TQCString& startu
 {
    TQString error;
 
-   if (startServiceByDesktopName("kfmclient", url, &error, 0, 0, startup_id, false))
+   if (startServiceByDesktopName("kfmclient", url, &error, nullptr, nullptr, startup_id, false))
    {
       if (Tty != tdeApp->type())
           TQMessageBox::critical(tdeApp->mainWidget(), i18n("Could not Launch Browser"),
@@ -3213,7 +3213,7 @@ TDEApplication::tdeinitExec( const TQString& name, const TQStringList &args,
                            TQString *error, int *pid, const TQCString& startup_id )
 {
    return startServiceInternal("tdeinit_exec(TQString,TQStringList,TQValueList<TQCString>,TQCString)",
-        name, args, error, 0, pid, startup_id, false);
+        name, args, error, nullptr, pid, startup_id, false);
 }
 
 int
@@ -3228,7 +3228,7 @@ TDEApplication::tdeinitExecWait( const TQString& name, const TQStringList &args,
                            TQString *error, int *pid, const TQCString& startup_id )
 {
    return startServiceInternal("tdeinit_exec_wait(TQString,TQStringList,TQValueList<TQCString>,TQCString)",
-        name, args, error, 0, pid, startup_id, false);
+        name, args, error, nullptr, pid, startup_id, false);
 }
 
 TQString TDEApplication::tempSaveName( const TQString& pFilename ) const
@@ -3402,7 +3402,7 @@ int TDEApplication::random()
       {
             // No /dev/urandom... try something else.
             srand(getpid());
-            seed = rand()+time(0);
+            seed = rand()+time(nullptr);
       }
       if (fd >= 0) close(fd);
       srand(seed);
@@ -3698,7 +3698,7 @@ void TDEApplication::installSigpipeHandler()
     act.sa_handler = SIG_IGN;
     sigemptyset( &act.sa_mask );
     act.sa_flags = 0;
-    sigaction( SIGPIPE, &act, 0 );
+    sigaction( SIGPIPE, &act, nullptr );
 #endif
 }
 
diff --git a/tdecore/tdeapplication.h b/tdecore/tdeapplication.h
index 171ae2eec..930d6fd1c 100644
--- a/tdecore/tdeapplication.h
+++ b/tdecore/tdeapplication.h
@@ -715,7 +715,7 @@ public:
    * @return an error code indicating success (== 0) or failure (> 0).
    */
   static int startServiceByName( const TQString& _name, const TQString &URL,
-                TQString *error=0, TQCString *dcopService=0, int *pid=0, const TQCString &startup_id = "", bool noWait = false );
+                TQString *error=nullptr, TQCString *dcopService=nullptr, int *pid=nullptr, const TQCString &startup_id = "", bool noWait = false );
 
   /**
    * Starts a service based on the (translated) name of the service.
@@ -738,7 +738,7 @@ public:
    * @return an error code indicating success (== 0) or failure (> 0).
    */
   static int startServiceByName( const TQString& _name, const TQStringList &URLs=TQStringList(),
-                TQString *error=0, TQCString *dcopService=0, int *pid=0, const TQCString &startup_id = "", bool noWait = false );
+                TQString *error=nullptr, TQCString *dcopService=nullptr, int *pid=nullptr, const TQCString &startup_id = "", bool noWait = false );
 
   /**
    * Starts a service based on the desktop path of the service.
@@ -761,7 +761,7 @@ public:
    * @return an error code indicating success (== 0) or failure (> 0).
    */
   static int startServiceByDesktopPath( const TQString& _name, const TQString &URL,
-                TQString *error=0, TQCString *dcopService=0, int *pid = 0, const TQCString &startup_id = "", bool noWait = false );
+                TQString *error=nullptr, TQCString *dcopService=nullptr, int *pid = nullptr, const TQCString &startup_id = "", bool noWait = false );
 
   /**
    * Starts a service based on the desktop path of the service.
@@ -784,7 +784,7 @@ public:
    * @return an error code indicating success (== 0) or failure (> 0).
    */
   static int startServiceByDesktopPath( const TQString& _name, const TQStringList &URLs=TQStringList(),
-                TQString *error=0, TQCString *dcopService=0, int *pid = 0, const TQCString &startup_id = "", bool noWait = false );
+                TQString *error=nullptr, TQCString *dcopService=nullptr, int *pid = nullptr, const TQCString &startup_id = "", bool noWait = false );
 
   /**
    * Starts a service based on the desktop name of the service.
@@ -807,7 +807,7 @@ public:
    * @return an error code indicating success (== 0) or failure (> 0).
    */
   static int startServiceByDesktopName( const TQString& _name, const TQString &URL,
-                TQString *error=0, TQCString *dcopService=0, int *pid = 0, const TQCString &startup_id = "", bool noWait = false );
+                TQString *error=nullptr, TQCString *dcopService=nullptr, int *pid = nullptr, const TQCString &startup_id = "", bool noWait = false );
 
   /**
    * Starts a service based on the desktop name of the service.
@@ -830,7 +830,7 @@ public:
    * @return an error code indicating success (== 0) or failure (> 0).
    */
   static int startServiceByDesktopName( const TQString& _name, const TQStringList &URLs=TQStringList(),
-                TQString *error=0, TQCString *dcopService=0, int *pid = 0, const TQCString &startup_id = "", bool noWait = false );
+                TQString *error=nullptr, TQCString *dcopService=nullptr, int *pid = nullptr, const TQCString &startup_id = "", bool noWait = false );
 
   /**
    * Starts a program via tdeinit.
@@ -853,7 +853,7 @@ public:
                 TQString *error, int *pid, const TQCString& startup_id );
   // KDE4 merge with above with startup_id = ""
   static int tdeinitExec( const TQString& name, const TQStringList &args=TQStringList(),
-                TQString *error=0, int *pid = 0 );
+                TQString *error=nullptr, int *pid = nullptr );
 
   /**
    * Starts a program via tdeinit and wait for it to finish.
@@ -876,7 +876,7 @@ public:
                 TQString *error, int *pid, const TQCString& startup_id );
   // KDE4 merge with above with startup_id = ""
   static int tdeinitExecWait( const TQString& name, const TQStringList &args=TQStringList(),
-                TQString *error=0, int *pid = 0 );
+                TQString *error=nullptr, int *pid = nullptr );
 
   /**
    * Returns a text for the window caption.
@@ -891,7 +891,7 @@ public:
   /**
    * @deprecated
    */
-  TDE_DEPRECATED TDEStyle* tdestyle() const { return 0; }
+  TDE_DEPRECATED TDEStyle* tdestyle() const { return nullptr; }
 
   /**
    * Builds a caption that contains the application name along with the
diff --git a/tdecore/tdecmdlineargs.cpp b/tdecore/tdecmdlineargs.cpp
index af28d0057..6df4505ec 100644
--- a/tdecore/tdecmdlineargs.cpp
+++ b/tdecore/tdecmdlineargs.cpp
@@ -110,12 +110,12 @@ public:
    TDECmdLineArgsList() { }
 };
 
-TDECmdLineArgsList *TDECmdLineArgs::argsList = 0;
+TDECmdLineArgsList *TDECmdLineArgs::argsList = nullptr;
 int TDECmdLineArgs::argc = 0;
-char **TDECmdLineArgs::argv = 0;
-char *TDECmdLineArgs::mCwd = 0;
+char **TDECmdLineArgs::argv = nullptr;
+char *TDECmdLineArgs::mCwd = nullptr;
 static KStaticDeleter <char> mCwdd;
-const TDEAboutData *TDECmdLineArgs::about = 0;
+const TDEAboutData *TDECmdLineArgs::about = nullptr;
 bool TDECmdLineArgs::parsed = false;
 bool TDECmdLineArgs::ignoreUnknown = false;
 
@@ -198,7 +198,7 @@ TQString TDECmdLineArgs::cwd()
 
 const char * TDECmdLineArgs::appName()
 {
-   if (!argc) return 0;
+   if (!argc) return nullptr;
    return argv[0];
 }
 
@@ -309,7 +309,7 @@ TDECmdLineArgs::loadAppArgs( TQDataStream &ds)
 
 TDECmdLineArgs *TDECmdLineArgs::parsedArgs(const char *id)
 {
-   TDECmdLineArgs *args = argsList ? argsList->first() : 0;
+   TDECmdLineArgs *args = argsList ? argsList->first() : nullptr;
    while(args)
    {
       if ((id && ::qstrcmp(args->id, id) == 0) || (!id && !args->id))
@@ -326,7 +326,7 @@ TDECmdLineArgs *TDECmdLineArgs::parsedArgs(const char *id)
 
 void TDECmdLineArgs::removeArgs(const char *id)
 {
-   TDECmdLineArgs *args = argsList ? argsList->first() : 0;
+   TDECmdLineArgs *args = argsList ? argsList->first() : nullptr;
    while(args)
    {
       if (args->id && id && ::qstrcmp(args->id, id) == 0)
@@ -488,7 +488,7 @@ TDECmdLineArgs::findOption(const char *_opt, TQCString opt, int &i, bool _enable
          }
          break; // Unknown argument
       }
-      args = 0;
+      args = nullptr;
       result = 0;
    }
 
@@ -584,7 +584,7 @@ TDECmdLineArgs::parseAllArgs()
          }
          if (::qstrcmp(option, "help") == 0)
          {
-            usage(0);
+            usage(nullptr);
          }
          else if (strncmp(option, "help-",5) == 0)
          {
@@ -715,7 +715,7 @@ TDECmdLineArgs::tqt_argv()
       TDEApplication::addCmdLineOptions(); // Lazy bastards!
 
    static char** tqt_argv;
-   if( tqt_argv != NULL )
+   if( tqt_argv )
       return &tqt_argv;
 
    TDECmdLineArgs *args = parsedArgs("qt");
@@ -736,7 +736,7 @@ TDECmdLineArgs::tqt_argv()
    {
       tqt_argv[i+1] = tqstrdup((char *) args->arg(i));
    }
-   tqt_argv[i+1] = 0;
+   tqt_argv[i+1] = nullptr;
 
    return &tqt_argv;
 }
@@ -774,7 +774,7 @@ void
 TDECmdLineArgs::usage(const char *id)
 {
    enable_i18n();
-   assert(argsList != 0); // It's an error to call usage(...) without
+   assert(argsList); // It's an error to call usage(...) without
                           // having done addCmdLineOptions first!
 
    TQString optionFormatString   = "  %1 %2\n";
@@ -992,8 +992,8 @@ TDECmdLineArgs::TDECmdLineArgs( const TDECmdLineOptions *_options,
                             const char *_name, const char *_id)
   : options(_options), name(_name), id(_id)
 {
-  parsedOptionList = 0;
-  parsedArgList = 0;
+  parsedOptionList = nullptr;
+  parsedArgList = nullptr;
   isQt = (::qstrcmp(id, "qt") == 0);
 }
 
@@ -1012,9 +1012,9 @@ void
 TDECmdLineArgs::clear()
 {
    delete parsedArgList;
-   parsedArgList = 0;
+   parsedArgList = nullptr;
    delete parsedOptionList;
-   parsedOptionList = 0;
+   parsedOptionList = nullptr;
 }
 
 void
@@ -1024,7 +1024,7 @@ TDECmdLineArgs::reset()
       argsList->setAutoDelete( true );
       argsList->clear();
       delete argsList;
-      argsList = 0;
+      argsList = nullptr;
    }
    parsed = false;
 }
@@ -1056,12 +1056,12 @@ TDECmdLineArgs::load( TQDataStream &ds)
    if (parsedOptionList->count() == 0)
    {
       delete parsedOptionList;
-      parsedOptionList = 0;
+      parsedOptionList = nullptr;
    }
    if (parsedArgList->count() == 0)
    {
       delete parsedArgList;
-      parsedArgList = 0;
+      parsedArgList = nullptr;
    }
 }
 
@@ -1118,7 +1118,7 @@ TDECmdLineArgs::setOption(const TQCString &opt, const char *value)
 TQCString
 TDECmdLineArgs::getOption(const char *_opt) const
 {
-   TQCString *value = 0;
+   TQCString *value = nullptr;
    if (parsedOptionList)
    {
       value = parsedOptionList->find(_opt);
@@ -1198,7 +1198,7 @@ TDECmdLineArgs::isSet(const char *_opt) const
       exit(255);
    }
 
-   TQCString *value = 0;
+   TQCString *value = nullptr;
    if (parsedOptionList)
    {
       value = parsedOptionList->find(opt);
@@ -1281,7 +1281,7 @@ TDECmdLineArgs::addArgument(const char *argument)
 
 static const TDECmdLineOptions kde_tempfile_option[] =
 {
-   { "tempfile",       I18N_NOOP("The files/URLs opened by the application will be deleted after use"), 0},
+   { "tempfile",       I18N_NOOP("The files/URLs opened by the application will be deleted after use"), nullptr},
    TDECmdLineLastOption
 };
 
diff --git a/tdecore/tdecmdlineargs.h b/tdecore/tdecmdlineargs.h
index c494c206f..7ebe33902 100644
--- a/tdecore/tdecmdlineargs.h
+++ b/tdecore/tdecmdlineargs.h
@@ -65,7 +65,7 @@ struct TDECORE_EXPORT TDECmdLineOptions
    const char *def; // Default
 };
 
-#define TDECmdLineLastOption { 0, 0, 0 }
+#define TDECmdLineLastOption { nullptr, nullptr, nullptr }
 
 class TDECmdLineArgsList;
 class TDEApplication;
@@ -355,8 +355,8 @@ public:
    * @param afterId The options are inserted after this set of options, can be 0.
    */
   static void addCmdLineOptions( const TDECmdLineOptions *options,
-				 const char *name=0, const char *id = 0,
-				 const char *afterId=0);
+				 const char *name=nullptr, const char *id = nullptr,
+				 const char *afterId=nullptr);
 
   /**
    * Access parsed arguments.
@@ -367,7 +367,7 @@ public:
    *
    * @param id The name of the options you are interested in, can be 0.
    */
-  static TDECmdLineArgs *parsedArgs(const char *id=0);
+  static TDECmdLineArgs *parsedArgs(const char *id=nullptr);
 
   /**
    * Get the CWD (Current Working Directory) associated with the
@@ -393,7 +393,7 @@ public:
    *        option specified by id. The id is the value set by
    *        addCmdLineOptions().
    **/
-  static void usage(const char *id = 0);
+  static void usage(const char *id = nullptr);
 
   /**
    * Print an error to stderr and the usage help to stdout and exit.
diff --git a/tdecore/tdeconfig.cpp b/tdecore/tdeconfig.cpp
index 4f67d5681..22f02110b 100644
--- a/tdecore/tdeconfig.cpp
+++ b/tdecore/tdeconfig.cpp
@@ -280,7 +280,7 @@ void TDEConfig::setFileWriteMode(int mode)
 TDELockFile::Ptr TDEConfig::lockFile(bool bGlobal)
 {
   TDEConfigINIBackEnd *aBackEnd = dynamic_cast<TDEConfigINIBackEnd*>(backEnd);
-  if (!aBackEnd) return 0;
+  if (!aBackEnd) return nullptr;
   return aBackEnd->lockFile(bGlobal);
 }
 
@@ -329,7 +329,7 @@ void TDEConfig::virtual_hook( int id, void* data )
 { TDEConfigBase::virtual_hook( id, data ); }
 
 static KStaticDeleter< TQValueList<TDESharedConfig*> > sd;
-TQValueList<TDESharedConfig*> *TDESharedConfig::s_list = 0;
+TQValueList<TDESharedConfig*> *TDESharedConfig::s_list = nullptr;
 
 TDESharedConfig::Ptr TDESharedConfig::openConfig(const TQString& fileName, bool readOnly, bool useKDEGlobals )
 {
diff --git a/tdecore/tdeconfig.h b/tdecore/tdeconfig.h
index 7d535e38b..60036bb8f 100644
--- a/tdecore/tdeconfig.h
+++ b/tdecore/tdeconfig.h
@@ -162,7 +162,7 @@ public:
    * @param config optional config object to reuse
    * @since 3.2
    */
-  TDEConfig* copyTo(const TQString &file, TDEConfig *config=0) const;
+  TDEConfig* copyTo(const TQString &file, TDEConfig *config=nullptr) const;
 
   /**
    * Returns a lock file object for the configuration file or 0 if
diff --git a/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp b/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp
index a4f4bc9c0..50342a706 100644
--- a/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp
+++ b/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp
@@ -40,10 +40,10 @@
 
 static const TDECmdLineOptions options[] =
 {
-  { "d", 0, 0 },
+  { "d", nullptr, nullptr },
   { "directory <dir>", I18N_NOOP("Directory to generate files in"), "." },
-  { "+file.kcfg", I18N_NOOP("Input kcfg XML file"), 0 },
-  { "+file.kcfgc", I18N_NOOP("Code generation options file"), 0 },
+  { "+file.kcfg", I18N_NOOP("Input kcfg XML file"), nullptr },
+  { "+file.kcfgc", I18N_NOOP("Code generation options file"), nullptr },
   TDECmdLineLastOption
 };
 
@@ -389,11 +389,11 @@ CfgEntry *parseEntry( const TQString &group, const TQDomElement &element )
       paramType = e.attribute( "type" );
       if ( param.isEmpty() ) {
         kdError() << "Parameter must have a name: " << dumpNode(e) << endl;
-        return 0;
+        return nullptr;
       }
       if ( paramType.isEmpty() ) {
         kdError() << "Parameter must have a type: " << dumpNode(e) << endl;
-        return 0;
+        return nullptr;
       }
       if ((paramType == "Int") || (paramType == "UInt"))
       {
@@ -402,7 +402,7 @@ CfgEntry *parseEntry( const TQString &group, const TQDomElement &element )
          if (!ok)
          {
            kdError() << "Integer parameter must have a maximum (e.g. max=\"0\"): " << dumpNode(e) << endl;
-           return 0;
+           return nullptr;
          }
       }
       else if (paramType == "Enum")
@@ -426,14 +426,14 @@ CfgEntry *parseEntry( const TQString &group, const TQDomElement &element )
          if (paramValues.isEmpty())
          {
            kdError() << "No values specified for parameter '" << param << "'." << endl;
-           return 0;
+           return nullptr;
          }
          paramMax = paramValues.count()-1;
       }
       else
       {
         kdError() << "Parameter '" << param << "' has type " << paramType << " but must be of type int, uint or Enum." << endl;
-        return 0;
+        return nullptr;
       }
     }
     else if ( tag == "default" )
@@ -470,7 +470,7 @@ CfgEntry *parseEntry( const TQString &group, const TQDomElement &element )
   bool nameIsEmpty = name.isEmpty();
   if ( nameIsEmpty && key.isEmpty() ) {
     kdError() << "Entry must have a name or a key: " << dumpNode(element) << endl;
-    return 0;
+    return nullptr;
   }
 
   if ( key.isEmpty() ) {
@@ -490,7 +490,7 @@ CfgEntry *parseEntry( const TQString &group, const TQDomElement &element )
     if (param.isEmpty())
     {
       kdError() << "Name may not be parameterized: " << name << endl;
-      return 0;
+      return nullptr;
     }
   }
   else
@@ -498,7 +498,7 @@ CfgEntry *parseEntry( const TQString &group, const TQDomElement &element )
     if (!param.isEmpty())
     {
       kdError() << "Name must contain '$(" << param << ")': " << name << endl;
-      return 0;
+      return nullptr;
     }
   }
 
@@ -537,14 +537,14 @@ CfgEntry *parseEntry( const TQString &group, const TQDomElement &element )
           if (i == -1)
           {
             kdError() << "Index '" << index << "' for default value is unknown." << endl;
-            return 0;
+            return nullptr;
           }
         }
 
         if ((i < 0) || (i > paramMax))
         {
           kdError() << "Index '" << i << "' for default value is out of range [0, "<< paramMax<<"]." << endl;
-          return 0;
+          return nullptr;
         }
 
         TQString tmpDefaultValue = e.text();
@@ -564,7 +564,7 @@ CfgEntry *parseEntry( const TQString &group, const TQDomElement &element )
                    "it is not a valid name. You need to specify a valid name for this entry." << endl;
     else
       kdError() << "The name '" << name << "' is not a valid name for an entry." << endl;
-    return 0;
+    return nullptr;
   }
 
   if (allNames.contains(name))
@@ -574,7 +574,7 @@ CfgEntry *parseEntry( const TQString &group, const TQDomElement &element )
                    "it does not result in a unique name. You need to specify a unique name for this entry." << endl;
     else
       kdError() << "The name '" << name << "' is not unique." << endl;
-    return 0;
+    return nullptr;
   }
   allNames.append(name);
 
@@ -953,9 +953,9 @@ int main( int argc, char **argv )
 {
   TDEAboutData aboutData( "tdeconfig_compiler", I18N_NOOP("TDE .kcfg compiler"), "0.3",
     I18N_NOOP("TDEConfig Compiler") , TDEAboutData::License_LGPL );
-  aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" );
-  aboutData.addAuthor( "Waldo Bastian", 0, "bastian@kde.org" );
-  aboutData.addAuthor( "Zack Rusin", 0, "zack@kde.org" );
+  aboutData.addAuthor( "Cornelius Schumacher", nullptr, "schumacher@kde.org" );
+  aboutData.addAuthor( "Waldo Bastian", nullptr, "bastian@kde.org" );
+  aboutData.addAuthor( "Zack Rusin", nullptr, "zack@kde.org" );
   aboutData.addCredit( "Reinhold Kainhofer", "Fix for parametrized entries",
       "reinhold@kainhofer.com", "http://reinhold.kainhofer.com" );
   aboutData.addCredit( "Duncan Mac-Vicar P.", "dpointer support",
diff --git a/tdecore/tdeconfig_compiler/tests/tdeconfigcompiler_test.cpp b/tdecore/tdeconfig_compiler/tests/tdeconfigcompiler_test.cpp
index 158d008a0..70395d156 100644
--- a/tdecore/tdeconfig_compiler/tests/tdeconfigcompiler_test.cpp
+++ b/tdecore/tdeconfig_compiler/tests/tdeconfigcompiler_test.cpp
@@ -39,14 +39,14 @@ static CompilerTestSet testCases =
 	"test8b.cpp", "test8b.h",
 	"test9.h", "test9.cpp", 
 	"test_dpointer.cpp", "test_dpointer.h",	 
-	NULL
+	nullptr
 };
 
 static CompilerTestSet willFailCases =
 {
 	// where is that TQDir comming from?
 	//"test9.cpp", NULL
-	NULL
+	nullptr
 };
 
 
diff --git a/tdecore/tdeconfigbackend.cpp b/tdecore/tdeconfigbackend.cpp
index c7944ed12..6b47a24db 100644
--- a/tdecore/tdeconfigbackend.cpp
+++ b/tdecore/tdeconfigbackend.cpp
@@ -266,8 +266,8 @@ void TDEConfigBackEnd::changeFileName(const TQString &_fileName,
 
    d->localLastModified = TQDateTime();
    d->localLastSize = 0;
-   d->localLockFile = 0;
-   d->globalLockFile = 0;
+   d->localLockFile = nullptr;
+   d->globalLockFile = nullptr;
 }
 
 TDELockFile::Ptr TDEConfigBackEnd::lockFile(bool bGlobal)
@@ -294,7 +294,7 @@ TDELockFile::Ptr TDEConfigBackEnd::lockFile(bool bGlobal)
          return d->localLockFile;
       }
    }
-   return 0;
+   return nullptr;
 }
 
 TDEConfigBackEnd::TDEConfigBackEnd(TDEConfigBase *_config,
@@ -372,7 +372,7 @@ bool TDEConfigINIBackEnd::parseConfigFiles()
       TQFile aConfigFile( *it );
       if (!aConfigFile.open( IO_ReadOnly ))
 	   continue;
-      parseSingleConfigFile( aConfigFile, 0L, true, (*it != mGlobalFileName) );
+      parseSingleConfigFile( aConfigFile, nullptr, true, (*it != mGlobalFileName) );
       aConfigFile.close();
       if (bFileImmutable)
          break;
@@ -404,7 +404,7 @@ bool TDEConfigINIBackEnd::parseConfigFiles()
       // we can already be sure that this file exists
       bool bIsLocal = (*it == mLocalFileName);
       if (aConfigFile.open( IO_ReadOnly )) {
-         parseSingleConfigFile( aConfigFile, 0L, false, !bIsLocal );
+         parseSingleConfigFile( aConfigFile, nullptr, false, !bIsLocal );
          aConfigFile.close();
          if (bFileImmutable)
             break;
@@ -549,7 +549,7 @@ void TDEConfigINIBackEnd::parseSingleConfigFile(TQFile &rFile,
       bool optionImmutable = groupOptionImmutable;
       bool optionDeleted = false;
       bool optionExpand = false;
-      const char *endOfKey = 0, *locale = 0, *elocale = 0;
+      const char *endOfKey = nullptr, *locale = nullptr, *elocale = nullptr;
       for (; (s < eof) && (*s != '\n'); s++)
       {
          if (*s == '=') //find the equal sign
@@ -635,7 +635,7 @@ void TDEConfigINIBackEnd::parseSingleConfigFile(TQFile &rFile,
                       continue; // We just ignore it
                   // We just store it as is to be able to write it back later.
                   endOfKey = elocale;
-                  locale = 0;
+                  locale = nullptr;
               }
           }
       }
@@ -651,7 +651,7 @@ void TDEConfigINIBackEnd::parseSingleConfigFile(TQFile &rFile,
       }
 
       KEntryKey aEntryKey(aCurrentGroup, decodeKey(key));
-      aEntryKey.bLocal = (locale != 0);
+      aEntryKey.bLocal = (locale != nullptr);
       aEntryKey.bDefault = bDefault;
 
       KEntry aEntry;
@@ -660,7 +660,7 @@ void TDEConfigINIBackEnd::parseSingleConfigFile(TQFile &rFile,
       aEntry.bImmutable = optionImmutable;
       aEntry.bDeleted = optionDeleted;
       aEntry.bExpand = optionExpand;
-      aEntry.bNLS = (locale != 0);
+      aEntry.bNLS = (locale != nullptr);
 
       if (pWriteBackMap) {
          // don't insert into the config object but into the temporary
@@ -755,7 +755,7 @@ void TDEConfigINIBackEnd::sync(bool bMerge)
       {
          lf = lockFile(false); // Lock file for local file
          if (lf && lf->isLocked())
-            lf = 0; // Already locked, we don't need to lock/unlock again
+            lf = nullptr; // Already locked, we don't need to lock/unlock again
 
          if (lf) 
          {
@@ -807,7 +807,7 @@ void TDEConfigINIBackEnd::sync(bool bMerge)
     if (checkAccess ( mGlobalFileName, W_OK )) {
       TDELockFile::Ptr lf = lockFile(true); // Lock file for global file
       if (lf && lf->isLocked())
-         lf = 0; // Already locked, we don't need to lock/unlock again
+         lf = nullptr; // Already locked, we don't need to lock/unlock again
 
       if (lf) 
       {
@@ -972,7 +972,7 @@ bool TDEConfigINIBackEnd::writeConfigFile(TQString filename, bool bGlobal,
     return true; // pretend we wrote it
 
   KEntryMap aTempMap;
-  TQFile *mergeFile = (bMerge ? new TQFile(filename) : 0);
+  TQFile *mergeFile = (bMerge ? new TQFile(filename) : nullptr);
   bool bEntriesLeft = getEntryMap(aTempMap, bGlobal, mergeFile);
   delete mergeFile;
   if (bFileImmutable)
@@ -1001,8 +1001,8 @@ bool TDEConfigINIBackEnd::writeConfigFile(TQString filename, bool bGlobal,
      }
   }
 
-  KSaveFile *pConfigFile = 0;
-  FILE *pStream = 0;
+  KSaveFile *pConfigFile = nullptr;
+  FILE *pStream = nullptr;
 
   if (createNew)
   {
diff --git a/tdecore/tdeconfigbackend.h b/tdecore/tdeconfigbackend.h
index ab74f927f..9e3debbfe 100644
--- a/tdecore/tdeconfigbackend.h
+++ b/tdecore/tdeconfigbackend.h
@@ -248,7 +248,7 @@ protected:
    * @param bDefault Specifies whether entries should be marked as
    *        being default values.
    */
-  void parseSingleConfigFile(TQFile& rFile, KEntryMap *pWriteBackMap = 0L,
+  void parseSingleConfigFile(TQFile& rFile, KEntryMap *pWriteBackMap = nullptr,
 			     bool bGlobal = false, bool bDefault = false);
 
   // Kubuntu patch, 2006-08-03
diff --git a/tdecore/tdeconfigbase.cpp b/tdecore/tdeconfigbase.cpp
index 4487e9592..6bdcf0ce1 100644
--- a/tdecore/tdeconfigbase.cpp
+++ b/tdecore/tdeconfigbase.cpp
@@ -48,8 +48,8 @@ public:
 };
 
 TDEConfigBase::TDEConfigBase()
-  : backEnd(0L), bDirty(false), bLocaleInitialized(false),
-    bReadOnly(false), bExpand(false), d(0)
+  : backEnd(nullptr), bDirty(false), bLocaleInitialized(false),
+    bReadOnly(false), bExpand(false), d(nullptr)
 {
     setGroup(TQString::null);
 }
@@ -294,7 +294,7 @@ TQString TDEConfigBase::readEntry( const char *pKey,
                 nEndPos++;
             aVarName = aValue.mid( nDollarPos+1, nEndPos-nDollarPos-1 );
           }
-          const char *pEnv = 0;
+          const char *pEnv = nullptr;
           if (!aVarName.isEmpty())
                pEnv = getenv( aVarName.ascii() );
           if (pEnv) {
@@ -1254,7 +1254,7 @@ bool TDEConfigBase::deleteGroup( const TQString& group, bool bDeep, bool bGlobal
       (*aIt).bDeleted = true;
       (*aIt).bDirty = true;
       (*aIt).bGlobal = bGlobal;
-      (*aIt).mValue = 0;
+      (*aIt).mValue = nullptr;
       putData(aIt.key(), *aIt, checkGroup);
       checkGroup = false;
       dirty = true;
diff --git a/tdecore/tdeconfigbase.h b/tdecore/tdeconfigbase.h
index d05064e73..6c49592ad 100644
--- a/tdecore/tdeconfigbase.h
+++ b/tdecore/tdeconfigbase.h
@@ -540,7 +540,7 @@ public:
    * key was not found or if the read value cannot be interpreted.
    * @return The value for this key.
    */
-  TQFont readFontEntry( const TQString& pKey, const TQFont* pDefault = 0L ) const;
+  TQFont readFontEntry( const TQString& pKey, const TQFont* pDefault = nullptr ) const;
 
   /**
    * Reads a TQFont value.
@@ -553,7 +553,7 @@ public:
    * key was not found or if the read value cannot be interpreted.
    * @return The value for this key.
    */
-  TQFont readFontEntry( const char *pKey, const TQFont* pDefault = 0L ) const;
+  TQFont readFontEntry( const char *pKey, const TQFont* pDefault = nullptr ) const;
 
   /**
    * Reads a boolean entry.
@@ -592,7 +592,7 @@ public:
    * key was not found or if the read value cannot be interpreted.
    * @return The value for this key.
    */
-  TQRect readRectEntry( const TQString& pKey, const TQRect* pDefault = 0L ) const;
+  TQRect readRectEntry( const TQString& pKey, const TQRect* pDefault = nullptr ) const;
 
   /**
    * Reads a TQRect entry.
@@ -605,7 +605,7 @@ public:
    * key was not found or if the read value cannot be interpreted.
    * @return The value for this key.
    */
-  TQRect readRectEntry( const char *pKey, const TQRect* pDefault = 0L ) const;
+  TQRect readRectEntry( const char *pKey, const TQRect* pDefault = nullptr ) const;
 
   /**
    * Reads a TQPoint entry.
@@ -618,7 +618,7 @@ public:
    * key was not found or if the read value cannot be interpreted.
    * @return The value for this key.
    */
-  TQPoint readPointEntry( const TQString& pKey, const TQPoint* pDefault = 0L ) const;
+  TQPoint readPointEntry( const TQString& pKey, const TQPoint* pDefault = nullptr ) const;
 
   /**
    * Reads a TQPoint entry.
@@ -631,7 +631,7 @@ public:
    * key was not found or if the read value cannot be interpreted.
    * @return The value for this key.
    */
-  TQPoint readPointEntry( const char *pKey, const TQPoint* pDefault = 0L ) const;
+  TQPoint readPointEntry( const char *pKey, const TQPoint* pDefault = nullptr ) const;
 
   /**
    * Reads a TQSize entry.
@@ -644,7 +644,7 @@ public:
    * key was not found or if the read value cannot be interpreted.
    * @return The value for this key.
    */
-  TQSize readSizeEntry( const TQString& pKey, const TQSize* pDefault = 0L ) const;
+  TQSize readSizeEntry( const TQString& pKey, const TQSize* pDefault = nullptr ) const;
 
   /**
    * Reads a TQSize entry.
@@ -657,7 +657,7 @@ public:
    * key was not found or if the read value cannot be interpreted.
    * @return The value for this key.
    */
-  TQSize readSizeEntry( const char *pKey, const TQSize* pDefault = 0L ) const;
+  TQSize readSizeEntry( const char *pKey, const TQSize* pDefault = nullptr ) const;
 
 
   /**
@@ -671,7 +671,7 @@ public:
    * key was not found or if the value cannot be interpreted.
    * @return The value for this key.
    */
-  TQColor readColorEntry( const TQString& pKey, const TQColor* pDefault = 0L ) const;
+  TQColor readColorEntry( const TQString& pKey, const TQColor* pDefault = nullptr ) const;
 
   /**
    * Reads a TQColor entry.
@@ -684,7 +684,7 @@ public:
    * key was not found or if the value cannot be interpreted.
    * @return The value for this key.
    */
-  TQColor readColorEntry( const char *pKey, const TQColor* pDefault = 0L ) const;
+  TQColor readColorEntry( const char *pKey, const TQColor* pDefault = nullptr ) const;
 
   /**
    * Reads a TQDateTime entry.
@@ -698,7 +698,7 @@ public:
    * interpreted.
    * @return The value for this key.
    */
-  TQDateTime readDateTimeEntry( const TQString& pKey, const TQDateTime* pDefault = 0L ) const;
+  TQDateTime readDateTimeEntry( const TQString& pKey, const TQDateTime* pDefault = nullptr ) const;
 
   /**
    * Reads a TQDateTime entry.
@@ -712,7 +712,7 @@ public:
    * interpreted.
    * @return The value for this key.
    */
-  TQDateTime readDateTimeEntry( const char *pKey, const TQDateTime* pDefault = 0L ) const;
+  TQDateTime readDateTimeEntry( const char *pKey, const TQDateTime* pDefault = nullptr ) const;
 
   /**
    * Reads the value of an entry specified by @p pKey in the current group.
diff --git a/tdecore/tdeconfigdialogmanager.cpp b/tdecore/tdeconfigdialogmanager.cpp
index 3864dcdd6..0785dc63f 100644
--- a/tdecore/tdeconfigdialogmanager.cpp
+++ b/tdecore/tdeconfigdialogmanager.cpp
@@ -166,7 +166,7 @@ bool TDEConfigDialogManager::parseChildren(const TQWidget *widget, bool trackCha
 
     TQWidget *childWidget = (TQWidget *)object;
 
-    const char *widgetName = childWidget->name(0);
+    const char *widgetName = childWidget->name(nullptr);
     bool bParseChildren = true;
     bool bSaveInsideGroupBox = d->insideGroupBox;
 
@@ -224,7 +224,7 @@ bool TDEConfigDialogManager::parseChildren(const TQWidget *widget, bool trackCha
       TQWidget *buddy = label->buddy();
       if (!buddy)
         continue;
-      const char *buddyName = buddy->name(0);
+      const char *buddyName = buddy->name(nullptr);
       if (buddyName && (strncmp(buddyName, "kcfg_", 5) == 0))
       {
         // This is one of our widgets!
diff --git a/tdecore/tdeconfigdialogmanager.h b/tdecore/tdeconfigdialogmanager.h
index 8f142f1f9..8f8f85894 100644
--- a/tdecore/tdeconfigdialogmanager.h
+++ b/tdecore/tdeconfigdialogmanager.h
@@ -114,7 +114,7 @@ public:
    * @param conf Object that contains settings
    * @param name - Object name.
    */
-   TDEConfigDialogManager(TQWidget *parent, TDEConfigSkeleton *conf, const char *name=0);
+   TDEConfigDialogManager(TQWidget *parent, TDEConfigSkeleton *conf, const char *name=nullptr);
 
   /**
    * Destructor.
diff --git a/tdecore/tdecrash.cpp b/tdecore/tdecrash.cpp
index b1dc62957..469ecda51 100644
--- a/tdecore/tdecrash.cpp
+++ b/tdecore/tdecrash.cpp
@@ -57,10 +57,10 @@
 #include <X11/Xlib.h>
 #endif
 
-TDECrash::HandlerType TDECrash::_emergencySaveFunction = 0;
-TDECrash::HandlerType TDECrash::_crashHandler = 0;
-const char *TDECrash::appName = 0;
-const char *TDECrash::appPath = 0;
+TDECrash::HandlerType TDECrash::_emergencySaveFunction = nullptr;
+TDECrash::HandlerType TDECrash::_crashHandler = nullptr;
+const char *TDECrash::appName = nullptr;
+const char *TDECrash::appPath = nullptr;
 bool TDECrash::safer = false;
 
 // This function sets the function which should be called when the
@@ -109,7 +109,7 @@ TDECrash::setCrashHandler (HandlerType handler)
   sigaddset(&mask, SIGABRT);
 #endif
 
-  sigprocmask(SIG_UNBLOCK, &mask, 0);
+  sigprocmask(SIG_UNBLOCK, &mask, nullptr);
 #endif //Q_OS_UNIX
 
   _crashHandler = handler;
@@ -197,7 +197,7 @@ TDECrash::defaultCrashHandler (int sig)
           argv[i++] = pidtxt;
 
           const TDEInstance *instance = TDEGlobal::_instance;
-          const TDEAboutData *about = instance ? instance->aboutData() : 0;
+          const TDEAboutData *about = instance ? instance->aboutData() : nullptr;
           if (about) {
             if (about->internalVersion()) {
               argv[i++] = "--appversion";
@@ -224,7 +224,7 @@ TDECrash::defaultCrashHandler (int sig)
             argv[i++] = "--safer";
 
           // NULL terminated list
-          argv[i] = NULL;
+          argv[i] = nullptr;
 
           startDrKonqi( argv, i );
           _exit(253);
@@ -332,7 +332,7 @@ void TDECrash::startDirectly( const char* argv[], int )
   {
     alarm(0); // Seems we made it....
     // wait for child to exit
-    waitpid(pid, NULL, 0);
+    waitpid(pid, nullptr, 0);
     _exit(253);
   }
 }
@@ -365,8 +365,8 @@ static char *getDisplay()
       display = ":0";
    }
    result = (char*)malloc(strlen(display)+1);
-   if (result == NULL)
-      return NULL;
+   if (!result)
+      return nullptr;
 
    strcpy(result, display);
    screen = strrchr(result, '.');
@@ -477,7 +477,7 @@ static int openSocket()
 
   /* append $DISPLAY */
   display = getDisplay();
-  if (display == NULL)
+  if (!display)
   {
      fprintf(stderr, "[tdecrash] Error: Could not determine display.\n");
      return -1;
diff --git a/tdecore/tdecrash.h b/tdecore/tdecrash.h
index 68caf6dd8..cab6e976d 100644
--- a/tdecore/tdecrash.h
+++ b/tdecore/tdecrash.h
@@ -80,7 +80,7 @@ class TDECORE_EXPORT TDECrash
    * is installed to ensure the save function is called.
    * @param saveFunction the handler to install
    */
-  static void setEmergencySaveFunction (HandlerType saveFunction = (HandlerType)0);
+  static void setEmergencySaveFunction (HandlerType saveFunction = (HandlerType)nullptr);
   /**
    * Return the currently set emergency save function.
    * @return the emergency save function
diff --git a/tdecore/tdeglobal.cpp b/tdecore/tdeglobal.cpp
index 70aa03877..44c3ec932 100644
--- a/tdecore/tdeglobal.cpp
+++ b/tdecore/tdeglobal.cpp
@@ -107,9 +107,9 @@ TDEInstance *TDEGlobal::instance()
 
 TDELocale	*TDEGlobal::locale()
 {
-    if( _locale == 0 ) {
+    if( !_locale ) {
 	if (!_instance)
-	   return 0;
+	   return nullptr;
         kglobal_init();
 
         // will set _locale if it works - otherwise 0 is returned
@@ -123,7 +123,7 @@ TDELocale	*TDEGlobal::locale()
 
 KCharsets *TDEGlobal::charsets()
 {
-    if( _charsets == 0 ) {
+    if( !_charsets ) {
         _charsets =new KCharsets();
         kglobal_init();
     }
@@ -213,17 +213,17 @@ TDEGlobal::deleteStaticDeleters()
     }
 
     delete TDEGlobal::_staticDeleters;
-    TDEGlobal::_staticDeleters = 0;
+    TDEGlobal::_staticDeleters = nullptr;
 }
 
 // The Variables
 
-KStringDict     *TDEGlobal::_stringDict   = 0;
-TDEInstance       *TDEGlobal::_instance     = 0;
-TDEInstance       *TDEGlobal::_activeInstance = 0;
-TDELocale         *TDEGlobal::_locale	= 0;
-KCharsets       *TDEGlobal::_charsets	= 0;
-KStaticDeleterList *TDEGlobal::_staticDeleters = 0;
+KStringDict     *TDEGlobal::_stringDict   = nullptr;
+TDEInstance       *TDEGlobal::_instance     = nullptr;
+TDEInstance       *TDEGlobal::_activeInstance = nullptr;
+TDELocale         *TDEGlobal::_locale	= nullptr;
+KCharsets       *TDEGlobal::_charsets	= nullptr;
+KStaticDeleterList *TDEGlobal::_staticDeleters = nullptr;
 
 #ifdef WIN32
 #include <windows.h>
@@ -240,14 +240,14 @@ __attribute__((destructor))
 static void kglobal_freeAll()
 {
     delete TDEGlobal::_locale;
-    TDEGlobal::_locale = 0;
+    TDEGlobal::_locale = nullptr;
     delete TDEGlobal::_charsets;
-    TDEGlobal::_charsets = 0;
+    TDEGlobal::_charsets = nullptr;
     delete TDEGlobal::_stringDict;
-    TDEGlobal::_stringDict = 0;
+    TDEGlobal::_stringDict = nullptr;
     TDEGlobal::deleteStaticDeleters();
     // so that we don't hold a reference and see memory leaks :/
-    TDEGlobal::setActiveInstance(0);
+    TDEGlobal::setActiveInstance(nullptr);
 }
 
 static void kglobal_init()
@@ -285,7 +285,7 @@ int kasciistricmp( const char *str1, const char *str2 )
 char* kasciitolower( char *s )
 {
   if ( !s )
-    return 0;
+    return nullptr;
   for ( unsigned char *p = (unsigned char *) s; *p; ++p )
     *p = ( *p >= 'A' && *p <= 'Z' ) ? (*p - 'A' + 'a') : *p;
   return s;
@@ -294,7 +294,7 @@ char* kasciitolower( char *s )
 char* kasciitoupper( char *s )
 {
   if ( !s )
-    return 0;
+    return nullptr;
   for ( unsigned char *p = (unsigned char *) s; *p; ++p )
     *p = ( *p >= 'a' && *p <= 'z' ) ? (*p - 'a' + 'A') : *p;
   return s;
diff --git a/tdecore/tdeglobalaccel.h b/tdecore/tdeglobalaccel.h
index be34a3cdd..9b388025e 100644
--- a/tdecore/tdeglobalaccel.h
+++ b/tdecore/tdeglobalaccel.h
@@ -52,7 +52,7 @@ class TDECORE_EXPORT TDEGlobalAccel : public TQObject
 	 * @param pParent the parent of the TQObject
 	 * @param psName the name of the TQObject
 	 */
-	TDEGlobalAccel( TQObject* pParent, const char* psName = 0 );
+	TDEGlobalAccel( TQObject* pParent, const char* psName = nullptr );
 	virtual ~TDEGlobalAccel();
 
 	/**
@@ -176,7 +176,7 @@ class TDECORE_EXPORT TDEGlobalAccel : public TQObject
 	 *                 configuration file
 	 * @return true if successful, false otherwise
 	 */
-	bool readSettings( TDEConfigBase* pConfig = 0 );
+	bool readSettings( TDEConfigBase* pConfig = nullptr );
 
 	/**
 	 * Write the current shortcuts to @p pConfig,
@@ -187,7 +187,7 @@ class TDECORE_EXPORT TDEGlobalAccel : public TQObject
 	 * @return true if successful, false otherwise
 	 * @since 3.1
 	 */
-	bool writeSettings( TDEConfigBase* pConfig = 0 ) const;
+	bool writeSettings( TDEConfigBase* pConfig = nullptr ) const;
 	// BCI: merge these two writeSettings methods in KDE 4.0
 	/**
 	 * Write the current shortcuts to @p pConfig,
diff --git a/tdecore/tdeglobalaccel_win.cpp b/tdecore/tdeglobalaccel_win.cpp
index faf3708f4..1563fd07d 100644
--- a/tdecore/tdeglobalaccel_win.cpp
+++ b/tdecore/tdeglobalaccel_win.cpp
@@ -37,14 +37,14 @@
 
 //----------------------------------------------------
 
-static TQValueList< TDEGlobalAccelPrivate* >* all_accels = 0;
+static TQValueList< TDEGlobalAccelPrivate* >* all_accels = nullptr;
 
 TDEGlobalAccelPrivate::TDEGlobalAccelPrivate()
 : TDEAccelBase( TDEAccelBase::NATIVE_KEYS )
 , m_blocked( false )
 , m_blockingDisabled( false )
 {
-        if( all_accels == NULL )
+        if( !all_accels )
             all_accels = new TQValueList< TDEGlobalAccelPrivate* >;
         all_accels->append( this );
 	m_sConfigGroup = "Global Shortcuts";
@@ -60,7 +60,7 @@ TDEGlobalAccelPrivate::~TDEGlobalAccelPrivate()
         all_accels->remove( this );
         if( all_accels->count() == 0 ) {
             delete all_accels;
-            all_accels = NULL;
+            all_accels = nullptr;
         }
 }
 
@@ -72,7 +72,7 @@ void TDEGlobalAccelPrivate::setEnabled( bool bEnable )
 
 void TDEGlobalAccelPrivate::blockShortcuts( bool block )
 {
-        if( all_accels == NULL )
+        if( !all_accels )
             return;
         for( TQValueList< TDEGlobalAccelPrivate* >::ConstIterator it = all_accels->begin();
              it != all_accels->end();
diff --git a/tdecore/tdeglobalaccel_x11.cpp b/tdecore/tdeglobalaccel_x11.cpp
index 2bf6e0d3e..79567fa82 100644
--- a/tdecore/tdeglobalaccel_x11.cpp
+++ b/tdecore/tdeglobalaccel_x11.cpp
@@ -77,7 +77,7 @@ static void calculateGrabMasks()
 
 //----------------------------------------------------
 
-static TQValueList< TDEGlobalAccelPrivate* >* all_accels = 0;
+static TQValueList< TDEGlobalAccelPrivate* >* all_accels = nullptr;
 
 TDEGlobalAccelPrivate::TDEGlobalAccelPrivate()
 : TDEAccelBase( TDEAccelBase::NATIVE_KEYS )
@@ -85,7 +85,7 @@ TDEGlobalAccelPrivate::TDEGlobalAccelPrivate()
 , m_blockingDisabled( false )
 , m_suspended( false )
 {
-        if( all_accels == NULL )
+        if( !all_accels )
             all_accels = new TQValueList< TDEGlobalAccelPrivate* >;
         all_accels->append( this );
 	m_sConfigGroup = "Global Shortcuts";
@@ -102,7 +102,7 @@ TDEGlobalAccelPrivate::~TDEGlobalAccelPrivate()
         all_accels->remove( this );
         if( all_accels->count() == 0 ) {
             delete all_accels;
-            all_accels = NULL;
+            all_accels = nullptr;
         }
 }
 
@@ -114,7 +114,7 @@ void TDEGlobalAccelPrivate::setEnabled( bool bEnable )
 
 void TDEGlobalAccelPrivate::blockShortcuts( bool block )
 {
-        if( all_accels == NULL )
+        if( !all_accels )
             return;
         for( TQValueList< TDEGlobalAccelPrivate* >::ConstIterator it = all_accels->begin();
              it != all_accels->end();
@@ -151,11 +151,11 @@ bool TDEGlobalAccelPrivate::emitSignal( Signal )
 bool TDEGlobalAccelPrivate::connectKey( TDEAccelAction& action, const KKeyServer::Key& key )
 	{ return grabKey( key, true, &action ); }
 bool TDEGlobalAccelPrivate::connectKey( const KKeyServer::Key& key )
-	{ return grabKey( key, true, 0 ); }
+	{ return grabKey( key, true, nullptr ); }
 bool TDEGlobalAccelPrivate::disconnectKey( TDEAccelAction& action, const KKeyServer::Key& key )
 	{ return grabKey( key, false, &action ); }
 bool TDEGlobalAccelPrivate::disconnectKey( const KKeyServer::Key& key )
-	{ return grabKey( key, false, 0 ); }
+	{ return grabKey( key, false, nullptr ); }
 
 bool TDEGlobalAccelPrivate::grabKey( const KKeyServer::Key& key, bool bGrab, TDEAccelAction* pAction )
 {
@@ -309,7 +309,7 @@ void TDEGlobalAccelPrivate::fakeKeyPressed(unsigned int keyCode) {
                 static bool recursion_block = false;
                 if( !recursion_block ) {
                         recursion_block = true;
-		        TQPopupMenu* pMenu = createPopupMenu( 0, KKeySequence(key) );
+		        TQPopupMenu* pMenu = createPopupMenu( nullptr, KKeySequence(key) );
 		        connect( pMenu, TQ_SIGNAL(activated(int)), this, TQ_SLOT(slotActivated(int)) );
 		        pMenu->exec( TQPoint( 0, 0 ) );
 		        disconnect( pMenu, TQ_SIGNAL(activated(int)), this, TQ_SLOT(slotActivated(int)));
@@ -388,7 +388,7 @@ bool TDEGlobalAccelPrivate::x11KeyPress( const XEvent *pEvent )
                 static bool recursion_block = false;
                 if( !recursion_block ) {
                         recursion_block = true;
-		        TQPopupMenu* pMenu = createPopupMenu( 0, KKeySequence(key) );
+		        TQPopupMenu* pMenu = createPopupMenu( nullptr, KKeySequence(key) );
 		        connect( pMenu, TQ_SIGNAL(activated(int)), this, TQ_SLOT(slotActivated(int)) );
 		        pMenu->exec( TQPoint( 0, 0 ) );
 		        disconnect( pMenu, TQ_SIGNAL(activated(int)), this, TQ_SLOT(slotActivated(int)));
@@ -435,7 +435,7 @@ void TDEGlobalAccelPrivate::activate( TDEAccelAction* pAction, const KKeySequenc
 	} else {
                 int slot_id = pAction->objSlotPtr()->metaObject()->findSlot( normalizeSignalSlot( pAction->methodSlotPtr() ).data() + 1, true );
                 if( slot_id >= 0 )
-                    const_cast< TQObject* >( pAction->objSlotPtr())->tqt_invoke( slot_id, 0 );
+                    const_cast< TQObject* >( pAction->objSlotPtr())->tqt_invoke( slot_id, nullptr );
 	}
 }
 
diff --git a/tdecore/tdeglobalsettings.cpp b/tdecore/tdeglobalsettings.cpp
index f03b4d9a5..dbb03878a 100644
--- a/tdecore/tdeglobalsettings.cpp
+++ b/tdecore/tdeglobalsettings.cpp
@@ -58,34 +58,34 @@ static TQRgb qt_colorref2qrgb(COLORREF col)
 #include <X11/Xlib.h>
 #endif
 
-TQString* TDEGlobalSettings::s_desktopPath = 0;
-TQString* TDEGlobalSettings::s_autostartPath = 0;
-TQString* TDEGlobalSettings::s_trashPath = 0;
-TQString* TDEGlobalSettings::s_documentPath = 0;
-TQString* TDEGlobalSettings::s_videosPath = 0;
-TQString* TDEGlobalSettings::s_musicPath = 0;
-TQString* TDEGlobalSettings::s_downloadPath = 0;
-TQString* TDEGlobalSettings::s_picturesPath = 0;
-TQString* TDEGlobalSettings::s_templatesPath = 0;
-TQString* TDEGlobalSettings::s_publicSharePath = 0;
-TQFont *TDEGlobalSettings::_generalFont = 0;
-TQFont *TDEGlobalSettings::_fixedFont = 0;
-TQFont *TDEGlobalSettings::_toolBarFont = 0;
-TQFont *TDEGlobalSettings::_menuFont = 0;
-TQFont *TDEGlobalSettings::_windowTitleFont = 0;
-TQFont *TDEGlobalSettings::_taskbarFont = 0;
-TQFont *TDEGlobalSettings::_largeFont = 0;
-TQColor *TDEGlobalSettings::_trinity4Blue = 0;
-TQColor *TDEGlobalSettings::_inactiveBackground = 0;
-TQColor *TDEGlobalSettings::_inactiveForeground = 0;
-TQColor *TDEGlobalSettings::_activeBackground = 0;
-TQColor *TDEGlobalSettings::_buttonBackground = 0;
-TQColor *TDEGlobalSettings::_selectBackground = 0;
-TQColor *TDEGlobalSettings::_linkColor = 0;
-TQColor *TDEGlobalSettings::_visitedLinkColor = 0;
-TQColor *TDEGlobalSettings::alternateColor = 0;
-
-TDEGlobalSettings::KMouseSettings *TDEGlobalSettings::s_mouseSettings = 0;
+TQString* TDEGlobalSettings::s_desktopPath = nullptr;
+TQString* TDEGlobalSettings::s_autostartPath = nullptr;
+TQString* TDEGlobalSettings::s_trashPath = nullptr;
+TQString* TDEGlobalSettings::s_documentPath = nullptr;
+TQString* TDEGlobalSettings::s_videosPath = nullptr;
+TQString* TDEGlobalSettings::s_musicPath = nullptr;
+TQString* TDEGlobalSettings::s_downloadPath = nullptr;
+TQString* TDEGlobalSettings::s_picturesPath = nullptr;
+TQString* TDEGlobalSettings::s_templatesPath = nullptr;
+TQString* TDEGlobalSettings::s_publicSharePath = nullptr;
+TQFont *TDEGlobalSettings::_generalFont = nullptr;
+TQFont *TDEGlobalSettings::_fixedFont = nullptr;
+TQFont *TDEGlobalSettings::_toolBarFont = nullptr;
+TQFont *TDEGlobalSettings::_menuFont = nullptr;
+TQFont *TDEGlobalSettings::_windowTitleFont = nullptr;
+TQFont *TDEGlobalSettings::_taskbarFont = nullptr;
+TQFont *TDEGlobalSettings::_largeFont = nullptr;
+TQColor *TDEGlobalSettings::_trinity4Blue = nullptr;
+TQColor *TDEGlobalSettings::_inactiveBackground = nullptr;
+TQColor *TDEGlobalSettings::_inactiveForeground = nullptr;
+TQColor *TDEGlobalSettings::_activeBackground = nullptr;
+TQColor *TDEGlobalSettings::_buttonBackground = nullptr;
+TQColor *TDEGlobalSettings::_selectBackground = nullptr;
+TQColor *TDEGlobalSettings::_linkColor = nullptr;
+TQColor *TDEGlobalSettings::_visitedLinkColor = nullptr;
+TQColor *TDEGlobalSettings::alternateColor = nullptr;
+
+TDEGlobalSettings::KMouseSettings *TDEGlobalSettings::s_mouseSettings = nullptr;
 
 // Helper function for reading xdg user dirs.
 // Returns sane values in case the user dir file can't be read
@@ -743,42 +743,42 @@ void TDEGlobalSettings::initColors()
 void TDEGlobalSettings::rereadFontSettings()
 {
     delete _generalFont;
-    _generalFont = 0L;
+    _generalFont = nullptr;
     delete _fixedFont;
-    _fixedFont = 0L;
+    _fixedFont = nullptr;
     delete _menuFont;
-    _menuFont = 0L;
+    _menuFont = nullptr;
     delete _toolBarFont;
-    _toolBarFont = 0L;
+    _toolBarFont = nullptr;
     delete _windowTitleFont;
-    _windowTitleFont = 0L;
+    _windowTitleFont = nullptr;
     delete _taskbarFont;
-    _taskbarFont = 0L;
+    _taskbarFont = nullptr;
 }
 
 void TDEGlobalSettings::rereadPathSettings()
 {
     kdDebug() << "TDEGlobalSettings::rereadPathSettings" << endl;
     delete s_autostartPath;
-    s_autostartPath = 0L;
+    s_autostartPath = nullptr;
     delete s_trashPath;
-    s_trashPath = 0L;
+    s_trashPath = nullptr;
     delete s_desktopPath;
-    s_desktopPath = 0L;
+    s_desktopPath = nullptr;
     delete s_documentPath;
-    s_documentPath = 0L;
+    s_documentPath = nullptr;
     delete s_downloadPath;
-    s_downloadPath = 0L;
+    s_downloadPath = nullptr;
     delete s_musicPath;
-    s_musicPath = 0L;
+    s_musicPath = nullptr;
     delete s_picturesPath;
-    s_picturesPath = 0L;
+    s_picturesPath = nullptr;
     delete s_publicSharePath;
-    s_publicSharePath = 0L;
+    s_publicSharePath = nullptr;
     delete s_templatesPath;
-    s_templatesPath = 0L;
+    s_templatesPath = nullptr;
     delete s_videosPath;
-    s_videosPath = 0L;
+    s_videosPath = nullptr;
 }
 
 TDEGlobalSettings::KMouseSettings & TDEGlobalSettings::mouseSettings()
@@ -835,7 +835,7 @@ void TDEGlobalSettings::rereadMouseSettings()
 {
 #ifndef TQ_WS_WIN
     delete s_mouseSettings;
-    s_mouseSettings = 0L;
+    s_mouseSettings = nullptr;
 #endif
 }
 
diff --git a/tdecore/tdehw/networkbackends/network-manager/network-manager.cpp b/tdecore/tdehw/networkbackends/network-manager/network-manager.cpp
index f41f5cbc8..534ee6f08 100644
--- a/tdecore/tdehw/networkbackends/network-manager/network-manager.cpp
+++ b/tdecore/tdehw/networkbackends/network-manager/network-manager.cpp
@@ -1862,15 +1862,15 @@ void TDENetworkConnectionManager_BackendNM::loadConnectionInformation() {
 			TQT_DBusObjectPathList::iterator it;
 			for (it = connections.begin(); it != connections.end(); ++it) {
 				TDENetworkConnection* connection;
-				TDEWiredEthernetConnection* ethernetConnection = NULL;
-				TDEWiredInfinibandConnection* infinibandConnection = NULL;
-				TDEWiFiConnection* wiFiConnection = NULL;
-				TDEVPNConnection* vpnConnection = NULL;
-				TDEWiMaxConnection* wiMaxConnection = NULL;
-				TDEVLANConnection* vlanConnection = NULL;
-				TDEOLPCMeshConnection* olpcMeshConnection = NULL;
-				TDEBluetoothConnection* bluetoothConnection = NULL;
-				TDEModemConnection* modemConnection = NULL;
+				TDEWiredEthernetConnection* ethernetConnection = nullptr;
+				TDEWiredInfinibandConnection* infinibandConnection = nullptr;
+				TDEWiFiConnection* wiFiConnection = nullptr;
+				TDEVPNConnection* vpnConnection = nullptr;
+				TDEWiMaxConnection* wiMaxConnection = nullptr;
+				TDEVLANConnection* vlanConnection = nullptr;
+				TDEOLPCMeshConnection* olpcMeshConnection = nullptr;
+				TDEBluetoothConnection* bluetoothConnection = nullptr;
+				TDEModemConnection* modemConnection = nullptr;
 				TDENetworkConnectionType::TDENetworkConnectionType connType = connectionType((*it));
 				if (connType == TDENetworkConnectionType::WiredEthernet) {
 					connection = ethernetConnection = new TDEWiredEthernetConnection;
@@ -5239,7 +5239,7 @@ TQStringList TDENetworkConnectionManager_BackendNM::validSettings() {
 
 TDENetworkWiFiAPInfo* TDENetworkConnectionManager_BackendNM::getAccessPointDetails(TQString dbusPath) {
 	if (dbusPath == "") {
-		return NULL;
+		return nullptr;
 	}
 
 	TDENetworkWiFiAPInfo* apInfo = new TDENetworkWiFiAPInfo;
@@ -5251,7 +5251,7 @@ TDENetworkWiFiAPInfo* TDENetworkConnectionManager_BackendNM::getAccessPointDetai
 	TQValueList<TQ_UINT8> nmSSID = accessPoint.getSsid(error);
 	if (error.isValid()) {
 		delete apInfo;
-		return NULL;
+		return nullptr;
 	}
 	TQValueList<TQ_UINT8>::iterator it;
 	index = 0;
@@ -5442,7 +5442,7 @@ TQStringList TDENetworkConnectionManager_BackendNM::defaultNetworkDevices() {
 	}
 }
 
-TDENetworkConnectionManager_BackendNMPrivate::TDENetworkConnectionManager_BackendNMPrivate(TDENetworkConnectionManager_BackendNM* parent) : m_networkManagerProxy(NULL), m_networkManagerSettings(NULL), m_networkDeviceProxy(NULL), m_wiFiDeviceProxy(NULL), m_vpnProxy(NULL), nonReentrantCallActive(false), vpn_service_error_notified(false), device_autoconnect_error_notified(false), m_parent(parent), m_prevDeviceState(-1) {
+TDENetworkConnectionManager_BackendNMPrivate::TDENetworkConnectionManager_BackendNMPrivate(TDENetworkConnectionManager_BackendNM* parent) : m_networkManagerProxy(nullptr), m_networkManagerSettings(nullptr), m_networkDeviceProxy(nullptr), m_wiFiDeviceProxy(nullptr), m_vpnProxy(nullptr), nonReentrantCallActive(false), vpn_service_error_notified(false), device_autoconnect_error_notified(false), m_parent(parent), m_prevDeviceState(-1) {
 	// Set up global signal handler
 	m_dbusSignalConnection = new TQT_DBusConnection(TQT_DBusConnection::systemBus());
 	m_dbusSignalReceiver = new TDENetworkConnectionManager_BackendNM_DBusSignalReceiver(this);
diff --git a/tdecore/tdehw/networkbackends/network-manager/network-manager.h b/tdecore/tdehw/networkbackends/network-manager/network-manager.h
index 241e83706..eaafceaab 100644
--- a/tdecore/tdehw/networkbackends/network-manager/network-manager.h
+++ b/tdecore/tdehw/networkbackends/network-manager/network-manager.h
@@ -230,7 +230,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkCo
 		virtual bool loadConnectionSecrets(TQString uuid);
 		virtual bool saveConnection(TDENetworkConnection* connection);
 		virtual bool deleteConnection(TQString uuid);
-		virtual bool verifyConnectionSettings(TDENetworkConnection* connection, TDENetworkConnectionErrorFlags::TDENetworkConnectionErrorFlags* type=NULL, TDENetworkErrorStringMap* reason=NULL);
+		virtual bool verifyConnectionSettings(TDENetworkConnection* connection, TDENetworkConnectionErrorFlags::TDENetworkConnectionErrorFlags* type=nullptr, TDENetworkErrorStringMap* reason=nullptr);
 
 		virtual TDENetworkConnectionStatus::TDENetworkConnectionStatus initiateConnection(TQString uuid);
 		virtual TDENetworkConnectionStatus::TDENetworkConnectionStatus checkConnectionStatus(TQString uuid);
diff --git a/tdecore/tdehw/tdecryptographiccarddevice.cpp b/tdecore/tdehw/tdecryptographiccarddevice.cpp
index ad6b4bd88..7da2d2a60 100644
--- a/tdecore/tdehw/tdecryptographiccarddevice.cpp
+++ b/tdecore/tdehw/tdecryptographiccarddevice.cpp
@@ -61,7 +61,7 @@ static TQString pcsc_error_code_to_string(long errcode) {
 
 CryptoCardDeviceWatcher::CryptoCardDeviceWatcher() {
 #ifdef WITH_PCSC
-	m_readerStates = NULL;
+	m_readerStates = nullptr;
 #endif
 	m_cardPINPromptDone = true;
 	m_pinCallbacksEnabled = false;
@@ -81,7 +81,7 @@ void CryptoCardDeviceWatcher::run() {
 	long ret;
 
 	DWORD dword_readers;
-	LPSTR lpstring_readers = NULL;
+	LPSTR lpstring_readers = nullptr;
 
 	TQStringList readers;
 
@@ -91,23 +91,23 @@ void CryptoCardDeviceWatcher::run() {
 	TQEventLoop* eventLoop = TQApplication::eventLoop();
 	if (!eventLoop) return;
 
-	ret = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &m_cardContext);
+	ret = SCardEstablishContext(SCARD_SCOPE_SYSTEM, nullptr, nullptr, &m_cardContext);
 	if (ret != SCARD_S_SUCCESS) {
 		printf("TDECryptographicCardDevice: PCSC SCardEstablishContext cannot connect to resource manager (%lX)", ret);
 		eventLoop->exit(0);
 		return;
 	}
 
-	ret = SCardListReaders(m_cardContext, NULL, NULL, &dword_readers);
+	ret = SCardListReaders(m_cardContext, nullptr, nullptr, &dword_readers);
 	if (ret == SCARD_S_SUCCESS) {
 		lpstring_readers = (LPSTR)malloc(sizeof(char)*dword_readers);
-		if (lpstring_readers == NULL) {
+		if (!lpstring_readers) {
 			printf("TDECryptographicCardDevice: insufficient memory, aborting");
 			eventLoop->exit(0);
 			return;
 		}
 
-		ret = SCardListReaders(m_cardContext, NULL, lpstring_readers, &dword_readers);
+		ret = SCardListReaders(m_cardContext, nullptr, lpstring_readers, &dword_readers);
 		if (ret == SCARD_S_SUCCESS) {
 			/* Extract reader names from the null separated string */
 			char *ptr = lpstring_readers;
@@ -119,7 +119,7 @@ void CryptoCardDeviceWatcher::run() {
 			free(lpstring_readers);
 
 			m_readerStates = (SCARD_READERSTATE*)calloc(readers.count(), sizeof(*m_readerStates));
-			if (m_readerStates == NULL) {
+			if (!m_readerStates) {
 				printf("TDECryptographicCardDevice: insufficient memory, aborting");
 				free(lpstring_readers);
 				eventLoop->exit(0);
@@ -136,7 +136,7 @@ void CryptoCardDeviceWatcher::run() {
 				if (m_terminationRequested) {
 					for (i=0; i<readers.count(); i++) {
 						free((char*)m_readerStates[i].szReader);
-						m_readerStates[i].szReader = NULL;
+						m_readerStates[i].szReader = nullptr;
 					}
 					eventLoop->exit(0);
 					return;
@@ -154,14 +154,14 @@ void CryptoCardDeviceWatcher::run() {
 					
 					ret = SCardConnect(m_cardContext, readers[i].ascii(), SCARD_SHARE_DIRECT, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1, &hCard, &dwActiveProtocol);
 					if (ret == SCARD_S_SUCCESS) {
-						ret = SCardGetAttrib(hCard, SCARD_ATTR_VENDOR_NAME, NULL, &cByte);
+						ret = SCardGetAttrib(hCard, SCARD_ATTR_VENDOR_NAME, nullptr, &cByte);
 						if (ret == SCARD_S_SUCCESS) {
 							char* data = new char[cByte];
 							ret = SCardGetAttrib(hCard, SCARD_ATTR_VENDOR_NAME, (LPBYTE)data, &cByte);
 							reader_vendor_name = data;
 							delete [] data;
 						}
-						ret = SCardGetAttrib(hCard, SCARD_ATTR_VENDOR_IFD_TYPE, NULL, &cByte);
+						ret = SCardGetAttrib(hCard, SCARD_ATTR_VENDOR_IFD_TYPE, nullptr, &cByte);
 						if (ret == SCARD_S_SUCCESS) {
 							char* data = new char[cByte];
 							ret = SCardGetAttrib(hCard, SCARD_ATTR_VENDOR_IFD_TYPE, (LPBYTE)data, &cByte);
@@ -253,7 +253,7 @@ TQString CryptoCardDeviceWatcher::getCardATR(TQString readerName) {
 
 	ret = SCardConnect(m_cardContext, readerName.ascii(), SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1, &hCard, &dwActiveProtocol);
 	if (ret == SCARD_S_SUCCESS) {
-		ret = SCardGetAttrib(hCard, SCARD_ATTR_ATR_STRING, NULL, &cByte);
+		ret = SCardGetAttrib(hCard, SCARD_ATTR_ATR_STRING, nullptr, &cByte);
 		if (ret == SCARD_S_SUCCESS) {
 			char* data = new char[cByte];
 			ret = SCardGetAttrib(hCard, SCARD_ATTR_ATR_STRING, (LPBYTE)data, &cByte);
@@ -352,7 +352,7 @@ int CryptoCardDeviceWatcher::initializePkcs() {
 	// pkcs11h_setLogLevel(PKCS11H_LOG_DEBUG2);
 
 #if 0
-	if ((rv = pkcs11h_setTokenPromptHook(_pkcs11h_hooks_token_prompt, NULL)) != CKR_OK) {
+	if ((rv = pkcs11h_setTokenPromptHook(_pkcs11h_hooks_token_prompt, nullptr)) != CKR_OK) {
 		printf("pkcs11h_setTokenPromptHook failed: %s\n", pkcs11h_getMessage(rv));
 		return -1;
 	}
@@ -393,20 +393,20 @@ int CryptoCardDeviceWatcher::retrieveCardCertificates(TQString readerName) {
 		return -1;
 	}
 
-	rv = pkcs11h_certificate_enumCertificateIds(PKCS11H_ENUM_METHOD_CACHE, NULL, PKCS11H_PROMPT_MASK_ALLOW_PIN_PROMPT, &issuers, &certs);
-	if ((rv != CKR_OK) || (certs == NULL)) {
+	rv = pkcs11h_certificate_enumCertificateIds(PKCS11H_ENUM_METHOD_CACHE, nullptr, PKCS11H_PROMPT_MASK_ALLOW_PIN_PROMPT, &issuers, &certs);
+	if (rv != CKR_OK || !certs) {
 		printf("Cannot enumerate certificates: %s\n", pkcs11h_getMessage(rv));
 		return -1;
 	}
 	printf("Successfully enumerated certificates\n");
 
 	int i = 0;
-	for (pkcs11h_certificate_id_list_t cert = certs; cert != NULL; cert = cert->next) {
+	for (pkcs11h_certificate_id_list_t cert = certs; cert; cert = cert->next) {
 		TQString label = cert->certificate_id->displayName;
 		printf("Certificate %d name: '%s'\n", i, label.ascii());
 
 		pkcs11h_certificate_t certificate;
-		rv = pkcs11h_certificate_create(certs->certificate_id, NULL, PKCS11H_PROMPT_MASK_ALLOW_PIN_PROMPT, PKCS11H_PIN_CACHE_INFINITE, &certificate);
+		rv = pkcs11h_certificate_create(certs->certificate_id, nullptr, PKCS11H_PROMPT_MASK_ALLOW_PIN_PROMPT, PKCS11H_PIN_CACHE_INFINITE, &certificate);
 		if (rv != CKR_OK) {
 			printf("Cannot read certificate: %s\n", pkcs11h_getMessage(rv));
 			pkcs11h_certificate_freeCertificateId(certs->certificate_id);
@@ -416,14 +416,14 @@ int CryptoCardDeviceWatcher::retrieveCardCertificates(TQString readerName) {
 
 		pkcs11h_certificate_freeCertificateId(certs->certificate_id);
 
-		pkcs11h_openssl_session_t openssl_session = NULL;
-		if ((openssl_session = pkcs11h_openssl_createSession(certificate)) == NULL) {
+		pkcs11h_openssl_session_t openssl_session = nullptr;
+		if (!(openssl_session = pkcs11h_openssl_createSession(certificate))) {
 			printf("Cannot initialize openssl session to retrieve cryptographic objects\n");
 			pkcs11h_certificate_freeCertificate(certificate);
 			ret = -1;
 			break;
 		}
-		certificate = NULL;	// the certificate object is managed by openssl_session
+		certificate = nullptr;	// the certificate object is managed by openssl_session
 
 		X509* x509_local;
 		x509_local = pkcs11h_openssl_session_getX509(openssl_session);
@@ -481,8 +481,8 @@ void CryptoCardDeviceWatcher::deleteAllCertificatesFromCache() {
 }
 
 TDECryptographicCardDevice::TDECryptographicCardDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn) : TDEGenericDevice(dt, dn),
-	m_watcherThread(NULL),
-	m_watcherObject(NULL),
+	m_watcherThread(nullptr),
+	m_watcherObject(nullptr),
 	m_cardPresent(false) {
 }
 
@@ -522,11 +522,11 @@ void TDECryptographicCardDevice::enableCardMonitoring(bool enable) {
 		if (m_watcherThread) {
 			m_watcherThread->wait();
 			delete m_watcherThread;
-			m_watcherThread = NULL;
+			m_watcherThread = nullptr;
 		}
 		if (m_watcherObject) {
 			delete m_watcherObject;
-			m_watcherObject = NULL;
+			m_watcherObject = nullptr;
 		}
 	}
 #endif
@@ -625,7 +625,7 @@ TQString TDECryptographicCardDevice::autoPIN() {
 	X509CertificatePtrListIterator it;
 	for (it = m_cardCertificates.begin(); it != m_cardCertificates.end(); ++it) {
 		X509* x509_cert = *it;
-		GENERAL_NAMES* subjectAltNames = (GENERAL_NAMES*)X509_get_ext_d2i(x509_cert, NID_subject_alt_name, NULL, NULL);
+		GENERAL_NAMES* subjectAltNames = (GENERAL_NAMES*)X509_get_ext_d2i(x509_cert, NID_subject_alt_name, nullptr, nullptr);
 		int altNameCount = sk_GENERAL_NAME_num(subjectAltNames);
 		for (i=0; i < altNameCount; i++) {
 			GENERAL_NAME* generalName = sk_GENERAL_NAME_value(subjectAltNames, i);
@@ -635,9 +635,9 @@ TQString TDECryptographicCardDevice::autoPIN() {
 					ASN1_TYPE* asnValue = otherName->value;
 					if (asnValue) {
 						// Found autopin structure
-						ASN1_TYPE* asnSeqValue = NULL;
-						ASN1_GENERALSTRING* asnGeneralString = NULL;
-						STACK_OF(ASN1_TYPE) *asnSeqValueStack = NULL;
+						ASN1_TYPE* asnSeqValue = nullptr;
+						ASN1_GENERALSTRING* asnGeneralString = nullptr;
+						STACK_OF(ASN1_TYPE) *asnSeqValueStack = nullptr;
 						long asn1SeqValueObjectLength;
 						int asn1SeqValueObjectTag;
 						int asn1SeqValueObjectClass;
@@ -645,7 +645,7 @@ TQString TDECryptographicCardDevice::autoPIN() {
 						int index = 0;	// Search for the PIN field
 
 						const uint8_t* asnSeqValueString = ASN1_STRING_get0_data(asnValue->value.sequence);
-						asnSeqValueStack = d2i_ASN1_SEQUENCE_ANY(NULL, &asnSeqValueString, ASN1_STRING_length(asnValue->value.sequence));
+						asnSeqValueStack = d2i_ASN1_SEQUENCE_ANY(nullptr, &asnSeqValueString, ASN1_STRING_length(asnValue->value.sequence));
 						asnSeqValue = sk_ASN1_TYPE_value(asnSeqValueStack, index);
 						if (asnSeqValue) {
 							if (ASN1_STRING_get0_data(asnSeqValue->value.octet_string)[0] == ((V_ASN1_CONSTRUCTED | V_ASN1_CONTEXT_SPECIFIC) + index)) {
@@ -653,7 +653,7 @@ TQString TDECryptographicCardDevice::autoPIN() {
 								returnCode = ASN1_get_object(&asn1SeqValueObjectData, &asn1SeqValueObjectLength, &asn1SeqValueObjectTag, &asn1SeqValueObjectClass, ASN1_STRING_length(asnSeqValue->value.sequence));
 								if (!(returnCode & 0x80)) {
 									if (returnCode == (V_ASN1_CONSTRUCTED + index)) {
-										if (d2i_ASN1_GENERALSTRING(&asnGeneralString, &asn1SeqValueObjectData, asn1SeqValueObjectLength) != NULL) {
+										if (d2i_ASN1_GENERALSTRING(&asnGeneralString, &asn1SeqValueObjectData, asn1SeqValueObjectLength)) {
 											retString = TQString((const char *)ASN1_STRING_get0_data(asnGeneralString));
 										}
 									}
@@ -711,18 +711,18 @@ int TDECryptographicCardDevice::decryptDataEncryptedWithCertPublicKey(TQValueLis
 		return -1;
 	}
 
-	rv = pkcs11h_certificate_enumCertificateIds(PKCS11H_ENUM_METHOD_CACHE, NULL, PKCS11H_PROMPT_MASK_ALLOW_PIN_PROMPT, &issuers, &certs);
-	if ((rv != CKR_OK) || (certs == NULL)) {
+	rv = pkcs11h_certificate_enumCertificateIds(PKCS11H_ENUM_METHOD_CACHE, nullptr, PKCS11H_PROMPT_MASK_ALLOW_PIN_PROMPT, &issuers, &certs);
+	if (rv != CKR_OK || !certs) {
 		if (errstr) *errstr = i18n("Cannot enumerate certificates: %1").arg(pkcs11h_getMessage(rv));
 		return -1;
 	}
 
 	int i = 0;
-	for (pkcs11h_certificate_id_list_t cert = certs; cert != NULL; cert = cert->next) {
+	for (pkcs11h_certificate_id_list_t cert = certs; cert; cert = cert->next) {
 		TQString label = cert->certificate_id->displayName;
 
 		pkcs11h_certificate_t certificate;
-		rv = pkcs11h_certificate_create(certs->certificate_id, NULL, PKCS11H_PROMPT_MASK_ALLOW_PIN_PROMPT, PKCS11H_PIN_CACHE_INFINITE, &certificate);
+		rv = pkcs11h_certificate_create(certs->certificate_id, nullptr, PKCS11H_PROMPT_MASK_ALLOW_PIN_PROMPT, PKCS11H_PIN_CACHE_INFINITE, &certificate);
 		if (rv != CKR_OK) {
 			if (errstr) *errstr = i18n("Cannot read certificate: %1").arg(pkcs11h_getMessage(rv));
 			pkcs11h_certificate_freeCertificateId(certs->certificate_id);
@@ -732,8 +732,8 @@ int TDECryptographicCardDevice::decryptDataEncryptedWithCertPublicKey(TQValueLis
 
 		pkcs11h_certificate_freeCertificateId(certs->certificate_id);
 
-		pkcs11h_openssl_session_t openssl_session = NULL;
-		if ((openssl_session = pkcs11h_openssl_createSession(certificate)) == NULL) {
+		pkcs11h_openssl_session_t openssl_session = nullptr;
+		if (!(openssl_session = pkcs11h_openssl_createSession(certificate))) {
 			if (errstr) *errstr = i18n("Cannot initialize openssl session to retrieve cryptographic objects");
 			pkcs11h_certificate_freeCertificate(certificate);
 			ret = -1;
@@ -749,8 +749,8 @@ int TDECryptographicCardDevice::decryptDataEncryptedWithCertPublicKey(TQValueLis
 		}
 
 		// Extract public key from X509 certificate
-		EVP_PKEY* x509_pubkey = NULL;
-		RSA* rsa_pubkey = NULL;
+		EVP_PKEY* x509_pubkey = nullptr;
+		RSA* rsa_pubkey = nullptr;
 		x509_pubkey = X509_get_pubkey(x509_local);
 		if (x509_pubkey) {
 			rsa_pubkey = EVP_PKEY_get1_RSA(x509_pubkey);
@@ -811,7 +811,7 @@ int TDECryptographicCardDevice::decryptDataEncryptedWithCertPublicKey(TQValueLis
 
 			size_t size = 0;
 			// Determine output buffer size
-			rv = pkcs11h_certificate_decryptAny(certificate, CKM_RSA_PKCS, (unsigned char*)ciphertext.data(), ciphertext.size(), NULL, &size);
+			rv = pkcs11h_certificate_decryptAny(certificate, CKM_RSA_PKCS, (unsigned char*)ciphertext.data(), ciphertext.size(), nullptr, &size);
 			if (rv != CKR_OK) {
 				if (errstr) *errstr = i18n("Cannot determine decrypted message length: %1 (%2)").arg(pkcs11h_getMessage(rv)).arg(rv);
 				if (rv == CKR_CANCEL) {
@@ -885,8 +885,8 @@ int TDECryptographicCardDevice::createNewSecretRSAKeyFromCertificate(TQByteArray
 	int retcode = -1;
 
 	// Extract public key from X509 certificate
-	EVP_PKEY* x509_pubkey = NULL;
-	RSA* rsa_pubkey = NULL;
+	EVP_PKEY* x509_pubkey = nullptr;
+	RSA* rsa_pubkey = nullptr;
 	x509_pubkey = X509_get_pubkey(certificate);
 	if (x509_pubkey) {
 		rsa_pubkey = EVP_PKEY_get1_RSA(x509_pubkey);
diff --git a/tdecore/tdehw/tdecryptographiccarddevice.h b/tdecore/tdehw/tdecryptographiccarddevice.h
index 8b3bd211a..f12b225f9 100644
--- a/tdecore/tdehw/tdecryptographiccarddevice.h
+++ b/tdecore/tdehw/tdecryptographiccarddevice.h
@@ -127,7 +127,7 @@ class TDECORE_EXPORT TDECryptographicCardDevice : public TDEGenericDevice
 		 * @param errstr Pointer to TQString to be loaded with error description on failure
 		 * @return 0 on success, -1 on general failure, -2 on encryption failure, -3 on user cancel
 		 */
-		int decryptDataEncryptedWithCertPublicKey(TQByteArray &ciphertext, TQByteArray &plaintext, TQString *errstr=NULL);
+		int decryptDataEncryptedWithCertPublicKey(TQByteArray &ciphertext, TQByteArray &plaintext, TQString *errstr=nullptr);
 
 		/**
 		 * If monitoring of insert / remove events is enabled, and a card has been inserted,
diff --git a/tdecore/tdehw/tdeeventdevice.cpp b/tdecore/tdehw/tdeeventdevice.cpp
index 3223e80e7..7466665e6 100644
--- a/tdecore/tdehw/tdeeventdevice.cpp
+++ b/tdecore/tdehw/tdeeventdevice.cpp
@@ -49,7 +49,7 @@
 
 TDEEventDevice::TDEEventDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn) : TDEGenericDevice(dt, dn) {
 	m_fd = -1;
-	m_watchTimer = 0;
+	m_watchTimer = nullptr;
 	m_monitorActive = false;
 }
 
diff --git a/tdecore/tdehw/tdegenericdevice.cpp b/tdecore/tdehw/tdegenericdevice.cpp
index e9a645cf1..9ad3a8e57 100644
--- a/tdecore/tdehw/tdegenericdevice.cpp
+++ b/tdecore/tdehw/tdegenericdevice.cpp
@@ -32,7 +32,7 @@ TDEGenericDevice::TDEGenericDevice(TDEGenericDeviceType::TDEGenericDeviceType dt
 	m_deviceType = dt;
 	m_deviceName = dn;
 
-	m_parentDevice = 0;
+	m_parentDevice = nullptr;
 	m_friendlyName = TQString::null;
 	m_blacklistedForUpdate = false;
 }
@@ -253,7 +253,7 @@ TQString TDEGenericDevice::friendlyName() {
 			else if (acpigentype.startsWith("device:")) {
 				acpigentype.remove(0, acpigentype.findRev(":")+1);
 				acpigentype.prepend("0x");
-				m_friendlyName = i18n("ACPI Node %1").arg(acpigentype.toUInt(0,0));
+				m_friendlyName = i18n("ACPI Node %1").arg(acpigentype.toUInt(nullptr,0));
 			}
 		}
 	}
diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp
index a61cfb77c..dcff1e1ca 100644
--- a/tdecore/tdehw/tdehardwaredevices.cpp
+++ b/tdecore/tdehw/tdehardwaredevices.cpp
@@ -132,10 +132,10 @@ extern "C" {
 
 TDEHardwareDevices::TDEHardwareDevices() {
 	// Initialize members
-	pci_id_map = 0;
-	usb_id_map = 0;
-	pnp_id_map = 0;
-	dpy_id_map = 0;
+	pci_id_map = nullptr;
+	usb_id_map = nullptr;
+	pnp_id_map = nullptr;
+	dpy_id_map = nullptr;
 	m_unclassifiedDevices = TQStringList();
 
 	// Set up device list
@@ -150,7 +150,7 @@ TDEHardwareDevices::TDEHardwareDevices() {
 	if (m_udevStruct) {
 		// Set up device add/remove monitoring
 		m_udevMonitorStruct = udev_monitor_new_from_netlink(m_udevStruct, "udev");
-		udev_monitor_filter_add_match_subsystem_devtype(m_udevMonitorStruct, NULL, NULL);
+		udev_monitor_filter_add_match_subsystem_devtype(m_udevMonitorStruct, nullptr, nullptr);
 		udev_monitor_enable_receiving(m_udevMonitorStruct);
 
 		int udevmonitorfd = udev_monitor_get_fd(m_udevMonitorStruct);
@@ -320,7 +320,7 @@ TDEGenericDevice* TDEHardwareDevices::findBySystemPath(TQString syspath) {
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 TDECPUDevice* TDEHardwareDevices::findCPUBySystemPath(TQString syspath, bool inCache=true) {
@@ -343,7 +343,7 @@ TDECPUDevice* TDEHardwareDevices::findCPUBySystemPath(TQString syspath, bool inC
 		return cdevice;
 	}
 
-	return 0;
+	return nullptr;
 }
 
 
@@ -357,7 +357,7 @@ TDEGenericDevice* TDEHardwareDevices::findByUniqueID(TQString uid) {
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 TDEGenericDevice* TDEHardwareDevices::findByDeviceNode(TQString devnode) {
@@ -375,7 +375,7 @@ TDEGenericDevice* TDEHardwareDevices::findByDeviceNode(TQString devnode) {
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 TDEStorageDevice* TDEHardwareDevices::findDiskByUID(TQString uid) {
@@ -389,7 +389,7 @@ TDEStorageDevice* TDEHardwareDevices::findDiskByUID(TQString uid) {
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 void TDEHardwareDevices::processHotPluggedHardware() {
@@ -403,7 +403,7 @@ void TDEHardwareDevices::processHotPluggedHardware() {
 			for (TDEGenericDevice *hwdevice = m_deviceList.first(); hwdevice; hwdevice = m_deviceList.next()) {
 				if (hwdevice->systemPath() == device->systemPath()) {
 					delete device;
-					device = 0;
+					device = nullptr;
 					break;
 				}
 			}
@@ -531,7 +531,7 @@ void TDEHardwareDevices::processModifiedCPUs() {
 					found = true;
 					break;
 				}
-				else if (curline2 == NULL || curline2 == "") {
+				else if (!curline2 || curline2 == "") {
 					break;
 				}
 			}
@@ -542,7 +542,7 @@ void TDEHardwareDevices::processModifiedCPUs() {
 				m_cpuInfo.insert(blockBegin, "processor : 0");
 			}
 		}
-		if (curline1 == NULL || curline1 == "") {
+		if (!curline1 || curline1 == "") {
 			blockNumber++;
 			blockBegin = cpuit1;
 			blockBegin++;
@@ -561,7 +561,7 @@ void TDEHardwareDevices::processModifiedCPUs() {
 
 	// Parse CPU information table
 	TDECPUDevice *cdevice;
-	cdevice = 0;
+	cdevice = nullptr;
 	bool modified = false;
 	bool have_frequency = false;
 
@@ -615,8 +615,8 @@ void TDEHardwareDevices::processModifiedCPUs() {
 					cdevice->internalSetVendorEncoded(curline);
 				}
 			}
-			else if (curline == NULL || curline == "") {
-				cdevice = 0;
+			else if (!curline || curline == "") {
+				cdevice = nullptr;
 			}
 		}
 	}
@@ -665,8 +665,8 @@ void TDEHardwareDevices::processModifiedCPUs() {
 					}
 				}
 			}
-			if (curline == NULL || curline == "") {
-				cdevice = 0;
+			if (!curline || curline == "") {
+				cdevice = nullptr;
 			}
 		}
 	}
@@ -901,7 +901,7 @@ void TDEHardwareDevices::processStatelessDevices() {
 		if ((hwdevice->type() == TDEGenericDeviceType::RootSystem) || (hwdevice->type() == TDEGenericDeviceType::Network) ||
 				(hwdevice->type() == TDEGenericDeviceType::OtherSensor) || (hwdevice->type() == TDEGenericDeviceType::Event) ||
 				(hwdevice->type() == TDEGenericDeviceType::Battery) || (hwdevice->type() == TDEGenericDeviceType::PowerSupply)) {
-			rescanDeviceInformation(hwdevice, NULL, false);
+			rescanDeviceInformation(hwdevice, nullptr, false);
 			emit hardwareUpdated(hwdevice);
 #ifdef STATELESSPROFILING
 			clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2);
@@ -925,13 +925,13 @@ void TDEHardwareDevices::processBatteryDevices() {
 	TDEGenericHardwareList devList = listAllPhysicalDevices();
 	for ( hwdevice = devList.first(); hwdevice; hwdevice = devList.next() ) {
 		if (hwdevice->type() == TDEGenericDeviceType::Battery) {
-			rescanDeviceInformation(hwdevice, NULL, false);
+			rescanDeviceInformation(hwdevice, nullptr, false);
 			emit hardwareUpdated(hwdevice);
 		}
 		else if (hwdevice->type() == TDEGenericDeviceType::PowerSupply) {
 			TDEMainsPowerDevice *pdevice = dynamic_cast<TDEMainsPowerDevice*>(hwdevice);
 			int previousOnlineState = pdevice->online();
-			rescanDeviceInformation(hwdevice, NULL, false);
+			rescanDeviceInformation(hwdevice, nullptr, false);
 			if (pdevice->online() != previousOnlineState) {
 				emit hardwareUpdated(hwdevice);
 			}
@@ -1584,7 +1584,7 @@ TDEDiskDeviceType::TDEDiskDeviceType readDiskDeviceSubtypeFromString(TQString qu
 }
 
 TDEGenericDevice* createDeviceObjectForType(TDEGenericDeviceType::TDEGenericDeviceType type) {
-	TDEGenericDevice* ret = 0;
+	TDEGenericDevice* ret = nullptr;
 
 	if (type == TDEGenericDeviceType::Disk) {
 		ret = new TDEStorageDevice(type);
@@ -1645,7 +1645,7 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDeviceByExternalRules(udev_
 				TQFileInfoListIterator it( *list );
 				TQFileInfo *fi;
 
-				while ((fi = it.current()) != 0) {
+				while ((fi = it.current()) != nullptr) {
 					if (fi->extension(false) == "hwclass") {
 						bool match = true;
 
@@ -1893,7 +1893,7 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
 		driverSymlinkDir.append("/device/");
 		TQFileInfo dirfi(driverSymlink);
 		if (dirfi.isSymLink()) {
-			char* collapsedPath = realpath((driverSymlinkDir + dirfi.readLink()).ascii(), NULL);
+			char* collapsedPath = realpath((driverSymlinkDir + dirfi.readLink()).ascii(), nullptr);
 			devicedriver = TQString(collapsedPath);
 			free(collapsedPath);
 			devicedriver.remove(0, devicedriver.findRev("/")+1);
@@ -1942,11 +1942,11 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
 	if (dirlist) {
 		TQFileInfoListIterator inputdirsit(*dirlist);
 		TQFileInfo *dirfi;
-		while ( (dirfi = inputdirsit.current()) != 0 ) {
+		while ((dirfi = inputdirsit.current()) != nullptr) {
 			if ((dirfi->fileName() != ".") && (dirfi->fileName() != "..")) {
 				struct udev_device *slavedev;
 				slavedev = udev_device_new_from_syspath(m_udevStruct, (inputtopdirname + dirfi->fileName()).ascii());
-				if (udev_device_get_property_value(slavedev, "ID_INPUT_KEYBOARD") != 0) {
+				if (udev_device_get_property_value(slavedev, "ID_INPUT_KEYBOARD")) {
 					is_keyboard = true;
 				}
 				udev_device_unref(slavedev);
@@ -2002,14 +2002,14 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
 			if (!device) {
 				// Second mouse check
 				// Look for ID_INPUT_MOUSE property presence
-				if (udev_device_get_property_value(dev, "ID_INPUT_MOUSE") != 0) {
+				if (udev_device_get_property_value(dev, "ID_INPUT_MOUSE")) {
 					if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Mouse);
 				}
 			}
 			if (!device) {
 				// Check for keyboard
 				// Look for ID_INPUT_KEYBOARD property presence
-				if (udev_device_get_property_value(dev, "ID_INPUT_KEYBOARD") != 0) {
+				if (udev_device_get_property_value(dev, "ID_INPUT_KEYBOARD")) {
 					if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Keyboard);
 				}
 			}
@@ -2077,7 +2077,7 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
 	}
 
 	// Try to at least generally classify unclassified devices
-	if (device == 0) {
+	if (!device) {
 		if (devicesubsystem == "backlight") {
 			if (!device) device = new TDEBacklightDevice(TDEGenericDeviceType::Backlight);
 		}
@@ -2353,7 +2353,7 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
 					TQFile ifaceprotofile(current_path + "/bInterfaceClass");
 					if (ifaceprotofile.open(IO_ReadOnly)) {
 						TQTextStream stream( &ifaceprotofile );
-						usbInterfaceClass = stream.readLine().toUInt(NULL, 16);
+						usbInterfaceClass = stream.readLine().toUInt(nullptr, 16);
 						ifaceprotofile.close();
 					}
 				}
@@ -2363,7 +2363,7 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
 					TQFile ifaceprotofile(current_path + "/bInterfaceSubClass");
 					if (ifaceprotofile.open(IO_ReadOnly)) {
 						TQTextStream stream( &ifaceprotofile );
-						usbInterfaceSubClass = stream.readLine().toUInt(NULL, 16);
+						usbInterfaceSubClass = stream.readLine().toUInt(nullptr, 16);
 						ifaceprotofile.close();
 					}
 				}
@@ -2373,7 +2373,7 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
 					TQFile ifaceprotofile(current_path + "/bInterfaceProtocol");
 					if (ifaceprotofile.open(IO_ReadOnly)) {
 						TQTextStream stream( &ifaceprotofile );
-						usbInterfaceProtocol = stream.readLine().toUInt(NULL, 16);
+						usbInterfaceProtocol = stream.readLine().toUInt(nullptr, 16);
 						ifaceprotofile.close();
 					}
 				}
@@ -2420,7 +2420,7 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
 		}
 	}
 
-	if (device == 0) {
+	if (!device) {
 		// Unhandled
 		if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Other);
 		if (!m_unclassifiedDevices.contains(devicename))
@@ -2534,9 +2534,9 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 			if (dirlist) {
 				TQFileInfoListIterator holdersdirit(*dirlist);
 				TQFileInfo *dirfi;
-				while ( (dirfi = holdersdirit.current()) != 0 ) {
+				while ((dirfi = holdersdirit.current()) != nullptr) {
 					if (dirfi->isSymLink()) {
-						char* collapsedPath = realpath((holdersnodename + dirfi->readLink()).ascii(), NULL);
+						char* collapsedPath = realpath((holdersnodename + dirfi->readLink()).ascii(), nullptr);
 						holdingDeviceNodes.append(TQString(collapsedPath));
 						free(collapsedPath);
 					}
@@ -2554,9 +2554,9 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 			if (dirlist) {
 				TQFileInfoListIterator slavedirit(*dirlist);
 				TQFileInfo *dirfi;
-				while ( (dirfi = slavedirit.current()) != 0 ) {
+				while ((dirfi = slavedirit.current()) != nullptr) {
 					if (dirfi->isSymLink()) {
-						char* collapsedPath = realpath((slavesnodename + dirfi->readLink()).ascii(), NULL);
+						char* collapsedPath = realpath((slavesnodename + dirfi->readLink()).ascii(), nullptr);
 						slaveDeviceNodes.append(TQString(collapsedPath));
 						free(collapsedPath);
 					}
@@ -2585,7 +2585,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 			TDEDiskDeviceType::TDEDiskDeviceType disktype = sdevice->diskType();
 			TDEDiskDeviceStatus::TDEDiskDeviceStatus diskstatus = TDEDiskDeviceStatus::Null;
 
-			TDEStorageDevice* parentdisk = NULL;
+			TDEStorageDevice* parentdisk = nullptr;
 			if (!(TQString(udev_device_get_property_value(dev, "ID_PART_ENTRY_NUMBER")).isEmpty())) {
 				TQString parentsyspath = systempath;
 				parentsyspath.truncate(parentsyspath.length()-1);	// Remove trailing slash
@@ -2657,7 +2657,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 				if (floppyblkdirlist) {
 					TQFileInfoListIterator floppyblkdirit(*floppyblkdirlist);
 					TQFileInfo *dirfi;
-					while ( (dirfi = floppyblkdirit.current()) != 0 ) {
+					while ((dirfi = floppyblkdirit.current()) != nullptr) {
 						if ((dirfi->fileName() != ".") && (dirfi->fileName() != "..")) {
 							// Does this routine work with more than one floppy drive in the system?
 							devicenode = TQString("/dev/").append(dirfi->fileName());
@@ -2868,7 +2868,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 			if (dirlist) {
 				TQFileInfoListIterator valuesdirit(*dirlist);
 				TQFileInfo *dirfi;
-				while ( (dirfi = valuesdirit.current()) != 0 ) {
+				while ((dirfi = valuesdirit.current()) != nullptr) {
 					nodename = dirfi->fileName();
 					TQFile file( valuesnodename + nodename );
 					if ( file.open( IO_ReadOnly ) ) {
@@ -2902,8 +2902,8 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 				char host[NI_MAXHOST];
 
 				if (getifaddrs(&ifaddr) != -1) {
-					for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
-						if (ifa->ifa_addr == NULL) {
+					for (ifa = ifaddr; ifa; ifa = ifa->ifa_next) {
+						if (!ifa->ifa_addr) {
 							continue;
 						}
 
@@ -2911,7 +2911,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 
 						if (TQString(ifa->ifa_name) == devicenode) {
 							if ((family == AF_INET) || (family == AF_INET6)) {
-								s = getnameinfo(ifa->ifa_addr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
+								s = getnameinfo(ifa->ifa_addr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, nullptr, 0, NI_NUMERICHOST);
 								if (s == 0) {
 									TQString address(host);
 									if (family == AF_INET) {
@@ -2922,7 +2922,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 										ndevice->internalSetIpV6Address(address);
 									}
 								}
-								s = getnameinfo(ifa->ifa_netmask, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
+								s = getnameinfo(ifa->ifa_netmask, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, nullptr, 0, NI_NUMERICHOST);
 								if (s == 0) {
 									TQString address(host);
 									if (family == AF_INET) {
@@ -2933,7 +2933,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 										ndevice->internalSetIpV6Netmask(address);
 									}
 								}
-								s = ifa->ifa_ifu.ifu_broadaddr ? getnameinfo(ifa->ifa_ifu.ifu_broadaddr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST) : EAI_NONAME;
+								s = ifa->ifa_ifu.ifu_broadaddr ? getnameinfo(ifa->ifa_ifu.ifu_broadaddr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, nullptr, 0, NI_NUMERICHOST) : EAI_NONAME;
 								if (s == 0) {
 									TQString address(host);
 									if (family == AF_INET) {
@@ -2944,7 +2944,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 										ndevice->internalSetIpV6Broadcast(address);
 									}
 								}
-								s = ifa->ifa_ifu.ifu_dstaddr ? getnameinfo(ifa->ifa_ifu.ifu_dstaddr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST) : EAI_NONAME;
+								s = ifa->ifa_ifu.ifu_dstaddr ? getnameinfo(ifa->ifa_ifu.ifu_dstaddr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, nullptr, 0, NI_NUMERICHOST) : EAI_NONAME;
 								if (s == 0) {
 									TQString address(host);
 									if (family == AF_INET) {
@@ -2971,7 +2971,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 				if (dirlist) {
 					TQFileInfoListIterator valuesdirit(*dirlist);
 					TQFileInfo *dirfi;
-					while ( (dirfi = valuesdirit.current()) != 0 ) {
+					while ((dirfi = valuesdirit.current()) != nullptr) {
 						nodename = dirfi->fileName();
 						TQFile file( valuesnodename + nodename );
 						if ( file.open( IO_ReadOnly ) ) {
@@ -3010,7 +3010,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 		if (dirlist) {
 			TQFileInfoListIterator valuesdirit(*dirlist);
 			TQFileInfo *dirfi;
-			while ( (dirfi = valuesdirit.current()) != 0 ) {
+			while ((dirfi = valuesdirit.current()) != nullptr) {
 				nodename = dirfi->fileName();
 				if (nodename.contains("_")) {
 					TQFile file( valuesnodename + nodename );
@@ -3083,7 +3083,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 				file.close();
 			}
 			// ...and then the other values
-			while ( (dirfi = valuesdirit.current()) != 0 ) {
+			while ((dirfi = valuesdirit.current()) != nullptr) {
 				nodename = dirfi->fileName();
 				file.setName( valuesnodename + nodename );
 				if ( file.open( IO_ReadOnly ) ) {
@@ -3210,7 +3210,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 		if (dirlist) {
 			TQFileInfoListIterator valuesdirit(*dirlist);
 			TQFileInfo *dirfi;
-			while ( (dirfi = valuesdirit.current()) != 0 ) {
+			while ((dirfi = valuesdirit.current()) != nullptr) {
 				nodename = dirfi->fileName();
 				TQFile file( valuesnodename + nodename );
 				if ( file.open( IO_ReadOnly ) ) {
@@ -3247,7 +3247,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 		if (dirlist) {
 			TQFileInfoListIterator valuesdirit(*dirlist);
 			TQFileInfo *dirfi;
-			while ( (dirfi = valuesdirit.current()) != 0 ) {
+			while ((dirfi = valuesdirit.current()) != nullptr) {
 				nodename = dirfi->fileName();
 				TQFile file( valuesnodename + nodename );
 				if ( file.open( IO_ReadOnly ) ) {
@@ -3288,7 +3288,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 		if (dirlist) {
 			TQFileInfoListIterator valuesdirit(*dirlist);
 			TQFileInfo *dirfi;
-			while ( (dirfi = valuesdirit.current()) != 0 ) {
+			while ((dirfi = valuesdirit.current()) != nullptr) {
 				nodename = dirfi->fileName();
 				TQFile file( valuesnodename + nodename );
 				if ( file.open( IO_ReadOnly ) ) {
@@ -3391,7 +3391,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
 			TDESystemHibernationMethodList hibernationmethods;
 			TDESystemHibernationMethod::TDESystemHibernationMethod hibernationmethod = 
 																				TDESystemHibernationMethod::Unsupported;
-			while ( (dirfi = valuesdirit.current()) != 0 ) {
+			while ((dirfi = valuesdirit.current()) != nullptr) {
 				nodename = dirfi->fileName();
 				TQFile file( valuesnodename + nodename );
 				if ( file.open( IO_ReadOnly ) ) {
@@ -3601,7 +3601,7 @@ bool TDEHardwareDevices::queryHardwareInformation() {
 
 	// Create a list of all devices
 	enumerate = udev_enumerate_new(m_udevStruct);
-	udev_enumerate_add_match_subsystem(enumerate, NULL);
+	udev_enumerate_add_match_subsystem(enumerate, nullptr);
 	udev_enumerate_scan_devices(enumerate);
 	devices = udev_enumerate_get_list_entry(enumerate);
 	// Get detailed information on each detected device
@@ -3619,7 +3619,7 @@ bool TDEHardwareDevices::queryHardwareInformation() {
 		for (hwdevice = m_deviceList.first(); hwdevice; hwdevice = m_deviceList.next()) {
 			if (hwdevice->systemPath() == device->systemPath()) {
 				delete device;
-				device = 0;
+				device = nullptr;
 				break;
 			}
 		}
@@ -3644,7 +3644,7 @@ void TDEHardwareDevices::updateParentDeviceInformation(TDEGenericDevice* hwdevic
 	// Scan for the first path up the sysfs tree that is available in the main hardware table
 	bool done = false;
 	TQString current_path = hwdevice->systemPath();
-	TDEGenericDevice* parentdevice = 0;
+	TDEGenericDevice* parentdevice = nullptr;
 
 	if (current_path.endsWith("/")) {
 		current_path.truncate(current_path.findRev("/"));
@@ -3698,7 +3698,7 @@ void TDEHardwareDevices::addCoreSystemDevices() {
 	if (dirlist) {
 		TQFileInfoListIterator devicesdirit(*dirlist);
 		TQFileInfo *dirfi;
-		while ( (dirfi = devicesdirit.current()) != 0 ) {
+		while ((dirfi = devicesdirit.current()) != nullptr) {
 			nodename = dirfi->fileName();
 			if (nodename != "." && nodename != "..") {
 				hwdevice = new TDEGenericDevice(TDEGenericDeviceType::Root);
@@ -3711,14 +3711,14 @@ void TDEHardwareDevices::addCoreSystemDevices() {
 
 	// Handle CPUs, which are currently handled terribly by udev
 	// Parse /proc/cpuinfo to extract some information about the CPUs
-	hwdevice = 0;
+	hwdevice = nullptr;
 	TQDir d("/sys/devices/system/cpu/");
 	d.setFilter( TQDir::Dirs );
 	const TQFileInfoList *list = d.entryInfoList();
 	if (list) {
 		TQFileInfoListIterator it( *list );
 		TQFileInfo *fi;
-		while ((fi = it.current()) != 0) {
+		while ((fi = it.current()) != nullptr) {
 			TQString directoryName = fi->fileName();
 			if (directoryName.startsWith("cpu")) {
 				directoryName = directoryName.remove(0,3);
@@ -4532,7 +4532,7 @@ TDERootSystemDevice* TDEHardwareDevices::rootSystemDevice() {
 		}
 	}
 
-	return 0;
+	return nullptr;
 }
 
 TQString TDEHardwareDevices::bytesToFriendlySizeString(double bytes) {
diff --git a/tdecore/tdehw/tdehardwaredevices.h b/tdecore/tdehw/tdehardwaredevices.h
index ad3f30c71..33dd17519 100644
--- a/tdecore/tdehw/tdehardwaredevices.h
+++ b/tdecore/tdehw/tdehardwaredevices.h
@@ -213,7 +213,7 @@ class TDECORE_EXPORT TDEHardwareDevices : public TQObject
 		*  @param dev udev_device* with the udev device to rescan
 		*  @param regenerateDeviceTree true to update parent/child links in device tree
 		*/
-		void rescanDeviceInformation(TDEGenericDevice* hwdevice, udev_device* dev = NULL, bool regenerateDeviceTree = true);
+		void rescanDeviceInformation(TDEGenericDevice* hwdevice, udev_device* dev = nullptr, bool regenerateDeviceTree = true);
 
 		/**
 		*  Enable or disable automatic state updates of triggerless hardware devices
@@ -264,9 +264,9 @@ class TDECORE_EXPORT TDEHardwareDevices : public TQObject
 		void updateBlacklists(TDEGenericDevice* hwdevice, udev_device* dev);
 
 	private:
-		TDEGenericDevice *classifyUnknownDevice(udev_device* dev, TDEGenericDevice* existingdevice=0, bool force_full_classification=true);
-		TDEGenericDevice *classifyUnknownDeviceByExternalRules(udev_device* dev, TDEGenericDevice* existingdevice=0, bool classifySubDevices=false);
-		void updateExistingDeviceInformation(TDEGenericDevice *device, udev_device *dev=NULL);
+		TDEGenericDevice *classifyUnknownDevice(udev_device* dev, TDEGenericDevice* existingdevice=nullptr, bool force_full_classification=true);
+		TDEGenericDevice *classifyUnknownDeviceByExternalRules(udev_device* dev, TDEGenericDevice* existingdevice=nullptr, bool classifySubDevices=false);
+		void updateExistingDeviceInformation(TDEGenericDevice *device, udev_device *dev=nullptr);
 
 		void updateParentDeviceInformation();
 		void updateParentDeviceInformation(TDEGenericDevice* hwdevice);
diff --git a/tdecore/tdehw/tdenetworkconnections.cpp b/tdecore/tdehw/tdenetworkconnections.cpp
index 9a273cebb..9280bc24b 100644
--- a/tdecore/tdehw/tdenetworkconnections.cpp
+++ b/tdecore/tdehw/tdenetworkconnections.cpp
@@ -240,7 +240,7 @@ void TDEMACAddress::fromString(TQString address) {
 	TQStringList pieces = TQStringList::split(":", address);
 	m_macAddress.clear();
 	for (TQStringList::Iterator it = pieces.begin(); it != pieces.end(); ++it) {
-		m_macAddress.append((*it).toUShort(0, 16));
+		m_macAddress.append((*it).toUShort(nullptr, 16));
 	}
 	m_isValid = true;
 }
@@ -705,7 +705,7 @@ TDEWiFiConnection::~TDEWiFiConnection() {
 /* TDENetworkConnectionManager                                                                    */
 /*================================================================================================*/
 
-TDENetworkConnectionManager::TDENetworkConnectionManager(TDENetworkDevice *networkDevice) : TQObject(), m_connectionList(NULL), m_hwNeighborList(NULL), m_networkDevice(networkDevice), m_prevConnectionStatus(TDENetworkGlobalManagerFlags::Unknown) {
+TDENetworkConnectionManager::TDENetworkConnectionManager(TDENetworkDevice *networkDevice) : TQObject(), m_connectionList(nullptr), m_hwNeighborList(nullptr), m_networkDevice(networkDevice), m_prevConnectionStatus(TDENetworkGlobalManagerFlags::Unknown) {
 	m_emissionTimer = new TQTimer();
 	connect(m_emissionTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(emitQueuedSignals()));
 	if (!m_emissionTimer->isActive()) m_emissionTimer->start(0, true);
@@ -735,12 +735,12 @@ TDENetworkConnection* TDENetworkConnectionManager::findConnectionByUUID(TQString
 			return connection;
 		}
 	}
-	return NULL;
+	return nullptr;
 }
 
 TDENetworkDevice* TDENetworkConnectionManager::findDeviceByUUID(TQString uuid) {
 	TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
-	if (!hwdevices) return NULL;
+	if (!hwdevices) return nullptr;
 
 	TDEGenericHardwareList devices = hwdevices->listByDeviceClass(TDEGenericDeviceType::Network);
 	for (TDEGenericHardwareList::iterator it = devices.begin(); it != devices.end(); ++it)
@@ -756,12 +756,12 @@ TDENetworkDevice* TDENetworkConnectionManager::findDeviceByUUID(TQString uuid) {
 		}
 	}
 
-	return NULL;
+	return nullptr;
 }
 
 TDENetworkWiFiAPInfo* TDENetworkConnectionManager::findAccessPointByBSSID(TDEMACAddress bssid) {
 	if (!bssid.isValid()) {
-		return NULL;
+		return nullptr;
 	}
 
 	TDENetworkHWNeighbor *neighbor;
@@ -774,7 +774,7 @@ TDENetworkWiFiAPInfo* TDENetworkConnectionManager::findAccessPointByBSSID(TDEMAC
 			return apInfo;
 		}
 	}
-	return NULL;
+	return nullptr;
 }
 
 TQString TDENetworkConnectionManager::friendlyConnectionTypeName(TDENetworkConnectionType::TDENetworkConnectionType type) {
@@ -957,9 +957,9 @@ void TDENetworkConnectionManager::emitQueuedSignals() {
 /* TDEGlobalNetworkManager                                                                        */
 /*================================================================================================*/
 
-TDEGlobalNetworkManager::TDEGlobalNetworkManager() : m_internalConnectionManager(NULL) {
+TDEGlobalNetworkManager::TDEGlobalNetworkManager() : m_internalConnectionManager(nullptr) {
 #ifdef WITH_NETWORK_MANAGER_BACKEND
-	m_internalConnectionManager = new TDENetworkConnectionManager_BackendNM(NULL);
+	m_internalConnectionManager = new TDENetworkConnectionManager_BackendNM(nullptr);
 #endif // WITH_NETWORK_MANAGER_BACKEND
 	if (m_internalConnectionManager) {
 		connect(m_internalConnectionManager, TQ_SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)), this, TQ_SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)));
@@ -1033,7 +1033,7 @@ TQStringList TDEGlobalNetworkManager::validSettings() {
 }
 
 TDENetworkHWNeighborList* TDEGlobalNetworkManager::siteSurvey() {
-	if (!m_internalConnectionManager) return NULL;
+	if (!m_internalConnectionManager) return nullptr;
 	return m_internalConnectionManager->siteSurvey();
 }
 
@@ -1078,27 +1078,27 @@ TQStringList TDEGlobalNetworkManager::defaultNetworkDevices() {
 }
 
 TDENetworkConnectionList* TDEGlobalNetworkManager::connections() {
-	if (!m_internalConnectionManager) return NULL;
+	if (!m_internalConnectionManager) return nullptr;
 	return m_internalConnectionManager->connections();
 }
 
 TDENetworkConnection* TDEGlobalNetworkManager::findConnectionByUUID(TQString uuid) {
-	if (!m_internalConnectionManager) return NULL;
+	if (!m_internalConnectionManager) return nullptr;
 	return m_internalConnectionManager->findConnectionByUUID(uuid);
 }
 
 TDENetworkDevice* TDEGlobalNetworkManager::findDeviceByUUID(TQString uuid) {
-	if (!m_internalConnectionManager) return NULL;
+	if (!m_internalConnectionManager) return nullptr;
 	return m_internalConnectionManager->findDeviceByUUID(uuid);
 }
 
 TDENetworkWiFiAPInfo* TDEGlobalNetworkManager::findAccessPointByBSSID(TDEMACAddress bssid) {
 	TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
 	if (!hwdevices) {
-		return NULL;
+		return nullptr;
 	}
 
-	TDENetworkWiFiAPInfo* ret = NULL;
+	TDENetworkWiFiAPInfo* ret = nullptr;
 	TDEGenericHardwareList devices = hwdevices->listByDeviceClass(TDEGenericDeviceType::Network);
 	for (TDEGenericHardwareList::iterator it = devices.begin(); it != devices.end(); ++it) {
 		TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(*it);
diff --git a/tdecore/tdehw/tdenetworkconnections.h b/tdecore/tdehw/tdenetworkconnections.h
index aa44e8edb..f22a8b46f 100644
--- a/tdecore/tdehw/tdenetworkconnections.h
+++ b/tdecore/tdehw/tdenetworkconnections.h
@@ -1107,7 +1107,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject
 		* strings containing the reason for the failure if provided.
 		* @return true on success, false if invalid settings are detected.
 		*/
-		virtual bool verifyConnectionSettings(TDENetworkConnection* connection, TDENetworkConnectionErrorFlags::TDENetworkConnectionErrorFlags* type=NULL, TDENetworkErrorStringMap* reason=NULL) = 0;
+		virtual bool verifyConnectionSettings(TDENetworkConnection* connection, TDENetworkConnectionErrorFlags::TDENetworkConnectionErrorFlags* type=nullptr, TDENetworkErrorStringMap* reason=nullptr) = 0;
 
 		/**
 		* Initiates a connection with UUID @param uuid.
@@ -1433,7 +1433,7 @@ class TDECORE_EXPORT TDEGlobalNetworkManager : public TQObject
 		* strings containing the reason for the failure if provided.
 		* @return true on success, false if invalid settings are detected.
 		*/
-		virtual bool verifyConnectionSettings(TDENetworkConnection* connection, TDENetworkConnectionErrorFlags::TDENetworkConnectionErrorFlags* type=NULL, TDENetworkErrorStringMap* reason=NULL);
+		virtual bool verifyConnectionSettings(TDENetworkConnection* connection, TDENetworkConnectionErrorFlags::TDENetworkConnectionErrorFlags* type=nullptr, TDENetworkErrorStringMap* reason=nullptr);
 
 		/**
 		* Initiates a connection with UUID @param uuid.
diff --git a/tdecore/tdehw/tdenetworkdevice.cpp b/tdecore/tdehw/tdenetworkdevice.cpp
index ad4b71a6b..bd97881ed 100644
--- a/tdecore/tdehw/tdenetworkdevice.cpp
+++ b/tdecore/tdehw/tdenetworkdevice.cpp
@@ -34,7 +34,7 @@ TDENetworkDevice::TDENetworkDevice(TDEGenericDeviceType::TDEGenericDeviceType dt
 	m_txbytes = -1;
 	m_rxpackets = -1;
 	m_txpackets = -1;
-	m_connectionManager = NULL;
+	m_connectionManager = nullptr;
 }
 
 TDENetworkDevice::~TDENetworkDevice() {
diff --git a/tdecore/tdehw/tdestoragedevice.cpp b/tdecore/tdehw/tdestoragedevice.cpp
index 318768dfe..f29ca98d4 100644
--- a/tdecore/tdehw/tdestoragedevice.cpp
+++ b/tdecore/tdehw/tdestoragedevice.cpp
@@ -53,7 +53,7 @@
 	#endif
 #endif
 
-TDEStorageDevice::TDEStorageDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn) : TDEGenericDevice(dt, dn), m_mediaInserted(true), m_cryptDevice(NULL), m_cryptKeySlotCount(0) {
+TDEStorageDevice::TDEStorageDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn) : TDEGenericDevice(dt, dn), m_mediaInserted(true), m_cryptDevice(nullptr), m_cryptKeySlotCount(0) {
 	m_diskType = TDEDiskDeviceType::Null;
 	m_diskStatus = TDEDiskDeviceStatus::Null;
 }
@@ -62,7 +62,7 @@ TDEStorageDevice::~TDEStorageDevice() {
 #if defined(WITH_CRYPTSETUP)
 	if (m_cryptDevice) {
 		crypt_free(m_cryptDevice);
-		m_cryptDevice = NULL;
+		m_cryptDevice = nullptr;
 	}
 #endif
 }
@@ -125,7 +125,7 @@ void TDEStorageDevice::internalInitializeLUKSIfNeeded() {
 			if (node != "") {
 				ret = crypt_init(&m_cryptDevice, node.ascii());
 				if (ret == 0) {
-					ret = crypt_load(m_cryptDevice, NULL, NULL);
+					ret = crypt_load(m_cryptDevice, nullptr, nullptr);
 					if (ret == 0) {
 						int keyslot_count;
 #if defined(CRYPTSETUP_OLD_API) || !defined(HAVE_CRYPTSETUP_GET_TYPE)
@@ -146,7 +146,7 @@ void TDEStorageDevice::internalInitializeLUKSIfNeeded() {
 					}
 				}
 				else {
-					m_cryptDevice = NULL;
+					m_cryptDevice = nullptr;
 				}
 			}
 		}
@@ -154,7 +154,7 @@ void TDEStorageDevice::internalInitializeLUKSIfNeeded() {
 	else {
 		if (m_cryptDevice) {
 			crypt_free(m_cryptDevice);
-			m_cryptDevice = NULL;
+			m_cryptDevice = nullptr;
 		}
 	}
 #endif
@@ -162,7 +162,7 @@ void TDEStorageDevice::internalInitializeLUKSIfNeeded() {
 
 void TDEStorageDevice::cryptSetOperationsUnlockPassword(TQByteArray password) {
 #if defined(WITH_CRYPTSETUP)
-	crypt_memory_lock(NULL, 1);
+	crypt_memory_lock(nullptr, 1);
 	m_cryptDevicePassword = password;
 #endif
 }
@@ -171,7 +171,7 @@ void TDEStorageDevice::cryptClearOperationsUnlockPassword() {
 	m_cryptDevicePassword.fill(0);
 	m_cryptDevicePassword.resize(0);
 #if defined(WITH_CRYPTSETUP)
-	crypt_memory_lock(NULL, 0);
+	crypt_memory_lock(nullptr, 0);
 #endif
 }
 
@@ -190,7 +190,7 @@ TDELUKSResult::TDELUKSResult TDEStorageDevice::cryptCheckKey(unsigned int keyslo
 
 	if (m_cryptDevice) {
 		if (keyslot < m_cryptKeySlotCount) {
-			ret = crypt_activate_by_passphrase(m_cryptDevice, NULL, keyslot, m_cryptDevicePassword.data(), m_cryptDevicePassword.size(), 0);
+			ret = crypt_activate_by_passphrase(m_cryptDevice, nullptr, keyslot, m_cryptDevicePassword.data(), m_cryptDevicePassword.size(), 0);
 			if (ret < 0) {
 				return TDELUKSResult::KeyslotOpFailed;
 			}
@@ -465,7 +465,7 @@ TQString decodeHexEncoding(TQString str) {
 	int s = -1;
 
 	while((s = hexEncRegExp.search(str, s+1))>=0){
-		str.replace(s, hexEncRegExp.cap(0).length(), TQChar((char)strtol(hexEncRegExp.cap(0).mid(2).ascii(), NULL, 16)));
+		str.replace(s, hexEncRegExp.cap(0).length(), TQChar((char)strtol(hexEncRegExp.cap(0).mid(2).ascii(), nullptr, 16)));
 	}
 
 	return str;
diff --git a/tdecore/tdeinstance.cpp b/tdecore/tdeinstance.cpp
index c8235e45e..ed5691202 100644
--- a/tdecore/tdeinstance.cpp
+++ b/tdecore/tdeinstance.cpp
@@ -42,8 +42,8 @@
 #ifndef NDEBUG
   #include <assert.h>
   #include <tqptrdict.h>
-  static TQPtrList<TDEInstance> *allInstances = 0;
-  static TQPtrDict<TQCString> *allOldInstances = 0;
+  static TQPtrList<TDEInstance> *allInstances = nullptr;
+  static TQPtrDict<TQCString> *allOldInstances = nullptr;
   #define DEBUG_ADD do { if (!allInstances) { allInstances = new TQPtrList<TDEInstance>(); allOldInstances = new TQPtrDict<TQCString>(); } allInstances->append(this); allOldInstances->insert( this, new TQCString( _name)); } while (false);
   #define DEBUG_REMOVE do { allInstances->removeRef(this); } while (false);
   #define DEBUG_CHECK_ALIVE do { if (!allInstances->contains((TDEInstance*)this)) { TQCString *old = allOldInstances->find((TDEInstance*)this); tqWarning("ACCESSING DELETED TDEINSTANCE! (%s)", old ? old->data() : "<unknown>"); assert(false); } } while (false);
@@ -58,7 +58,7 @@ class TDEInstancePrivate
 public:
     TDEInstancePrivate ()
     {
-        mimeSourceFactory = 0L;
+        mimeSourceFactory = nullptr;
     }
 
     ~TDEInstancePrivate ()
@@ -73,14 +73,14 @@ public:
 };
 
 TDEInstance::TDEInstance( const TQCString& name)
-  : _dirs (0L),
-    _config (0L),
-    _iconLoader (0L),
+  : _dirs (nullptr),
+    _config (nullptr),
+    _iconLoader (nullptr),
 #ifdef __TDE_HAVE_TDEHWLIB
-    _hardwaredevices (0L),
-    _networkmanager (0L),
+    _hardwaredevices (nullptr),
+    _networkmanager (nullptr),
 #endif
-    _name( name ), _aboutData( new TDEAboutData( name, "", 0 ) ), m_configReadOnly(false)
+    _name( name ), _aboutData( new TDEAboutData( name, "", nullptr ) ), m_configReadOnly(false)
 {
     DEBUG_ADD
     Q_ASSERT(!name.isEmpty());
@@ -95,12 +95,12 @@ TDEInstance::TDEInstance( const TQCString& name)
 }
 
 TDEInstance::TDEInstance( const TDEAboutData * aboutData )
-  : _dirs (0L),
-    _config (0L),
-    _iconLoader (0L),
+  : _dirs (nullptr),
+    _config (nullptr),
+    _iconLoader (nullptr),
 #ifdef __TDE_HAVE_TDEHWLIB
-    _hardwaredevices (0L),
-    _networkmanager (0L),
+    _hardwaredevices (nullptr),
+    _networkmanager (nullptr),
 #endif
     _name( aboutData->appName() ), _aboutData( aboutData ), m_configReadOnly(false)
 {
@@ -140,14 +140,14 @@ TDEInstance::TDEInstance( TDEInstance* src )
     d->ownAboutdata = src->d->ownAboutdata;
     d->sharedConfig = src->d->sharedConfig;
 
-    src->_dirs = 0L;
-    src->_config = 0L;
-    src->_iconLoader = 0L;
+    src->_dirs = nullptr;
+    src->_config = nullptr;
+    src->_iconLoader = nullptr;
 #ifdef __TDE_HAVE_TDEHWLIB
-    src->_hardwaredevices = 0L;
-    src->_networkmanager = 0L;
+    src->_hardwaredevices = nullptr;
+    src->_networkmanager = nullptr;
 #endif
-    src->_aboutData = 0L;
+    src->_aboutData = nullptr;
     delete src;
 }
 
@@ -157,31 +157,31 @@ TDEInstance::~TDEInstance()
 
     if (d->ownAboutdata)
         delete _aboutData;
-    _aboutData = 0;
+    _aboutData = nullptr;
 
     delete d;
-    d = 0;
+    d = nullptr;
 
     delete _iconLoader;
-    _iconLoader = 0;
+    _iconLoader = nullptr;
 
 #ifdef __TDE_HAVE_TDEHWLIB
     delete _hardwaredevices;
-    _hardwaredevices = 0;
+    _hardwaredevices = nullptr;
 
     delete _networkmanager;
-    _networkmanager = 0;
+    _networkmanager = nullptr;
 #endif
 
     // delete _config; // Do not delete, stored in d->sharedConfig
-    _config = 0;
+    _config = nullptr;
     delete _dirs;
-    _dirs = 0;
+    _dirs = nullptr;
 
     if (TDEGlobal::_instance == this)
-        TDEGlobal::_instance = 0;
+        TDEGlobal::_instance = nullptr;
     if (TDEGlobal::activeInstance() == this)
-        TDEGlobal::setActiveInstance(0);
+        TDEGlobal::setActiveInstance(nullptr);
     DEBUG_REMOVE
 }
 
@@ -189,7 +189,7 @@ TDEInstance::~TDEInstance()
 TDEStandardDirs *TDEInstance::dirs() const
 {
     DEBUG_CHECK_ALIVE
-    if( _dirs == 0 ) {
+    if( !_dirs ) {
 	_dirs = new TDEStandardDirs( );
         if (_config) {
             if (_dirs->addCustomized(_config))
@@ -212,7 +212,7 @@ void TDEInstance::setConfigReadOnly(bool ro)
 TDEConfig	*TDEInstance::config() const
 {
     DEBUG_CHECK_ALIVE
-    if( _config == 0 ) {
+    if( !_config ) {
         if ( !d->configName.isEmpty() )
         {
             d->sharedConfig = TDESharedConfig::openConfig( d->configName );
@@ -226,12 +226,12 @@ TDEConfig	*TDEInstance::config() const
             }
             else
             {
-               d->sharedConfig = 0;
+               d->sharedConfig = nullptr;
             }
 
         }
 
-        if ( d->sharedConfig == 0 )
+        if ( !d->sharedConfig )
         {
 	    if ( !_name.isEmpty() ) {
 	        d->sharedConfig = TDESharedConfig::openConfig( _name + "rc", m_configReadOnly );
@@ -245,7 +245,7 @@ TDEConfig	*TDEInstance::config() const
 	if (kde_kiosk_admin && !kde_kiosk_exception && !TQCString(getenv("TDE_KIOSK_NO_RESTRICTIONS")).isEmpty())
 	{
             kde_kiosk_exception = true;
-            d->sharedConfig = 0;
+            d->sharedConfig = nullptr;
             return config(); // Reread...
         }
 
@@ -261,7 +261,7 @@ TDEConfig	*TDEInstance::config() const
 TDESharedConfig *TDEInstance::sharedConfig() const
 {
     DEBUG_CHECK_ALIVE
-    if (_config == 0)
+    if (!_config)
        (void) config(); // Initialize config
 
     return d->sharedConfig;
@@ -276,7 +276,7 @@ void TDEInstance::setConfigName(const TQString &configName)
 TDEIconLoader *TDEInstance::iconLoader() const
 {
     DEBUG_CHECK_ALIVE
-    if( _iconLoader == 0 ) {
+    if( !_iconLoader ) {
 	_iconLoader = new TDEIconLoader( _name, dirs() );
     	_iconLoader->enableDelayedIconSetLoading( true );
     }
@@ -288,7 +288,7 @@ TDEIconLoader *TDEInstance::iconLoader() const
 TDEHardwareDevices *TDEInstance::hardwareDevices() const
 {
 	DEBUG_CHECK_ALIVE
-	if (_hardwaredevices == 0)
+	if (!_hardwaredevices)
 	{
 		TQString libName = TQString("libtdehw.so.%1").arg(TDE_VERSION_MAJOR);
 		KLibrary *lib = KLibLoader::self()->library(libName.latin1());
@@ -308,7 +308,7 @@ TDEHardwareDevices *TDEInstance::hardwareDevices() const
 TDEGlobalNetworkManager *TDEInstance::networkManager() const
 {
 	DEBUG_CHECK_ALIVE
-	if (_networkmanager == 0)
+	if (!_networkmanager)
 	{
 		TQString libName = TQString("libtdehw.so.%1").arg(TDE_VERSION_MAJOR);
 		KLibrary *lib = KLibLoader::self()->library(libName.latin1());
diff --git a/tdecore/tdelocale.cpp b/tdecore/tdelocale.cpp
index 1e771c85a..023ec1084 100644
--- a/tdecore/tdelocale.cpp
+++ b/tdecore/tdelocale.cpp
@@ -48,7 +48,7 @@
 
 static const char * const SYSTEM_MESSAGES = "tdelibs";
 
-static const char *maincatalogue = 0;
+static const char *maincatalogue = nullptr;
 
 class TDELocalePrivate
 {
@@ -78,27 +78,27 @@ public:
   bool useMainCatalogue;
 };
 
-static TDELocale *this_klocale = 0;
+static TDELocale *this_klocale = nullptr;
 
 TDELocale::TDELocale( const TQString & catalog, TDEConfig * config )
 {
   d = new TDELocalePrivate;
   d->config = config;
-  d->languages = 0;
-  d->calendar = 0;
+  d->languages = nullptr;
+  d->calendar = nullptr;
   d->formatInited = false;
 
-  initEncoding(0);
-  initFileNameEncoding(0);
+  initEncoding(nullptr);
+  initFileNameEncoding(nullptr);
 
   TDEConfig *cfg = d->config;
   this_klocale = this;
   if (!cfg) cfg = TDEGlobal::instance()->config();
-  this_klocale = 0;
+  this_klocale = nullptr;
   Q_ASSERT( cfg );
 
   d->appName = catalog;
-  initLanguageList( cfg, config == 0);
+  initLanguageList( cfg, config == nullptr);
   initMainCatalogues(catalog);
 }
 
@@ -366,7 +366,7 @@ void TDELocale::initFormat()
 		     MeasureSystem);
   readConfigEntry("CalendarSystem", "gregorian", d->calendarType);
   delete d->calendar;
-  d->calendar = 0; // ### HPB Is this the correct place?
+  d->calendar = nullptr; // ### HPB Is this the correct place?
 
   //Grammatical
   //Precedence here is l10n / i18n / config file
@@ -713,7 +713,7 @@ TDELocale::~TDELocale()
   delete d->calendar;
   delete d->languages;
   delete d;
-  d = 0L;
+  d = nullptr;
 }
 
 TQString TDELocale::translate_priv(const char *msgid,
@@ -820,7 +820,7 @@ TQString TDELocale::translate( const char *singular, const char *plural,
   sprintf(newstring, "_n: %s\n%s", singular, plural);
   // as copying TQString is very fast, it looks slower as it is ;/
   int pluralType = -1;
-  TQString r = translate_priv(newstring, 0, 0, &pluralType);
+  TQString r = translate_priv(newstring, nullptr, nullptr, &pluralType);
   delete [] newstring;
 
   if ( r.isEmpty() || useDefaultLanguage() || pluralType == -1) {
@@ -972,14 +972,14 @@ TQString TDELocale::translateQt( const char *context, const char *source,
     return TQString::null;
   }
 
-  char *newstring = 0;
-  const char *translation = 0;
+  char *newstring = nullptr;
+  const char *translation = nullptr;
   TQString r;
 
   if ( message && message[0]) {
     char *newstring = new char[strlen(source) + strlen(message) + 5];
     sprintf(newstring, "_: %s\n%s", source, message);
-    const char *translation = 0;
+    const char *translation = nullptr;
     // as copying TQString is very fast, it looks slower as it is ;/
     r = translate_priv(newstring, source, &translation);
     delete [] newstring;
@@ -2073,7 +2073,7 @@ void TDELocale::initFileNameEncoding(TDEConfig *)
 {
   // If the following environment variable is set, assume all filenames
   // are in UTF-8 regardless of the current C locale.
-  d->utf8FileEncoding = getenv("TDE_UTF8_FILENAMES") != 0;
+  d->utf8FileEncoding = getenv("TDE_UTF8_FILENAMES") != nullptr;
   if (d->utf8FileEncoding)
   {
     TQFile::setEncodingFunction(TDELocale::encodeFileNameUTF8);
@@ -2302,7 +2302,7 @@ bool TDELocale::setEncoding(int mibEnum)
   if (codec)
     d->codecForEncoding = codec;
 
-  return codec != 0;
+  return codec != nullptr;
 }
 
 TQStringList TDELocale::languagesTwoAlpha() const
@@ -2394,7 +2394,7 @@ void TDELocale::setCalendar(const TQString & calType)
   d->calendarType = calType;
 
   delete d->calendar;
-  d->calendar = 0;
+  d->calendar = nullptr;
 }
 
 TQString TDELocale::calendarType() const
@@ -2448,8 +2448,8 @@ TDELocale & TDELocale::operator=(const TDELocale & rhs)
 
   // the assignment operator works here
   *d = *rhs.d;
-  d->languages = 0; // Don't copy languages
-  d->calendar = 0; // Don't copy the calendar
+  d->languages = nullptr; // Don't copy languages
+  d->calendar = nullptr; // Don't copy the calendar
 
   return *this;
 }
diff --git a/tdecore/tdelocale.h b/tdecore/tdelocale.h
index 395344890..1e3df67ee 100644
--- a/tdecore/tdelocale.h
+++ b/tdecore/tdelocale.h
@@ -104,7 +104,7 @@ TDECORE_EXPORT TQString i18n(const char *singular, const char *plural, unsigned
  * with our i18n method. We use uic -tr tr2i18n to redirect
  * to the right i18n() function
 **/
-inline TQString tr2i18n(const char* message, const char* =0) {
+inline TQString tr2i18n(const char* message, const char* =nullptr) {
   return i18n(message);
 }
 
@@ -140,7 +140,7 @@ public:
    * @param catalog The name of the main language file
    * @param config The configuration file to use.
    */
-  TDELocale( const TQString& catalog, TDEConfig *config = 0 );
+  TDELocale( const TQString& catalog, TDEConfig *config = nullptr );
 
   /**
    * Copy constructor.
@@ -631,7 +631,7 @@ public:
    *
    * @return The string converted to a double
    */
-  double readMoney(const TQString &numStr, bool * ok = 0) const;
+  double readMoney(const TQString &numStr, bool * ok = nullptr) const;
 
   /**
    * Converts a localized numeric string to a double.
@@ -642,7 +642,7 @@ public:
    *
    * @return The string converted to a double
    */
-  double readNumber(const TQString &numStr, bool * ok = 0) const;
+  double readNumber(const TQString &numStr, bool * ok = nullptr) const;
 
   /**
    * Converts a localized date string to a TQDate.
@@ -654,13 +654,13 @@ public:
    *
    * @return The string converted to a QDate
    */
-  TQDate readDate(const TQString &str, bool* ok = 0) const;
+  TQDate readDate(const TQString &str, bool* ok = nullptr) const;
 
   /**
    * Converts a localized date string to a TQDate, using the specified format.
    * You will usually not want to use this method.
    */
-  TQDate readDate( const TQString &intstr, const TQString &fmt, bool* ok = 0) const;
+  TQDate readDate( const TQString &intstr, const TQString &fmt, bool* ok = nullptr) const;
 
   enum ReadDateFlags {
       NormalFormat = 1,
@@ -680,7 +680,7 @@ public:
    * @return The string converted to a QDate
    * @since 3.2
    */
-  TQDate readDate(const TQString &str, ReadDateFlags flags, bool *ok = 0) const;
+  TQDate readDate(const TQString &str, ReadDateFlags flags, bool *ok = nullptr) const;
 
   /**
    * Converts a localized time string to a TQTime.
@@ -694,7 +694,7 @@ public:
    *
    * @return The string converted to a QTime
    */
-  TQTime readTime(const TQString &str, bool* ok = 0) const;
+  TQTime readTime(const TQString &str, bool* ok = nullptr) const;
 
   enum ReadTimeFlags {
       WithSeconds = 0, // default (no flag set)
@@ -714,7 +714,7 @@ public:
    * @return The string converted to a QTime
    * @since 3.2
    */
-  TQTime readTime(const TQString &str, ReadTimeFlags flags, bool *ok = 0) const;
+  TQTime readTime(const TQString &str, ReadTimeFlags flags, bool *ok = nullptr) const;
 
   /**
    * Returns the language used by this object. The domain AND the
@@ -1248,8 +1248,8 @@ private:
    */
   TQString translate_priv(const char *index,
 			 const char *text,
-			 const char ** original = 0,
-			 int* pluralType = 0) const;
+			 const char ** original = nullptr,
+			 int* pluralType = nullptr) const;
 
   /**
    * @internal function used to determine if we are using the en_US translation
diff --git a/tdecore/tdemultipledrag.cpp b/tdecore/tdemultipledrag.cpp
index c3d63cbde..cac155687 100644
--- a/tdecore/tdemultipledrag.cpp
+++ b/tdecore/tdemultipledrag.cpp
@@ -71,7 +71,7 @@ const char* KMultipleDrag::format( int i ) const
         i -= *nit;
     if ( it.current() )
         return it.current()->format( i );
-    return 0;
+    return nullptr;
 }
 
 void KMultipleDrag::virtual_hook( int, void* )
diff --git a/tdecore/tdemultipledrag.h b/tdecore/tdemultipledrag.h
index 631959bc0..46eae80a9 100644
--- a/tdecore/tdemultipledrag.h
+++ b/tdecore/tdemultipledrag.h
@@ -62,7 +62,7 @@ public:
      *                   0 for a parent-less object
      * @param name the name of the object, can be 0
      */
-    KMultipleDrag( TQWidget *dragSource = 0, const char *name = 0 );
+    KMultipleDrag( TQWidget *dragSource = nullptr, const char *name = nullptr );
 
     /**
      * Call this to add each underlying drag object to the multiple drag object.
diff --git a/tdecore/tdeprocctrl.cpp b/tdecore/tdeprocctrl.cpp
index 05ff0566a..5287721e0 100644
--- a/tdecore/tdeprocctrl.cpp
+++ b/tdecore/tdeprocctrl.cpp
@@ -51,7 +51,7 @@ void TDEProcessController::deref()
   if( !refCount ) {
     resetHandlers();
     delete theTDEProcessController;
-    theTDEProcessController = 0;
+    theTDEProcessController = nullptr;
   }
 }
 
@@ -108,7 +108,7 @@ void TDEProcessController::setupHandlers()
 
   act.sa_handler = SIG_IGN;
   act.sa_flags = 0;
-  sigaction( SIGPIPE, &act, 0L );
+  sigaction( SIGPIPE, &act, nullptr );
 
   act.sa_handler = theReaper;
   act.sa_flags = SA_NOCLDSTOP;
@@ -121,7 +121,7 @@ void TDEProcessController::setupHandlers()
 
   sigaddset( &act.sa_mask, SIGCHLD );
   // Make sure we don't block this signal. gdb tends to do that :-(
-  sigprocmask( SIG_UNBLOCK, &act.sa_mask, 0 );
+  sigprocmask( SIG_UNBLOCK, &act.sa_mask, nullptr );
 #else
   //TODO: win32
 #endif
@@ -134,7 +134,7 @@ void TDEProcessController::resetHandlers()
   handlerSet = false;
 
 #ifdef Q_OS_UNIX
-  sigaction( SIGCHLD, &oldChildHandlerData, 0 );
+  sigaction( SIGCHLD, &oldChildHandlerData, nullptr );
 #else
   //TODO: win32
 #endif
@@ -211,7 +211,7 @@ void TDEProcessController::slotDoHousekeeping()
   TQValueListIterator<int> ueit( unixProcessList.end() );
   while( uit != ueit )
   {
-    if( waitpid( *uit, 0, WNOHANG ) > 0 )
+    if( waitpid( *uit, nullptr, WNOHANG ) > 0 )
     {
       uit = unixProcessList.remove( uit );
       deref(); // counterpart to addProcess, can invalidate 'this'
@@ -227,7 +227,7 @@ bool TDEProcessController::waitForProcessExit( int timeout )
   {
     struct timeval tv, *tvp;
     if (timeout < 0)
-      tvp = 0;
+      tvp = nullptr;
     else
     {
       tv.tv_sec = timeout;
@@ -239,7 +239,7 @@ bool TDEProcessController::waitForProcessExit( int timeout )
     FD_ZERO( &fds );
     FD_SET( fd[0], &fds );
 
-    switch( select( fd[0]+1, &fds, 0, 0, tvp ) )
+    switch( select( fd[0]+1, &fds, nullptr, nullptr, tvp ) )
     {
     case -1:
       if( errno == EINTR )
diff --git a/tdecore/tdeprocess.cpp b/tdecore/tdeprocess.cpp
index 360fca350..5319be6d8 100644
--- a/tdecore/tdeprocess.cpp
+++ b/tdecore/tdeprocess.cpp
@@ -82,7 +82,7 @@ public:
      usePty(TDEProcess::NoCommunication),
      addUtmp(false), useShell(false),
 #ifdef Q_OS_UNIX
-     pty(0),
+     pty(nullptr),
 #endif
      priority(0)
    {
@@ -115,11 +115,11 @@ TDEProcess::TDEProcess( TQObject* parent, const char *name )
     pid_(0),
     status(0),
     keepPrivs(false),
-    innot(0),
-    outnot(0),
-    errnot(0),
+    innot(nullptr),
+    outnot(nullptr),
+    errnot(nullptr),
     communication(NoCommunication),
-    input_data(0),
+    input_data(nullptr),
     input_sent(0),
     input_total(0)
 {
@@ -140,11 +140,11 @@ TDEProcess::TDEProcess()
     pid_(0),
     status(0),
     keepPrivs(false),
-    innot(0),
-    outnot(0),
-    errnot(0),
+    innot(nullptr),
+    outnot(nullptr),
+    errnot(nullptr),
     communication(NoCommunication),
-    input_data(0),
+    input_data(nullptr),
     input_sent(0),
     input_total(0)
 {
@@ -317,14 +317,14 @@ bool TDEProcess::start(RunMode runmode, Communication comm)
       arglist[0] = d->shell.data();
       arglist[1] = (char *) "-c";
       arglist[2] = shellCmd.data();
-      arglist[3] = 0;
+      arglist[3] = nullptr;
   }
   else
   {
       arglist = static_cast<char **>(malloc( (n + 1) * sizeof(char *)));
       for (uint i = 0; i < n; i++)
          arglist[i] = arguments[i].data();
-      arglist[n] = 0;
+      arglist[n] = nullptr;
   }
 
   run_mode = runmode;
@@ -339,7 +339,7 @@ bool TDEProcess::start(RunMode runmode, Communication comm)
   // We do this in the parent because if we do it in the child process
   // gdb gets confused when the application runs from gdb.
 #ifdef HAVE_INITGROUPS
-  struct passwd *pw = geteuid() ? 0 : getpwuid(getuid());
+  struct passwd *pw = geteuid() ? nullptr : getpwuid(getuid());
 #endif
 
   int fd[2];
@@ -366,7 +366,7 @@ bool TDEProcess::start(RunMode runmode, Communication comm)
         act.sa_handler = SIG_DFL;
         act.sa_flags = 0;
         for (int sig = 1; sig < NSIG; sig++)
-          sigaction(sig, &act, 0L);
+          sigaction(sig, &act, nullptr);
 
         if (d->priority)
             setpriority(PRIO_PROCESS, 0, d->priority);
@@ -421,7 +421,7 @@ bool TDEProcess::start(RunMode runmode, Communication comm)
      {
          // exec() failed
          close(fd[0]);
-         waitpid(pid_, 0, 0);
+         waitpid(pid_, nullptr, 0);
          pid_ = 0;
          commClose();
          return false;
@@ -469,7 +469,7 @@ bool TDEProcess::start(RunMode runmode, Communication comm)
     emit processExited(this);
     break;
   default: // NotifyOnExit & OwnGroup
-    input_data = 0; // Discard any data for stdin that might still be there
+    input_data = nullptr; // Discard any data for stdin that might still be there
     break;
   }
   return true;
@@ -526,7 +526,7 @@ bool TDEProcess::wait(int timeout)
 #endif
   struct timeval tv, *tvp;
   if (timeout < 0)
-    tvp = 0;
+    tvp = nullptr;
   else
   {
 #ifndef __linux__
@@ -557,7 +557,7 @@ bool TDEProcess::wait(int timeout)
     }
 #endif
 
-    switch( select( fd+1, &fds, 0, 0, tvp ) )
+    switch( select( fd+1, &fds, nullptr, nullptr, tvp ) )
     {
     case -1:
       if( errno == EINTR )
@@ -621,7 +621,7 @@ bool TDEProcess::writeStdin(const char *buffer, int buflen)
   // if there is still data pending, writing new data
   // to stdout is not allowed (since it could also confuse
   // tdeprocess ...)
-  if (input_data != 0)
+  if (input_data)
     return false;
 
   if (communication & Stdin) {
@@ -653,7 +653,7 @@ bool TDEProcess::closeStdin()
   if (communication & Stdin) {
     communication = (Communication) (communication & ~Stdin);
     delete innot;
-    innot = 0;
+    innot = nullptr;
     if (!(d->usePty & Stdin))
       close(in[1]);
     in[1] = -1;
@@ -667,7 +667,7 @@ bool TDEProcess::closeStdout()
   if (communication & Stdout) {
     communication = (Communication) (communication & ~Stdout);
     delete outnot;
-    outnot = 0;
+    outnot = nullptr;
     if (!(d->usePty & Stdout))
       close(out[0]);
     out[0] = -1;
@@ -681,7 +681,7 @@ bool TDEProcess::closeStderr()
   if (communication & Stderr) {
     communication = (Communication) (communication & ~Stderr);
     delete errnot;
-    errnot = 0;
+    errnot = nullptr;
     if (!(d->usePty & Stderr))
       close(err[0]);
     err[0] = -1;
@@ -737,7 +737,7 @@ void TDEProcess::slotSendData(int)
 {
   if (input_sent == input_total) {
     innot->setEnabled(false);
-    input_data = 0;
+    input_data = nullptr;
     emit wroteStdin(this);
   } else {
     int result = ::write(in[1], input_data+input_sent, input_total-input_sent);
@@ -787,7 +787,7 @@ void TDEProcess::setUsePty(Communication usePty, bool addUtmp)
       d->pty = new KPty;
   } else {
     delete d->pty;
-    d->pty = 0;
+    d->pty = nullptr;
   }
 }
 
@@ -1058,7 +1058,7 @@ void TDEProcess::commClose()
           max_fd = notfd;
         // If the process is still running we block until we
         // receive data or the process exits.
-        p_timeout = 0; // no timeout
+        p_timeout = nullptr; // no timeout
       } else {
         // If the process has already exited, we only check
         // the available data, we don't wait for more.
@@ -1066,7 +1066,7 @@ void TDEProcess::commClose()
         p_timeout = &timeout;
       }
 
-      int fds_ready = select(max_fd+1, &rfds, 0, 0, p_timeout);
+      int fds_ready = select(max_fd+1, &rfds, nullptr, nullptr, p_timeout);
       if (fds_ready < 0) {
         if (errno == EINTR)
           continue;
diff --git a/tdecore/tdeprocess.h b/tdecore/tdeprocess.h
index a6329f147..c7c3aa7a0 100644
--- a/tdecore/tdeprocess.h
+++ b/tdecore/tdeprocess.h
@@ -191,7 +191,7 @@ public:
    * Constructor
    * @since 3.2
    */
-  TDEProcess( TQObject* parent, const char *name = 0 );
+  TDEProcess( TQObject* parent, const char *name = nullptr );
 
   /**
    * Constructor
@@ -521,7 +521,7 @@ public:
    *              for shell compatibility reasons.
    * @since 3.1
    */
-  void setUseShell(bool useShell, const char *shell = 0);
+  void setUseShell(bool useShell, const char *shell = nullptr);
 
   /**
    * This function can be used to quote an argument string such that
@@ -912,7 +912,7 @@ public:
    *
    * If no shellname is specified, the user's default shell is used.
    */
-  KShellProcess(const char *shellname=0);
+  KShellProcess(const char *shellname=nullptr);
 
   /**
    * Destructor.
diff --git a/tdecore/tdeprocio.cpp b/tdecore/tdeprocio.cpp
index e614148c5..5abf88845 100644
--- a/tdecore/tdeprocio.cpp
+++ b/tdecore/tdeprocio.cpp
@@ -158,7 +158,7 @@ void TDEProcIO::closeWhenDone()
      closeStdin();
      return;
   }
-  outbuffer.append(0);
+  outbuffer.append(nullptr);
   
   return;
 }
diff --git a/tdecore/tdeprocio.h b/tdecore/tdeprocio.h
index d7394b8b1..fe97a0d8b 100644
--- a/tdecore/tdeprocio.h
+++ b/tdecore/tdeprocio.h
@@ -55,7 +55,7 @@ public:
   /**
    * Constructor
    */
-  TDEProcIO ( TQTextCodec *codec = 0 );
+  TDEProcIO ( TQTextCodec *codec = nullptr );
 
   /**
    * Destructor
@@ -149,7 +149,7 @@ public:
    * false if the line contains a '\\n' and false otherwise.
    * @return the number of characters read, or -1 if no data is available.
    **/
-  int readln (TQString &line, bool autoAck=true, bool *partial=0);
+  int readln (TQString &line, bool autoAck=true, bool *partial=nullptr);
 
   /**
    * This function calls readln().
diff --git a/tdecore/tdeshortcut.cpp b/tdecore/tdeshortcut.cpp
index e4337163f..0577b6e3b 100644
--- a/tdecore/tdeshortcut.cpp
+++ b/tdecore/tdeshortcut.cpp
@@ -31,9 +31,9 @@
 
 //----------------------------------------------------
 
-static KKey* g_pspec = 0;
-static KKeySequence* g_pseq = 0;
-static TDEShortcut* g_pcut = 0;
+static KKey* g_pspec = nullptr;
+static KKeySequence* g_pseq = nullptr;
+static TDEShortcut* g_pcut = nullptr;
 
 //----------------------------------------------------
 // KKey
diff --git a/tdecore/tdeshortcut.h b/tdecore/tdeshortcut.h
index 69fb3c82c..79b370fd7 100644
--- a/tdecore/tdeshortcut.h
+++ b/tdecore/tdeshortcut.h
@@ -824,7 +824,7 @@ class TDECORE_EXPORT TDEShortcut
 	/**
 	 * @internal
 	 */
-	TQString toStringInternal( const TDEShortcut* pcutDefault = 0 ) const;
+	TQString toStringInternal( const TDEShortcut* pcutDefault = nullptr ) const;
 
 	/**
 	 * Returns a null shortcut.
diff --git a/tdecore/tdeshortcutlist.cpp b/tdecore/tdeshortcutlist.cpp
index b4ceb86d8..4cbcd7022 100644
--- a/tdecore/tdeshortcutlist.cpp
+++ b/tdecore/tdeshortcutlist.cpp
@@ -55,7 +55,7 @@ int TDEShortcutList::index( const KKeySequence& seq ) const
 
 const TDEInstance* TDEShortcutList::instance() const
 {
-	return 0;
+	return nullptr;
 }
 
 TQVariant TDEShortcutList::getOther( Other, uint ) const
diff --git a/tdecore/tdeshortcutlist.h b/tdecore/tdeshortcutlist.h
index 9c45b6d0e..58ab53007 100644
--- a/tdecore/tdeshortcutlist.h
+++ b/tdecore/tdeshortcutlist.h
@@ -162,7 +162,7 @@ class TDECORE_EXPORT TDEShortcutList
 	 * @param pConfig the configuration file to load from
 	 * @return true if successful, false otherwise
 	 */
-	virtual bool readSettings( const TQString& sConfigGroup = TQString::null, TDEConfigBase* pConfig = 0 );
+	virtual bool readSettings( const TQString& sConfigGroup = TQString::null, TDEConfigBase* pConfig = nullptr );
 
 	/**
 	 * Writes the shortcuts to the given configuration file.
@@ -173,7 +173,7 @@ class TDECORE_EXPORT TDEShortcutList
 	 * @param bGlobal true to write to the global configuration file
 	 * @return true if successful, false otherwise
 	 */
-	virtual bool writeSettings( const TQString& sConfigGroup = TQString::null, TDEConfigBase* pConfig = 0,
+	virtual bool writeSettings( const TQString& sConfigGroup = TQString::null, TDEConfigBase* pConfig = nullptr,
 			bool bWriteAll = false, bool bGlobal = false ) const;
 
  protected:
diff --git a/tdecore/tdeshortcutmenu.cpp b/tdecore/tdeshortcutmenu.cpp
index bf381bf78..958b930d2 100644
--- a/tdecore/tdeshortcutmenu.cpp
+++ b/tdecore/tdeshortcutmenu.cpp
@@ -37,7 +37,7 @@ TDEShortcutMenu::TDEShortcutMenu( TQWidget* pParent, TDEAccelActions* pActions,
 	TQFont fontTitle = TDEGlobalSettings::menuFont();
 	fontTitle.setBold( true );
 	
-	pTitle = new TQLabel( "", (TQWidget*)0 );
+	pTitle = new TQLabel( "", nullptr );
 	pTitle->setFont( fontTitle );
 	pTitle->setFrameShape( TQFrame::Panel );	
 	
diff --git a/tdecore/tdestandarddirs.cpp b/tdecore/tdestandarddirs.cpp
index 0821b22d1..6366cf257 100644
--- a/tdecore/tdestandarddirs.cpp
+++ b/tdecore/tdestandarddirs.cpp
@@ -86,7 +86,7 @@ private:
    static TDEStandardDirsSingleton* s_self;
 };
 static KStaticDeleter<TDEStandardDirsSingleton> kstds_sd;
-TDEStandardDirsSingleton* TDEStandardDirsSingleton::s_self = 0;
+TDEStandardDirsSingleton* TDEStandardDirsSingleton::s_self = nullptr;
 TDEStandardDirsSingleton* TDEStandardDirsSingleton::self() {
     if ( !s_self )
         kstds_sd.setObject( s_self, new TDEStandardDirsSingleton );
@@ -100,7 +100,7 @@ static const char* const types[] = {"html", "html-bundle", "icon", "apps", "soun
 			      "module", "tqtplugins",
 			      "xdgdata-apps", "xdgdata-dirs", "xdgconf-menu",
 			      "xdgdata-icon", "xdgdata-pixmap", "xdgconf-autostart",
-			      "kcfg", "emoticons", 0 };
+			      "kcfg", "emoticons", nullptr };
 
 static int tokenize( TQStringList& token, const TQString& str,
 		const TQString& delim );
@@ -157,7 +157,7 @@ void TDEStandardDirs::applyDataRestrictions(const TQString &relPath) const
 TQStringList TDEStandardDirs::allTypes() const
 {
     TQStringList list;
-    for (int i = 0; types[i] != 0; ++i)
+    for (int i = 0; types[i]; ++i)
         list.append(TQString::fromLatin1(types[i]));
     return list;
 }
@@ -492,7 +492,7 @@ static void lookupDirectory(const TQString& path, const TQString &relPart,
     TQString _dot(".");
     TQString _dotdot("..");
 
-    while( ( ep = readdir( dp ) ) != 0L )
+    while(( ep = readdir( dp ) ) != nullptr)
     {
       TQString fn( TQFile::decodeName(ep->d_name));
       if (fn == _dot || fn == _dotdot || TQChar(fn.at(fn.length() - 1)).latin1() == TQChar('~').latin1())
@@ -591,7 +591,7 @@ static void lookupPrefix(const TQString& prefix, const TQString& relpath,
         TQString _dot(".");
         TQString _dotdot("..");
 
-	while( ( ep = readdir( dp ) ) != 0L )
+	while(( ep = readdir( dp ) ) != nullptr)
 	    {
 		TQString fn( TQFile::decodeName(ep->d_name));
 		if (fn == _dot || fn == _dotdot || fn.at(fn.length() - 1) == TQChar('~'))
@@ -692,7 +692,7 @@ TDEStandardDirs::realPath(const TQString &dirname)
     memset(realpath_buffer, 0, MAXPATHLEN + 1);
 
     /* If the path contains symlinks, get the real name */
-    if (realpath( TQFile::encodeName(dirname).data(), realpath_buffer) != 0) {
+    if (realpath( TQFile::encodeName(dirname).data(), realpath_buffer)) {
         // success, use result from realpath
         int len = strlen(realpath_buffer);
         realpath_buffer[len] = TQChar('/');
@@ -710,7 +710,7 @@ TDEStandardDirs::realFilePath(const TQString &filename)
     memset(realpath_buffer, 0, MAXPATHLEN + 1);
 
     /* If the path contains symlinks, get the real name */
-    if (realpath( TQFile::encodeName(filename).data(), realpath_buffer) != 0) {
+    if (realpath( TQFile::encodeName(filename).data(), realpath_buffer)) {
         // success, use result from realpath
         return TQFile::decodeName(realpath_buffer);
     }
@@ -825,7 +825,7 @@ TQStringList TDEStandardDirs::resourceDirs(const char *type) const
         if (dirs)
         {
             bool local = true;
-            const TQStringList *prefixList = 0;
+            const TQStringList *prefixList = nullptr;
             if (strncmp(type, "xdgdata-", 8) == 0)
                 prefixList = &(d->xdgdata_prefixes);
             else if (strncmp(type, "xdgconf-", 8) == 0)
@@ -1449,7 +1449,7 @@ void TDEStandardDirs::addKDEDefaults()
 
 
     uint index = 0;
-    while (types[index] != 0) {
+    while (types[index]) {
 	addResourceType(types[index], kde_default(types[index]));
 	index++;
     }
diff --git a/tdecore/tdestartupinfo.cpp b/tdecore/tdestartupinfo.cpp
index a2ea6c4a7..6024224c4 100644
--- a/tdecore/tdestartupinfo.cpp
+++ b/tdecore/tdestartupinfo.cpp
@@ -102,21 +102,21 @@ struct TDEStartupInfoPrivate
 	TDEStartupInfoPrivate( int flags_P )
     	    :
 #ifdef TQ_WS_X11
-	    msgs( NET_STARTUP_MSG, NULL, false ),
+	    msgs( NET_STARTUP_MSG, nullptr, false ),
 #endif
 	      flags( flags_P ) {}
     };
 
 TDEStartupInfo::TDEStartupInfo( int flags_P, TQObject* parent_P, const char* name_P )
     : TQObject( parent_P, name_P ),
-        timeout( 60 ), d( NULL )
+        timeout( 60 ), d( nullptr )
     {
     init( flags_P );
     }
 
 TDEStartupInfo::TDEStartupInfo( bool clean_on_cantdetect_P, TQObject* parent_P, const char* name_P )
     : TQObject( parent_P, name_P ),
-        timeout( 60 ), d( NULL )
+        timeout( 60 ), d( nullptr )
     {
     init( clean_on_cantdetect_P ? CleanOnCantDetect : 0 );
     }
@@ -138,7 +138,7 @@ void TDEStartupInfo::init( int flags_P )
         connect( d->wm_module, TQ_SIGNAL( systemTrayWindowAdded( WId )), TQ_SLOT( slot_window_added( WId )));
         }
     else
-        d->wm_module = NULL;
+        d->wm_module = nullptr;
     connect( &d->msgs, TQ_SIGNAL( gotMessage( const TQString& )), TQ_SLOT( got_message( const TQString& )));
 #endif
     d->cleanup = new TQTimer( this, "cleanup" );
@@ -225,7 +225,7 @@ void TDEStartupInfo::got_startup_info( const TQString& msg_P, bool update_P )
 void TDEStartupInfo::new_startup_info_internal( const TDEStartupInfoId& id_P,
     Data& data_P, bool update_P )
     {
-    if( d == NULL )
+    if( !d )
         return;
     if( id_P.none())
         return;
@@ -310,7 +310,7 @@ void TDEStartupInfo::got_remove_startup_info( const TQString& msg_P )
 
 void TDEStartupInfo::remove_startup_info_internal( const TDEStartupInfoId& id_P )
     {
-    if( d == NULL )
+    if( !d )
         return;
     if( d->startups.contains( id_P ))
         {
@@ -333,7 +333,7 @@ void TDEStartupInfo::remove_startup_info_internal( const TDEStartupInfoId& id_P
 
 void TDEStartupInfo::remove_startup_pids( const TDEStartupInfoData& data_P )
     { // first find the matching info
-    if( d == NULL )
+    if( !d )
         return;
     for( TQMap< TDEStartupInfoId, Data >::Iterator it = d->startups.begin();
          it != d->startups.end();
@@ -351,10 +351,10 @@ void TDEStartupInfo::remove_startup_pids( const TDEStartupInfoData& data_P )
 void TDEStartupInfo::remove_startup_pids( const TDEStartupInfoId& id_P,
     const TDEStartupInfoData& data_P )
     {
-    if( d == NULL )
+    if( !d )
         return;
     kdFatal( data_P.pids().count() == 0, 172 );
-    Data* data = NULL;
+    Data* data = nullptr;
     if( d->startups.contains( id_P ))
 	data = &d->startups[ id_P ];
     else if( d->silent_startups.contains( id_P ))
@@ -489,7 +489,7 @@ bool TDEStartupInfo::sendFinishX( Display* disp_P, const TDEStartupInfoId& id_P,
 
 void TDEStartupInfo::appStarted()
     {
-    if( tdeApp != NULL )  // TDEApplication constructor unsets the env. variable
+    if( tdeApp )  // TDEApplication constructor unsets the env. variable
         appStarted( tdeApp->startupId());
     else
         appStarted( TDEStartupInfo::currentStartupIdEnv().id());
@@ -501,13 +501,13 @@ void TDEStartupInfo::appStarted( const TQCString& startup_id )
     id.initId( startup_id );
     if( id.none())
         return;
-    if( tdeApp != NULL )
+    if( tdeApp )
         TDEStartupInfo::sendFinish( id );
-    else if( getenv( "DISPLAY" ) != NULL ) // don't rely on tqt_xdisplay()
+    else if( getenv( "DISPLAY" ) ) // don't rely on tqt_xdisplay()
         {
 #ifdef TQ_WS_X11
-        Display* disp = XOpenDisplay( NULL );
-        if( disp != NULL )
+        Display* disp = XOpenDisplay( nullptr );
+        if( disp )
             {
             TDEStartupInfo::sendFinishX( disp, id );
             XCloseDisplay( disp );
@@ -542,7 +542,7 @@ void TDEStartupInfo::setNewStartupId( TQWidget* window, const TQCString& startup
     {
     bool activate = true;
     tdeApp->setStartupId( startup_id );
-    if( window != NULL )
+    if( window )
         {
         if( !startup_id.isEmpty() && startup_id != "0" )
             {
@@ -574,23 +574,23 @@ TDEStartupInfo::startup_t TDEStartupInfo::checkStartup( WId w_P, TDEStartupInfoI
 
 TDEStartupInfo::startup_t TDEStartupInfo::checkStartup( WId w_P, TDEStartupInfoId& id_O )
     {
-    return check_startup_internal( w_P, &id_O, NULL );
+    return check_startup_internal( w_P, &id_O, nullptr );
     }
 
 TDEStartupInfo::startup_t TDEStartupInfo::checkStartup( WId w_P, TDEStartupInfoData& data_O )
     {
-    return check_startup_internal( w_P, NULL, &data_O );
+    return check_startup_internal( w_P, nullptr, &data_O );
     }
 
 TDEStartupInfo::startup_t TDEStartupInfo::checkStartup( WId w_P )
     {
-    return check_startup_internal( w_P, NULL, NULL );
+    return check_startup_internal( w_P, nullptr, nullptr );
     }
 
 TDEStartupInfo::startup_t TDEStartupInfo::check_startup_internal( WId w_P, TDEStartupInfoId* id_O,
     TDEStartupInfoData* data_O )
     {
-    if( d == NULL )
+    if( !d )
         return NoMatch;
     if( d->startups.count() == 0 )
         return NoMatch; // no startups
@@ -659,16 +659,16 @@ TDEStartupInfo::startup_t TDEStartupInfo::check_startup_internal( WId w_P, TDESt
 bool TDEStartupInfo::find_id( const TQCString& id_P, TDEStartupInfoId* id_O,
     TDEStartupInfoData* data_O )
     {
-    if( d == NULL )
+    if( !d )
         return false;
     kdDebug( 172 ) << "[tdecore-tdestartupinfo] find_id:" << id_P << endl;
     TDEStartupInfoId id;
     id.initId( id_P );
     if( d->startups.contains( id ))
         {
-        if( id_O != NULL )
+        if( id_O )
             *id_O = id;
-        if( data_O != NULL )
+        if( data_O )
             *data_O = d->startups[ id ];
         kdDebug( 172 ) << "[tdecore-tdestartupinfo] check_startup_id:match" << endl;
         return true;
@@ -679,7 +679,7 @@ bool TDEStartupInfo::find_id( const TQCString& id_P, TDEStartupInfoId* id_O,
 bool TDEStartupInfo::find_pid( pid_t pid_P, const TQCString& hostname_P,
     TDEStartupInfoId* id_O, TDEStartupInfoData* data_O )
     {
-    if( d == NULL )
+    if( !d )
         return false;
     kdDebug( 172 ) << "[tdecore-tdestartupinfo] find_pid:" << pid_P << endl;
     for( TQMap< TDEStartupInfoId, Data >::Iterator it = d->startups.begin();
@@ -688,9 +688,9 @@ bool TDEStartupInfo::find_pid( pid_t pid_P, const TQCString& hostname_P,
         {
         if( ( *it ).is_pid( pid_P ) && ( *it ).hostname() == hostname_P )
             { // Found it !
-            if( id_O != NULL )
+            if( id_O )
                 *id_O = it.key();
-            if( data_O != NULL )
+            if( data_O )
                 *data_O = *it;
             // non-compliant, remove on first match
             remove_startup_info_internal( it.key());
@@ -704,7 +704,7 @@ bool TDEStartupInfo::find_pid( pid_t pid_P, const TQCString& hostname_P,
 bool TDEStartupInfo::find_wclass( TQCString res_name, TQCString res_class,
     TDEStartupInfoId* id_O, TDEStartupInfoData* data_O )
     {
-    if( d == NULL )
+    if( !d )
         return false;
     res_name = res_name.lower();
     res_class = res_class.lower();
@@ -716,9 +716,9 @@ bool TDEStartupInfo::find_wclass( TQCString res_name, TQCString res_class,
         const TQCString wmclass = ( *it ).findWMClass();
         if( wmclass.lower() == res_name || wmclass.lower() == res_class )
             { // Found it !
-            if( id_O != NULL )
+            if( id_O )
                 *id_O = it.key();
-            if( data_O != NULL )
+            if( data_O )
                 *data_O = *it;
             // non-compliant, remove on first match
             remove_startup_info_internal( it.key());
@@ -743,9 +743,9 @@ static TQCString read_startup_id_property( WId w_P )
             False, utf8_string_atom, &type_ret, &format_ret, &nitems_ret, &after_ret, &name_ret )
 	    == Success )
         {
-	if( type_ret == utf8_string_atom && format_ret == 8 && name_ret != NULL )
+	if( type_ret == utf8_string_atom && format_ret == 8 && name_ret )
   	    ret = reinterpret_cast< char* >( name_ret );
-        if ( name_ret != NULL )
+        if ( name_ret )
             XFree( name_ret );
         }
     return ret;
@@ -825,7 +825,7 @@ void TDEStartupInfo::startups_cleanup_no_age()
 
 void TDEStartupInfo::startups_cleanup()
     {
-    if( d == NULL )
+    if( !d )
         return;
     if( d->startups.count() == 0 && d->silent_startups.count() == 0
         && d->uninited_startups.count() == 0 )
@@ -838,7 +838,7 @@ void TDEStartupInfo::startups_cleanup()
 
 void TDEStartupInfo::startups_cleanup_internal( bool age_P )
     {
-    if( d == NULL )
+    if( !d )
         return;
     for( TQMap< TDEStartupInfoId, Data >::Iterator it = d->startups.begin();
          it != d->startups.end();
@@ -901,7 +901,7 @@ void TDEStartupInfo::startups_cleanup_internal( bool age_P )
 
 void TDEStartupInfo::clean_all_noncompliant()
     {
-    if( d == NULL )
+    if( !d )
         return;
     for( TQMap< TDEStartupInfoId, Data >::Iterator it = d->startups.begin();
          it != d->startups.end();
@@ -924,7 +924,7 @@ TQCString TDEStartupInfo::createNewStartupId()
     // Assign a unique id, use hostname+time+pid, that should be 200% unique.
     // Also append the user timestamp (for focus stealing prevention).
     struct timeval tm;
-    gettimeofday( &tm, NULL );
+    gettimeofday( &tm, nullptr );
     char hostname[ 256 ];
     hostname[ 0 ] = '\0';
     if (!gethostname( hostname, 255 ))
@@ -978,7 +978,7 @@ void TDEStartupInfoId::initId( const TQCString& id_P )
         return;
         }
     const char* startup_env = getenv( NET_STARTUP_ENV );
-    if( startup_env != NULL && *startup_env != '\0' )
+    if( startup_env && *startup_env != '\0' )
         { // already has id
         d->id = startup_env;
 #ifdef KSTARTUPINFO_ALL_DEBUG
@@ -1003,7 +1003,7 @@ TDEStartupInfoId TDEStartupInfo::currentStartupIdEnv()
     {
     const char* startup_env = getenv( NET_STARTUP_ENV );
     TDEStartupInfoId id;
-    if( startup_env != NULL && *startup_env != '\0' )
+    if( startup_env && *startup_env != '\0' )
         id.d->id = startup_env;
     else
         id.d->id = "0";
diff --git a/tdecore/tdestartupinfo.h b/tdecore/tdestartupinfo.h
index 8df8ea182..929b28afe 100644
--- a/tdecore/tdestartupinfo.h
+++ b/tdecore/tdestartupinfo.h
@@ -147,7 +147,7 @@ class TDECORE_EXPORT TDEStartupInfo
 	 * @param name the name of the TQObject (can be 0 for no name)
 	 *
 	 */
-	TDEStartupInfo( int flags, TQObject* parent = NULL, const char* name = NULL );
+	TDEStartupInfo( int flags, TQObject* parent = nullptr, const char* name = nullptr );
 	/**
 	 * Creates an instance that will receive the startup notifications.
 	 *
@@ -159,7 +159,7 @@ class TDECORE_EXPORT TDEStartupInfo
 	 *
 	 * @obsolete
 	 */
-        TDEStartupInfo( bool clean_on_cantdetect, TQObject* parent = 0, const char* name = 0 );
+        TDEStartupInfo( bool clean_on_cantdetect, TQObject* parent = nullptr, const char* name = nullptr );
         virtual ~TDEStartupInfo();
 	/**
 	 * Sends given notification data about started application
diff --git a/tdecore/tdestdaccel.cpp b/tdecore/tdestdaccel.cpp
index b26948fd0..4b042c3cc 100644
--- a/tdecore/tdestdaccel.cpp
+++ b/tdecore/tdestdaccel.cpp
@@ -50,51 +50,51 @@ struct TDEStdAccelInfo
 static TDEStdAccelInfo g_infoStdAccel[] =
 {
 	{AccelNone,            "Group:File", I18N_NOOP("File"), 0, 0, 0, 0, TDEShortcut(), false },
-	{ Open,                I18N_NOOP("Open"), 0,     TQt::CTRL+TQt::Key_O, 0, 0, 0, TDEShortcut(), false },
-	{ New,                 I18N_NOOP("New"), 0,      TQt::CTRL+TQt::Key_N, 0, 0, 0, TDEShortcut(), false },
-	{ Close,               I18N_NOOP("Close"), 0,    TQt::CTRL+TQt::Key_W, TQt::CTRL+TQt::Key_Escape, 0, TQt::CTRL+TQt::Key_W, TDEShortcut(), false },
-	{ Save,                I18N_NOOP("Save"), 0,     TQt::CTRL+TQt::Key_S, 0, 0, 0, TDEShortcut(), false },
-	{ Print,               I18N_NOOP("Print"), 0,    TQt::CTRL+TQt::Key_P, 0, 0, 0, TDEShortcut(), false },
-	{ Quit,                I18N_NOOP("Quit"), 0,     TQt::CTRL+TQt::Key_Q, 0, 0, 0, TDEShortcut(), false },
+	{ Open,                I18N_NOOP("Open"), nullptr,     TQt::CTRL+TQt::Key_O, 0, 0, 0, TDEShortcut(), false },
+	{ New,                 I18N_NOOP("New"), nullptr,      TQt::CTRL+TQt::Key_N, 0, 0, 0, TDEShortcut(), false },
+	{ Close,               I18N_NOOP("Close"), nullptr,    TQt::CTRL+TQt::Key_W, TQt::CTRL+TQt::Key_Escape, 0, TQt::CTRL+TQt::Key_W, TDEShortcut(), false },
+	{ Save,                I18N_NOOP("Save"), nullptr,     TQt::CTRL+TQt::Key_S, 0, 0, 0, TDEShortcut(), false },
+	{ Print,               I18N_NOOP("Print"), nullptr,    TQt::CTRL+TQt::Key_P, 0, 0, 0, TDEShortcut(), false },
+	{ Quit,                I18N_NOOP("Quit"), nullptr,     TQt::CTRL+TQt::Key_Q, 0, 0, 0, TDEShortcut(), false },
 	{AccelNone,            "Group:Edit", I18N_NOOP("Edit"), 0, 0, 0, 0, TDEShortcut(), false },
-	{ Undo,                I18N_NOOP("Undo"), 0,     TQt::CTRL+TQt::Key_Z, 0, 0, 0, TDEShortcut(), false },
-	{ Redo,                I18N_NOOP("Redo"), 0,     TQt::CTRL+TQt::SHIFT+TQt::Key_Z, 0, 0, 0, TDEShortcut(), false },
-	{ Cut,                 I18N_NOOP("Cut"), 0,      TQt::CTRL+TQt::Key_X, 0, TQt::SHIFT+TQt::Key_Delete, 0, TDEShortcut(), false },
-	{ Copy,                I18N_NOOP("Copy"), 0,     TQt::CTRL+TQt::Key_C, 0, TQt::CTRL+TQt::Key_Insert, 0, TDEShortcut(), false },
-	{ Paste,               I18N_NOOP("Paste"), 0,    TQt::CTRL+TQt::Key_V, 0, TQt::SHIFT+TQt::Key_Insert, 0, TDEShortcut(), false },
-	{ PasteSelection,      I18N_NOOP("Paste Selection"), 0, 0, 0, TQt::CTRL+TQt::SHIFT+TQt::Key_Insert, 0, TDEShortcut(), false },
+	{ Undo,                I18N_NOOP("Undo"), nullptr,     TQt::CTRL+TQt::Key_Z, 0, 0, 0, TDEShortcut(), false },
+	{ Redo,                I18N_NOOP("Redo"), nullptr,     TQt::CTRL+TQt::SHIFT+TQt::Key_Z, 0, 0, 0, TDEShortcut(), false },
+	{ Cut,                 I18N_NOOP("Cut"), nullptr,      TQt::CTRL+TQt::Key_X, 0, TQt::SHIFT+TQt::Key_Delete, 0, TDEShortcut(), false },
+	{ Copy,                I18N_NOOP("Copy"), nullptr,     TQt::CTRL+TQt::Key_C, 0, TQt::CTRL+TQt::Key_Insert, 0, TDEShortcut(), false },
+	{ Paste,               I18N_NOOP("Paste"), nullptr,    TQt::CTRL+TQt::Key_V, 0, TQt::SHIFT+TQt::Key_Insert, 0, TDEShortcut(), false },
+	{ PasteSelection,      I18N_NOOP("Paste Selection"), nullptr, 0, 0, TQt::CTRL+TQt::SHIFT+TQt::Key_Insert, 0, TDEShortcut(), false },
 	{ SelectAll,           "SelectAll", I18N_NOOP("Select All"), TQt::CTRL+TQt::Key_A, 0, 0, 0, TDEShortcut(), false },
-	{ Deselect,            I18N_NOOP("Deselect"), 0, TQt::CTRL+TQt::SHIFT+TQt::Key_A, 0, 0, 0, TDEShortcut(), false },
+	{ Deselect,            I18N_NOOP("Deselect"), nullptr, TQt::CTRL+TQt::SHIFT+TQt::Key_A, 0, 0, 0, TDEShortcut(), false },
 	{ DeleteWordBack,      "DeleteWordBack", I18N_NOOP("Delete Word Backwards"), TQt::CTRL+TQt::Key_Backspace, 0, 0, 0, TDEShortcut(), false },
 	{ DeleteWordForward,   "DeleteWordForward", I18N_NOOP("Delete Word Forward"), TQt::CTRL+TQt::Key_Delete, 0,  0, 0, TDEShortcut(), false },
-	{ Find,                I18N_NOOP("Find"), 0,     TQt::CTRL+TQt::Key_F, 0, 0, 0, TDEShortcut(), false },
+	{ Find,                I18N_NOOP("Find"), nullptr,     TQt::CTRL+TQt::Key_F, 0, 0, 0, TDEShortcut(), false },
 	{ FindNext,            "FindNext", I18N_NOOP("Find Next"), TQt::Key_F3, 0, 0, 0, TDEShortcut(), false },
 	{ FindPrev,            "FindPrev", I18N_NOOP("Find Prev"), TQt::SHIFT+TQt::Key_F3, 0, 0, 0, TDEShortcut(), false },
-	{ Replace,             I18N_NOOP("Replace"), 0,  TQt::CTRL+TQt::Key_R, 0, 0, 0, TDEShortcut(), false },
+	{ Replace,             I18N_NOOP("Replace"), nullptr,  TQt::CTRL+TQt::Key_R, 0, 0, 0, TDEShortcut(), false },
 	{AccelNone,            "Group:Navigation", I18N_NOOP("Navigation"), 0, 0, 0, 0, TDEShortcut(), false },
-	{ Home,                I18N_NOOP2("Opposite to End","Home"), 0,     TQt::CTRL+TQt::Key_Home, 0, TQt::Key_HomePage, 0, TDEShortcut(), false },
-	{ End,                 I18N_NOOP("End"), 0,      TQt::CTRL+TQt::Key_End, 0, 0, 0, TDEShortcut(), false },
+	{ Home,                I18N_NOOP2("Opposite to End","Home"), nullptr,     TQt::CTRL+TQt::Key_Home, 0, TQt::Key_HomePage, 0, TDEShortcut(), false },
+	{ End,                 I18N_NOOP("End"), nullptr,      TQt::CTRL+TQt::Key_End, 0, 0, 0, TDEShortcut(), false },
 	{ BeginningOfLine,     "BeginningOfLine", I18N_NOOP("Beginning of Line"), TQt::Key_Home, 0, 0, 0, TDEShortcut(), false},
 	{ EndOfLine,           "EndOfLine", I18N_NOOP("End of Line"), TQt::Key_End, 0, 0, 0, TDEShortcut(), false},
-	{ Prior,               I18N_NOOP("Prior"), 0,    TQt::Key_Prior, 0, 0, 0, TDEShortcut(), false },
-	{ Next,                I18N_NOOP2("Opposite to Prior","Next"), 0,     TQt::Key_Next, 0, 0, 0, TDEShortcut(), false },
+	{ Prior,               I18N_NOOP("Prior"), nullptr,    TQt::Key_Prior, 0, 0, 0, TDEShortcut(), false },
+	{ Next,                I18N_NOOP2("Opposite to Prior","Next"), nullptr,     TQt::Key_Next, 0, 0, 0, TDEShortcut(), false },
 	{ GotoLine,            "GotoLine", I18N_NOOP("Go to Line"), TQt::CTRL+TQt::Key_G, 0, 0, 0, TDEShortcut(), false },
 	{ AddBookmark,         "AddBookmark", I18N_NOOP("Add Bookmark"), TQt::CTRL+TQt::Key_B, 0, 0, 0, TDEShortcut(), false },
 	{ ZoomIn,              "ZoomIn", I18N_NOOP("Zoom In"), TQt::CTRL+TQt::Key_Plus, 0, 0, 0, TDEShortcut(), false },
 	{ ZoomOut,             "ZoomOut", I18N_NOOP("Zoom Out"), TQt::CTRL+TQt::Key_Minus, 0, 0, 0, TDEShortcut(), false },
-	{ Up,                  I18N_NOOP("Up"), 0,       TQt::ALT+TQt::Key_Up, 0, 0, 0, TDEShortcut(), false },
-	{ Back,                I18N_NOOP("Back"), 0,     TQt::ALT+TQt::Key_Left, 0, TQt::Key_Back, 0, TDEShortcut(), false },
-	{ Forward,             I18N_NOOP("Forward"), 0,  TQt::ALT+TQt::Key_Right, 0, TQt::Key_Forward, 0, TDEShortcut(), false },
-	{ Reload,              I18N_NOOP("Reload"), 0,   TQt::Key_F5, 0, TQt::Key_Refresh, 0, TDEShortcut(), false },
+	{ Up,                  I18N_NOOP("Up"), nullptr,       TQt::ALT+TQt::Key_Up, 0, 0, 0, TDEShortcut(), false },
+	{ Back,                I18N_NOOP("Back"), nullptr,     TQt::ALT+TQt::Key_Left, 0, TQt::Key_Back, 0, TDEShortcut(), false },
+	{ Forward,             I18N_NOOP("Forward"), nullptr,  TQt::ALT+TQt::Key_Right, 0, TQt::Key_Forward, 0, TDEShortcut(), false },
+	{ Reload,              I18N_NOOP("Reload"), nullptr,   TQt::Key_F5, 0, TQt::Key_Refresh, 0, TDEShortcut(), false },
 	{ PopupMenuContext,    "PopupMenuContext", I18N_NOOP("Popup Menu Context"), TQt::Key_Menu, 0, 0, 0, TDEShortcut(), false },
 	{ ShowMenubar,         "ShowMenubar", I18N_NOOP("Show Menu Bar"), TQt::CTRL+TQt::Key_M, 0, 0, 0, TDEShortcut(), false },
 	{ BackwardWord,        "BackwardWord", I18N_NOOP("Backward Word"), TQt::CTRL+TQt::Key_Left, 0, 0, 0, TDEShortcut(), false },
 	{ ForwardWord,         "ForwardWord", I18N_NOOP("Forward Word"), TQt::CTRL+TQt::Key_Right, 0, 0, 0, TDEShortcut(), false },
-	{ TabNext,             I18N_NOOP("Activate Next Tab"), 0,  TQt::CTRL+TQt::Key_Period, 0, TQt::CTRL+TQt::Key_BracketRight, 0, TDEShortcut(), false },
-	{ TabPrev,             I18N_NOOP("Activate Previous Tab"), 0,   TQt::CTRL+TQt::Key_Comma, 0, TQt::CTRL+TQt::Key_BracketLeft, 0, TDEShortcut(), false },
+	{ TabNext,             I18N_NOOP("Activate Next Tab"), nullptr,  TQt::CTRL+TQt::Key_Period, 0, TQt::CTRL+TQt::Key_BracketRight, 0, TDEShortcut(), false },
+	{ TabPrev,             I18N_NOOP("Activate Previous Tab"), nullptr,   TQt::CTRL+TQt::Key_Comma, 0, TQt::CTRL+TQt::Key_BracketLeft, 0, TDEShortcut(), false },
 	{ FullScreen,          "FullScreen", I18N_NOOP("Full Screen Mode"), TQt::CTRL+TQt::SHIFT+TQt::Key_F, 0, 0, 0, TDEShortcut(), false },
 	{AccelNone,            "Group:Help", I18N_NOOP("Help"), 0, 0, 0, 0, TDEShortcut(), false },
-	{ Help,                I18N_NOOP("Help"), 0,     TQt::Key_F1, 0, 0, 0, TDEShortcut(), false },
+	{ Help,                I18N_NOOP("Help"), nullptr,     TQt::Key_F1, 0, 0, 0, TDEShortcut(), false },
 	{ WhatsThis,           "WhatsThis", I18N_NOOP("What's This"), TQt::SHIFT+TQt::Key_F1, 0, 0, 0, TDEShortcut(), false },
 	{AccelNone,            "Group:TextCompletion", I18N_NOOP("Text Completion"), 0, 0, 0, 0, TDEShortcut(), false },
 	{ TextCompletion,      "TextCompletion", I18N_NOOP("Text Completion"), TQt::CTRL+TQt::Key_E, 0, 0, 0, TDEShortcut(), false },
@@ -103,7 +103,7 @@ static TDEStdAccelInfo g_infoStdAccel[] =
 	{ SubstringCompletion, "SubstringCompletion", I18N_NOOP("Substring Completion"), TQt::CTRL+TQt::Key_T, 0, 0, 0, TDEShortcut(), false },
 	{ RotateUp,            "RotateUp", I18N_NOOP("Previous Item in List"), TQt::Key_Up, 0, 0, 0, TDEShortcut(), false },
 	{ RotateDown,          "RotateDown", I18N_NOOP("Next Item in List"), TQt::Key_Down, 0, 0, 0, TDEShortcut(), false },
-	{ AccelNone,           0, 0, 0, 0, 0, 0, TDEShortcut(), false }
+	{ AccelNone,           nullptr, nullptr, 0, 0, 0, 0, TDEShortcut(), false }
 };
 
 /** Search for the TDEStdAccelInfo object associated with the given @p id. */
@@ -113,12 +113,12 @@ static TDEStdAccelInfo* infoPtr( StdAccel id )
 		// Linear search. Changing the data structure doesn't seem possible
 		// (since we need groups for the config stuff), but maybe a little
 		// additional hashtable wouldn't hurt.
-		for( uint i = 0; g_infoStdAccel[i].psName != 0; i++ ) {
+		for( uint i = 0; g_infoStdAccel[i].psName; i++ ) {
 			if( g_infoStdAccel[i].id == id )
 				return &g_infoStdAccel[i];
 		}
 	}
-	return 0;
+	return nullptr;
 }
 
 /** Initialize the accelerator @p id by checking if it is overridden
@@ -186,7 +186,7 @@ const TDEShortcut& shortcut( StdAccel id )
 StdAccel findStdAccel( const KKeySequence& seq )
 {
 	if( !seq.isNull() ) {
-		for( uint i = 0; g_infoStdAccel[i].psName != 0; i++ ) {
+		for( uint i = 0; g_infoStdAccel[i].psName; i++ ) {
 			StdAccel id = g_infoStdAccel[i].id;
 			if( id != AccelNone ) {
 				if( !g_infoStdAccel[i].bInitialized )
@@ -330,7 +330,7 @@ uint ShortcutList::count() const
 {
 	static uint g_nAccels = 0;
 	if( g_nAccels == 0 ) {
-		for( ; g_infoStdAccel[g_nAccels].psName != 0; g_nAccels++ )
+		for( ; g_infoStdAccel[g_nAccels].psName; g_nAccels++ )
 			;
 	}
 	return g_nAccels;
@@ -373,7 +373,7 @@ bool ShortcutList::setOther( Other, uint, TQVariant )
 
 bool ShortcutList::save() const
 {
-	return writeSettings( TQString::null, 0, false, true );
+	return writeSettings( TQString::null, nullptr, false, true );
 }
 
 TDECORE_EXPORT TQString action(StdAccel id)
diff --git a/tdecore/tdesycoca.cpp b/tdecore/tdesycoca.cpp
index 80764faec..0d8ad5a46 100644
--- a/tdecore/tdesycoca.cpp
+++ b/tdecore/tdesycoca.cpp
@@ -66,7 +66,7 @@ template class TQPtrList<KSycocaFactory>;
 class KSycocaPrivate {
 public:
     KSycocaPrivate() {
-        database = 0;
+        database = nullptr;
         readError = false;
         updateSig = 0;
         autoRebuild = true;
@@ -87,8 +87,8 @@ int KSycoca::version()
 
 // Read-only constructor
 KSycoca::KSycoca()
-  : DCOPObject("tdesycoca"), m_lstFactories(0), m_str(0), m_barray(0), bNoDatabase(false),
-    m_sycoca_size(0), m_sycoca_mmap(0), m_timeStamp(0)
+  : DCOPObject("tdesycoca"), m_lstFactories(nullptr), m_str(nullptr), m_barray(nullptr), bNoDatabase(false),
+    m_sycoca_size(0), m_sycoca_mmap(nullptr), m_timeStamp(0)
 {
    d = new KSycocaPrivate;
    // Register app as able to receive DCOP messages
@@ -108,9 +108,9 @@ bool KSycoca::openDatabase( bool openDummyIfNotFound )
 {
    bool result = true;
   
-   m_sycoca_mmap = 0;
-   m_str = 0;
-   m_barray = 0;
+   m_sycoca_mmap = nullptr;
+   m_str = nullptr;
+   m_barray = nullptr;
    TQString path;
    TQCString tdesycoca_env = getenv("TDESYCOCA");
    if (tdesycoca_env.isEmpty())
@@ -138,12 +138,12 @@ bool KSycoca::openDatabase( bool openDummyIfNotFound )
      fcntl(database->handle(), F_SETFD, FD_CLOEXEC);
      m_sycoca_size = database->size();
 #ifdef HAVE_MMAP
-     m_sycoca_mmap = (const char *) mmap(0, m_sycoca_size,
+     m_sycoca_mmap = (const char *) mmap(nullptr, m_sycoca_size,
                                 PROT_READ, MAP_SHARED,
                                 database->handle(), 0);
      /* POSIX mandates only MAP_FAILED, but we are paranoid so check for
         null pointer too.  */
-     if (m_sycoca_mmap == (const char*) MAP_FAILED || m_sycoca_mmap == 0)
+     if (m_sycoca_mmap == (const char*) MAP_FAILED || !m_sycoca_mmap)
      {
         kdDebug(7011) << "mmap failed. (length = " << m_sycoca_size << ")" << endl;
 #endif
@@ -170,7 +170,7 @@ bool KSycoca::openDatabase( bool openDummyIfNotFound )
 
      // No database file
      delete database;
-     database = 0;
+     database = nullptr;
 
      bNoDatabase = true;
      if (openDummyIfNotFound)
@@ -197,8 +197,8 @@ bool KSycoca::openDatabase( bool openDummyIfNotFound )
 
 // Read-write constructor - only for KBuildSycoca
 KSycoca::KSycoca( bool /* dummy */ )
-  : DCOPObject("tdesycoca_building"), m_lstFactories(0), m_str(0), m_barray(0), bNoDatabase(false),
-    m_sycoca_size(0), m_sycoca_mmap(0)
+  : DCOPObject("tdesycoca_building"), m_lstFactories(nullptr), m_str(nullptr), m_barray(nullptr), bNoDatabase(false),
+    m_sycoca_size(0), m_sycoca_mmap(nullptr)
 {
    d = new KSycocaPrivate;
    m_lstFactories = new KSycocaFactoryList();
@@ -223,12 +223,12 @@ KSycoca::~KSycoca()
 {
    closeDatabase();
    delete d;
-   _self = 0L;
+   _self = nullptr;
 }
 
 void KSycoca::closeDatabase()
 {
-   TQIODevice *device = 0;
+   TQIODevice *device = nullptr;
    if (m_str)
       device = m_str->device();
 #ifdef HAVE_MMAP
@@ -239,23 +239,23 @@ void KSycoca::closeDatabase()
       // Solaris has munmap(char*, size_t) and everything else should
       // be happy with a char* for munmap(void*, size_t)
       munmap((char*) m_sycoca_mmap, m_sycoca_size);
-      m_sycoca_mmap = 0;
+      m_sycoca_mmap = nullptr;
    }
 #endif
 
    delete m_str;
-   m_str = 0;
+   m_str = nullptr;
    delete device;
    if (d->database != device)
       delete d->database;
    if (m_barray) delete m_barray;
-   m_barray = 0;
-   device = 0;
-   d->database = 0;
+   m_barray = nullptr;
+   device = nullptr;
+   d->database = nullptr;
    // It is very important to delete all factories here
    // since they cache information about the database file
    delete m_lstFactories;
-   m_lstFactories = 0L;
+   m_lstFactories = nullptr;
 }
 
 void KSycoca::addFactory( KSycocaFactory *factory )
@@ -337,14 +337,14 @@ TQDataStream * KSycoca::findFactory(KSycocaFactoryId id)
            // Ok, the new database should be here now, open it.
          }
          if (!openDatabase(false))
-            return 0L; // Still no database - uh oh
+            return nullptr; // Still no database - uh oh
       }
    }
    // rewind and check
    if (!checkVersion(false))
    {
      kdWarning(7011) << "Outdated database found" << endl;
-     return 0L;
+     return nullptr;
    }
    TQ_INT32 aId;
    TQ_INT32 aOffset;
@@ -365,7 +365,7 @@ TQDataStream * KSycoca::findFactory(KSycocaFactoryId id)
          return m_str;
       }
    }
-   return 0;
+   return nullptr;
 }
 
 TQString KSycoca::kfsstnd_prefixes()
@@ -439,7 +439,7 @@ TQString KSycoca::determineRelativePath( const TQString & _fullpath, const char
   return sRelativeFilePath;
 }
 
-KSycoca * KSycoca::_self = 0L;
+KSycoca * KSycoca::_self = nullptr;
 
 void KSycoca::flagError()
 {
diff --git a/tdecore/tdesycocadict.cpp b/tdecore/tdesycocadict.cpp
index 908ce8170..7f30335d9 100644
--- a/tdecore/tdesycocadict.cpp
+++ b/tdecore/tdesycocadict.cpp
@@ -52,12 +52,12 @@ KSycocaDictStringList::KSycocaDictStringList()
 }
 
 KSycocaDict::KSycocaDict()
-  : d(0), mStr(0), mOffset(0)
+  : d(nullptr), mStr(nullptr), mOffset(0)
 {
 }
 
 KSycocaDict::KSycocaDict(TQDataStream *str, int offset)
-  : d(0), mStr(str), mOffset(offset)
+  : d(nullptr), mStr(str), mOffset(offset)
 {
    TQ_UINT32 test1, test2;
    str->device()->at(offset);
@@ -175,7 +175,7 @@ void
 KSycocaDict::clear()
 {
    delete d;
-   d = 0;
+   d = nullptr;
 }
 
 uint
@@ -375,8 +375,8 @@ KSycocaDict::save(TQDataStream &str)
    //kdDebug(7011) << "Clearing hashtable..." << endl;
    for (unsigned int i=0; i < sz; i++)
    {
-      hashTable[i].entry = 0;
-      hashTable[i].duplicates = 0;
+      hashTable[i].entry = nullptr;
+      hashTable[i].duplicates = nullptr;
    }
 
    //kdDebug(7011) << "Filling hashtable..." << endl;
diff --git a/tdecore/tdesycocafactory.cpp b/tdecore/tdesycocafactory.cpp
index bffd12b6a..fd7629937 100644
--- a/tdecore/tdesycocafactory.cpp
+++ b/tdecore/tdesycocafactory.cpp
@@ -29,7 +29,7 @@ template class TQDict<KSycocaEntry>;
 template class TQDict<TDESharedPtr<KSycocaEntry> >;
 
 KSycocaFactory::KSycocaFactory(KSycocaFactoryId factory_id)
- : m_resourceList(0), m_entryDict(0), m_sycocaDict(0)
+ : m_resourceList(nullptr), m_entryDict(nullptr), m_sycocaDict(nullptr)
 {
   if (!KSycoca::self()->isBuilding()) // read-only database ?
   {
@@ -55,8 +55,8 @@ KSycocaFactory::KSycocaFactory(KSycocaFactoryId factory_id)
    else
    {
       // Build new database!
-      m_str = 0;
-      m_resourceList = 0;
+      m_str = nullptr;
+      m_resourceList = nullptr;
       m_entryDict = new KSycocaEntryDict(977);
       m_entryDict->setAutoDelete(true);
       m_sycocaDict = new KSycocaDict();
diff --git a/tdecore/tdetempfile.cpp b/tdecore/tdetempfile.cpp
index 4f6dade45..77440004d 100644
--- a/tdecore/tdetempfile.cpp
+++ b/tdecore/tdetempfile.cpp
@@ -61,10 +61,10 @@ KTempFile::KTempFile(TQString filePrefix, TQString fileExtension, int mode)
 {
    bAutoDelete = false;
    mFd = -1;
-   mStream = 0;
-   mFile = 0;
-   mTextStream = 0;
-   mDataStream = 0;
+   mStream = nullptr;
+   mFile = nullptr;
+   mTextStream = nullptr;
+   mDataStream = nullptr;
    mError = 0;
    bOpen = false;
    if (fileExtension.isEmpty())
@@ -80,10 +80,10 @@ KTempFile::KTempFile(bool)
 {
    bAutoDelete = false;
    mFd = -1;
-   mStream = 0;
-   mFile = 0;
-   mTextStream = 0;
-   mDataStream = 0;
+   mStream = nullptr;
+   mFile = nullptr;
+   mTextStream = nullptr;
+   mDataStream = nullptr;
    mError = 0;
    bOpen = false;
 }
@@ -159,7 +159,7 @@ FILE *
 KTempFile::fstream()
 {
    if (mStream) return mStream;
-   if (mFd < 0) return 0;
+   if (mFd < 0) return nullptr;
 
    // Create a stream
    mStream = KDE_fdopen(mFd, "r+");
@@ -174,7 +174,7 @@ TQFile *
 KTempFile::file()
 {
    if (mFile) return mFile;
-   if ( !fstream() ) return 0;
+   if ( !fstream() ) return nullptr;
 
    mFile = new TQFile();
    mFile->setName( name() );
@@ -186,7 +186,7 @@ TQTextStream *
 KTempFile::textStream()
 {
    if (mTextStream) return mTextStream;
-   if ( !file() ) return 0; // Initialize mFile
+   if ( !file() ) return nullptr; // Initialize mFile
 
    mTextStream = new TQTextStream( mFile );
    return mTextStream;
@@ -196,7 +196,7 @@ TQDataStream *
 KTempFile::dataStream()
 {
    if (mDataStream) return mDataStream;
-   if ( !file() ) return 0;  // Initialize mFile
+   if ( !file() ) return nullptr;  // Initialize mFile
 
    mDataStream = new TQDataStream( mFile );
    return mDataStream;
@@ -257,9 +257,9 @@ bool
 KTempFile::close()
 {
    int result = 0;
-   delete mTextStream; mTextStream = 0;
-   delete mDataStream; mDataStream = 0;
-   delete mFile; mFile = 0;
+   delete mTextStream; mTextStream = nullptr;
+   delete mDataStream; mDataStream = nullptr;
+   delete mFile; mFile = nullptr;
 
    if (mStream)
    {
@@ -268,7 +268,7 @@ KTempFile::close()
          mError = ENOSPC; // Assume disk full.
          
       result = fclose(mStream);
-      mStream = 0;
+      mStream = nullptr;
       mFd = -1;
       if (result != 0) {
          kdWarning() << "KTempFile: Error trying to close " << mTmpName << ": " << strerror(errno) << endl;
diff --git a/tdecore/tdeuniqueapplication.cpp b/tdecore/tdeuniqueapplication.cpp
index 85904a622..6f7b3ae9d 100644
--- a/tdecore/tdeuniqueapplication.cpp
+++ b/tdecore/tdeuniqueapplication.cpp
@@ -66,7 +66,7 @@ bool TDEUniqueApplication::s_handleAutoStarted = false;
 
 static TDECmdLineOptions tdeunique_options[] =
 {
-  { "nofork", "Don't run in the background.", 0 },
+  { "nofork", "Don't run in the background.", nullptr },
   TDECmdLineLastOption
 };
 
@@ -86,7 +86,7 @@ public:
 void
 TDEUniqueApplication::addCmdLineOptions()
 {
-  TDECmdLineArgs::addCmdLineOptions(tdeunique_options, 0, "tdeuniqueapp", "tde" );
+  TDECmdLineArgs::addCmdLineOptions(tdeunique_options, nullptr, "tdeuniqueapp", "tde" );
 }
 
 bool
@@ -187,14 +187,14 @@ TDEUniqueApplication::start()
 #ifdef TQ_WS_X11
            // say we're up and running ( probably no new window will appear )
            TDEStartupInfoId id;
-           if( tdeApp != NULL ) // TDEApplication constructor unsets the env. variable
+           if( tdeApp ) // TDEApplication constructor unsets the env. variable
                id.initId( tdeApp->startupId());
            else
                id = TDEStartupInfo::currentStartupIdEnv();
            if( !id.none())
            {
-               Display* disp = XOpenDisplay( NULL );
-               if( disp != NULL ) // use extra X connection
+               Display* disp = XOpenDisplay( nullptr );
+               if( disp ) // use extra X connection
                {
                    TDEStartupInfo::sendFinishX( disp, id );
                    XCloseDisplay( disp );
@@ -211,14 +211,14 @@ TDEUniqueApplication::start()
      {
 #ifdef TQ_WS_X11
          TDEStartupInfoId id;
-         if( tdeApp != NULL ) // TDEApplication constructor unsets the env. variable
+         if( tdeApp ) // TDEApplication constructor unsets the env. variable
              id.initId( tdeApp->startupId());
          else
              id = TDEStartupInfo::currentStartupIdEnv();
          if( !id.none())
          { // notice about pid change
-            Display* disp = XOpenDisplay( NULL );
-            if( disp != NULL ) // use extra X connection
+            Display* disp = XOpenDisplay( nullptr );
+            if( disp ) // use extra X connection
                {
                TDEStartupInfoData data;
                data.addPid( getpid());
@@ -274,7 +274,7 @@ TDEUniqueApplication::start()
      TQCString new_asn_id;
 #if defined TQ_WS_X11
      TDEStartupInfoId id;
-     if( tdeApp != NULL ) // TDEApplication constructor unsets the env. variable
+     if( tdeApp ) // TDEApplication constructor unsets the env. variable
          id.initId( tdeApp->startupId());
      else
          id = TDEStartupInfo::currentStartupIdEnv();
diff --git a/tdecore/tests/kcalendartest.cpp b/tdecore/tests/kcalendartest.cpp
index 7dc2cc6d7..5669c3520 100644
--- a/tdecore/tests/kcalendartest.cpp
+++ b/tdecore/tests/kcalendartest.cpp
@@ -22,9 +22,9 @@ static const char description[] = "KCalendarTest";
 
 static TDECmdLineOptions options[] =
 {
-  { "help", I18N_NOOP("Prints this help"), 0 },
-  { "type hijri|gregorian|jalali|hebrew", I18N_NOOP("Supported calendar types"), 0 },
-  { "date <date>", I18N_NOOP("Show day info"), 0 },
+  { "help", I18N_NOOP("Prints this help"), nullptr },
+  { "type hijri|gregorian|jalali|hebrew", I18N_NOOP("Supported calendar types"), nullptr },
+  { "date <date>", I18N_NOOP("Show day info"), nullptr },
 };
 
 int main(int argc, char **argv) {
@@ -34,9 +34,9 @@ int main(int argc, char **argv) {
 	
         TDEAboutData aboutData( "kcalendartest", "KCalendarTest" ,
                         "0.1", description, TDEAboutData::License_GPL,
-                        "(c) 2002, Carlos Moro", 0, 0,
+                        "(c) 2002, Carlos Moro", nullptr, nullptr,
                         "cfmoro@correo.uniovi.es");
-  	aboutData.addAuthor("Carlos Moro",0, "cfmoro@correo.uniovi.es");
+	aboutData.addAuthor("Carlos Moro",nullptr, "cfmoro@correo.uniovi.es");
 	
 
         TDECmdLineArgs::init( argc, argv, &aboutData );
diff --git a/tdecore/tests/kcmdlineargstest.cpp b/tdecore/tests/kcmdlineargstest.cpp
index 5213e443f..50b561bfe 100644
--- a/tdecore/tests/kcmdlineargstest.cpp
+++ b/tdecore/tests/kcmdlineargstest.cpp
@@ -14,9 +14,9 @@ static const char description[] = I18N_NOP("This is a test program.");
 static TDECmdLineOptions options[] =
 {
  { "test",		I18N_NOP("do a short test only, note that\n"
-				  "this is rather long comment"), 0 },
+				  "this is rather long comment"), nullptr },
  { "baud <baudrate>",	I18N_NOP("set baudrate"), "9600" },
- { "+file(s)",		I18N_NOP("Files to load"), 0 },
+ { "+file(s)",		I18N_NOP("Files to load"), nullptr },
  TDECmdLineLastOption
 };
 
diff --git a/tdecore/tests/kdebugtest.cpp b/tdecore/tests/kdebugtest.cpp
index 266eaeaae..2f5d31465 100644
--- a/tdecore/tests/kdebugtest.cpp
+++ b/tdecore/tests/kdebugtest.cpp
@@ -37,7 +37,7 @@ public:
     kdError(1202) << "Error !!!" << endl;
     kdError() << "Error with no area" << endl;
 
-    kdDebug() << "Printing a null TQWidget pointer: " << (TQWidget*)0 << endl;
+    kdDebug() << "Printing a null TQWidget pointer: " << static_cast<TQWidget *>(nullptr) << endl;
 
     kdDebug() << "char " << '^' << " " << char(26) << endl;
     TQPoint p(0,9);
@@ -88,7 +88,7 @@ public:
 int main(int argc, char** argv)
 {
   TQApplication app(argc, argv);
-  TestWidget widget(0, "NoNameWidget");
+  TestWidget widget(nullptr, "NoNameWidget");
   widget.setGeometry(45, 54, 120, 80);
   widget.show();
   app.setMainWidget(&widget);
diff --git a/tdecore/tests/kglobaltest.cpp b/tdecore/tests/kglobaltest.cpp
index 852e2ba34..635ef03cd 100644
--- a/tdecore/tests/kglobaltest.cpp
+++ b/tdecore/tests/kglobaltest.cpp
@@ -30,10 +30,10 @@ void testkasciistricmp()
   assert( kasciistricmp( "test", "Test" ) == 0 );
   assert( kasciistricmp( "TeSt", "tEst" ) == 0 );
 
-  assert( kasciistricmp( 0, 0 ) == 0 );
+  assert( kasciistricmp( nullptr, nullptr ) == 0 );
   assert( kasciistricmp( "", "" ) == 0 );
-  assert( kasciistricmp( 0, "" ) < 0 );
-  assert( kasciistricmp( "", 0 ) > 0 );
+  assert( kasciistricmp( nullptr, "" ) < 0 );
+  assert( kasciistricmp( "", nullptr ) > 0 );
 
   assert( kasciistricmp( "", "foo" ) < 0 );
   assert( kasciistricmp( "foo", "" ) > 0 );
@@ -54,7 +54,7 @@ void testkasciistricmp()
 int main(int argc, char *argv[])
 {
   TDEApplication::disableAutoDcopRegistration();
-  TDECmdLineArgs::init( argc, argv, "kglobaltest", 0, 0, 0, 0 );
+  TDECmdLineArgs::init( argc, argv, "kglobaltest", nullptr, nullptr, nullptr, 0 );
   TDEApplication app( false, false );
 
   testkasciistricmp();
diff --git a/tdecore/tests/kipctest.cpp b/tdecore/tests/kipctest.cpp
index 9692710e2..d84c48ab1 100644
--- a/tdecore/tests/kipctest.cpp
+++ b/tdecore/tests/kipctest.cpp
@@ -6,7 +6,7 @@
 #include "kipctest.h"
 
 MyObject::MyObject()
-    : TQObject(0L, "testobj")
+    : TQObject(nullptr, "testobj")
 {
     connect(tdeApp, TQ_SIGNAL(tdedisplayPaletteChanged()), TQ_SLOT(slotPaletteChanged()));
     connect(tdeApp, TQ_SIGNAL(tdedisplayFontChanged()), TQ_SLOT(slotFontChanged()));
diff --git a/tdecore/tests/klocaletest.h b/tdecore/tests/klocaletest.h
index 433807b78..b4a260075 100644
--- a/tdecore/tests/klocaletest.h
+++ b/tdecore/tests/klocaletest.h
@@ -18,7 +18,7 @@ public:
   //@{
   /** Constructor  
 	*/
-  Test( TQWidget *parent=0, const char *name=0 );
+  Test( TQWidget *parent=nullptr, const char *name=nullptr );
   /** Destructor
 	*/
   ~Test();
diff --git a/tdecore/tests/kmdcodectest.cpp b/tdecore/tests/kmdcodectest.cpp
index 4cc06813d..bdb97b3e7 100644
--- a/tdecore/tests/kmdcodectest.cpp
+++ b/tdecore/tests/kmdcodectest.cpp
@@ -55,7 +55,7 @@ void MD5_testSuite ();
 void testCodec (const char*, Codec, bool);
 void MD5_verify (const char*, const char*, bool);
 void MD5_file (const char * , bool rawOutput = false);
-void MD5_string (const char *, const char *expected = 0, bool rawOutput = false);
+void MD5_string (const char *, const char *expected = nullptr, bool rawOutput = false);
 
 long readContent (const TQFile& f, long count, TQByteArray& buf)
 {
@@ -318,19 +318,19 @@ int main (int argc, char *argv[])
     const char *description = "Unit test for md5, base64 encode/decode and uuencode/decode facilities";
     TDECmdLineOptions options[] =
     {
-        { "c <digest>", "compare <digest> with the calculated digest for a string or file.", 0 },
-        { "d", "decode the given string or file using base64", 0 },
-        { "e", "encode the given string or file using base64", 0 },
+        { "c <digest>", "compare <digest> with the calculated digest for a string or file.", nullptr },
+        { "d", "decode the given string or file using base64", nullptr },
+        { "e", "encode the given string or file using base64", nullptr },
         { "f", "the filename to be used as input", "default" },
-        { "p", "encode the given string or file using quoted-printable", 0},
-        { "q", "decode the given string or file using quoted-printable", 0},
-        { "r", "calculate the raw md5 for the given string or file", 0 },
-        { "s", "the string to be used as input", 0 },
-        { "t", "perform a timed message-digest test", 0 },
-        { "u", "uuencode the given string or file", 0 },
-        { "x", "uudecode the given string or file", 0 },
-        { "z", "run a preset message-digest test", 0 },
-        { "+command", "[input1, input2,...]", 0 },
+        { "p", "encode the given string or file using quoted-printable", nullptr},
+        { "q", "decode the given string or file using quoted-printable", nullptr},
+        { "r", "calculate the raw md5 for the given string or file", nullptr },
+        { "s", "the string to be used as input", nullptr },
+        { "t", "perform a timed message-digest test", nullptr },
+        { "u", "uuencode the given string or file", nullptr },
+        { "x", "uudecode the given string or file", nullptr },
+        { "z", "run a preset message-digest test", nullptr },
+        { "+command", "[input1, input2,...]", nullptr },
         TDECmdLineLastOption
     };
 
@@ -383,7 +383,7 @@ int main (int argc, char *argv[])
             else
             {
               if ( isString )
-                MD5_string( args->arg( i ), 0, args->isSet("r") );
+                MD5_string( args->arg( i ), nullptr, args->isSet("r") );
               else
                 MD5_file( args->arg( i ), args->isSet("r") );
             }
diff --git a/tdecore/tests/kmemtest.cpp b/tdecore/tests/kmemtest.cpp
index c36fac555..4b60f1a41 100644
--- a/tdecore/tests/kmemtest.cpp
+++ b/tdecore/tests/kmemtest.cpp
@@ -111,8 +111,8 @@ void *mmapFile(const char *file)
       exit(-1);
    }   
      
-   void *ptr = mmap(0, stat_s.st_size, PROT_READ, MAP_SHARED, fd, 0);
-   if (ptr == 0)
+   void *ptr = mmap(nullptr, stat_s.st_size, PROT_READ, MAP_SHARED, fd, 0);
+   if (!ptr)
    {
       printf("mmap: %s\n", strerror(errno));
       exit(-1);
diff --git a/tdecore/tests/kresolvertest.cpp b/tdecore/tests/kresolvertest.cpp
index 58d0e9ac1..126261fc8 100644
--- a/tdecore/tests/kresolvertest.cpp
+++ b/tdecore/tests/kresolvertest.cpp
@@ -102,7 +102,7 @@ bool try_ntop()
   ((unsigned char*)&in)[15] = 1;	// set this to be ::1
 
   printf("\tTrying to convert ::1 into string...");
-  if (inet_ntop(AF_INET6, &in, buf, sizeof(buf)) == NULL)
+  if (!inet_ntop(AF_INET6, &in, buf, sizeof(buf)))
     {
       printf("failed\n");
       return false;
@@ -214,7 +214,7 @@ bool testKernel()
   printf("succeeded\n");
 
   TDESocketAddress *ksin = KExtendedSocket::localAddress(sock);
-  if (ksin != NULL)
+  if (ksin)
     {
       printf("\tWe got socket %s\n", (const char*)ksin->pretty().latin1());
       delete ksin;
@@ -360,7 +360,7 @@ void go()
   /* Start with simple lookups */
   printf("Trying simple lookups\n"
 	 "All of the following look ups should work\n\n");
-  tryLookup(NULL, "/tmp/something");
+  tryLookup(nullptr, "/tmp/something");
   tryLookup("127.0.0.1", "80");
   tryLookup("localhost", "http");
 
diff --git a/tdecore/tests/kurltest.cpp b/tdecore/tests/kurltest.cpp
index b80515e81..bb243209b 100644
--- a/tdecore/tests/kurltest.cpp
+++ b/tdecore/tests/kurltest.cpp
@@ -82,7 +82,7 @@ void testAdjustPath()
 int main(int argc, char *argv[])
 {
   TDEApplication::disableAutoDcopRegistration();
-  TDECmdLineArgs::init( argc, argv, "kurltest", 0, 0, 0, 0 );
+  TDECmdLineArgs::init( argc, argv, "kurltest", nullptr, nullptr, nullptr, 0 );
   TDEApplication app( false, false );
 
   KURL::List lst;
diff --git a/tdecore/tests/kxerrorhandlertest.cpp b/tdecore/tests/kxerrorhandlertest.cpp
index c2efc7443..f78ea5d49 100644
--- a/tdecore/tests/kxerrorhandlertest.cpp
+++ b/tdecore/tests/kxerrorhandlertest.cpp
@@ -19,7 +19,7 @@ bool handler3( int request, int error_code, unsigned long resourceid )
     
 int main()
     {
-    Display* dpy = XOpenDisplay( NULL );
+    Display* dpy = XOpenDisplay( nullptr );
     XSetWindowAttributes attrs;
     Window w = XCreateWindow( dpy, DefaultRootWindow( dpy ), 0, 0, 100, 100, 0, CopyFromParent, CopyFromParent,
         CopyFromParent, 0, &attrs );
diff --git a/tdecore/tests/tdeapptest.cpp b/tdecore/tests/tdeapptest.cpp
index 09e9124b6..916a87358 100644
--- a/tdecore/tests/tdeapptest.cpp
+++ b/tdecore/tests/tdeapptest.cpp
@@ -36,5 +36,5 @@ main(int argc, char *argv[])
    KSycoca *s = KSycoca::self();
   
    tqWarning("s->language() %s", s->language().latin1());
-   tqWarning("Offset of aIconName: %ld", (long) &(static_cast<TDEApplication *>(0)->aIconName));
+   tqWarning("Offset of aIconName: %ld", (long) &(static_cast<TDEApplication *>(nullptr)->aIconName));
 }
diff --git a/tdecore/tests/tdeconfigtestgui.cpp b/tdecore/tests/tdeconfigtestgui.cpp
index 8db4fce3a..e80e26e73 100644
--- a/tdecore/tests/tdeconfigtestgui.cpp
+++ b/tdecore/tests/tdeconfigtestgui.cpp
@@ -61,9 +61,9 @@
 
 TDEConfigTestView::TDEConfigTestView( TQWidget *parent, const char *name )
     : TQDialog( parent, name ),
-      pConfig( 0L ),
-      pFile( 0L ),
-      pStream( 0L )
+      pConfig( nullptr ),
+      pFile( nullptr ),
+      pStream( nullptr )
 {
   // Set the window caption/title
 
@@ -138,11 +138,11 @@ void TDEConfigTestView::appConfigEditReturnPressed()
 {
     // if there already was a config object, delete it and its associated data
     delete pConfig;
-    pConfig = 0L;
+    pConfig = nullptr;
     delete pFile;
-    pFile = 0L;
+    pFile = nullptr;
     delete pStream;
-    pStream = 0L;
+    pStream = nullptr;
 
   // create a new config object
   if( !pAppFileEdit->text().isEmpty() )
diff --git a/tdecore/tests/tdeconfigtestgui.h b/tdecore/tests/tdeconfigtestgui.h
index 520cb79cf..031e6789f 100644
--- a/tdecore/tests/tdeconfigtestgui.h
+++ b/tdecore/tests/tdeconfigtestgui.h
@@ -43,7 +43,7 @@ class TDEConfigTestView : public TQDialog
 {
   TQ_OBJECT
 public:
-  TDEConfigTestView( TQWidget *parent=0, const char *name=0 );
+  TDEConfigTestView( TQWidget *parent=nullptr, const char *name=nullptr );
   ~TDEConfigTestView();
 
 private slots:
diff --git a/tdecore/tests/testqtargs.cpp b/tdecore/tests/testqtargs.cpp
index cb67ab02a..95678a828 100644
--- a/tdecore/tests/testqtargs.cpp
+++ b/tdecore/tests/testqtargs.cpp
@@ -50,7 +50,7 @@ application palette (light and dark shades are\ncalculated)."), 0},
 
 static const TDECmdLineOptions options[] =
 {
-  { "hello ", I18N_NOOP("Says hello"), 0 },
+  { "hello ", I18N_NOOP("Says hello"), nullptr },
   TDECmdLineLastOption
 };
 
diff --git a/tdecore/twin.cpp b/tdecore/twin.cpp
index 6e96b3b66..1028077bc 100644
--- a/tdecore/twin.cpp
+++ b/tdecore/twin.cpp
@@ -164,7 +164,7 @@ public:
 };
 
 ContextWidget::ContextWidget()
-	: TQWidget(0,0)
+	: TQWidget(nullptr,nullptr)
     {
 	twin_net_create_atoms();
 	tdeApp->installX11EventFilter( this );
@@ -310,9 +310,9 @@ void KWin::setMainWindow( TQWidget* subwindow, WId mainwindow )
         /*
          Grmbl. See TQDialog::show(). That should get fixed in Qt somehow.
         */
-        if( tqt_cast< TQDialog* >( subwindow ) != NULL
-            && subwindow->parentWidget() == NULL
-            && tdeApp->mainWidget() != NULL )
+        if( tqt_cast< TQDialog* >( subwindow )
+            && !subwindow->parentWidget()
+            && tdeApp->mainWidget() )
         {
             kdWarning() << "KWin::setMainWindow(): There either mustn't be tdeApp->mainWidget(),"
                 " or the dialog must have a non-NULL parent, otherwise Qt will reset the change. Bummer." << endl;
@@ -368,7 +368,7 @@ KWin::Info KWin::info( WId win )
     if ( inf.name() ) {
 	w.name = TQString::fromUtf8( inf.name() );
     } else {
-	char* c = 0;
+	char* c = nullptr;
 	if ( XFetchName( tqt_xdisplay(), win, &c ) != 0 ) {
 	    w.name = TQString::fromLocal8Bit( c );
 	    XFree( c );
@@ -407,7 +407,7 @@ TQPixmap KWin::icon( WId win, int width, int height, bool scale, int flags )
         NETWinInfo info( tqt_xdisplay(), win, tqt_xrootwin(), NET::WMIcon );
         NETIcon ni = info.icon( width, height );
         if ( ni.data && ni.size.width > 0 && ni.size.height > 0 ) {
-    	    TQImage img( (uchar*) ni.data, (int) ni.size.width, (int) ni.size.height, 32, 0, 0, TQImage::IgnoreEndian );
+	    TQImage img( (uchar*) ni.data, (int) ni.size.width, (int) ni.size.height, 32, nullptr, 0, TQImage::IgnoreEndian );
 	    img.setAlphaBuffer( true );
 	    if ( scale && width > 0 && height > 0 &&img.size() != TQSize( width, height ) && !img.isNull() )
 	        img = TQImage(img).smoothScale( width, height );
@@ -484,7 +484,7 @@ TQPixmap KWin::icon( WId win, int width, int height, bool scale, int flags )
 	        TQString className = hint.res_class;
 
 	        TQPixmap pm = TDEGlobal::instance()->iconLoader()->loadIcon( className.lower(), TDEIcon::Small, iconWidth,
-								          TDEIcon::DefaultState, 0, true );
+								          TDEIcon::DefaultState, nullptr, true );
 	        if( scale && !pm.isNull() )
 		    result.convertFromImage( TQImage(pm.convertToImage()).smoothScale( width, height ) );
 	        else
@@ -501,7 +501,7 @@ TQPixmap KWin::icon( WId win, int width, int height, bool scale, int flags )
 	// as a last resort:
 	if ( result.isNull() ) {
 	    TQPixmap pm = TDEGlobal::instance()->iconLoader()->loadIcon(  "xapp", TDEIcon::Small, iconWidth,
-								       TDEIcon::DefaultState, 0, true );
+								       TDEIcon::DefaultState, nullptr, true );
 	    if( scale && !pm.isNull() )
 		result.convertFromImage( TQImage(pm.convertToImage()).smoothScale( width, height ) );
 	    else
@@ -740,7 +740,7 @@ class KWin::WindowInfoPrivate
     public:
 	WindowInfoPrivate()
 #ifdef TQ_WS_X11
-	: info( NULL )
+	: info( nullptr )
 #endif
 	{}
 #ifdef TQ_WS_X11
@@ -813,13 +813,13 @@ KWin::WindowInfo::WindowInfo( WId win, unsigned long properties, unsigned long p
 
 // this one is only to make TQValueList<> or similar happy
 KWin::WindowInfo::WindowInfo()
-    : d( NULL )
+    : d( nullptr )
 {
 }
 
 KWin::WindowInfo::~WindowInfo()
 {
-    if( d != NULL ) {
+    if( d ) {
 	if( --d->ref == 0 ) {
 	    delete d;
 	}
@@ -829,18 +829,18 @@ KWin::WindowInfo::~WindowInfo()
 KWin::WindowInfo::WindowInfo( const WindowInfo& wininfo )
     : d( wininfo.d )
 {
-    if( d != NULL )
+    if( d )
 	++d->ref;
 }
 
 KWin::WindowInfo& KWin::WindowInfo::operator=( const WindowInfo& wininfo )
 {
     if( d != wininfo.d ) {
-	if( d != NULL )
+	if( d )
 	    if( --d->ref == 0 )
 		delete d;
 	d = wininfo.d;
-	if( d != NULL )
+	if( d )
 	    ++d->ref;
     }
     return *this;
@@ -1238,12 +1238,12 @@ TQString KWin::readNameProperty( WId win, unsigned long atom )
 {
 #ifdef TQ_WS_X11
     XTextProperty tp;
-    char **text = NULL;
+    char **text = nullptr;
     int count;
 #endif
     TQString result;
 #ifdef TQ_WS_X11
-    if ( XGetTextProperty( tqt_xdisplay(), win, &tp, atom ) != 0 && tp.value != NULL ) 
+    if ( XGetTextProperty( tqt_xdisplay(), win, &tp, atom ) != 0 && tp.value )
     {
         if (!twin_UTF8_STRING)
           twin_UTF8_STRING = XInternAtom( tqt_xdisplay(), "UTF8_STRING", False);
@@ -1252,11 +1252,11 @@ TQString KWin::readNameProperty( WId win, unsigned long atom )
             result = TQString::fromUtf8 ( (const char*) tp.value );
         }
         else if ( XmbTextPropertyToTextList( tqt_xdisplay(), &tp, &text, &count) == Success &&
-                  text != NULL && count > 0 ) {
+                  text && count > 0 ) {
             result = TQString::fromLocal8Bit( text[0] );
         } else if ( tp.encoding == XA_STRING )
             result = TQString::fromLocal8Bit( (const char*) tp.value );
-        if( text != NULL )
+        if( text )
             XFreeStringList( text );
         XFree( tp.value );
     }
diff --git a/tdecore/twinmodule.cpp b/tdecore/twinmodule.cpp
index 8a0cfdded..3b44b3ca9 100644
--- a/tdecore/twinmodule.cpp
+++ b/tdecore/twinmodule.cpp
@@ -34,7 +34,7 @@
 #include <dcopclient.h>
 #include "netwm.h"
 
-static TWinModulePrivate* static_d = 0;
+static TWinModulePrivate* static_d = nullptr;
 
 static unsigned long windows_properties[ 2 ] = { NET::ClientList | NET::ClientListStacking |
 				     NET::NumberOfDesktops |
@@ -62,7 +62,7 @@ class TWinModulePrivate : public TQWidget, public NETRootInfo4
 {
 public:
     TWinModulePrivate(int _what)
-        : TQWidget(0,0), NETRootInfo4( tqt_xdisplay(),
+        : TQWidget(nullptr,nullptr), NETRootInfo4( tqt_xdisplay(),
           _what >= TWinModule::INFO_WINDOWS ?
           windows_properties : desktop_properties,
           2,
@@ -155,7 +155,7 @@ TWinModule::~TWinModule()
     d->modules.removeRef( this );
     if ( d->modules.isEmpty() ) {
 	delete d;
-	static_d = 0;
+	static_d = nullptr;
     }
 }
 
diff --git a/tdecore/twinmodule.h b/tdecore/twinmodule.h
index 9c48f7ff8..43a42d139 100644
--- a/tdecore/twinmodule.h
+++ b/tdecore/twinmodule.h
@@ -90,7 +90,7 @@ public:
      * manager.
      * @param parent the parent for the TQObject
      **/
-    TWinModule( TQObject* parent = 0 );
+    TWinModule( TQObject* parent = nullptr );
 
     /**
      * Destructor. Internal cleanup, nothing fancy.
diff --git a/tdeinit/autostart.cpp b/tdeinit/autostart.cpp
index c5ebb794a..ade77c696 100644
--- a/tdeinit/autostart.cpp
+++ b/tdeinit/autostart.cpp
@@ -224,10 +224,10 @@ AutoStart::loadAutoStartList()
    TQPtrListIterator<AutoStartItem> it2(*m_startList);
    AutoStartItem *item1;
    AutoStartItem *item2;
-   while ((item1 = it1.current()) != 0) {
+   while ((item1 = it1.current()) != nullptr) {
        bool dupfound1 = false;
        it2.toFirst();
-       while ((item2 = it2.current()) != 0) {
+       while ((item2 = it2.current()) != nullptr) {
            bool dupfound2 = false;
            if (item2 != item1) {
                if (item1->service == item2->service) {
@@ -250,7 +250,7 @@ TQString
 AutoStart::startService()
 {
    if (m_startList->isEmpty())
-      return 0;
+      return nullptr;
 
    while(!m_started.isEmpty())
    {
@@ -300,5 +300,5 @@ AutoStart::startService()
       }
    }
 
-   return 0;
+   return nullptr;
 }
diff --git a/tdeinit/setproctitle.cpp b/tdeinit/setproctitle.cpp
index 5d2570b35..f4095576c 100644
--- a/tdeinit/setproctitle.cpp
+++ b/tdeinit/setproctitle.cpp
@@ -130,8 +130,8 @@ typedef unsigned int	*pt_entry_t;
 **	This allows "ps" listings to give more useful information.
 */
 
-char		**Argv = NULL;		/* pointer to argument vector */
-char		*LastArgv = NULL;	/* end of argv */
+char		**Argv = nullptr;		/* pointer to argument vector */
+char		*LastArgv = nullptr;	/* end of argv */
 
 void
 tdeinit_initsetproctitle(int argc, char **argv, char **envp)
@@ -146,15 +146,15 @@ tdeinit_initsetproctitle(int argc, char **argv, char **envp)
 	**  the top of memory.
 	*/
 
-	for (i = 0; envp[i] != NULL; i++)
+	for (i = 0; envp[i]; i++)
 		envpsize += strlen(envp[i]) + 1;
 	environ = (char **) malloc(sizeof (char *) * (i + 1));
-	if (environ == NULL)
+	if (!environ)
         	return;
 
-	for (i = 0; envp[i] != NULL; i++)
+	for (i = 0; envp[i]; i++)
 		environ[i] = strdup(envp[i]);
-	environ[i] = NULL;
+	environ[i] = nullptr;
 
 	/*
 	**  Save start and extent of argv for setproctitle.
@@ -182,7 +182,7 @@ tdeinit_initsetproctitle(int argc, char **argv, char **envp)
          * seems to be the only option
          */
 #ifndef __linux__
-	for (i=0; envp[i] != NULL; i++)
+	for (i=0; envp[i]; i++)
 	{
 		if (LastArgv + 1 == envp[i])
 			LastArgv = envp[i] + strlen(envp[i]);
@@ -260,7 +260,7 @@ setproctitle(const char *fmt, ...)
 	p = &Argv[0][i];
 	while (p < LastArgv)
 		*p++ = SPT_PADCHAR;
-	Argv[1] = NULL;
+	Argv[1] = nullptr;
 #  endif
 #  if SPT_TYPE == SPT_CHANGEARGV
 	Argv[0] = buf;
diff --git a/tdeinit/tdeinit.cpp b/tdeinit/tdeinit.cpp
index 517a66879..dd03214f3 100644
--- a/tdeinit/tdeinit.cpp
+++ b/tdeinit/tdeinit.cpp
@@ -108,11 +108,11 @@ extern int lt_dlopen_flag;
 //#if defined TQ_WS_X11 && ! defined K_WS_QTONLY
 #ifdef TQ_WS_X11
 static int X11fd = -1;
-static Display *X11display = 0;
+static Display *X11display = nullptr;
 static int X11_startup_notify_fd = -1;
-static Display *X11_startup_notify_display = 0;
+static Display *X11_startup_notify_display = nullptr;
 #endif
-static const TDEInstance *s_instance = 0;
+static const TDEInstance *s_instance = nullptr;
 #define MAX_SOCK_FILE 255
 static char sock_file[MAX_SOCK_FILE];
 static char sock_file_old[MAX_SOCK_FILE];
@@ -250,7 +250,7 @@ static void exitWithErrorMsg(const TQString &errorMsg)
 
 static void setup_tty( const char* tty )
 {
-    if( tty == NULL || *tty == '\0' )
+    if( !tty || *tty == '\0' )
         return;
     int fd = open( tty, O_WRONLY );
     if( fd < 0 )
@@ -312,7 +312,7 @@ const char* get_env_var( const char* var, int envc, const char* envs )
                 env_l++;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 #if defined TQ_WS_X11 && ! defined K_WS_QTONLY
@@ -324,7 +324,7 @@ static void init_startup_info( TDEStartupInfoId& id, const char* bin,
     // this may be called in a child, so it can't use display open using X11display
     // also needed for multihead
     X11_startup_notify_display = XOpenDisplay( dpy );
-    if( X11_startup_notify_display == NULL )
+    if( !X11_startup_notify_display )
         return;
     X11_startup_notify_fd = XConnectionNumber( X11_startup_notify_display );
     TDEStartupInfoData data;
@@ -337,7 +337,7 @@ static void init_startup_info( TDEStartupInfoId& id, const char* bin,
 
 static void complete_startup_info( TDEStartupInfoId& id, pid_t pid )
 {
-    if( X11_startup_notify_display == NULL )
+    if( !X11_startup_notify_display )
         return;
     if( pid == 0 ) // failure
         TDEStartupInfo::sendFinishX( X11_startup_notify_display, id );
@@ -349,7 +349,7 @@ static void complete_startup_info( TDEStartupInfoId& id, pid_t pid )
         TDEStartupInfo::sendChangeX( X11_startup_notify_display, id, data );
     }
     XCloseDisplay( X11_startup_notify_display );
-    X11_startup_notify_display = NULL;
+    X11_startup_notify_display = nullptr;
     X11_startup_notify_fd = -1;
 }
 #endif
@@ -360,7 +360,7 @@ TQCString execpath_avoid_loops( const TQCString& exec, int envc, const char* env
      if( envc > 0 ) /* use the passed environment */
      {
          const char* path = get_env_var( "PATH=", envc, envs );
-         if( path != NULL )
+         if( path )
              paths = TQStringList::split( TQRegExp( "[:\b]" ), path, true );
      }
      else
@@ -407,8 +407,8 @@ static void reset_oom_protect() {
    if( write( oom_pipe, &pid, sizeof( pid_t )) > 0 ) {
       sigsuspend( &oldsigs ); // wait for the signal to come
     }
-   sigprocmask( SIG_SETMASK, &oldsigs, NULL );
-   sigaction( SIGUSR1, &oldact, NULL );
+   sigprocmask( SIG_SETMASK, &oldsigs, nullptr );
+   sigaction( SIGUSR1, &oldact, nullptr );
    close( oom_pipe );
    oom_pipe = -1;
 }
@@ -418,10 +418,10 @@ static void reset_oom_protect() {
 #endif
 
 static pid_t launch(int argc, const char *_name, const char *args,
-                    const char *cwd=0, int envc=0, const char *envs=0,
+                    const char *cwd=nullptr, int envc=0, const char *envs=nullptr,
                     bool reset_env = false,
-                    const char *tty=0, bool avoid_loops = false,
-                    const char* startup_id_str = "0" )
+                    const char *tty=nullptr, bool avoid_loops = false,
+                    const char* startup_id_str = "nullptr" )
 {
   int launcher = 0;
   TQCString lib;
@@ -487,7 +487,7 @@ static pid_t launch(int argc, const char *_name, const char *args,
       init_startup_info( startup_id, name, envc, envs );
 #endif
 
-  d.errorMsg = 0;
+  d.errorMsg = nullptr;
   d.fork = fork();
   switch(d.fork) {
   case -1:
@@ -530,7 +530,7 @@ static pid_t launch(int argc, const char *_name, const char *args,
               tmp_env_count++)
              unset_envs.append( environ[ tmp_env_count ] );
          for( TQStrListIterator it( unset_envs );
-              it.current() != NULL ;
+              it.current() != nullptr ;
               ++it )
          {
              TQCString tmp( it.current());
@@ -567,7 +567,7 @@ static pid_t launch(int argc, const char *_name, const char *args,
           while(*args != 0) args++;
           args++;
        }
-       d.argv[argc] = 0;
+       d.argv[argc] = nullptr;
 
        /** Give the process a new name **/
 #ifdef HAVE_SYS_PRCTL_H
@@ -582,7 +582,7 @@ static pid_t launch(int argc, const char *_name, const char *args,
 #endif
      }
 
-     d.handle = 0;
+     d.handle = nullptr;
      if (libpath.isEmpty() && execpath.isEmpty())
      {
         TQString errorMsg = i18n("Could not find '%1' executable.").arg(TQFile::decodeName(_name));
@@ -608,7 +608,7 @@ static pid_t launch(int argc, const char *_name, const char *args,
           else
           {
              // Print warning
-             fprintf(stderr, "Could not open library %s: %s\n", lib.data(), ltdlError != 0 ? ltdlError : "(null)" );
+             fprintf(stderr, "Could not open library %s: %s\n", lib.data(), ltdlError ? ltdlError : "(null)" );
           }
        }
      }
@@ -640,7 +640,7 @@ static pid_t launch(int argc, const char *_name, const char *args,
            if (!d.sym )
            {
               const char * ltdlError = lt_dlerror();
-              fprintf(stderr, "Could not find kdemain: %s\n", ltdlError != 0 ? ltdlError : "(null)" );
+              fprintf(stderr, "Could not find kdemain: %s\n", ltdlError ? ltdlError : "(null)" );
               TQString errorMsg = i18n("Could not find 'kdemain' in '%1'.\n%2").arg(TQString(libpath))
                  .arg(ltdlError ? TQFile::decodeName(ltdlError) : i18n("Unknown error"));
               exitWithErrorMsg(errorMsg);
@@ -798,7 +798,7 @@ static void init_signals()
   act.sa_handler=sig_child_handler;
   sigemptyset(&(act.sa_mask));
   sigaddset(&(act.sa_mask), SIGCHLD);
-  sigprocmask(SIG_UNBLOCK, &(act.sa_mask), 0L);
+  sigprocmask(SIG_UNBLOCK, &(act.sa_mask), nullptr);
   act.sa_flags = SA_NOCLDSTOP;
 
   // CC: take care of SunOS which automatically restarts interrupted system
@@ -807,14 +807,14 @@ static void init_signals()
 #ifdef SA_RESTART
   act.sa_flags |= SA_RESTART;
 #endif
-  sigaction( SIGCHLD, &act, 0L);
+  sigaction( SIGCHLD, &act, nullptr);
 
   act.sa_handler=SIG_IGN;
   sigemptyset(&(act.sa_mask));
   sigaddset(&(act.sa_mask), SIGPIPE);
-  sigprocmask(SIG_UNBLOCK, &(act.sa_mask), 0L);
+  sigprocmask(SIG_UNBLOCK, &(act.sa_mask), nullptr);
   act.sa_flags = 0;
-  sigaction( SIGPIPE, &act, 0L);
+  sigaction( SIGPIPE, &act, nullptr);
 }
 
 static void init_tdeinit_socket()
@@ -1081,7 +1081,7 @@ static void launcher_died()
    close(d.launcher[0]);
    d.launcher[0] = -1;
 
-   pid_t pid = launch( 1, "tdelauncher", 0 );
+   pid_t pid = launch( 1, "tdelauncher", nullptr );
 #ifndef NDEBUG
    fprintf(stderr, "[tdeinit] Relaunching TDELauncher, pid = %ld result = %d\n", (long) pid, d.result);
 #endif
@@ -1097,7 +1097,7 @@ static void handle_launcher_request(int sock = -1)
    }
 
    tdelauncher_header request_header;
-   char *request_data = 0L;
+   char *request_data = nullptr;
    int result = read_socket(sock, (char *) &request_header, sizeof(request_header));
    if (result != 0)
    {
@@ -1139,10 +1139,10 @@ static void handle_launcher_request(int sock = -1)
       int argc = l;
       const char *name = request_data + sizeof(long);
       const char *args = name + strlen(name) + 1;
-      const char *cwd = 0;
+      const char *cwd = nullptr;
       int envc = 0;
-      const char *envs = 0;
-      const char *tty = 0;
+      const char *envs = nullptr;
+      const char *tty = nullptr;
       int avoid_loops = 0;
       const char *startup_id_str = "0";
 
@@ -1286,7 +1286,7 @@ static void handle_launcher_request(int sock = -1)
        fprintf(stderr,"[tdeinit] Terminating Trinity.\n");
 #endif
 #ifdef TQ_WS_X11
-       tdeinit_xio_errhandler( 0L );
+       tdeinit_xio_errhandler( nullptr );
 #endif
    }
    else if (request_header.cmd == LAUNCHER_TERMINATE_TDEINIT)
@@ -1338,7 +1338,7 @@ static void handle_requests(pid_t waitForPid)
 
       /* Handle dying children */
       do {
-        exit_pid = waitpid(-1, 0, WNOHANG);
+        exit_pid = waitpid(-1, nullptr, WNOHANG);
         if (exit_pid > 0)
         {
 // FIXME: This disabled fprintf might need to be reinstated when converting to kdDebug.
@@ -1383,7 +1383,7 @@ static void handle_requests(pid_t waitForPid)
       if(X11fd >= 0) FD_SET(X11fd, &rd_set);
 #endif
 
-      result = select(max_sock, &rd_set, &wr_set, &e_set, 0);
+      result = select(max_sock, &rd_set, &wr_set, &e_set, nullptr);
 
       /* Handle wrapper request */
       if ((result > 0) && (FD_ISSET(d.wrapper, &rd_set)))
@@ -1394,7 +1394,7 @@ static void handle_requests(pid_t waitForPid)
          if (sock >= 0)
          {
 #if defined(TDEINIT_USE_XFT) && defined(TDEINIT_USE_FONTCONFIG)
-            if( FcGetVersion() < 20390 && !FcConfigUptoDate(NULL))
+            if( FcGetVersion() < 20390 && !FcConfigUptoDate(nullptr))
                FcInitReinitialize();
 #endif
             if (fork() == 0)
@@ -1415,7 +1415,7 @@ static void handle_requests(pid_t waitForPid)
          if (sock >= 0)
          {
 #if defined(TDEINIT_USE_XFT) && defined(TDEINIT_USE_FONTCONFIG)
-            if( FcGetVersion() < 20390 && !FcConfigUptoDate(NULL))
+            if( FcGetVersion() < 20390 && !FcConfigUptoDate(nullptr))
                FcInitReinitialize();
 #endif
             if (fork() == 0)
@@ -1444,7 +1444,7 @@ static void handle_requests(pid_t waitForPid)
       {
         if(FD_ISSET(X11fd,&rd_set))
         {
-          if (X11display != 0) {
+          if (X11display) {
 	    XEvent event_return;
 	    while (XPending(X11display))
 	      XNextEvent(X11display, &event_return);
@@ -1497,7 +1497,7 @@ static void tdeinit_library_path()
    if (lt_dlinit())
    {
       const char * ltdlError = lt_dlerror();
-      fprintf(stderr, "[tdeinit] Can't initialize dynamic loading: %s\n", ltdlError != 0 ? ltdlError : "(null)" );
+      fprintf(stderr, "[tdeinit] Can't initialize dynamic loading: %s\n", ltdlError ? ltdlError : "(null)" );
    }
    if (!extra_path.isEmpty())
       lt_dlsetsearchpath(extra_path.data());
@@ -1615,8 +1615,8 @@ static void setupX()
 // Borrowed from tdebase/kaudio/kaudioserver.cpp
 static int initXconnection()
 {
-  X11display = XOpenDisplay(NULL);
-  if ( X11display != 0 ) {
+  X11display = XOpenDisplay(nullptr);
+  if ( X11display ) {
     XCreateSimpleWindow(X11display, DefaultRootWindow(X11display), 0,0,1,1, \
         0,
         BlackPixelOfScreen(DefaultScreenOfDisplay(X11display)),
@@ -1670,7 +1670,7 @@ void _main(void)
 
 static void secondary_child_handler(int)
 {
-   waitpid(-1, 0, WNOHANG);
+   waitpid(-1, nullptr, WNOHANG);
 }
 
 int main(int argc, char **argv, char **envp)
@@ -1752,7 +1752,7 @@ int main(int argc, char **argv, char **envp)
    // Don't make our instance the global instance
    // (do it only after tdeinit_library_path, that one indirectly uses TDEConfig,
    // which seems to be buggy and always use TDEGlobal instead of the maching TDEInstance)
-   TDEGlobal::_instance = 0L;
+   TDEGlobal::_instance = nullptr;
    // don't change envvars before tdeinit_initsetproctitle()
    unsetenv("LD_BIND_NOW");
    unsetenv("DYLD_BIND_AT_LAUNCH");
@@ -1809,7 +1809,7 @@ int main(int argc, char **argv, char **envp)
       if( new_startup )
          pid = launch( 2, "tdelauncher", "--new-startup" );
       else
-         pid = launch( 1, "tdelauncher", 0 );
+         pid = launch( 1, "tdelauncher", nullptr );
 #ifndef NDEBUG
       fprintf(stderr, "[tdeinit] Launched TDELauncher, pid = %ld result = %d\n", (long) pid, d.result);
 #endif
@@ -1837,7 +1837,7 @@ int main(int argc, char **argv, char **envp)
       {
          // Similar to TQApplication::create_xim()
 	 // but we need to use our own display
-	 XOpenIM (X11display, 0, 0, 0);
+	 XOpenIM (X11display, nullptr, nullptr, nullptr);
       }
 #endif
    }
@@ -1847,7 +1847,7 @@ int main(int argc, char **argv, char **envp)
       if( new_startup )
          pid = launch( 2, "kded", "--new-startup" );
       else
-         pid = launch( 1, "kded", 0 );
+         pid = launch( 1, "kded", nullptr );
 #ifndef NDEBUG
       fprintf(stderr, "[tdeinit] Launched KDED, pid = %ld result = %d\n", (long) pid, d.result);
 #endif
@@ -1858,7 +1858,7 @@ int main(int argc, char **argv, char **envp)
    {
       if (safe_argv[i][0] == '+')
       {
-         pid = launch( 1, safe_argv[i]+1, 0);
+         pid = launch( 1, safe_argv[i]+1, nullptr);
 #ifndef NDEBUG
       fprintf(stderr, "[tdeinit] Launched '%s', pid = %ld result = %d\n", safe_argv[i]+1, (long) pid, d.result);
 #endif
@@ -1874,7 +1874,7 @@ int main(int argc, char **argv, char **envp)
       }
       else
       {
-         pid = launch( 1, safe_argv[i], 0 );
+         pid = launch( 1, safe_argv[i], nullptr );
 #ifndef NDEBUG
       fprintf(stderr, "[tdeinit] Launched '%s', pid = %ld result = %d\n", safe_argv[i], (long) pid, d.result);
 #endif
diff --git a/tdeinit/tdeioslave.cpp b/tdeinit/tdeioslave.cpp
index d62b02591..96384e40f 100644
--- a/tdeinit/tdeioslave.cpp
+++ b/tdeinit/tdeioslave.cpp
@@ -71,7 +71,7 @@ int main(int argc, char **argv)
      if (!handle )
      {
         const char * ltdlError = lt_dlerror();
-        fprintf(stderr, "could not open %s: %s", libpath.data(), ltdlError != 0 ? ltdlError : "(null)" );
+        fprintf(stderr, "could not open %s: %s", libpath.data(), ltdlError ? ltdlError : "(null)" );
         exit(1);
      }  
 
@@ -82,7 +82,7 @@ int main(int argc, char **argv)
         if (!sym )
         {
            const char * ltdlError = lt_dlerror();
-           fprintf(stderr, "Could not find main: %s\n", ltdlError != 0 ? ltdlError : "(null)" );
+           fprintf(stderr, "Could not find main: %s\n", ltdlError ? ltdlError : "(null)" );
            exit(1);
         }
      }
diff --git a/tdeinit/tdelauncher.cpp b/tdeinit/tdelauncher.cpp
index 371f1ba7b..50df791bf 100644
--- a/tdeinit/tdelauncher.cpp
+++ b/tdeinit/tdelauncher.cpp
@@ -72,7 +72,7 @@ IdleSlave::IdleSlave(TDESocket *socket)
    mConn.connect(this, TQ_SLOT(gotInput()));
    mConn.send( CMD_SLAVE_STATUS );
    mPid = 0;
-   mBirthDate = time(0);
+   mBirthDate = time(nullptr);
    mOnHold = false;
 }
 
@@ -170,7 +170,7 @@ TDELauncher::TDELauncher(int _tdeinitSocket, bool new_startup)
     dontBlockReading(false), newStartup( new_startup )
 {
 #ifdef TQ_WS_X11
-   mCached_dpy = NULL;
+   mCached_dpy = nullptr;
 #endif
    connect(&mAutoTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotAutoStart()));
    requestList.setAutoDelete(true);
@@ -204,7 +204,7 @@ TDELauncher::TDELauncher(int _tdeinitSocket, bool new_startup)
    connect(tdeinitNotifier, TQ_SIGNAL( activated( int )),
            this, TQ_SLOT( slotKDEInitData( int )));
    tdeinitNotifier->setEnabled( true );
-   lastRequest = 0;
+   lastRequest = nullptr;
    bProcessingQueue = false;
 
    mSlaveDebug = getenv("TDE_SLAVE_DEBUG_WAIT");
@@ -238,7 +238,7 @@ void TDELauncher::close()
    }
 #if defined TQ_WS_X11 && ! defined K_WS_QTONLY
 //#ifdef TQ_WS_X11
-   if( mCached_dpy != NULL )
+   if( mCached_dpy )
        XCloseDisplay( mCached_dpy );
 #endif
 }
@@ -294,7 +294,7 @@ TDELauncher::process(const TQCString &fun, const TQByteArray &data,
       TQValueList<TQCString> envs;
       TQCString startup_id = "";
       DCOPresult.result = -1;
-      DCOPresult.dcopName = 0;
+      DCOPresult.dcopName = nullptr;
       DCOPresult.error = TQString::null;
       DCOPresult.pid = 0;
       stream >> serviceName >> urls;
@@ -536,7 +536,7 @@ TDELauncher::slotKDEInitData(int)
       timeval tm = { 0, 0 };
       FD_ZERO ( &in );
       FD_SET( tdeinitSocket, &in );
-      select( tdeinitSocket + 1, &in, 0, 0, &tm );
+      select( tdeinitSocket + 1, &in, nullptr, nullptr, &tm );
       if( !FD_ISSET( tdeinitSocket, &in ))
          return;
    }
@@ -594,7 +594,7 @@ TDELauncher::slotKDEInitData(int)
          break;
        }
      }
-     lastRequest = 0;
+     lastRequest = nullptr;
      return;
    }
    if (lastRequest && (request_header.cmd == LAUNCHER_ERROR))
@@ -602,7 +602,7 @@ TDELauncher::slotKDEInitData(int)
      lastRequest->status = TDELaunchRequest::Error;
      if (!requestData.isEmpty())
         lastRequest->errorMsg = TQString::fromUtf8((char *) requestData.data());
-     lastRequest = 0;
+     lastRequest = nullptr;
      return;
    }
 
@@ -750,18 +750,18 @@ TDELauncher::requestDone(TDELaunchRequest *request)
 //#ifdef TQ_WS_X11
       if (!request->startup_dpy.isEmpty())
       {
-         Display* dpy = NULL;
-         if( (mCached_dpy != NULL) &&
+         Display* dpy = nullptr;
+         if( (mCached_dpy) &&
               (request->startup_dpy == XDisplayString( mCached_dpy )))
             dpy = mCached_dpy;
-         if( dpy == NULL )
+         if( !dpy )
             dpy = XOpenDisplay( request->startup_dpy );
          if( dpy )
          {
             TDEStartupInfoId id;
             id.initId( request->startup_id );
             TDEStartupInfo::sendFinishX( dpy, id );
-            if( mCached_dpy != dpy && mCached_dpy != NULL )
+            if( mCached_dpy != dpy && mCached_dpy )
                XCloseDisplay( mCached_dpy );
             mCached_dpy = dpy;
          }
@@ -874,7 +874,7 @@ TDELauncher::requestStart(TDELaunchRequest *request)
    do {
       slotKDEInitData( tdeinitSocket );
    }
-   while (lastRequest != 0);
+   while (lastRequest);
    dontBlockReading = true;
 }
 
@@ -886,15 +886,15 @@ TDELauncher::exec_blind( const TQCString &name, const TQValueList<TQCString> &ar
    request->autoStart = false;
    request->name = name;
    request->arg_list =  arg_list;
-   request->dcop_name = 0;
+   request->dcop_name = nullptr;
    request->dcop_service_type = KService::DCOP_None;
    request->pid = 0;
    request->status = TDELaunchRequest::Launching;
-   request->transaction = 0; // No confirmation is send
+   request->transaction = nullptr; // No confirmation is send
    request->envs = envs;
    // Find service, if any - strip path if needed
    KService::Ptr service = KService::serviceByDesktopName( name.mid( name.findRev( '/' ) + 1 ));
-   if (service != NULL)
+   if (service)
        send_service_startup_info( request,  service,
            startup_id, TQValueList< TQCString >());
    else // no .desktop file, no startup info
@@ -910,14 +910,14 @@ bool
 TDELauncher::start_service_by_name(const TQString &serviceName, const TQStringList &urls,
     const TQValueList<TQCString> &envs, const TQCString& startup_id, bool blind)
 {
-   KService::Ptr service = 0;
+   KService::Ptr service = nullptr;
    // Find service
    service = KService::serviceByName(serviceName);
    if (!service)
    {
       DCOPresult.result = ENOENT;
       DCOPresult.error = i18n("Could not find service '%1'.").arg(serviceName);
-      cancel_service_startup_info( NULL, startup_id, envs ); // cancel it if any
+      cancel_service_startup_info( nullptr, startup_id, envs ); // cancel it if any
       return false;
    }
    return start_service(service, urls, envs, startup_id, blind);
@@ -927,7 +927,7 @@ bool
 TDELauncher::start_service_by_desktop_path(const TQString &serviceName, const TQStringList &urls,
     const TQValueList<TQCString> &envs, const TQCString& startup_id, bool blind)
 {
-   KService::Ptr service = 0;
+   KService::Ptr service = nullptr;
    // Find service
    if (serviceName[0] == '/')
    {
@@ -942,7 +942,7 @@ TDELauncher::start_service_by_desktop_path(const TQString &serviceName, const TQ
    {
       DCOPresult.result = ENOENT;
       DCOPresult.error = i18n("Could not find service '%1'.").arg(serviceName);
-      cancel_service_startup_info( NULL, startup_id, envs ); // cancel it if any
+      cancel_service_startup_info( nullptr, startup_id, envs ); // cancel it if any
       return false;
    }
    return start_service(service, urls, envs, startup_id, blind);
@@ -952,14 +952,14 @@ bool
 TDELauncher::start_service_by_desktop_name(const TQString &serviceName, const TQStringList &urls,
     const TQValueList<TQCString> &envs, const TQCString& startup_id, bool blind)
 {
-   KService::Ptr service = 0;
+   KService::Ptr service = nullptr;
    // Find service
    service = KService::serviceByDesktopName(serviceName);
    if (!service)
    {
       DCOPresult.result = ENOENT;
       DCOPresult.error = i18n("Could not find service '%1'.").arg(serviceName);
-      cancel_service_startup_info( NULL, startup_id, envs ); // cancel it if any
+      cancel_service_startup_info( nullptr, startup_id, envs ); // cancel it if any
       return false;
    }
    return start_service(service, urls, envs, startup_id, blind);
@@ -974,7 +974,7 @@ TDELauncher::start_service(KService::Ptr service, const TQStringList &_urls,
    {
       DCOPresult.result = ENOEXEC;
       DCOPresult.error = i18n("Service '%1' is malformatted.").arg(service->desktopEntryPath());
-      cancel_service_startup_info( NULL, startup_id, envs ); // cancel it if any
+      cancel_service_startup_info( nullptr, startup_id, envs ); // cancel it if any
       return false;
    }
    TDELaunchRequest *request = new TDELaunchRequest;
@@ -1011,7 +1011,7 @@ TDELauncher::start_service(KService::Ptr service, const TQStringList &_urls,
       DCOPresult.result = ENOEXEC;
       DCOPresult.error = i18n("Service '%1' is malformatted.").arg(service->desktopEntryPath());
       delete request;
-      cancel_service_startup_info( NULL, startup_id, envs );
+      cancel_service_startup_info( nullptr, startup_id, envs );
       return false;
    }
 
@@ -1033,7 +1033,7 @@ TDELauncher::start_service(KService::Ptr service, const TQStringList &_urls,
    }
 
    request->pid = 0;
-   request->transaction = 0;
+   request->transaction = nullptr;
    request->envs = envs;
    send_service_startup_info( request, service, startup_id, envs );
 
@@ -1061,20 +1061,20 @@ TDELauncher::send_service_startup_info( TDELaunchRequest *request, KService::Ptr
         return;
     TDEStartupInfoId id;
     id.initId( startup_id );
-    const char* dpy_str = NULL;
+    const char* dpy_str = nullptr;
     for( TQValueList<TQCString>::ConstIterator it = envs.begin();
          it != envs.end();
          ++it )
         if( strncmp( *it, "DISPLAY=", 8 ) == 0 )
             dpy_str = static_cast< const char* >( *it ) + 8;
-    Display* dpy = NULL;
-    if( dpy_str != NULL && mCached_dpy != NULL
+    Display* dpy = nullptr;
+    if( dpy_str && mCached_dpy
         && qstrcmp( dpy_str, XDisplayString( mCached_dpy )) == 0 )
         dpy = mCached_dpy;
-    if( dpy == NULL )
+    if( !dpy )
         dpy = XOpenDisplay( dpy_str );
     request->startup_id = id.id();
-    if( dpy == NULL )
+    if( !dpy )
     {
         cancel_service_startup_info( request, startup_id, envs );
         return;
@@ -1092,7 +1092,7 @@ TDELauncher::send_service_startup_info( TDELaunchRequest *request, KService::Ptr
         data.setSilent( TDEStartupInfoData::Yes );
     // the rest will be sent by tdeinit
     TDEStartupInfo::sendStartupX( dpy, id, data );
-    if( mCached_dpy != dpy && mCached_dpy != NULL )
+    if( mCached_dpy != dpy && mCached_dpy )
         XCloseDisplay( mCached_dpy );
     mCached_dpy = dpy;
     return;
@@ -1107,28 +1107,28 @@ TDELauncher::cancel_service_startup_info( TDELaunchRequest* request, const TQCSt
 {
 #if defined TQ_WS_X11 && ! defined K_WS_QTONLY
 //#ifdef TQ_WS_X11 // TDEStartup* isn't implemented for Qt/Embedded yet
-    if( request != NULL )
+    if( request )
         request->startup_id = "0";
     if( !startup_id.isEmpty() && startup_id != "0" )
     {
-        const char* dpy_str = NULL;
+        const char* dpy_str = nullptr;
         for( TQValueList<TQCString>::ConstIterator it = envs.begin();
              it != envs.end();
              ++it )
             if( strncmp( *it, "DISPLAY=", 8 ) == 0 )
                 dpy_str = static_cast< const char* >( *it ) + 8;
-        Display* dpy = NULL;
-        if( dpy_str != NULL && mCached_dpy != NULL
+        Display* dpy = nullptr;
+        if( dpy_str && mCached_dpy
             && qstrcmp( dpy_str, XDisplayString( mCached_dpy )) == 0 )
             dpy = mCached_dpy;
-        if( dpy == NULL )
+        if( !dpy )
             dpy = XOpenDisplay( dpy_str );
-        if( dpy == NULL )
+        if( !dpy )
             return;
         TDEStartupInfoId id;
         id.initId( startup_id );
         TDEStartupInfo::sendFinishX( dpy, id );
-        if( mCached_dpy != dpy && mCached_dpy != NULL )
+        if( mCached_dpy != dpy && mCached_dpy )
            XCloseDisplay( mCached_dpy );
         mCached_dpy = dpy;
     }
@@ -1156,7 +1156,7 @@ TDELauncher::tdeinit_exec(const TQString &app, const TQStringList &args,
       request->dcop_service_type = KService::DCOP_Wait;
    else
       request->dcop_service_type = KService::DCOP_None;
-   request->dcop_name = 0;
+   request->dcop_name = nullptr;
    request->pid = 0;
 #ifdef TQ_WS_X11
    request->startup_id = startup_id;
@@ -1166,7 +1166,7 @@ TDELauncher::tdeinit_exec(const TQString &app, const TQStringList &args,
    {
        // Find service, if any - strip path if needed
        KService::Ptr service = KService::serviceByDesktopName( app.mid( app.findRev( '/' ) + 1 ));
-       if (service != NULL)
+       if (service)
            send_service_startup_info( request,  service,
                startup_id, TQValueList< TQCString >());
        else // no .desktop file, no startup info
@@ -1315,14 +1315,14 @@ TDELauncher::requestSlave(const TQString &protocol,
     request->autoStart = false;
     request->name = name;
     request->arg_list =  arg_list;
-    request->dcop_name = 0;
+    request->dcop_name = nullptr;
     request->dcop_service_type = KService::DCOP_None;
     request->pid = 0;
 #ifdef TQ_WS_X11
     request->startup_id = "0";
 #endif
     request->status = TDELaunchRequest::Launching;
-    request->transaction = 0; // No confirmation is send
+    request->transaction = nullptr; // No confirmation is send
     requestStart(request);
     pid_t pid = request->pid;
 
@@ -1404,7 +1404,7 @@ void
 TDELauncher::idleTimeout()
 {
     bool keepOneFileSlave=true;
-    time_t now = time(0);
+    time_t now = time(nullptr);
     IdleSlave *slave;
     for(slave = mSlaveList.first(); slave; slave = mSlaveList.next())
     {
diff --git a/tdeinit/tdelauncher_main.cpp b/tdeinit/tdelauncher_main.cpp
index 53944caec..6f37f604d 100644
--- a/tdeinit/tdelauncher_main.cpp
+++ b/tdeinit/tdelauncher_main.cpp
@@ -46,7 +46,7 @@ static void sig_handler(int sig_num)
 
 static TDECmdLineOptions options[] =
 {
-  { "new-startup", "Internal", 0 },
+  { "new-startup", "Internal", nullptr },
   TDECmdLineLastOption
 };
 
diff --git a/tdeinit/tdestartupconfig.cpp b/tdeinit/tdestartupconfig.cpp
index 373ac6787..5bb8c4ca2 100644
--- a/tdeinit/tdestartupconfig.cpp
+++ b/tdeinit/tdestartupconfig.cpp
@@ -103,7 +103,7 @@ int main()
         }
     time_t config_time = st.st_mtime;
     FILE* config = fopen( filename, "r" );
-    if( config == NULL )
+    if( !config )
         {
         int ret = system( "tdedostartupconfig" );
         return WEXITSTATUS( ret );
@@ -111,7 +111,7 @@ int main()
     strlcpy( filename, tdehome, 1024 );
     strlcat( filename, "/share/config/startupconfigkeys", 1024 );
     FILE* keys = fopen( filename, "r" );
-    if( keys == NULL )
+    if( !keys )
         {
         fclose( config );
         return 2;
@@ -120,7 +120,7 @@ int main()
     for(;;)
         {
         char keyline[ 1024 ];
-        if( fgets( keyline, 1023, keys ) == NULL )
+        if( !fgets( keyline, 1023, keys ) )
             {
             need_update = false;
             break;
@@ -128,7 +128,7 @@ int main()
         if( char* nl = strchr( keyline, '\n' ))
             *nl = '\0';
         char line[ 1024 ];
-        if( fgets( line, 1023, config ) == NULL )
+        if( !fgets( line, 1023, config ) )
             break;
         if( char* nl = strchr( line, '\n' ))
             *nl = '\0';
@@ -137,7 +137,7 @@ int main()
         bool ok = false;
         for(;;)
             {
-            if( fgets( line, 1023, config ) == NULL )
+            if( !fgets( line, 1023, config ) )
                 break;
             if( char* nl = strchr( line, '\n' ))
                 *nl = '\0';
diff --git a/tderandr/ktimerdialog.h b/tderandr/ktimerdialog.h
index 0d844a27f..dcf4020fb 100644
--- a/tderandr/ktimerdialog.h
+++ b/tderandr/ktimerdialog.h
@@ -67,8 +67,8 @@ class KTimerDialog : public KDialogBase
      *
      * For the rest of the arguments, See @see KDialogBase .
      */
-    KTimerDialog( int msec, TimerStyle style=CountDown, TQWidget *parent=0,
-                 const char *name=0, bool modal=true,
+    KTimerDialog( int msec, TimerStyle style=CountDown, TQWidget *parent=nullptr,
+                 const char *name=nullptr, bool modal=true,
                  const TQString &caption=TQString::null,
                  int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok,
                  bool separator=false,
diff --git a/tderandr/libtderandr.cpp b/tderandr/libtderandr.cpp
index 94828e434..5799bcd79 100644
--- a/tderandr/libtderandr.cpp
+++ b/tderandr/libtderandr.cpp
@@ -66,7 +66,7 @@ TQString exec(const char * cmd) {
 	char buffer[128];
 	TQString result = "";
 	while(!feof(pipe)) {
-		if(fgets(buffer, 128, pipe) != NULL) {
+		if(fgets(buffer, 128, pipe)) {
 			result += buffer;
 		}
 	}
@@ -80,15 +80,15 @@ TQString capitalizeString(TQString in) {
 }
 
 TQString KRandrSimpleAPI::getIccFileName(TQString profileName, TQString screenName, TQString kde_confdir) {
-	TDESimpleConfig *t_config = NULL;
-	TDESimpleConfig *t_systemconfig = NULL;
+	TDESimpleConfig *t_config = nullptr;
+	TDESimpleConfig *t_systemconfig = nullptr;
 	int t_numberOfProfiles;
 	TQStringList t_cfgProfiles;
 	TQString retval;
 
-	if ((profileName != NULL) && (profileName != "")) {
+	if (!profileName.isEmpty()) {
 		t_config = new TDESimpleConfig( TQString::fromLatin1( "kiccconfigrc" ));
-		t_config->setGroup(NULL);
+		t_config->setGroup(nullptr);
 		if (t_config->readBoolEntry("EnableICC", false) == true) {
 			t_config->setGroup(profileName);
 			retval = t_config->readEntry(screenName);
@@ -100,7 +100,7 @@ TQString KRandrSimpleAPI::getIccFileName(TQString profileName, TQString screenNa
 	}
 	else {
 		t_systemconfig = new TDESimpleConfig( kde_confdir + TQString("/kicc/kiccconfigrc") );
-		t_systemconfig->setGroup(NULL);
+		t_systemconfig->setGroup(nullptr);
 		if (t_systemconfig->readBoolEntry("EnableICC", false) == true) {
 			retval = t_systemconfig->readEntry("ICCFile");
 		}
@@ -135,7 +135,7 @@ TQString KRandrSimpleAPI::applyIccFile(TQString screenName, TQString fileName) {
 			screenNumber = -1;
 			randr_display = tqt_xdisplay();
 			randr_screen_info = read_screen_info(randr_display);
-			if (randr_screen_info == NULL) {
+			if (!randr_screen_info) {
 				return "";
 			}
 			j=0;
@@ -166,7 +166,7 @@ TQString KRandrSimpleAPI::applyIccFile(TQString screenName, TQString fileName) {
 			xcalib_result[0]=0;
 
 			icc_command = TQString("xcalib \"%1\"").arg(fileName);
-			if ((pipe_xcalib = popen(icc_command.ascii(), "r")) == NULL)
+			if (!(pipe_xcalib = popen(icc_command.ascii(), "r")))
 			{
 				printf("Xcalib pipe error\n [xcalib apply]");
 			}
@@ -204,7 +204,7 @@ TQString KRandrSimpleAPI::applyIccFile(TQString screenName, TQString fileName) {
 			screenNumber = -1;
 			randr_display = tqt_xdisplay();
 			randr_screen_info = read_screen_info(randr_display);
-			if (randr_screen_info == NULL) {
+			if (!randr_screen_info) {
 				return "";
 			}
 			j=0;
@@ -235,7 +235,7 @@ TQString KRandrSimpleAPI::applyIccFile(TQString screenName, TQString fileName) {
 			xcalib_result[0]=0;
 
 			icc_command = TQString("xcalib -c");
-			if ((pipe_xcalib = popen(icc_command.ascii(), "r")) == NULL)
+			if (!(pipe_xcalib = popen(icc_command.ascii(), "r")))
 			{
 				printf("Xcalib pipe error\n [xcalib clear]");
 			}
@@ -277,7 +277,7 @@ TQString KRandrSimpleAPI::applyIccConfiguration(TQString profileName, TQString k
 	if (isValid() == true) {
 		randr_display = tqt_xdisplay();
 		randr_screen_info = read_screen_info(randr_display);
-		if (randr_screen_info == NULL) {
+		if (!randr_screen_info) {
 			return "";
 		}
 		for (i = 0; i < randr_screen_info->n_output; i++) {
@@ -389,8 +389,8 @@ TQString KRandrSimpleAPI::applySystemWideIccConfiguration(TQString kde_confdir)
 	int i;
 	xcalib_result[0]=0;
 
-	icc_command = TQString("xcalib \"%1\"").arg(getIccFileName(NULL, "Default", kde_confdir));
-	if ((pipe_xcalib = popen(icc_command.ascii(), "r")) == NULL)
+	icc_command = TQString("xcalib \"%1\"").arg(getIccFileName(TQString::null, "Default", kde_confdir));
+	if (!(pipe_xcalib = popen(icc_command.ascii(), "r")))
 	{
 		printf("Xcalib pipe error [xcalib apply]\n");
 	}
@@ -426,7 +426,7 @@ TQStringList KRandrSimpleAPI::getDisplayConfigurationProfiles(TQString kde_confd
 		TQFileInfoListIterator it(*list);
 		TQFileInfo *fi;
 
-		while ((fi = it.current()) != 0) {
+		while ((fi = it.current()) != nullptr) {
 			if (fi->fileName() != "default") {
 				ret.append(fi->fileName());
 			}
@@ -701,12 +701,12 @@ bool KRandrSimpleAPI::applyDisplayConfiguration(TQPtrList<SingleScreenData> scre
 			}
 			
 			if(xrandr_command_output.startsWith("xrandr: Failed to get size of gamma for output")) {
-				KMessageBox::sorry(0, xrandr_command_output, i18n("Setting gamma failed."));
+				KMessageBox::sorry(nullptr, xrandr_command_output, i18n("Setting gamma failed."));
 			} else if (xrandr_command_output != "") {
 				applyDisplayConfiguration(oldconfig, false, kde_confdir);
 				accepted = false;
 				destroyScreenInformationObject(oldconfig);
-				KMessageBox::sorry(0, xrandr_command_output, i18n("XRandR encountered a problem"));
+				KMessageBox::sorry(nullptr, xrandr_command_output, i18n("XRandR encountered a problem"));
 				return accepted;
 			}
 		}
@@ -1054,7 +1054,7 @@ void KRandrSimpleAPI::applyHotplugRules(TQString kde_confdir) {
 	int j;
 	TQString bestRule;
 	int bestRuleMatchCount = 0;
-	SingleScreenData *screendata = NULL;
+	SingleScreenData *screendata = nullptr;
 	HotPlugRulesList::Iterator it;
 	for (it=rules.begin(); it != rules.end(); ++it) {
 		// Compare each rule against the current display configuration
@@ -1231,7 +1231,7 @@ TQPtrList<SingleScreenData> KRandrSimpleAPI::readCurrentDisplayConfiguration() {
 
 			// Get resolutions
 			bool screen_active;
-			RandRScreen *cur_screen = 0;
+			RandRScreen *cur_screen = nullptr;
 			if (RR_Disconnected == randr_screen_info->outputs[i]->info->connection) {
 				// Output DISCONNECTED
 				screen_active = false;
@@ -1502,7 +1502,7 @@ TQString KRandrSimpleAPI::clearIccConfiguration() {
 	xcalib_result[0]=0;
 
 	icc_command = TQString("xcalib -c");
-	if ((pipe_xcalib = popen(icc_command.ascii(), "r")) == NULL)
+	if (!(pipe_xcalib = popen(icc_command.ascii(), "r")))
 	{
 		printf("Xcalib pipe error [xcalib clear]\n");
 	}
diff --git a/tderandr/randr.cpp b/tderandr/randr.cpp
index 3dfce4589..b95d063a3 100644
--- a/tderandr/randr.cpp
+++ b/tderandr/randr.cpp
@@ -91,7 +91,7 @@ SingleScreenData::~SingleScreenData()
 class RandRScreenPrivate
 {
 public:
-	RandRScreenPrivate() : config(0L) {};
+	RandRScreenPrivate() : config(nullptr) {};
 	~RandRScreenPrivate()
 	{
 		if (config) {
@@ -105,7 +105,7 @@ public:
 TDE_EXPORT RandRScreen::RandRScreen(int screenIndex)
 	: d(new RandRScreenPrivate())
 	, m_screen(screenIndex)
-	, m_shownDialog(NULL)
+	, m_shownDialog(nullptr)
 {
 	loadSettings();
 	setOriginal();
@@ -282,13 +282,13 @@ TDE_EXPORT bool RandRScreen::confirm()
 
 TDE_EXPORT void RandRScreen::shownDialogDestroyed()
 {
-    m_shownDialog = NULL;
+    m_shownDialog = nullptr;
     disconnect( tdeApp->desktop(), TQ_SIGNAL( resized(int)), this, TQ_SLOT( desktopResized()));
 }
 
 TDE_EXPORT void RandRScreen::desktopResized()
 {
-	if( m_shownDialog != NULL )
+	if( m_shownDialog )
 		KDialog::centerOnScreen(m_shownDialog, m_screen);
 }
 
@@ -683,13 +683,13 @@ TDE_EXPORT RandRDisplay::RandRDisplay()
 
 	// Sometimes the extension is available but does not return any screens (!)
 	// Check for that case
-	Display *randr_display = XOpenDisplay(NULL);
+	Display *randr_display = XOpenDisplay(nullptr);
 	int screen_num;
 	Window root_window;
 
 	screen_num = DefaultScreen (randr_display);
 	root_window = RootWindow (randr_display, screen_num);
-	if (XRRGetScreenResources (randr_display, root_window) == NULL) {
+	if (!XRRGetScreenResources (randr_display, root_window)) {
 		m_errorCode = i18n("No screens detected");
 		m_valid = false;
 		return;
diff --git a/win/bootstrap.cpp b/win/bootstrap.cpp
index 9f24f315c..8d458cf0b 100644
--- a/win/bootstrap.cpp
+++ b/win/bootstrap.cpp
@@ -26,7 +26,7 @@
 
 #include "qeventloopex.h"
 
-QEventLoopEx* qeventloopex = 0;
+QEventLoopEx* qeventloopex = nullptr;
 
 /**
  Actions to perform at very early stage of KDE application life on MS Windows.
@@ -69,7 +69,7 @@ KDEWIN32_EXPORT void kde_bootstrap()
 			s = getenv("HOMEDRIVE");
 			s2 = getenv("HOMEPATH");
 			if (!s2)
-				s = 0;
+				s = nullptr;
 		}
 		if (!s) {
 			//no $HOME! : set a value from registry:
@@ -97,7 +97,7 @@ KDEWIN32_EXPORT void kde_bootstrap()
 			if (ok) {
 				ok = (0==access(path, R_OK));
 				if (!ok) {
-					CreateDirectoryA(path,NULL);
+					CreateDirectoryA(path,nullptr);
 					ok = (0==access(path, R_OK));
 					fprintf(stderr,"CreateDirectoryA(%s) = %d\n", path, ok);
 				}
diff --git a/win/qeventloopex.cpp b/win/qeventloopex.cpp
index ac027b4ba..26a3d71ba 100644
--- a/win/qeventloopex.cpp
+++ b/win/qeventloopex.cpp
@@ -58,9 +58,9 @@ public:
 
 	void reset() {
 		m_bStopped = false;
-		m_hThread = NULL;
+		m_hThread = nullptr;
 		m_sockUpdate = 0;
-		m_evPendingListEmpty = NULL;
+		m_evPendingListEmpty = nullptr;
 		sn_highest = 0;
 	}
 	bool m_bStopped;
@@ -95,7 +95,7 @@ QSockNotTypeEx::QSockNotTypeEx()
 QSockNotTypeEx::~QSockNotTypeEx()
 {
 	delete list;
-	list = 0;
+	list = nullptr;
 }
 
 QEventLoopEx::QEventLoopEx( TQObject *parent, const char *name) : 
@@ -111,10 +111,10 @@ QEventLoopEx::QEventLoopEx( TQObject *parent, const char *name) :
 	InitializeCriticalSection(&d->m_csVec);
 	InitializeCriticalSection(&d->m_csPendingList);
 
-	d->m_evPendingListEmpty = CreateEvent(NULL,TRUE,FALSE,NULL);
+	d->m_evPendingListEmpty = CreateEvent(nullptr,TRUE,FALSE,nullptr);
 
 	d->m_sockUpdate = socket(AF_INET,SOCK_DGRAM,0);
-	d->m_hThread = CreateThread(NULL,0,ThreadProc,this,0,&dwThreadId);
+	d->m_hThread = CreateThread(nullptr,0,ThreadProc,this,0,&dwThreadId);
 #ifdef _DEBUG_EVENTLOOPEX
 	tqDebug( "QEventLoopEx::QEventLoopEx leave");
 #endif	
@@ -425,7 +425,7 @@ void QEventLoopEx::run()
 				&d->sn_vec[0].select_fds,
 				&d->sn_vec[1].select_fds,
 				&d->sn_vec[2].select_fds,
-				NULL );
+				nullptr );
 #ifdef _DEBUG_EVENTLOOPEX	
 		tqDebug("QEventLoopEx: select returned %d",nsel);
 #endif
diff --git a/win/qeventloopex.h b/win/qeventloopex.h
index 2fed3ecf9..dd9ffa5ab 100644
--- a/win/qeventloopex.h
+++ b/win/qeventloopex.h
@@ -33,7 +33,7 @@ class QEventLoopEx : public TQEventLoop
 	TQ_OBJECT
 
 public:
-	QEventLoopEx( TQObject *parent = 0, const char *name = 0 );
+	QEventLoopEx( TQObject *parent = nullptr, const char *name = nullptr );
 	virtual ~QEventLoopEx();
 
 public:
diff --git a/win/win32_utils.h b/win/win32_utils.h
index 1f18264cc..65727de14 100644
--- a/win/win32_utils.h
+++ b/win/win32_utils.h
@@ -60,7 +60,7 @@ KDEWIN32_EXPORT void win32_slashify(char *path, int maxlen);
  @param ok if not null, will be set to true on success and false on failure
 */
 KDEWIN32_EXPORT TQString getWin32RegistryValue(HKEY key, const TQString& subKey, 
-	const TQString& item, bool *ok = 0);
+	const TQString& item, bool *ok = nullptr);
 
 /**
  \return a value from MS Windows native registry for shell folder \a folder.
diff --git a/win/win32_utils2.cpp b/win/win32_utils2.cpp
index 946d62e5a..6f4142928 100644
--- a/win/win32_utils2.cpp
+++ b/win/win32_utils2.cpp
@@ -51,14 +51,14 @@ TQString getWin32RegistryValue(HKEY key, const TQString &subKey, const TQString
 		FAILURE;
 	}
 
-	if (ERROR_SUCCESS != RegQueryValueEx(hKey, item.ucs2(), NULL, NULL, NULL, &dwSize))
+	if (ERROR_SUCCESS != RegQueryValueEx(hKey, item.ucs2(), nullptr, nullptr, nullptr, &dwSize))
 	{
 		FAILURE;
 	}
 
 	lszValue = new TCHAR[dwSize];
 
-	if (ERROR_SUCCESS != RegQueryValueEx(hKey, item.ucs2(), NULL, &dwType, (LPBYTE)lszValue, &dwSize))
+	if (ERROR_SUCCESS != RegQueryValueEx(hKey, item.ucs2(), nullptr, &dwType, (LPBYTE)lszValue, &dwSize))
 	{
 		delete[] lszValue;
 		FAILURE;
-- 
cgit v1.2.3

