From 4f322a1c88e609df8bd6590389ad8e7ab1e0a30a Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sun, 20 Sep 2026 17:15:43 -0300
Subject: Replace zero 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/app/historyAction.cpp           |  6 +++---
 src/app/historyAction.h             |  2 +-
 src/app/main.cpp                    | 10 +++++-----
 src/app/mainWindow.cpp              |  4 ++--
 src/part/debug.h                    |  2 +-
 src/part/fileTree.cpp               |  2 +-
 src/part/fileTree.h                 | 14 +++++++-------
 src/part/localLister.cpp            |  4 ++--
 src/part/part.cpp                   |  2 +-
 src/part/part.h                     |  2 +-
 src/part/radialMap/labels.cpp       |  8 ++++----
 src/part/radialMap/map.cpp          |  6 +++---
 src/part/radialMap/segmentTip.cpp   |  2 +-
 src/part/radialMap/widget.cpp       | 14 +++++++-------
 src/part/radialMap/widget.h         |  8 ++++----
 src/part/radialMap/widgetEvents.cpp |  4 ++--
 src/part/remoteLister.cpp           |  6 +++---
 src/part/scan.cpp                   |  6 +++---
 src/part/settingsDialog.h           |  2 +-
 19 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/src/app/historyAction.cpp b/src/app/historyAction.cpp
index 0c20264..b5290a4 100644
--- a/src/app/historyAction.cpp
+++ b/src/app/historyAction.cpp
@@ -10,7 +10,7 @@
 
 inline
 HistoryAction::HistoryAction( const TQString &text, const char *icon, const TDEShortcut &cut, TDEActionCollection *ac, const char *name )
-        : TDEAction( text, icon, cut, 0, 0, ac, name )
+        : TDEAction( text, icon, cut, nullptr, nullptr, ac, name )
         , m_text( text )
 {
     // ui files make this false, but we can't rely on UI file as it isn't compiled in :(
@@ -44,7 +44,7 @@ HistoryCollection::HistoryCollection( TDEActionCollection *ac, TQObject *parent,
         : TQObject( parent, name )
         , m_b( new HistoryAction( i18n( "Back" ), "back", TDEStdAccel::back(), ac, "go_back" ) )
         , m_f( new HistoryAction( i18n( "Forward" ), "forward",  TDEStdAccel::forward(), ac, "go_forward" ) )
-        , m_receiver( 0 )
+        , m_receiver( nullptr )
 {
     connect( m_b, TQ_SIGNAL(activated()), TQ_SLOT(pop()) );
     connect( m_f, TQ_SIGNAL(activated()), TQ_SLOT(pop()) );
@@ -63,7 +63,7 @@ HistoryCollection::push( const KURL &url ) //slot
 
         m_receiver->push( url.path( 1 ) );
     }
-    m_receiver = 0;
+    m_receiver = nullptr;
 }
 
 void
diff --git a/src/app/historyAction.h b/src/app/historyAction.h
index aa056a6..e99026d 100644
--- a/src/app/historyAction.h
+++ b/src/app/historyAction.h
@@ -50,7 +50,7 @@ public:
 
 public slots:
     void push( const KURL& );
-    void stop() { m_receiver = 0; }
+    void stop() { m_receiver = nullptr; }
 
 signals:
     void activated( const KURL& );
diff --git a/src/app/main.cpp b/src/app/main.cpp
index e4c59f3..4771e2c 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -12,14 +12,14 @@
 
 static const TDECmdLineOptions options[] =
 {
-    { "+[path]", I18N_NOOP( "Scan 'path'" ), 0 },
-    { 0, 0, 0 }
+    { "+[path]", I18N_NOOP( "Scan 'path'" ), nullptr },
+    { nullptr, nullptr, nullptr }
 };
 
 static TDEAboutData about(
         APP_NAME, I18N_NOOP( APP_PRETTYNAME ), APP_VERSION,
         I18N_NOOP("Graphical disk-usage information"), TDEAboutData::License_GPL_V2,
-        I18N_NOOP("(C )2006 Max Howell"), 0,
+        I18N_NOOP("(C )2006 Max Howell"), nullptr,
         "http://www.methylblue.com/filelight/", "filelight@methylblue.com" );
 
 
@@ -28,8 +28,8 @@ int main( int argc, char *argv[] )
     using Filelight::MainWindow;
 
     about.addAuthor( "Max Howell", I18N_NOOP("Author, maintainer"), "max.howell@methylblue.com", "http://www.methylblue.com/" );
-    about.addAuthor( "Mike Diehl", I18N_NOOP("Documentation"), 0, 0 );
-    about.addCredit( "Steffen Gerlach", I18N_NOOP("Inspiration"), 0, "http://www.steffengerlach.de/" );
+    about.addAuthor( "Mike Diehl", I18N_NOOP("Documentation"), nullptr, nullptr );
+    about.addCredit( "Steffen Gerlach", I18N_NOOP("Inspiration"), nullptr, "http://www.steffengerlach.de/" );
     about.addCredit( "André Somers",   I18N_NOOP("Internationalization") );
     about.addCredit( "Stephanie James", I18N_NOOP("Testing") );
     about.addCredit( "Marcus Camen",    I18N_NOOP("Bravery in the face of unreadable code") );
diff --git a/src/app/mainWindow.cpp b/src/app/mainWindow.cpp
index 5999d56..82dcef5 100644
--- a/src/app/mainWindow.cpp
+++ b/src/app/mainWindow.cpp
@@ -32,7 +32,7 @@ namespace Filelight {
 
 MainWindow::MainWindow()
         : KParts::MainWindow()
-        , m_part( 0 )
+        , m_part( nullptr )
 {
     KLibFactory *factory = KLibLoader::self()->factory( "libfilelight" );
 
@@ -95,7 +95,7 @@ MainWindow::setupActions() //singleton function
     new TDEAction( i18n( "Clear Location Bar" ), TDEApplication::reverseLayout() ? "clear_left" : "locationbar_erase", 0, m_combo, TQ_SLOT(clearEdit()), ac, "clear_location" );
     new TDEAction( i18n( "Go" ), "key_enter", 0, m_combo, TQ_SIGNAL(returnPressed()), ac, "go" );
 
-    KWidgetAction *combo = new KWidgetAction( m_combo, i18n( "Location Bar" ), 0, 0, 0, ac, "location_bar" );
+    KWidgetAction *combo = new KWidgetAction( m_combo, i18n( "Location Bar" ), 0, nullptr, nullptr, ac, "location_bar" );
     m_recentScans = new TDERecentFilesAction( i18n( "&Recent Scans" ), 0, ac, "scan_recent", 8 );
     m_histories = new HistoryCollection( ac, this, "history_collection" );
 
diff --git a/src/part/debug.h b/src/part/debug.h
index e5e680b..a7d76be 100644
--- a/src/part/debug.h
+++ b/src/part/debug.h
@@ -23,7 +23,7 @@ static inline kdbgstream debug()
    #ifdef DEBUG_PREFIX
       "[" DEBUG_PREFIX "] ",
    #endif
-      0, 0 );
+      nullptr, 0 );
 }
 #endif
 
diff --git a/src/part/fileTree.cpp b/src/part/fileTree.cpp
index 70497c5..d47af36 100644
--- a/src/part/fileTree.cpp
+++ b/src/part/fileTree.cpp
@@ -18,7 +18,7 @@ File::fullPath( const Directory *root /*= 0*/ ) const
    TQString path;
 
    if( root == this )
-      root = 0; //prevent returning empty string when there is something we could return
+      root = nullptr; //prevent returning empty string when there is something we could return
 
    for( const Directory *d = (Directory*)this; d != root && d; d = d->parent() )
       path.prepend( d->name() );
diff --git a/src/part/fileTree.h b/src/part/fileTree.h
index 9974b3c..6bca84f 100644
--- a/src/part/fileTree.h
+++ b/src/part/fileTree.h
@@ -25,7 +25,7 @@ class Link
 {
 public:
    Link( T* const t ) : prev( this ), next( this ), data( t ) {}
-   Link() : prev( this ), next( this ), data( 0 ) {}
+   Link() : prev( this ), next( this ), data( nullptr ) {}
 
 //TODO unlinking is slow and you don't use it very much in this context.
 //  ** Perhaps you can make a faster deletion system that doesn't bother tidying up first
@@ -50,7 +50,7 @@ template <class T>
 class Iterator
 {
 public:
-   Iterator() : link( 0 ) { } //**** remove this, remove this REMOVE THIS!!! dangerous as your implementation doesn't test for null links, always assumes they can be derefenced
+   Iterator() : link( nullptr ) { } //**** remove this, remove this REMOVE THIS!!! dangerous as your implementation doesn't test for null links, always assumes they can be derefenced
    Iterator( Link<T> *p ) : link( p ) { }
 
    bool operator==( const Iterator<T>& it ) const { return link == it.link; }
@@ -63,7 +63,7 @@ public:
 
    Iterator<T>& operator++() { link = link->next; return *this; } //**** does it waste time returning in places where we don't use the retval?
 
-   bool isNull() const { return (link == 0); } //REMOVE WITH ABOVE REMOVAL you don't want null iterators to be possible
+   bool isNull() const { return (link == nullptr); } //REMOVE WITH ABOVE REMOVAL you don't want null iterators to be possible
 
    void transferTo( Chain<T> &chain )
    {
@@ -75,7 +75,7 @@ public:
       T* const d = link->data;
       Link<T>* const p = link->prev;
 
-      link->data = 0;
+      link->data = nullptr;
       delete link;
       link = p; //make iterator point to previous element, YOU must check this points to an element
 
@@ -165,7 +165,7 @@ public:
    static const uint DENOMINATOR[4];
 
 public:
-   File( const char *name, FileSize size ) : m_parent( 0 ), m_name( tqstrdup( name ) ), m_size( size ) {}
+   File( const char *name, FileSize size ) : m_parent( nullptr ), m_name( tqstrdup( name ) ), m_size( size ) {}
    virtual ~File() { delete [] m_name; }
 
    const Directory *parent() const { return m_parent; }
@@ -175,7 +175,7 @@ public:
 
    virtual bool isDirectory() const { return false; }
 
-   TQString fullPath( const Directory* = 0 ) const;
+   TQString fullPath( const Directory* = nullptr ) const;
    TQString humanReadableSize( UnitPrefix key = mega ) const;
 
 public:
@@ -203,7 +203,7 @@ public:
    virtual bool isDirectory() const { return true; }
 
    ///appends a Directory
-   void append( Directory *d, const char *name=0 )
+   void append( Directory *d, const char *name=nullptr )
    {
       if( name ) {
          delete [] d->m_name;
diff --git a/src/part/localLister.cpp b/src/part/localLister.cpp
index 2f23a79..3a553a4 100644
--- a/src/part/localLister.cpp
+++ b/src/part/localLister.cpp
@@ -59,7 +59,7 @@ namespace Filelight
       {
          debug() << "Scan succesfully aborted\n";
          delete tree;
-         tree = 0;
+         tree = nullptr;
       }
 
       TQCustomEvent *e = new TQCustomEvent( 1000 );
@@ -196,7 +196,7 @@ namespace Filelight
 
          else if( S_ISDIR( statbuf.st_mode ) )  //directory
          {
-            Directory *d = 0;
+            Directory *d = nullptr;
             TQCString new_dirname = ent->d_name;
             new_dirname += '/';
             new_path    += '/';
diff --git a/src/part/part.cpp b/src/part/part.cpp
index 2d291cc..3052e0d 100644
--- a/src/part/part.cpp
+++ b/src/part/part.cpp
@@ -42,7 +42,7 @@ Part::Part( TQWidget *parentWidget, const char *widgetName, TQObject *parent, co
         : ReadOnlyPart( parent, name )
         , m_ext( new BrowserExtension( this ) )
         , m_statusbar( new StatusBarExtension( this ) )
-        , m_map( 0 )
+        , m_map( nullptr )
         , m_manager( new ScanManager( this ) )
         , m_started( false )
 {
diff --git a/src/part/part.h b/src/part/part.h
index ba027ac..30b10a2 100644
--- a/src/part/part.h
+++ b/src/part/part.h
@@ -22,7 +22,7 @@ namespace Filelight
    class BrowserExtension : public KParts::BrowserExtension
    {
    public:
-      BrowserExtension( Part*, const char * = 0 );
+      BrowserExtension( Part*, const char * = nullptr );
    };
 
 
diff --git a/src/part/radialMap/labels.cpp b/src/part/radialMap/labels.cpp
index 482110f..7a47f4f 100644
--- a/src/part/radialMap/labels.cpp
+++ b/src/part/radialMap/labels.cpp
@@ -157,7 +157,7 @@ RadialMap::Widget::paintExplodedLabels( TQPainter &paint ) const
          //determine current range of levels to draw for
          uint range = 0;
 
-         for( it.toFirst(); it != 0; ++it )
+         for( it.toFirst(); it != nullptr; ++it )
          {
             uint lvl = (*it)->lvl;
             if( lvl > range )
@@ -204,7 +204,7 @@ RadialMap::Widget::paintExplodedLabels( TQPainter &paint ) const
 
       TQFont font;
 
-      for( it.toFirst(); it != 0; ++it )
+      for( it.toFirst(); it != nullptr; ++it )
       {
          //** bear in mind that text is drawn with TQPoint param as BOTTOM left corner of text box
          TQString qs = (*it)->segment->file()->name();
@@ -300,14 +300,14 @@ RadialMap::Widget::paintExplodedLabels( TQPainter &paint ) const
       //**** in rare case that deleted label was last label in top level
       //     and last in labelList too, this will not work as expected (not critical)
 
-   } while( it != 0 );
+   } while( it != nullptr );
 
 
    //5. Render labels
 
    paint.setPen( TQPen( TQt::black, 1 ) );
 
-   for( it.toFirst(); it != 0; ++it )
+   for( it.toFirst(); it != nullptr; ++it )
    {
       if( varySizes ) {
          //**** how much overhead in making new TQFont each time?
diff --git a/src/part/radialMap/map.cpp b/src/part/radialMap/map.cpp
index e564969..7561525 100644
--- a/src/part/radialMap/map.cpp
+++ b/src/part/radialMap/map.cpp
@@ -22,7 +22,7 @@
 
 
 RadialMap::Map::Map()
-        : m_signature( 0 )
+        : m_signature( nullptr )
         , m_ringBreadth( MIN_RING_BREADTH )
         , m_innerRadius( 0 )
         , m_visibleDepth( DEFAULT_RING_DEPTH )
@@ -44,7 +44,7 @@ RadialMap::Map::invalidate( const bool desaturateTheImage )
    DEBUG_ANNOUNCE
 
    delete [] m_signature;
-   m_signature = 0;
+   m_signature = nullptr;
 
    if( desaturateTheImage )
    {
@@ -150,7 +150,7 @@ RadialMap::Map::resize( const TQRect &rect )
       if (KPixmap::isNull())
           return false;
 
-      if( m_signature != 0 )
+      if( m_signature != nullptr )
       {
          setRingBreadth();
          paint();
diff --git a/src/part/radialMap/segmentTip.cpp b/src/part/radialMap/segmentTip.cpp
index 72629fd..4caf8b0 100644
--- a/src/part/radialMap/segmentTip.cpp
+++ b/src/part/radialMap/segmentTip.cpp
@@ -34,7 +34,7 @@ bool isBackingStoreActive()
 
 
 SegmentTip::SegmentTip( uint h )
-        : TQWidget( 0, 0, WNoAutoErase | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WStyle_StaysOnTop | WX11BypassWM )
+        : TQWidget( nullptr, nullptr, WNoAutoErase | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WStyle_StaysOnTop | WX11BypassWM )
         , m_cursorHeight( -h )
         , m_backing_store( isBackingStoreActive() )
 {
diff --git a/src/part/radialMap/widget.cpp b/src/part/radialMap/widget.cpp
index f2e20f7..a74a332 100644
--- a/src/part/radialMap/widget.cpp
+++ b/src/part/radialMap/widget.cpp
@@ -19,9 +19,9 @@
 
 RadialMap::Widget::Widget( TQWidget *parent, const char *name )
    : TQWidget( parent, name, TQt::WNoAutoErase )
-   , m_tree( 0 )
-   , m_focus( 0 )
-   , m_rootSegment( 0 ) //TODO we don't delete it, *shrug*
+   , m_tree( nullptr )
+   , m_focus( nullptr )
+   , m_rootSegment( nullptr ) //TODO we don't delete it, *shrug*
 {
    setAcceptDrops( true );
    setBackgroundColor( TQt::white );
@@ -65,11 +65,11 @@ RadialMap::Widget::invalidate( const bool b )
       setMouseTracking( false );
 
       //ensure this class won't think we have a map still
-      m_tree  = 0;
-      m_focus = 0;
+      m_tree  = nullptr;
+      m_focus = nullptr;
 
       delete m_rootSegment;
-      m_rootSegment = 0;
+      m_rootSegment = nullptr;
 
       //FIXME move this disablement thing no?
       //      it is confusing in other areas, like the whole createFromCache() thing
@@ -127,7 +127,7 @@ RadialMap::Widget::resizeTimeout() //slot
 {
    // the segments are about to erased!
    // this was a horrid bug, and proves the OO programming should be obeyed always!
-   m_focus = 0;
+   m_focus = nullptr;
    if( m_tree )
       m_map.make( m_tree, true );
    update();
diff --git a/src/part/radialMap/widget.h b/src/part/radialMap/widget.h
index 7e996d4..47a3ba5 100644
--- a/src/part/radialMap/widget.h
+++ b/src/part/radialMap/widget.h
@@ -27,7 +27,7 @@ namespace RadialMap
         void make( const Directory *, bool = false );
         bool resize( const TQRect& );
 
-        bool isNull() const { return ( m_signature == 0 ); }
+        bool isNull() const { return ( m_signature == nullptr ); }
         void invalidate( const bool );
 
         friend class Builder;
@@ -56,13 +56,13 @@ namespace RadialMap
   
 
     public:
-        Widget( TQWidget* = 0, const char* = 0 );
+        Widget( TQWidget* = nullptr, const char* = nullptr );
         ~Widget() { delete m_tip; }
 
         TQString path() const;
-        KURL url( File const * const = 0 ) const;
+        KURL url( File const * const = nullptr ) const;
 
-        bool isValid() const { return m_tree != 0; }
+        bool isValid() const { return m_tree != nullptr; }
 
         friend class Label; //FIXME badness
 
diff --git a/src/part/radialMap/widgetEvents.cpp b/src/part/radialMap/widgetEvents.cpp
index 863f906..645a287 100644
--- a/src/part/radialMap/widgetEvents.cpp
+++ b/src/part/radialMap/widgetEvents.cpp
@@ -70,7 +70,7 @@ RadialMap::Widget::segmentAt( TQPoint &e ) const
     e -= m_offset;
 
     if( !m_map.m_signature )
-       return 0;
+       return nullptr;
 
     if( e.x() <= m_map.width() && e.y() <= m_map.height() )
     {
@@ -106,7 +106,7 @@ RadialMap::Widget::segmentAt( TQPoint &e ) const
         else return m_rootSegment; //hovering over inner circle
     }
 
-    return 0;
+    return nullptr;
 }
 
 void
diff --git a/src/part/remoteLister.cpp b/src/part/remoteLister.cpp
index dc2d04f..ef81203 100644
--- a/src/part/remoteLister.cpp
+++ b/src/part/remoteLister.cpp
@@ -30,7 +30,7 @@ namespace Filelight
       List stores;
 
       Store()
-         : directory( 0 ), parent( 0 ) {}
+         : directory( nullptr ), parent( nullptr ) {}
       Store( const KURL &u, const TQString &name, Store *s )
          : url( u ), directory( new Directory( name.local8Bit() + '/' ) ), parent( s ) {}
 
@@ -63,7 +63,7 @@ namespace Filelight
 
    RemoteLister::RemoteLister( const KURL &url, TQWidget *parent )
       : KDirLister( true /*don't fetch mimetypes*/ )
-      , m_root( new Store( url, url.url(), 0 ) )
+      , m_root( new Store( url, url.url(), nullptr ) )
       , m_store( m_root )
    {
       setAutoUpdate( false ); //don't use KDirWatchers
@@ -80,7 +80,7 @@ namespace Filelight
 
    RemoteLister::~RemoteLister()
    {
-      Directory *tree = isFinished() ? m_store->directory : 0;
+      Directory *tree = isFinished() ? m_store->directory : nullptr;
 
       TQCustomEvent *e = new TQCustomEvent( 1000 );
       e->setData( tree );
diff --git a/src/part/scan.cpp b/src/part/scan.cpp
index 3617761..f28a9be 100644
--- a/src/part/scan.cpp
+++ b/src/part/scan.cpp
@@ -17,7 +17,7 @@ namespace Filelight
 
    ScanManager::ScanManager( TQObject *parent )
       : TQObject( parent )
-      , m_thread( 0 )
+      , m_thread( nullptr )
       , m_cache( new Chain<Directory> )
    {
       Filelight::LocalLister::readMounts();
@@ -95,7 +95,7 @@ namespace Filelight
                   const Link<File> *end = d->end();
                   TQString s = split.first(); s += '/';
 
-                  for( d = 0; jt != end; ++jt )
+                  for( d = nullptr; jt != end; ++jt )
                   if( s == (*jt)->name() )
                   {
                      d = (Directory*)*jt;
@@ -182,7 +182,7 @@ namespace Filelight
           m_thread->terminate();
           m_thread->wait();
           delete m_thread; //note the lister deletes itself
-          m_thread = 0;
+          m_thread = nullptr;
       }
 
       emit completed( tree );
diff --git a/src/part/settingsDialog.h b/src/part/settingsDialog.h
index c748267..553fd80 100644
--- a/src/part/settingsDialog.h
+++ b/src/part/settingsDialog.h
@@ -14,7 +14,7 @@ class SettingsDialog : public Dialog
   
 
 public:
-  SettingsDialog( TQWidget* =0, const char* =0 );
+  SettingsDialog( TQWidget* =nullptr, const char* =nullptr );
 
 protected:
   virtual void closeEvent( TQCloseEvent * );
-- 
cgit v1.2.3

