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

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 karm/karm_part.cpp                          | 10 +++++-----
 karm/mainwindow.cpp                         | 10 +++++-----
 karm/task.cpp                               |  2 +-
 kgantt/kgantt/KGanttItem.cpp                |  2 +-
 kgantt/kgantt/xQGanttBarView.cpp            |  2 +-
 kgantt/kgantt/xQGanttBarViewPort.cpp        |  4 ++--
 kgantt/kgantt/xQGanttBarViewPort_Events.cpp |  4 ++--
 kgantt/kgantt/xQGanttListViewPort.cpp       |  2 +-
 korganizer/koprefsdialog.cpp                |  8 ++++----
 korganizer/plugins/hebrew/parsha.cpp        |  4 ++--
 libkcal/vcalformat.cpp                      |  2 +-
 11 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/karm/karm_part.cpp b/karm/karm_part.cpp
index 1adb45dfb..690213654 100644
--- a/karm/karm_part.cpp
+++ b/karm/karm_part.cpp
@@ -533,13 +533,13 @@ int karmPart::bookTime
 
   // Find task
   task = _taskView->first_child();
-  t = NULL;
+  t = nullptr;
   while ( !t && task )
   {
     t = _hasUid( task, taskId );
     task = task->nextSibling();
   }
-  if ( t == NULL ) rval = KARM_ERR_UID_NOT_FOUND;
+  if (!t) rval = KARM_ERR_UID_NOT_FOUND;
 
   // Parse datetime
   if ( !rval ) 
@@ -588,13 +588,13 @@ int karmPart::totalMinutesForTaskId( const TQString& taskId )
 
   // Find task
   task = _taskView->first_child();
-  t = NULL;
+  t = nullptr;
   while ( !t && task )
   {
     t = _hasUid( task, taskId );
     task = task->nextSibling();
   }
-  if ( t != NULL ) 
+  if (t)
   {
     rval = t->totalTime();
     kdDebug(5970) << "MainWindow::totalTimeForTask - task found: rval = " << rval << endl;
@@ -629,7 +629,7 @@ TQString karmPart::_hasTask( Task* task, const TQString &taskname ) const
 
 Task* karmPart::_hasUid( Task* task, const TQString &uid ) const
 {
-  Task *rval = NULL;
+  Task *rval = nullptr;
 
   //kdDebug(5970) << "MainWindow::_hasUid( " << task << ", " << uid << " )" << endl;
 
diff --git a/karm/mainwindow.cpp b/karm/mainwindow.cpp
index 26cab9b57..22ec82711 100644
--- a/karm/mainwindow.cpp
+++ b/karm/mainwindow.cpp
@@ -567,13 +567,13 @@ int MainWindow::bookTime
 
   // Find task
   task = _taskView->first_child();
-  t = NULL;
+  t = nullptr;
   while ( !t && task )
   {
     t = _hasUid( task, taskId );
     task = task->nextSibling();
   }
-  if ( t == NULL ) rval = KARM_ERR_UID_NOT_FOUND;
+  if (!t) rval = KARM_ERR_UID_NOT_FOUND;
 
   // Parse datetime
   if ( !rval ) 
@@ -622,13 +622,13 @@ int MainWindow::totalMinutesForTaskId( const TQString& taskId )
 
   // Find task
   task = _taskView->first_child();
-  t = NULL;
+  t = nullptr;
   while ( !t && task )
   {
     t = _hasUid( task, taskId );
     task = task->nextSibling();
   }
-  if ( t != NULL ) 
+  if (t)
   {
     rval = t->totalTime();
     kdDebug(5970) << "MainWindow::totalTimeForTask - task found: rval = " << rval << endl;
@@ -663,7 +663,7 @@ TQString MainWindow::_hasTask( Task* task, const TQString &taskname ) const
 
 Task* MainWindow::_hasUid( Task* task, const TQString &uid ) const
 {
-  Task *rval = NULL;
+  Task *rval = nullptr;
 
   //kdDebug(5970) << "MainWindow::_hasUid( " << task << ", " << uid << " )" << endl;
 
diff --git a/karm/task.cpp b/karm/task.cpp
index 6b4d32839..a4be2e17f 100644
--- a/karm/task.cpp
+++ b/karm/task.cpp
@@ -296,7 +296,7 @@ TQString Task::fullName() const
 KCal::Todo* Task::asTodo(KCal::Todo* todo) const
 {
 
-  Q_ASSERT( todo != NULL );
+  Q_ASSERT(todo);
 
   kdDebug(5970) << "Task::asTodo: name() = '" << name() << "'" << endl;
   todo->setSummary( name() );
diff --git a/kgantt/kgantt/KGanttItem.cpp b/kgantt/kgantt/KGanttItem.cpp
index c517e767a..3df2d1f61 100644
--- a/kgantt/kgantt/KGanttItem.cpp
+++ b/kgantt/kgantt/KGanttItem.cpp
@@ -101,7 +101,7 @@ KGanttItem::addRelation(KGanttItem* from, KGanttItem* to,
     return rel;
   }	   
   else
-    return NULL;
+    return nullptr;
 }
 
 
diff --git a/kgantt/kgantt/xQGanttBarView.cpp b/kgantt/kgantt/xQGanttBarView.cpp
index 3e691c04b..0eee851b8 100644
--- a/kgantt/kgantt/xQGanttBarView.cpp
+++ b/kgantt/kgantt/xQGanttBarView.cpp
@@ -16,7 +16,7 @@ xQGanttBarView::xQGanttBarView(KGanttItem* toplevelitem,
 			       const char * name, WFlags f)
   : TQScrollView(parent,name,f)
 {     
-  _config = NULL;
+  _config = nullptr;
 
   _toplevelitem = toplevelitem;
 
diff --git a/kgantt/kgantt/xQGanttBarViewPort.cpp b/kgantt/kgantt/xQGanttBarViewPort.cpp
index 5aca74c92..eff6e4d5e 100644
--- a/kgantt/kgantt/xQGanttBarViewPort.cpp
+++ b/kgantt/kgantt/xQGanttBarViewPort.cpp
@@ -32,8 +32,8 @@ xQGanttBarViewPort::xQGanttBarViewPort(KGanttItem* toplevelitem,
   closedIcon =  TQPixmap(open_xpm);
   openedIcon =  TQPixmap(close_xpm);
 
-  _observedList = NULL;
-  _toolbar = NULL;
+  _observedList = nullptr;
+  _toolbar = nullptr;
 
   _gItemList = TQPtrDict<xTQTaskPosition>(449);
   _gItemList.setAutoDelete(true);
diff --git a/kgantt/kgantt/xQGanttBarViewPort_Events.cpp b/kgantt/kgantt/xQGanttBarViewPort_Events.cpp
index 94b597263..c0a92dc12 100644
--- a/kgantt/kgantt/xQGanttBarViewPort_Events.cpp
+++ b/kgantt/kgantt/xQGanttBarViewPort_Events.cpp
@@ -52,7 +52,7 @@ xQGanttBarViewPort::mousePressEvent(TQMouseEvent* e)
   /*
    *  get clicked item and position
    */
-  _currentItem = NULL;
+  _currentItem = nullptr;
   Position pos = check(&_currentItem, e->x(), e->y());
 
   if(!_currentItem) {
@@ -407,7 +407,7 @@ xQGanttBarViewPort::mouseMoveEvent(TQMouseEvent* e)
       
       static Position _pos = Outside;
       
-      KGanttItem* item = NULL;
+      KGanttItem* item = nullptr;
       
       Position pos = check(&item, e->x(), e->y());
       
diff --git a/kgantt/kgantt/xQGanttListViewPort.cpp b/kgantt/kgantt/xQGanttListViewPort.cpp
index e12534efd..d74f2f42e 100644
--- a/kgantt/kgantt/xQGanttListViewPort.cpp
+++ b/kgantt/kgantt/xQGanttListViewPort.cpp
@@ -21,7 +21,7 @@ xQGanttListViewPort::xQGanttListViewPort(KGanttItem* toplevelitem, TQWidget* par
 
   setBackgroundColor(TQColor(white));
 
-  _barviewport = NULL;
+  _barviewport = nullptr;
 
   _width = 1000;
 
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 31ad77780..c35e75fe6 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -190,7 +190,7 @@ class KOPrefsDialogTime : public KPrefsModule
 
         if (f = popen(buf, "r"))
           {
-           if (fgets(buf, MAXPATHLEN - 1, f) != NULL)
+           if (fgets(buf, MAXPATHLEN - 1, f))
              {
                buf[strlen(buf) - 1] = '\0';
                sCurrentlySet = TQString(buf);
@@ -198,7 +198,7 @@ class KOPrefsDialogTime : public KPrefsModule
            pclose(f);
           }
     #else
-      if((f = fopen("/etc/timezone", "r")) != NULL) {
+      if ((f = fopen("/etc/timezone", "r")) != nullptr) {
         // get the currently set timezone
         fgets(tempstring, 100, f);
         tempstring[strlen(tempstring) - 1] = '\0';
@@ -217,7 +217,7 @@ class KOPrefsDialogTime : public KPrefsModule
 
         if (f = popen(buf, "r"))
           {
-           while(fgets(buf, MAXPATHLEN - 1, f) != NULL)
+           while(fgets(buf, MAXPATHLEN - 1, f))
              {
                buf[strlen(buf) - 1] = '\0';
                list.append(buf);
@@ -228,7 +228,7 @@ class KOPrefsDialogTime : public KPrefsModule
     #else
       f = popen("grep -e  ^[^#] /usr/share/zoneinfo/zone.tab | cut -f 3","r");
       if (!f) return;
-      while(fgets(tempstring, 100, f) != NULL) {
+      while(fgets(tempstring, 100, f)) {
         tempstring[strlen(tempstring)-1] = '\0';
         list.append(i18n(tempstring));
         tzonenames << tempstring;
diff --git a/korganizer/plugins/hebrew/parsha.cpp b/korganizer/plugins/hebrew/parsha.cpp
index 4f5522ab7..8d79a885e 100644
--- a/korganizer/plugins/hebrew/parsha.cpp
+++ b/korganizer/plugins/hebrew/parsha.cpp
@@ -180,7 +180,7 @@ TQString
  */
 
   int week = daynumber / 7;        // week of the year
-  unsigned const char *array = NULL;
+  unsigned const char *array = nullptr;
   int index;
 
   // get the appropriate array by exhaustive search into the 14 year types.  Since we
@@ -245,7 +245,7 @@ TQString
 
   TQString buffer;
 
-  if (array == NULL)
+  if (!array)
     /* Something is terribly wrong. */
       {
         buffer = "??Parsha??";
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp
index 539921fad..a20197cdd 100644
--- a/libkcal/vcalformat.cpp
+++ b/libkcal/vcalformat.cpp
@@ -1341,7 +1341,7 @@ int vcaltime_utc_offset( TQDateTime ictt, TQString tzid )
   //  struct icaltimetype tt = icaltime_from_timet( ictt.toTime_t(), false );
   //  return icaltime_utc_offset( tt, tzid.latin1() );
   int daylight;
-  struct icaltimetype tt = icaltime_from_timet_with_zone( ictt.toTime_t(), false, NULL);
+  struct icaltimetype tt = icaltime_from_timet_with_zone( ictt.toTime_t(), false, nullptr);
   return icaltimezone_get_utc_offset(
     icaltimezone_get_builtin_timezone( tzid.latin1() ),
     &tt, &daylight );
-- 
cgit v1.2.3

