From 360746994968aaefec3c626a6a153ad9f9a7c142 Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sun, 20 Sep 2026 16:43:21 -0300
Subject: Replace NULL pointer constants with nullptr
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>
---
 src/tdedocker.cpp    |  2 +-
 src/tqtraylabel.cpp  | 18 +++++++++---------
 src/tqtraylabel.h    |  4 ++--
 src/trace.cpp        |  2 +-
 src/traylabelmgr.cpp | 34 +++++++++++++++++-----------------
 src/util.cpp         | 14 +++++++-------
 6 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/src/tdedocker.cpp b/src/tdedocker.cpp
index e0bded0..456b902 100644
--- a/src/tdedocker.cpp
+++ b/src/tdedocker.cpp
@@ -42,7 +42,7 @@
 #define TMPFILE_PREFIX TQString("/tmp/tdedocker.")
 
 TDEDocker::TDEDocker()
-  : TDEApplication(), mTrayLabelMgr(NULL)
+  : TDEApplication(), mTrayLabelMgr(nullptr)
 {
   // Set ourselves up to be called from the application loop
   connect(&mInitTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(doInit()));
diff --git a/src/tqtraylabel.cpp b/src/tqtraylabel.cpp
index 621b764..eeec5f2 100644
--- a/src/tqtraylabel.cpp
+++ b/src/tqtraylabel.cpp
@@ -408,7 +408,7 @@ void TQTrayLabel::skipTaskbar(void)
   Atom __attribute__ ((unused)) type;
   int __attribute__ ((unused)) format;
   unsigned long __attribute__ ((unused)) left;
-  Atom *data = NULL;
+  Atom *data = nullptr;
   unsigned long nitems = 0, num_states = 0;
   Display *display = TQPaintDevice::x11AppDisplay();
 
@@ -632,7 +632,7 @@ void TQTrayLabel::balloonText()
 void TQTrayLabel::handleTitleChange(void)
 {
   Display *display = TQPaintDevice::x11AppDisplay();
-  char *window_name = NULL;
+  char *window_name = nullptr;
 
   XFetchName(display, mDockedWindow, &window_name);
   mTitle = window_name;
@@ -669,14 +669,14 @@ void TQTrayLabel::updateTitle()
 
 void TQTrayLabel::handleIconChange(void)
 {
-  char **window_icon = NULL;
+  char **window_icon = nullptr;
 
   TRACE("%s", me());
   if (mDockedWindow == None) return;
 
   Display *display = TQPaintDevice::x11AppDisplay();
   XWMHints *wm_hints = XGetWMHints(display, mDockedWindow);
-  if (wm_hints != NULL)
+  if (wm_hints != nullptr)
   {
     if (!(wm_hints->flags & IconMaskHint))
       wm_hints->icon_mask = None;
@@ -687,7 +687,7 @@ void TQTrayLabel::handleIconChange(void)
      */
     if ((wm_hints->flags & IconPixmapHint) && (wm_hints->icon_pixmap))
       XpmCreateDataFromPixmap(display, &window_icon, wm_hints->icon_pixmap,
-                              wm_hints->icon_mask, NULL);
+                              wm_hints->icon_mask, nullptr);
     XFree(wm_hints);
   }
   TQImage image;
@@ -744,7 +744,7 @@ void TQTrayLabel::dragEnterEvent(TQDragEnterEvent *ev)
 
 void TQTrayLabel::dropEvent(TQDropEvent *)
 {
-  KMessageBox::error(NULL, i18n("You cannot drop an item into the tray icon. Drop it on the window\n"
+  KMessageBox::error(nullptr, i18n("You cannot drop an item into the tray icon. Drop it on the window\n"
       "that is brought in front when you hover the item over the tray icon"), i18n("TDEDocker"));
 }
 
@@ -893,7 +893,7 @@ void TQTrayLabel::propertyChangeEvent(Atom property)
     Atom type = None;
     int format;
     unsigned long nitems, after;
-    unsigned char *data = NULL;
+    unsigned char *data = nullptr;
     int r = XGetWindowProperty(display, mDockedWindow, WM_STATE,
              0, 1, False, AnyPropertyType, &type,
              &format, &nitems, &after, &data);
@@ -936,7 +936,7 @@ void TQTrayLabel::setDockWhenRestored(bool dwr)
 
   if (dwr && appName().isEmpty())
   {
-    KMessageBox::error(NULL, i18n("No valid application executable file known. \"Dock When Restore\" is not possible."),
+    KMessageBox::error(nullptr, i18n("No valid application executable file known. \"Dock When Restore\" is not possible."),
                         i18n("TDEDocker"));
     mDockWhenRestored->setChecked(false);
   }
@@ -1015,7 +1015,7 @@ void TQTrayLabel::installMenu()
   mMainMenu->insertSeparator();
 
   mMainMenu->insertItem(SmallIcon("help"),KStdGuiItem::help().text(), (new KHelpMenu(this, TDEGlobal::instance()->aboutData()))->menu(), false);
-  TDEAction *quitAction = KStdAction::quit(this, TQ_SLOT(close()), NULL);
+  TDEAction *quitAction = KStdAction::quit(this, TQ_SLOT(close()), nullptr);
   quitAction->plug(mMainMenu);
 
   connect(mMainMenu, TQ_SIGNAL(aboutToShow()), this, TQ_SLOT(updateMenu()));
diff --git a/src/tqtraylabel.h b/src/tqtraylabel.h
index d75e649..6fa3f36 100644
--- a/src/tqtraylabel.h
+++ b/src/tqtraylabel.h
@@ -54,8 +54,8 @@ class TQTrayLabel : public TQLabel
   TQ_OBJECT
 
 public:
-  TQTrayLabel(Window w, TQWidget *p = NULL, const TQString &text = TQString::null);
-  TQTrayLabel(const TQStringList &argv, pid_t pid, TQWidget *parent = NULL);
+  TQTrayLabel(Window w, TQWidget *p = nullptr, const TQString &text = TQString::null);
+  TQTrayLabel(const TQStringList &argv, pid_t pid, TQWidget *parent = nullptr);
   virtual ~TQTrayLabel();
 
   // Accessors
diff --git a/src/trace.cpp b/src/trace.cpp
index 5756a56..278e97a 100644
--- a/src/trace.cpp
+++ b/src/trace.cpp
@@ -3,7 +3,7 @@
 #include <tqfile.h>
 #include <stdio.h>
 
-static TQTextEdit *tracer = NULL;
+static TQTextEdit *tracer = nullptr;
 
 void TRACER(TQtMsgType, const char *msg)
 {
diff --git a/src/traylabelmgr.cpp b/src/traylabelmgr.cpp
index 61f08e1..b676fa5 100644
--- a/src/traylabelmgr.cpp
+++ b/src/traylabelmgr.cpp
@@ -36,7 +36,7 @@
 #include <errno.h>
 #include <stdlib.h>
 
-TrayLabelMgr* TrayLabelMgr::gTrayLabelMgr = NULL;
+TrayLabelMgr* TrayLabelMgr::gTrayLabelMgr = nullptr;
 
 TrayLabelMgr* TrayLabelMgr::instance()
 {
@@ -80,7 +80,7 @@ void TrayLabelMgr::startup(void)
       return;
     }
 
-    if (KMessageBox::warningContinueCancel(NULL,
+    if (KMessageBox::warningContinueCancel(nullptr,
           state == SysTrayAbsent ? i18n("No system tray found") : i18n("System tray appears to be hidden"),
           i18n("TDEDocker")) == KMessageBox::Cancel)
     {
@@ -131,7 +131,7 @@ void TrayLabelMgr::manageTrayLabel(TQTrayLabel *t)
 void TrayLabelMgr::dockAnother()
 {
   TQTrayLabel *t = selectAndDock();
-  if (t == NULL) return;
+  if (t == nullptr) return;
   manageTrayLabel(t);
   t->withdraw();
   t->dock();
@@ -183,7 +183,7 @@ bool TrayLabelMgr::processCommand(const TQStringList &args)
     argv[i] = args[i].local8Bit();
   }
 
-  argv[argc] = NULL; // null terminate the array
+  argv[argc] = nullptr; // null terminate the array
 
   return processCommand(argc, const_cast<char **>(argv));
 }
@@ -268,7 +268,7 @@ bool TrayLabelMgr::processCommand(int argc, char** argv)
 
   int option;
   Window w = None;
-  const char *icon = NULL;
+  const char *icon = nullptr;
   int balloon_timeout = 4000;
   bool withdraw = true, skip_taskbar = false,
        dock_obscure = false, check_normality = true, enable_sm = true;
@@ -328,7 +328,7 @@ bool TrayLabelMgr::processCommand(int argc, char** argv)
 
   // Launch an application if present in command line. else request from user
   TQTrayLabel *t = (optind < argc) ? dockApplication(&argv[optind]) : selectAndDock(w, check_normality);
-  if (t == NULL) return false;
+  if (t == nullptr) return false;
   // apply settings and add to tray
   manageTrayLabel(t);
   if (icon) t->setTrayIcon(icon);
@@ -351,15 +351,15 @@ TQTrayLabel *TrayLabelMgr::selectAndDock(Window w, bool checkNormality)
     tqDebug("%s", i18n("Select the application/window to dock with button1.").local8Bit().data());
     tqDebug("%s", i18n("Click any other button to abort\n").local8Bit().data());
 
-    const char *err = NULL;
+    const char *err = nullptr;
 
     if ((w = selectWindow(TQPaintDevice::x11AppDisplay(), &err)) == None)
     {
       if (err)
       {
-        KMessageBox::error(NULL, err, i18n("TDEDocker"));
+        KMessageBox::error(nullptr, err, i18n("TDEDocker"));
       }
-      return NULL;
+      return nullptr;
     }
   }
 
@@ -369,11 +369,11 @@ TQTrayLabel *TrayLabelMgr::selectAndDock(Window w, bool checkNormality)
      * Abort should be the only option here really. "Ignore" is provided here
      * for the curious user who wants to screw himself very badly
      */
-    if (KMessageBox::warningContinueCancel(NULL,
+    if (KMessageBox::warningContinueCancel(nullptr,
           i18n("The window you are attempting to dock does not seem to be a normal window."),
           i18n("TDEDocker")) == KMessageBox::Cancel)
     {
-      return NULL;
+      return nullptr;
     }
   }
 
@@ -384,9 +384,9 @@ TQTrayLabel *TrayLabelMgr::selectAndDock(Window w, bool checkNormality)
 
   TRACE("0x%x is alredy docked", (unsigned) w);
 
-  KMessageBox::error(NULL, i18n("This window is already docked.\n"
+  KMessageBox::error(nullptr, i18n("This window is already docked.\n"
        "Click on system tray icon to toggle docking."), i18n("TDEDocker"));
-  return NULL;
+  return nullptr;
 }
 
 bool TrayLabelMgr::isWindowDocked(Window w)
@@ -428,14 +428,14 @@ TQTrayLabel *TrayLabelMgr::dockApplication(char *argv[])
       // Exit the forked process only.
       // Using tdeApp->quit() crashes the parent application.
       exit(0);
-      return NULL;
+      return nullptr;
     }
   }
 
   if (pid == -1)
   {
-    KMessageBox::error(NULL, i18n("Failed to fork: %1").arg(strerror(errno)), i18n("Ignore"));
-    return NULL;
+    KMessageBox::error(nullptr, i18n("Failed to fork: %1").arg(strerror(errno)), i18n("Ignore"));
+    return nullptr;
   }
 
   TQStringList cmd_line;
@@ -507,7 +507,7 @@ void TrayLabelMgr::notifySysTrayAbsence()
   if (state == SysTrayPresent) 
     return; // So sweet of the systray to come back so soon
 
-  KMessageBox::error(NULL, i18n("The System tray was hidden or removed. All applications "
+  KMessageBox::error(nullptr, i18n("The System tray was hidden or removed. All applications "
                      "will be undocked."), i18n("TDEDocker"));
   undockAll();
 }
diff --git a/src/util.cpp b/src/util.cpp
index 1093305..3107183 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -51,7 +51,7 @@ bool isNormalWindow(Display *display, Window w)
   Atom __attribute__ ((unused)) type;
   int __attribute__ ((unused)) format;
   unsigned long __attribute__ ((unused)) left;
-  Atom *data = NULL;
+  Atom *data = nullptr;
   unsigned long nitems;
   Window transient_for = None;
 
@@ -72,7 +72,7 @@ bool isNormalWindow(Display *display, Window w)
 
   TRACE("0x%x (%i)", (unsigned) w, (unsigned) w);
 
-  if (ret != Success || data == NULL) return false;
+  if (ret != Success || data == nullptr) return false;
   TRACE("\tHas WM_STATE");
   if (data) XFree(data);
 
@@ -171,7 +171,7 @@ bool analyzeWindow(Display *display, Window w, pid_t epid, const TQString &ename
   if (epid) return false;
 
   // no plans to analyze windows without a name
-  char *window_name = NULL;
+  char *window_name = nullptr;
   if (!XFetchName(display, w, &window_name)) return false;
   TRACE("Window has name [%s]", window_name);
   if (window_name) XFree(window_name); else return false;
@@ -193,7 +193,7 @@ bool analyzeWindow(Display *display, Window w, pid_t epid, const TQString &ename
     else
     {
       // sheer desperation
-      char *wm_name = NULL;
+      char *wm_name = nullptr;
       XFetchName(display, w, &wm_name);
       if (wm_name && (TQString(wm_name).find(ename, 0, false) != -1))
       {
@@ -216,7 +216,7 @@ Window activeWindow(Display *display)
   Atom type = None;
   int format;
   unsigned long nitems, after;
-  unsigned char *data = NULL;
+  unsigned char *data = nullptr;
   int screen = DefaultScreen(display);
   Window root = RootWindow(display, screen);
   int r = XGetWindowProperty(display, root, active_window_atom,0, 1,
@@ -243,7 +243,7 @@ Window selectWindow(Display *display, const char **err)
   int screen = DefaultScreen(display);
   Window root = RootWindow(display, screen);
 
-  if (err) *err = NULL;
+  if (err) *err = nullptr;
 
   Cursor cursor = XCreateFontCursor(display, XC_draped_box);
   if (cursor == None)
@@ -311,7 +311,7 @@ bool getCardinalProperty(Display *display, Window w, Atom prop, long *data)
   Atom type;
   int format;
   unsigned long nitems, bytes;
-  unsigned char *d = NULL;
+  unsigned char *d = nullptr;
 
   if (XGetWindowProperty(display, w, prop, 0, 1, False, XA_CARDINAL,&type, 
                          &format, &nitems, &bytes, &d) == Success && d)
-- 
cgit v1.2.3

