From fdf9249b95b0d1b2c644952ecf1ebfd4d6d47bbf Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sat, 3 Oct 2026 21:18:52 -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>
---
 kdiff3plugin/kdiff3plugin.cpp          |  14 +--
 src/diff.cpp                           |  32 +++---
 src/diff.h                             |  20 ++--
 src/difftextwindow.cpp                 |  56 +++++-----
 src/directorymergewindow.cpp           | 194 ++++++++++++++++-----------------
 src/directorymergewindow.h             |   2 +-
 src/fileaccess.cpp                     |  28 ++---
 src/gnudiff_analyze.cpp                |   6 +-
 src/gnudiff_xmalloc.cpp                |   6 +-
 src/kdiff3.cpp                         |  90 +++++++--------
 src/kdiff3.h                           |   2 +-
 src/kdiff3_part.cpp                    |  20 ++--
 src/kdiff3_shell.cpp                   |   2 +-
 src/kreplacements/ShellContextMenu.cpp |   8 +-
 src/main.cpp                           |  46 ++++----
 src/merger.cpp                         |   8 +-
 src/mergeresultwindow.cpp              | 108 +++++++++---------
 src/mergeresultwindow.h                |  14 +--
 src/optiondialog.cpp                   |  40 +++----
 src/optiondialog.h                     |   2 +-
 src/pdiff.cpp                          | 130 +++++++++++-----------
 src/smalldialogs.cpp                   |   8 +-
 22 files changed, 418 insertions(+), 418 deletions(-)

diff --git a/kdiff3plugin/kdiff3plugin.cpp b/kdiff3plugin/kdiff3plugin.cpp
index c9d24cd..206d9df 100644
--- a/kdiff3plugin/kdiff3plugin.cpp
+++ b/kdiff3plugin/kdiff3plugin.cpp
@@ -31,17 +31,17 @@
 
 //#include <iostream>
 
-static TQStringList* s_pHistory=0;
+static TQStringList* s_pHistory=nullptr;
 
 class KDiff3PluginFactory : public KGenericFactory < KDiff3Plugin, KonqPopupMenu >
 {
    TDESimpleConfig* m_pConfig;
 public:
-   KDiff3PluginFactory( const char* instanceName  = 0 )
+   KDiff3PluginFactory( const char* instanceName  = nullptr )
    : KGenericFactory< KDiff3Plugin, KonqPopupMenu >( instanceName )
    {
-      m_pConfig = 0;
-      if (s_pHistory==0)
+      m_pConfig = nullptr;
+      if (!s_pHistory)
       {
          //std::cout << "New History: " << instanceName << std::endl;
          s_pHistory = new TQStringList;
@@ -57,8 +57,8 @@ public:
          m_pConfig->writeEntry("HistoryStack",*s_pHistory);
       delete s_pHistory;
       delete m_pConfig;
-      s_pHistory = 0;
-      m_pConfig = 0;
+      s_pHistory = nullptr;
+      m_pConfig = nullptr;
    }
 };
 
@@ -95,7 +95,7 @@ KDiff3Plugin::KDiff3Plugin( KonqPopupMenu* pPopupmenu, const char *name, const T
    */
 
    TDEActionMenu* pActionMenu = new TDEActionMenu (i18n ("KDiff3"), "kdiff3", actionCollection (), "kdiff3_menu" );
-   TDEAction* pAction = 0;
+   TDEAction* pAction = nullptr;
    TQString s;
 
    if(m_list.count() == 1)
diff --git a/src/diff.cpp b/src/diff.cpp
index fba2c1a..539054c 100644
--- a/src/diff.cpp
+++ b/src/diff.cpp
@@ -63,7 +63,7 @@ int LineData::width(int tabSize) const
 // This choice is good for C/C++.
 bool equal( const LineData& l1, const LineData& l2, bool bStrict )
 {
-   if ( l1.pLine==0 || l2.pLine==0) return false;
+   if ( !l1.pLine || !l2.pLine) return false;
 
    if ( bStrict && g_bIgnoreTrivialMatches )//&& (l1.occurances>=5 || l2.occurances>=5) )
       return false;
@@ -151,7 +151,7 @@ Optimizations: Skip unneeded steps.
 
 SourceData::SourceData()
 {
-   m_pOptionDialog = 0;
+   m_pOptionDialog = nullptr;
    reset();
 }
 
@@ -162,7 +162,7 @@ SourceData::~SourceData()
 
 void SourceData::reset()
 {
-   m_pEncoding = 0;
+   m_pEncoding = nullptr;
    m_fileAccess = FileAccess();
    m_normalData.reset();
    m_lmppData.reset();
@@ -193,7 +193,7 @@ bool SourceData::isEmpty()
 
 bool SourceData::hasData() 
 { 
-   return m_normalData.m_pBuf != 0;
+   return m_normalData.m_pBuf != nullptr;
 }
 
 bool SourceData::isValid()
@@ -255,15 +255,15 @@ void SourceData::setData( const TQString& data )
 
 const LineData* SourceData::getLineDataForDiff() const
 {
-   if ( m_lmppData.m_pBuf==0 )
-      return m_normalData.m_v.size()>0 ? &m_normalData.m_v[0] : 0;
+   if ( !m_lmppData.m_pBuf )
+      return m_normalData.m_v.size()>0 ? &m_normalData.m_v[0] : nullptr;
    else
-      return m_lmppData.m_v.size()>0   ? &m_lmppData.m_v[0]   : 0;
+      return m_lmppData.m_v.size()>0   ? &m_lmppData.m_v[0]   : nullptr;
 }
 
 const LineData* SourceData::getLineDataForDisplay() const
 {
-   return m_normalData.m_v.size()>0 ? &m_normalData.m_v[0] : 0;
+   return m_normalData.m_v.size()>0 ? &m_normalData.m_v[0] : nullptr;
 }
 
 int  SourceData::getSizeLines() const
@@ -302,7 +302,7 @@ bool SourceData::isBinaryEqualWith( const SourceData& other ) const
 void SourceData::FileData::reset()
 {
    delete[] (char*)m_pBuf;
-   m_pBuf = 0;
+   m_pBuf = nullptr;
    m_v.clear();
    m_size = 0;
    m_vSize = 0;
@@ -324,7 +324,7 @@ bool SourceData::FileData::readFile( const TQString& filename )
    if ( !bSuccess )
    {
       delete pBuf;
-      m_pBuf = 0;
+      m_pBuf = nullptr;
       m_size = 0;
    }
    return bSuccess;
@@ -393,7 +393,7 @@ static TQTextCodec* detectEncoding( const char* buf, long size, long& skipBytes
          return TQTextCodec::codecForName( "UTF-8-BOM" );
    }
    skipBytes = 0;
-   return 0;
+   return nullptr;
 }
 
 TQTextCodec* SourceData::detectEncoding( const TQString& fileName, TQTextCodec* pFallbackCodec )
@@ -1605,9 +1605,9 @@ void calcWhiteDiff3Lines(
 
    for( ; i3!=d3ll.end(); ++i3 )
    {
-      i3->bWhiteLineA = ( (*i3).lineA == -1  ||  pldA==0 ||  pldA[(*i3).lineA].whiteLine() || pldA[(*i3).lineA].bContainsPureComment );
-      i3->bWhiteLineB = ( (*i3).lineB == -1  ||  pldB==0 ||  pldB[(*i3).lineB].whiteLine() || pldB[(*i3).lineB].bContainsPureComment );
-      i3->bWhiteLineC = ( (*i3).lineC == -1  ||  pldC==0 ||  pldC[(*i3).lineC].whiteLine() || pldC[(*i3).lineC].bContainsPureComment );
+      i3->bWhiteLineA = ( (*i3).lineA == -1  ||  pldA==nullptr ||  pldA[(*i3).lineA].whiteLine() || pldA[(*i3).lineA].bContainsPureComment );
+      i3->bWhiteLineB = ( (*i3).lineB == -1  ||  pldB==nullptr ||  pldB[(*i3).lineB].whiteLine() || pldB[(*i3).lineB].bContainsPureComment );
+      i3->bWhiteLineC = ( (*i3).lineC == -1  ||  pldC==nullptr ||  pldC[(*i3).lineC].whiteLine() || pldC[(*i3).lineC].bContainsPureComment );
    }
 }
 
@@ -1629,7 +1629,7 @@ void debugLineCheck( Diff3LineList& d3ll, int size, int idx )
       {
          if( l!=i )
          {
-            KMessageBox::error(0, i18n(
+            KMessageBox::error(nullptr, i18n(
                "Data loss error:\n"
                "If it is reproducable please contact the author.\n"
                ), i18n("Severe Internal Error") );
@@ -1643,7 +1643,7 @@ void debugLineCheck( Diff3LineList& d3ll, int size, int idx )
 
    if( size!=i )
    {
-      KMessageBox::error(0, i18n(
+      KMessageBox::error(nullptr, i18n(
          "Data loss error:\n"
          "If it is reproducable please contact the author.\n"
          ), i18n("Severe Internal Error") );
diff --git a/src/diff.h b/src/diff.h
index da7ebe2..eb60e3c 100644
--- a/src/diff.h
+++ b/src/diff.h
@@ -52,7 +52,7 @@ struct LineData
    const TQChar* pFirstNonWhiteChar;
    int size;
 
-   LineData(){ pLine=0; pFirstNonWhiteChar=0; size=0; /*occurances=0;*/ bContainsPureComment=false; }
+   LineData(){ pLine=nullptr; pFirstNonWhiteChar=nullptr; size=0; /*occurances=0;*/ bContainsPureComment=false; }
    int width(int tabSize) const;  // Calcs width considering tabs.
    //int occurances;
    bool whiteLine() const { return pFirstNonWhiteChar-pLine == size; }
@@ -103,19 +103,19 @@ struct Diff3Line
    {
       lineA=-1; lineB=-1; lineC=-1;
       bAEqC=false; bAEqB=false; bBEqC=false;
-      pFineAB=0; pFineBC=0; pFineCA=0;
+      pFineAB=nullptr; pFineBC=nullptr; pFineCA=nullptr;
       linesNeededForDisplay=1;
       sumLinesNeededForDisplay=0;
       bWhiteLineA=false; bWhiteLineB=false; bWhiteLineC=false;
-      m_pDiffBufferInfo=0;
+      m_pDiffBufferInfo=nullptr;
    }
 
    ~Diff3Line()
    {
-      if (pFineAB!=0) delete pFineAB;
-      if (pFineBC!=0) delete pFineBC;
-      if (pFineCA!=0) delete pFineCA;
-      pFineAB=0; pFineBC=0; pFineCA=0;
+      if (pFineAB) delete pFineAB;
+      if (pFineBC) delete pFineBC;
+      if (pFineCA) delete pFineCA;
+      pFineAB=nullptr; pFineBC=nullptr; pFineCA=nullptr;
    }
 
    bool operator==( const Diff3Line& d3l ) const
@@ -126,11 +126,11 @@ struct Diff3Line
 
    const LineData* getLineData( int src ) const
    {
-      assert( m_pDiffBufferInfo!=0 );
+      assert( m_pDiffBufferInfo!=nullptr );
       if ( src == 1 && lineA >= 0 ) return &m_pDiffBufferInfo->m_pLineDataA[lineA];
       if ( src == 2 && lineB >= 0 ) return &m_pDiffBufferInfo->m_pLineDataB[lineB];
       if ( src == 3 && lineC >= 0 ) return &m_pDiffBufferInfo->m_pLineDataC[lineC];
-      return 0;
+      return nullptr;
    }
    TQString getString( int src ) const
    {
@@ -288,7 +288,7 @@ private:
 
    struct FileData
    {
-      FileData(){ m_pBuf=0; m_size=0; m_vSize=0; m_bIsText=false; }
+      FileData(){ m_pBuf=nullptr; m_size=0; m_vSize=0; m_bIsText=false; }
       ~FileData(){ reset(); }
       const char* m_pBuf;
       int m_size;
diff --git a/src/difftextwindow.cpp b/src/difftextwindow.cpp
index a7c18ae..7f07573 100644
--- a/src/difftextwindow.cpp
+++ b/src/difftextwindow.cpp
@@ -44,13 +44,13 @@ public:
    {
       m_pDiffTextWindow = p;
       m_bPaintingAllowed = false;
-      m_pLineData = 0;
+      m_pLineData = nullptr;
       m_size = 0;
       m_bWordWrap = false;
       m_delayedDrawTimer = 0;
-      m_pDiff3LineVector = 0;
-      m_pManualDiffHelpList = 0;
-      m_pOptionDialog = 0;
+      m_pDiff3LineVector = nullptr;
+      m_pManualDiffHelpList = nullptr;
+      m_pOptionDialog = nullptr;
       m_fastSelectorLine1 = 0;
       m_fastSelectorNofLines = 0;
       m_bTriple = 0;
@@ -60,7 +60,7 @@ public:
       m_oldFirstColumn = 0;
       m_firstColumn = 0;
       m_lineNumberWidth = 0;
-      m_pStatusBar = 0;
+      m_pStatusBar = nullptr;
       m_scrollDeltaX = 0;
       m_scrollDeltaY = 0;
       m_bMyUpdate = false;
@@ -138,7 +138,7 @@ DiffTextWindow::DiffTextWindow(
    OptionDialog* pOptionDialog,
    int winIdx
    )
-   : TQWidget(pParent, 0, TQt::WResizeNoErase | TQt::WRepaintNoErase)
+   : TQWidget(pParent, nullptr, TQt::WResizeNoErase | TQt::WRepaintNoErase)
 {
    d = new DiffTextWindowData(this);
    d->m_pDiffTextWindowFrame = pParent;
@@ -146,7 +146,7 @@ DiffTextWindow::DiffTextWindow(
    setAcceptDrops( true );
 
    d->m_pOptionDialog = pOptionDialog;
-   init( 0, 0, 0, 0, 0, false );
+   init( nullptr, nullptr, 0, nullptr, nullptr, false );
 
    setMinimumSize(TQSize(20,20));
 
@@ -201,9 +201,9 @@ void DiffTextWindow::init(
 
 void DiffTextWindow::reset()
 {
-   d->m_pLineData=0;
+   d->m_pLineData=nullptr;
    d->m_size=0;
-   d->m_pDiff3LineVector=0;
+   d->m_pDiff3LineVector=nullptr;
    d->m_filename="";
    d->m_diff3WrapLineVector.clear();
 }
@@ -321,7 +321,7 @@ int DiffTextWindow::convertLineToDiff3LineIdx( int line )
 
 int DiffTextWindow::convertDiff3LineIdxToLine( int d3lIdx )
 {
-   if ( d->m_bWordWrap && d->m_pDiff3LineVector!=0 && d->m_pDiff3LineVector->size()>0 )
+   if ( d->m_bWordWrap && d->m_pDiff3LineVector && d->m_pDiff3LineVector->size()>0 )
       return (*d->m_pDiff3LineVector)[ min2( d3lIdx, (int)d->m_pDiff3LineVector->size()-1 ) ]->sumLinesNeededForDisplay;
    else
       return d3lIdx;
@@ -374,7 +374,7 @@ void DiffTextWindow::showStatusLine(int line )
    if(d3lIdx >= 0 && d3lIdx<(int)d->m_pDiff3LineVector->size() )
    {
       const Diff3Line* pD3l = (*d->m_pDiff3LineVector)[d3lIdx];
-      if ( pD3l != 0 )
+      if ( pD3l )
       {
          int l = pD3l->getLineInFile( d->m_winIdx );
 
@@ -383,7 +383,7 @@ void DiffTextWindow::showStatusLine(int line )
             s.sprintf("File %s: Line %d", d->m_filename.ascii(), l+1 );
          else
             s.sprintf("File %s: Line not available", d->m_filename.ascii() );
-         if (d->m_pStatusBar!=0) d->m_pStatusBar->message(s);
+         if (d->m_pStatusBar) d->m_pStatusBar->message(s);
 
          emit lineClicked( d->m_winIdx, l );
       }
@@ -754,8 +754,8 @@ void DiffTextWindowData::writeLine(
       return;
 
    int changed = whatChanged;
-   if ( pLineDiff1 != 0 ) changed |= 1;
-   if ( pLineDiff2 != 0 ) changed |= 2;
+   if ( pLineDiff1 ) changed |= 1;
+   if ( pLineDiff2 ) changed |= 2;
 
    TQColor c = m_pOptionDialog->m_fgColor;
    if ( changed == 2 ) {
@@ -768,12 +768,12 @@ void DiffTextWindowData::writeLine(
 
    p.fillRect( leftInfoWidth()*fontWidth, yOffset, deviceWidth, fontHeight, bgColor );
 
-   if (pld!=0)
+   if (pld)
    {
       // First calculate the "changed" information for each character.
       int i=0;
       std::vector<UINT8> charChanged( pld->size );
-      if ( pLineDiff1!=0 || pLineDiff2 != 0 )
+      if ( pLineDiff1 || pLineDiff2 )
       {
          Merger merger( pLineDiff1, pLineDiff2 );
          while( ! merger.isEndReached() &&  i<pld->size )
@@ -883,7 +883,7 @@ void DiffTextWindowData::writeLine(
    xOffset = (m_lineNumberWidth+2)*fontWidth;
    int xLeft =   m_lineNumberWidth*fontWidth;
    p.setPen( m_pOptionDialog->m_fgColor );
-   if ( pld!=0 )
+   if ( pld )
    {
       if ( m_pOptionDialog->m_bShowLineNumbers && !bWrapLine )
       {
@@ -937,7 +937,7 @@ void DiffTextWindowData::writeLine(
 
 void DiffTextWindow::paintEvent( TQPaintEvent* e )
 {
-   if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed ||
+   if ( !d->m_pDiff3LineVector || ! d->m_bPaintingAllowed ||
         ( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) ) 
       return;
 
@@ -989,7 +989,7 @@ void DiffTextWindow::paintEvent( TQPaintEvent* e )
 
 void DiffTextWindow::print( MyPainter& p, const TQRect&, int firstLine, int nofLinesPerPage )
 {
-   if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed ||
+   if ( !d->m_pDiff3LineVector || ! d->m_bPaintingAllowed ||
         ( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) ) 
       return;
    resetSelection();
@@ -1034,7 +1034,7 @@ void DiffTextWindowData::draw( MyPainter& p, const TQRect& invalidRect, int devi
    {
       int wrapLineOffset=0;
       int wrapLineLength=0;
-      const Diff3Line* d3l =0;
+      const Diff3Line* d3l =nullptr;
       bool bWrapLine = false;
       if (m_bWordWrap)
       {
@@ -1058,7 +1058,7 @@ void DiffTextWindowData::draw( MyPainter& p, const TQRect& invalidRect, int devi
 
       writeLine(
          p,                         // TQPainter
-         srcLineIdx == -1 ? 0 : &m_pLineData[srcLineIdx],     // Text in this line
+         srcLineIdx == -1 ? nullptr : &m_pLineData[srcLineIdx],     // Text in this line
          pFineDiff1,
          pFineDiff2,
          line,                      // Line on the screen
@@ -1321,7 +1321,7 @@ void DiffTextWindow::setSelection( int firstLine, int startPos, int lastLine, in
          endPos = d->m_pLineData[line].width( d->m_pOptionDialog->m_tabSize);
    }
 
-   if ( d->m_bWordWrap && d->m_pDiff3LineVector!=0 )
+   if ( d->m_bWordWrap && d->m_pDiff3LineVector )
    {
       TQString s1 = d->getString(firstLine);
       int firstWrapLine = convertDiff3LineIdxToLine(firstLine);
@@ -1452,7 +1452,7 @@ int wordWrap( const TQString& origLine, int nofColumns, Diff3WrapLine* pDiff3Wra
 
 void DiffTextWindow::convertSelectionToD3LCoords()
 {
-   if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed || !isVisible() || d->m_selection.isEmpty() )
+   if ( !d->m_pDiff3LineVector || ! d->m_bPaintingAllowed || !isVisible() || d->m_selection.isEmpty() )
    {
       return;
    }
@@ -1475,7 +1475,7 @@ void DiffTextWindow::convertSelectionToD3LCoords()
 
 void DiffTextWindow::recalcWordWrap( bool bWordWrap, int wrapLineVectorSize, int nofVisibleColumns )
 {
-   if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed || !isVisible() )
+   if ( !d->m_pDiff3LineVector || ! d->m_bPaintingAllowed || !isVisible() )
    {
       d->m_bWordWrap = bWordWrap;
       if (!bWordWrap)  d->m_diff3WrapLineVector.resize( 0 );
@@ -1498,7 +1498,7 @@ void DiffTextWindow::recalcWordWrap( bool bWordWrap, int wrapLineVectorSize, int
       for( i=0; i<size; ++i )
       {
          TQString s = d->getString( i );
-         int linesNeeded = wordWrap( s, nofVisibleColumns, wrapLineVectorSize==0 ? 0 : &d->m_diff3WrapLineVector[wrapLineIdx] );
+         int linesNeeded = wordWrap( s, nofVisibleColumns, wrapLineVectorSize==0 ? nullptr : &d->m_diff3WrapLineVector[wrapLineIdx] );
          Diff3Line& d3l = *(*d->m_pDiff3LineVector)[i];
          if ( d3l.linesNeededForDisplay<linesNeeded )
          {
@@ -1582,7 +1582,7 @@ DiffTextWindowFrame::DiffTextWindowFrame( TQWidget* pParent, TQStatusBar* pStatu
 
    d->m_pLabel = new TQLabel("A:",d->m_pTopLineWidget);
    d->m_pTopLine = new TQLabel(d->m_pTopLineWidget);
-   d->m_pDiffTextWindow = 0;
+   d->m_pDiffTextWindow = nullptr;
    d->m_pDiffTextWindow = new DiffTextWindow( this, pStatusBar, pOptionDialog, winIdx );
    TQHBoxLayout* pHL = new TQHBoxLayout(d->m_pTopLineWidget);
    pHL->setMargin(2);
@@ -1730,7 +1730,7 @@ void DiffTextWindowFrame::slotBrowseButtonClicked()
 {
    TQString current = d->m_pFileSelection->text();
 
-   KURL newURL = KFileDialog::getOpenURL( current, 0, this);
+   KURL newURL = KFileDialog::getOpenURL( current, nullptr, this);
    if ( !newURL.isEmpty() )
    {
       DiffTextWindow* pDTW = d->m_pDiffTextWindow;
@@ -1741,7 +1741,7 @@ void DiffTextWindowFrame::slotBrowseButtonClicked()
 TQCString encodeString( const TQString& s )
 {
    TQTextCodec* c = TQTextCodec::codecForLocale();
-   if (c!=0)
+   if (c)
       return c->fromUnicode( s );
    else
       return TQCString( s.latin1() );
diff --git a/src/directorymergewindow.cpp b/src/directorymergewindow.cpp
index b533c59..dddb59f 100644
--- a/src/directorymergewindow.cpp
+++ b/src/directorymergewindow.cpp
@@ -276,18 +276,18 @@ DirectoryMergeWindow::DirectoryMergeWindow( TQWidget* pParent, OptionDialog* pOp
    connect( this, TQ_SIGNAL(selectionChanged(TQListViewItem*)), this, TQ_SLOT(onSelectionChanged(TQListViewItem*)));
    m_pOptions = pOptions;
    m_pIconLoader = pIconLoader;
-   m_pDirectoryMergeInfo = 0;
+   m_pDirectoryMergeInfo = nullptr;
    m_bAllowResizeEvents = true;
    m_bSimulatedMergeStarted=false;
    m_bRealMergeStarted=false;
    m_bError = false;
    m_bSyncMode = false;
-   m_pStatusInfo = new StatusInfo(0);
+   m_pStatusInfo = new StatusInfo(nullptr);
    m_pStatusInfo->hide();
    m_bScanning = false;
-   m_pSelection1Item = 0;
-   m_pSelection2Item = 0;
-   m_pSelection3Item = 0;
+   m_pSelection1Item = nullptr;
+   m_pSelection2Item = nullptr;
+   m_pSelection3Item = nullptr;
    m_bCaseSensitive = true;
 
    addColumn(i18n("Name"));
@@ -403,7 +403,7 @@ static void calcDirStatus( bool bThreeDirs, DirMergeItem* i, int& nofFiles,
             ++nofManualMerges;
       }
    }
-   for( TQListViewItem* p = i->firstChild();  p!=0; p = p->nextSibling() )
+   for( TQListViewItem* p = i->firstChild();  p; p = p->nextSibling() )
       calcDirStatus( bThreeDirs, static_cast<DirMergeItem*>(p), nofFiles, nofDirs, nofEqualFiles, nofManualMerges );
 }
 
@@ -441,7 +441,7 @@ bool DirectoryMergeWindow::init
       checkIfCanContinue( &bCanContinue );
       if ( !bCanContinue )
          return false;
-      startDiffMerge("","","","","","","",0);  // hide main window
+      startDiffMerge("","","","","","","",nullptr);  // hide main window
    }
 
    show();
@@ -471,9 +471,9 @@ bool DirectoryMergeWindow::init
    m_bRealMergeStarted=false;
    m_bError=false;
    m_bDirectoryMerge = bDirectoryMerge;
-   m_pSelection1Item = 0;
-   m_pSelection2Item = 0;
-   m_pSelection3Item = 0;
+   m_pSelection1Item = nullptr;
+   m_pSelection2Item = nullptr;
+   m_pSelection3Item = nullptr;
    m_bCaseSensitive = m_pOptions->m_bDmCaseSensitiveFilenameComparison;
 
    clear();
@@ -658,7 +658,7 @@ bool DirectoryMergeWindow::init
    {
       prepareListView(pp);
 
-      for( TQListViewItem* p = firstChild();  p!=0; p = p->nextSibling() )
+      for( TQListViewItem* p = firstChild();  p; p = p->nextSibling() )
       {
          DirMergeItem* pDMI = static_cast<DirMergeItem*>( p );
          calcSuggestedOperation( *pDMI->m_pMFI, eDefaultMergeOp );
@@ -666,7 +666,7 @@ bool DirectoryMergeWindow::init
    }
    else
    {
-      setSelected( 0, true );
+      setSelected( nullptr, true );
    }
 
    TQDir::setCurrent(origCurrentDirectory);
@@ -674,7 +674,7 @@ bool DirectoryMergeWindow::init
    // Try to improve the view a little bit.
    TQWidget* pParent = parentWidget();
    TQSplitter* pSplitter = static_cast<TQSplitter*>(pParent);
-   if (pSplitter!=0)
+   if (pSplitter)
    {
       TQValueList<int> sizes = pSplitter->sizes();
       int total = sizes[0] + sizes[1];
@@ -693,7 +693,7 @@ bool DirectoryMergeWindow::init
       int nofDirs=0;
       int nofEqualFiles=0;
       int nofManualMerges=0;
-      for( TQListViewItem* p = firstChild();  p!=0; p = p->nextSibling() )
+      for( TQListViewItem* p = firstChild();  p; p = p->nextSibling() )
          calcDirStatus( m_dirC.isValid(), static_cast<DirMergeItem*>(p),
                         nofFiles, nofDirs, nofEqualFiles, nofManualMerges );
 
@@ -751,7 +751,7 @@ void DirectoryMergeWindow::slotNoOpEverywhere(){ setAllMergeOperations(eNoOperat
 
 static void setListViewItemOpen( TQListViewItem* p, bool bOpen )
 {
-   for( TQListViewItem* pChild = p->firstChild();  pChild!=0; pChild = pChild->nextSibling() )
+   for( TQListViewItem* pChild = p->firstChild();  pChild; pChild = pChild->nextSibling() )
       setListViewItemOpen( pChild, bOpen );
 
    p->setOpen( bOpen );
@@ -759,19 +759,19 @@ static void setListViewItemOpen( TQListViewItem* p, bool bOpen )
 
 void DirectoryMergeWindow::slotFoldAllSubdirs()
 {
-   for( TQListViewItem* p = firstChild();  p!=0; p = p->nextSibling() )
+   for( TQListViewItem* p = firstChild();  p; p = p->nextSibling() )
       setListViewItemOpen( p, false );
 }
 
 void DirectoryMergeWindow::slotUnfoldAllSubdirs()
 {
-   for( TQListViewItem* p = firstChild();  p!=0; p = p->nextSibling() )
+   for( TQListViewItem* p = firstChild();  p; p = p->nextSibling() )
       setListViewItemOpen( p, true );
 }
 
 static void setMergeOperation( TQListViewItem* pLVI, e_MergeOperation eMergeOp )
 {
-   if ( pLVI==0 ) return;
+   if ( !pLVI ) return;
 
    DirMergeItem* pDMI = static_cast<DirMergeItem*>(pLVI);
    MergeFileInfos& mfi = *pDMI->m_pMFI;
@@ -808,12 +808,12 @@ void DirectoryMergeWindow::keyPressEvent( TQKeyEvent* e )
       bool bThreeDirs = m_dirC.isValid();
 
       TQListViewItem* lvi = currentItem();
-      DirMergeItem* pDMI = lvi==0 ? 0 : static_cast<DirMergeItem*>(lvi);
-      MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI;
+      DirMergeItem* pDMI = lvi==nullptr ? nullptr : static_cast<DirMergeItem*>(lvi);
+      MergeFileInfos* pMFI = pDMI==nullptr ? nullptr : pDMI->m_pMFI;
 
-      if ( pMFI==0 ) return;
+      if ( !pMFI ) return;
       bool bMergeMode = bThreeDirs || !m_bSyncMode;
-      bool bFTConflict = pMFI==0 ? false : conflictingFileTypes(*pMFI);
+      bool bFTConflict = pMFI==nullptr ? false : conflictingFileTypes(*pMFI);
 
       if ( bMergeMode )
       {
@@ -863,7 +863,7 @@ void DirectoryMergeWindow::setAllMergeOperations( e_MergeOperation eDefaultOpera
         i18n("This affects all merge operations."),
         i18n("Changing All Merge Operations"),i18n("C&ontinue"), i18n("&Cancel") ) )
    {
-      for( TQListViewItem* p = firstChild(); p!=0; p = p->nextSibling() )
+      for( TQListViewItem* p = firstChild(); p; p = p->nextSibling() )
       {
          DirMergeItem* pDMI = static_cast<DirMergeItem*>( p );
          calcSuggestedOperation( *pDMI->m_pMFI, eDefaultOperation );
@@ -1056,7 +1056,7 @@ static TQPixmap colorToPixmap(TQColor c)
 
 static void initPixmaps( TQColor newest, TQColor oldest, TQColor middle, TQColor notThere )
 {
-   if (pmNew==0)
+   if (!pmNew)
    {
       pmNotThere = new TQPixmap;
       pmNew = new TQPixmap;
@@ -1165,18 +1165,18 @@ static void setPixmaps( MergeFileInfos& mfi, bool bCheckC )
 // Iterate through the complete tree. Start by specifying TQListView::firstChild().
 static TQListViewItem* treeIterator( TQListViewItem* p, bool bVisitChildren=true, bool bFindInvisible=false )
 {
-   if( p!=0 )
+   if( p )
    {
       do
       {
-         if ( bVisitChildren && p->firstChild() != 0 )      p = p->firstChild();
-         else if ( p->nextSibling() !=0 ) p = p->nextSibling();
+         if ( bVisitChildren && p->firstChild() )      p = p->firstChild();
+         else if ( p->nextSibling() ) p = p->nextSibling();
          else
          {
             p = p->parent();
-            while ( p!=0 )
+            while ( p )
             {
-               if( p->nextSibling()!=0 ) { p = p->nextSibling(); break; }
+               if( p->nextSibling() ) { p = p->nextSibling(); break; }
                else                      { p = p->parent();             }
             }
          }
@@ -1266,14 +1266,14 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp )
       else
       {
          MergeFileInfos& dirMfi = m_fileMergeMap[sortString(dirPart, m_bCaseSensitive)]; // parent
-         assert(dirMfi.m_pDMI!=0);
+         assert(dirMfi.m_pDMI!=nullptr);
          new DirMergeItem( dirMfi.m_pDMI, filePart, &mfi );
          mfi.m_pParent = &dirMfi;
 
          if ( !bEqual )  // Set all parents to "not equal"
          {
             MergeFileInfos* p = mfi.m_pParent;
-            while(p!=0)
+            while(p)
             {
                bool bChange = false;
                if ( !mfi.m_bEqualAB && p->m_bEqualAB ){ p->m_bEqualAB = false; bChange=true; }
@@ -1498,7 +1498,7 @@ void DirectoryMergeWindow::calcSuggestedOperation( MergeFileInfos& mfi, e_MergeO
 
 void DirectoryMergeWindow::onDoubleClick( TQListViewItem* lvi )
 {
-   if (lvi==0) return;
+   if (!lvi) return;
 
    if ( m_bDirectoryMerge )
       mergeCurrentFile();
@@ -1508,7 +1508,7 @@ void DirectoryMergeWindow::onDoubleClick( TQListViewItem* lvi )
 
 void DirectoryMergeWindow::onSelectionChanged( TQListViewItem* lvi )
 {
-   if ( lvi==0 ) return;
+   if ( !lvi ) return;
 
    DirMergeItem* pDMI = static_cast<DirMergeItem*>(lvi);
 
@@ -1520,7 +1520,7 @@ void DirectoryMergeWindow::onSelectionChanged( TQListViewItem* lvi )
 
 void DirectoryMergeWindow::onClick( int button, TQListViewItem* lvi, const TQPoint& p, int c )
 {
-   if ( lvi==0 ) return;
+   if ( !lvi ) return;
 
    DirMergeItem* pDMI = static_cast<DirMergeItem*>(lvi);
 
@@ -1587,7 +1587,7 @@ void DirectoryMergeWindow::onClick( int button, TQListViewItem* lvi, const TQPoi
 
 void DirectoryMergeWindow::slotShowContextMenu(TQListViewItem* lvi,const TQPoint & p,int c)
 {
-   if ( lvi==0 ) return;
+   if ( !lvi ) return;
 
    DirMergeItem* pDMI = static_cast<DirMergeItem*>(lvi);
 
@@ -1619,7 +1619,7 @@ void DirectoryMergeWindow::slotShowContextMenu(TQListViewItem* lvi,const TQPoint
 
 static TQString getFileName( DirMergeItem* pDMI, int column )
 {
-   if ( pDMI != 0 )
+   if ( pDMI )
    {
       MergeFileInfos& mfi = *pDMI->m_pMFI;
       return column == s_ACol ? mfi.m_fileInfoA.absFilePath() :
@@ -1632,7 +1632,7 @@ static TQString getFileName( DirMergeItem* pDMI, int column )
 
 static bool isDir( DirMergeItem* pDMI, int column )
 {
-   if ( pDMI != 0 )
+   if ( pDMI )
    {
       MergeFileInfos& mfi = *pDMI->m_pMFI;
       return column == s_ACol ? mfi.m_bDirA :
@@ -1663,29 +1663,29 @@ void DirectoryMergeWindow::selectItemAndColumn(DirMergeItem* pDMI, int c, bool b
          bReset = true;
    }
 
-   if ( bReset || m_pSelection3Item!=0 ||
+   if ( bReset || m_pSelection3Item ||
         pDMI==m_pSelection1Item && c==m_selection1Column ||
         pDMI==m_pSelection2Item && c==m_selection2Column ||
         pDMI==m_pSelection3Item && c==m_selection3Column)
    {
-      m_pSelection1Item = 0;
-      m_pSelection2Item = 0;
-      m_pSelection3Item = 0;
+      m_pSelection1Item = nullptr;
+      m_pSelection2Item = nullptr;
+      m_pSelection3Item = nullptr;
    }
-   else if ( m_pSelection1Item==0 )
+   else if ( !m_pSelection1Item )
    {
       m_pSelection1Item = pDMI;
       m_selection1Column = c;
-      m_pSelection2Item = 0;
-      m_pSelection3Item = 0;
+      m_pSelection2Item = nullptr;
+      m_pSelection3Item = nullptr;
    }
-   else if ( m_pSelection2Item==0 )
+   else if ( !m_pSelection2Item )
    {
       m_pSelection2Item = pDMI;
       m_selection2Column = c;
-      m_pSelection3Item = 0;
+      m_pSelection3Item = nullptr;
    }
-   else if ( m_pSelection3Item==0 )
+   else if ( !m_pSelection3Item )
    {
       m_pSelection3Item = pDMI;
       m_selection3Column = c;
@@ -1737,7 +1737,7 @@ int DirMergeItem::compare(TQListViewItem *i, int col, bool ascending) const
    DirMergeItem* pDMI = static_cast<DirMergeItem*>(i);
    bool bDir1 =  m_pMFI->m_bDirA || m_pMFI->m_bDirB || m_pMFI->m_bDirC;
    bool bDir2 =  pDMI->m_pMFI->m_bDirA || pDMI->m_pMFI->m_bDirB || pDMI->m_pMFI->m_bDirC;
-   if ( m_pMFI==0 || pDMI->m_pMFI==0 || bDir1 == bDir2 )
+   if ( !m_pMFI || !pDMI->m_pMFI || bDir1 == bDir2 )
    {
       if(col==s_UnsolvedCol || col==s_SolvedCol || col==s_NonWhiteCol || col==s_WhiteCol)
          return key(col,ascending).toInt() > i->key(col,ascending).toInt() ? -1 : 1;
@@ -1793,7 +1793,7 @@ void DirMergeItem::paintCell(TQPainter * p, const TQColorGroup & cg, int column,
 
 DirMergeItem::~DirMergeItem()
 {
-   m_pMFI->m_pDMI = 0;
+   m_pMFI->m_pDMI = nullptr;
 }
 
 void MergeFileInfos::setMergeOperation( e_MergeOperation eMOp, bool bRecursive )
@@ -1807,7 +1807,7 @@ void MergeFileInfos::setMergeOperation( e_MergeOperation eMOp, bool bRecursive )
    m_eMergeOperation = eMOp;
    TQString s;
    bool bDir = m_bDirA || m_bDirB || m_bDirC;
-   if( m_pDMI!=0 )
+   if( m_pDMI )
    {
       switch( m_eMergeOperation )
       {
@@ -1837,7 +1837,7 @@ void MergeFileInfos::setMergeOperation( e_MergeOperation eMOp, bool bRecursive )
          e_MergeOperation eChildrenMergeOp = m_eMergeOperation;
          if ( eChildrenMergeOp == eConflictingFileTypes ) eChildrenMergeOp = eMergeABCToDest;
          TQListViewItem* p = m_pDMI->firstChild();
-         while ( p!=0 )
+         while ( p )
          {
             DirMergeItem* pDMI = static_cast<DirMergeItem*>( p );
             DirectoryMergeWindow* pDMW = static_cast<DirectoryMergeWindow*>( p->listView() );
@@ -1859,7 +1859,7 @@ void DirectoryMergeWindow::compareCurrentFile()
    }
 
    DirMergeItem* pDMI = static_cast<DirMergeItem*>( selectedItem() );
-   if ( pDMI != 0 )
+   if ( pDMI )
    {
       MergeFileInfos& mfi = *pDMI->m_pMFI;
       if ( !(mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC) )
@@ -1869,7 +1869,7 @@ void DirectoryMergeWindow::compareCurrentFile()
             mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : TQString(""),
             mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : TQString(""),
             "",
-            "","","",0
+            "","","",nullptr
             );
       }
    }
@@ -1892,11 +1892,11 @@ void DirectoryMergeWindow::slotCompareExplicitlySelectedFiles()
       getFileName( m_pSelection2Item, m_selection2Column ),
       getFileName( m_pSelection3Item, m_selection3Column ),
       "",
-      "","","",0
+      "","","",nullptr
       );
-   m_pSelection1Item=0;
-   m_pSelection2Item=0;
-   m_pSelection3Item=0;
+   m_pSelection1Item=nullptr;
+   m_pSelection2Item=nullptr;
+   m_pSelection3Item=nullptr;
 
    emit updateAvailabilities();
    triggerUpdate();
@@ -1918,11 +1918,11 @@ void DirectoryMergeWindow::slotMergeExplicitlySelectedFiles()
 
    emit startDiffMerge( fn1, fn2, fn3, 
       fn3.isEmpty() ? fn2 : fn3,
-      "","","",0
+      "","","",nullptr
       );
-   m_pSelection1Item=0;
-   m_pSelection2Item=0;
-   m_pSelection3Item=0;
+   m_pSelection1Item=nullptr;
+   m_pSelection2Item=nullptr;
+   m_pSelection3Item=nullptr;
 
    emit updateAvailabilities();
    triggerUpdate();
@@ -1931,7 +1931,7 @@ void DirectoryMergeWindow::slotMergeExplicitlySelectedFiles()
 bool DirectoryMergeWindow::isFileSelected()
 {
    DirMergeItem* pDMI = static_cast<DirMergeItem*>( selectedItem() );
-   if ( pDMI != 0 )
+   if ( pDMI )
    {
       MergeFileInfos& mfi = *pDMI->m_pMFI;
       return ! (mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC || conflictingFileTypes(mfi) );
@@ -1942,15 +1942,15 @@ bool DirectoryMergeWindow::isFileSelected()
 void DirectoryMergeWindow::mergeResultSaved(const TQString& fileName)
 {
    DirMergeItem* pCurrentItemForOperation = (m_mergeItemList.empty() || m_currentItemForOperation==m_mergeItemList.end() )
-                                               ? 0
+                                               ? nullptr
                                                : *m_currentItemForOperation;
 
-   if ( pCurrentItemForOperation!=0 && pCurrentItemForOperation->m_pMFI==0 )
+   if ( pCurrentItemForOperation && !pCurrentItemForOperation->m_pMFI )
    {
       KMessageBox::error( this, i18n("This should never happen: \n\nmergeResultSaved: m_pMFI=0\n\nIf you know how to reproduce this, please contact the program author."),i18n("Program Error") );
       return;
    }
-   if ( pCurrentItemForOperation!=0 && fileName == fullNameDest(*pCurrentItemForOperation->m_pMFI) )
+   if ( pCurrentItemForOperation && fileName == fullNameDest(*pCurrentItemForOperation->m_pMFI) )
    {
       if ( pCurrentItemForOperation->m_pMFI->m_eMergeOperation==eMergeToAB )
       {
@@ -1988,9 +1988,9 @@ bool DirectoryMergeWindow::canContinue()
    if ( bCanContinue && !m_bError )
    {
       DirMergeItem* pCurrentItemForOperation =
-         (m_mergeItemList.empty() || m_currentItemForOperation==m_mergeItemList.end() ) ? 0 : *m_currentItemForOperation;
+         (m_mergeItemList.empty() || m_currentItemForOperation==m_mergeItemList.end() ) ? nullptr : *m_currentItemForOperation;
 
-      if ( pCurrentItemForOperation!=0  && ! pCurrentItemForOperation->m_pMFI->m_bOperationComplete )
+      if ( pCurrentItemForOperation  && ! pCurrentItemForOperation->m_pMFI->m_bOperationComplete )
       {
          pCurrentItemForOperation->setText( s_OpStatusCol, i18n("Not saved.") );
          pCurrentItemForOperation->m_pMFI->m_bOperationComplete = true;
@@ -2090,7 +2090,7 @@ void DirectoryMergeWindow::prepareMergeStart( TQListViewItem* pBegin, TQListView
    }
 
    m_mergeItemList.clear();
-   if (pBegin == 0)
+   if (!pBegin)
       return;
 
    for( TQListViewItem* p = pBegin; p!= pEnd; p = treeIterator( p ) )
@@ -2101,7 +2101,7 @@ void DirectoryMergeWindow::prepareMergeStart( TQListViewItem* pBegin, TQListView
       {
          m_mergeItemList.push_back(pDMI);
 
-         if (pDMI!=0 && pDMI->m_pMFI->m_eMergeOperation == eConflictingFileTypes )
+         if (pDMI && pDMI->m_pMFI->m_eMergeOperation == eConflictingFileTypes )
          {
             ensureItemVisible( pDMI );
             setSelected( pDMI, true );
@@ -2110,7 +2110,7 @@ void DirectoryMergeWindow::prepareMergeStart( TQListViewItem* pBegin, TQListView
             m_bRealMergeStarted=false;
             return;
          }
-         if (pDMI!=0 && pDMI->m_pMFI->m_eMergeOperation == eConflictingAges )
+         if (pDMI && pDMI->m_pMFI->m_eMergeOperation == eConflictingAges )
          {
             ensureItemVisible( pDMI );
             setSelected( pDMI, true );
@@ -2152,7 +2152,7 @@ void DirectoryMergeWindow::slotRunOperationForAllItems()
    {
       TQListViewItem* pBegin = firstChild();
 
-      prepareMergeStart( pBegin, 0, bVerbose );
+      prepareMergeStart( pBegin, nullptr, bVerbose );
       mergeContinue(true, bVerbose);
    }
    else
@@ -2172,7 +2172,7 @@ void DirectoryMergeWindow::mergeCurrentFile()
    if ( isFileSelected() )
    {
       DirMergeItem* pDMI = static_cast<DirMergeItem*>( selectedItem() );
-      if ( pDMI != 0 )
+      if ( pDMI )
       {
          MergeFileInfos& mfi = *pDMI->m_pMFI;
          m_mergeItemList.clear();
@@ -2218,11 +2218,11 @@ void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose)
    m_pStatusInfo->hide();
    m_pStatusInfo->clear();
 
-   DirMergeItem* pCurrentItemForOperation = m_currentItemForOperation==m_mergeItemList.end() ? 0 : *m_currentItemForOperation;
+   DirMergeItem* pCurrentItemForOperation = m_currentItemForOperation==m_mergeItemList.end() ? nullptr : *m_currentItemForOperation;
 
    bool bContinueWithCurrentItem = bStart;  // true for first item, else false
    bool bSkipItem = false;
-   if ( !bStart && m_bError && pCurrentItemForOperation!=0 )
+   if ( !bStart && m_bError && pCurrentItemForOperation )
    {
       int status = KMessageBox::warningYesNoCancel(this,
          i18n("There was an error in the last step.\n"
@@ -2239,25 +2239,25 @@ void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose)
    bool bSim = m_bSimulatedMergeStarted;
    while( bSuccess )
    {
-      if ( pCurrentItemForOperation==0 )
+      if ( !pCurrentItemForOperation )
       {
          m_mergeItemList.clear();
          m_bRealMergeStarted=false;
          break;
       }
 
-      if ( pCurrentItemForOperation!=0 && !bContinueWithCurrentItem )
+      if ( pCurrentItemForOperation && !bContinueWithCurrentItem )
       {
          if ( bSim )
          {
-            if( pCurrentItemForOperation->firstChild()==0 )
+            if( !pCurrentItemForOperation->firstChild() )
             {
                pCurrentItemForOperation->m_pMFI->m_bSimOpComplete = true;
             }
          }
          else
          {
-            if( pCurrentItemForOperation->firstChild()==0 )
+            if( !pCurrentItemForOperation->firstChild() )
             {
                if( !pCurrentItemForOperation->m_pMFI->m_bOperationComplete )
                {
@@ -2278,15 +2278,15 @@ void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose)
          // Depth first
          TQListViewItem* pPrevItem = pCurrentItemForOperation;
          ++m_currentItemForOperation;
-         pCurrentItemForOperation = m_currentItemForOperation==m_mergeItemList.end() ? 0 : *m_currentItemForOperation;
-         if ( (pCurrentItemForOperation==0 || pCurrentItemForOperation->parent()!=pPrevItem->parent()) && pPrevItem->parent()!=0 )
+         pCurrentItemForOperation = m_currentItemForOperation==m_mergeItemList.end() ? nullptr : *m_currentItemForOperation;
+         if ( (!pCurrentItemForOperation || pCurrentItemForOperation->parent()!=pPrevItem->parent()) && pPrevItem->parent() )
          {
             // Check if the parent may be set to "Done"
             TQListViewItem* pParent = pPrevItem->parent();
             bool bDone = true;
-            while ( bDone && pParent!=0 )
+            while ( bDone && pParent )
             {
-               for( TQListViewItem* p = pParent->firstChild(); p!=0; p=p->nextSibling() )
+               for( TQListViewItem* p = pParent->firstChild(); p; p=p->nextSibling() )
                {
                   DirMergeItem* pDMI = static_cast<DirMergeItem*>(p);
                   if ( !bSim && ! pDMI->m_pMFI->m_bOperationComplete   ||  bSim && pDMI->m_pMFI->m_bSimOpComplete )
@@ -2310,7 +2310,7 @@ void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose)
          }
       }
 
-      if ( pCurrentItemForOperation == 0 ) // end?
+      if ( !pCurrentItemForOperation ) // end?
       {
          if ( m_bRealMergeStarted )
          {
@@ -2324,7 +2324,7 @@ void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose)
          if ( m_bSimulatedMergeStarted )
          {
             m_bSimulatedMergeStarted = false;
-            for( TQListViewItem* p=firstChild(); p!=0; p=treeIterator(p) )
+            for( TQListViewItem* p=firstChild(); p; p=treeIterator(p) )
             {
                static_cast<DirMergeItem*>(p)->m_pMFI->m_bSimOpComplete = false;
             }
@@ -2497,7 +2497,7 @@ bool DirectoryMergeWindow::mergeFLD( const TQString& nameA,const TQString& nameB
    (*m_currentItemForOperation)->setText( s_OpStatusCol, i18n("In progress...") );
    ensureItemVisible( *m_currentItemForOperation );
 
-   emit startDiffMerge( nameA, nameB, nameC, nameDest, "","","",0 );
+   emit startDiffMerge( nameA, nameB, nameC, nameDest, "","","",nullptr );
 
    return false;
 }
@@ -2830,7 +2830,7 @@ void DirectoryMergeWindow::slotSaveMergeState()
    //slotStatusMsg(i18n("Saving Directory Merge State ..."));
 
    //TQString s = KFileDialog::getSaveURL( TQDir::currentDirPath(), 0, this, i18n("Save As...") ).url();
-   TQString s = KFileDialog::getSaveFileName( TQDir::currentDirPath(), 0, this, i18n("Save Directory Merge State As...") );
+   TQString s = KFileDialog::getSaveFileName( TQDir::currentDirPath(), nullptr, this, i18n("Save Directory Merge State As...") );
    if(!s.isEmpty())
    {
       m_dirMergeStateFilename = s;
@@ -2868,9 +2868,9 @@ void DirectoryMergeWindow::updateFileVisibilities()
    bool bShowOnlyInB   = m_pDirShowFilesOnlyInB->isChecked();
    bool bShowOnlyInC   = m_pDirShowFilesOnlyInC->isChecked();
    bool bThreeDirs = m_dirC.isValid();
-   m_pSelection1Item = 0;
-   m_pSelection2Item = 0;
-   m_pSelection3Item = 0;
+   m_pSelection1Item = nullptr;
+   m_pSelection2Item = nullptr;
+   m_pSelection3Item = nullptr;
 
    TQListViewItem* p = firstChild();
    while(p)
@@ -2924,8 +2924,8 @@ void DirectoryMergeWindow::initDirectoryMergeActions( TQObject* pKDiff3App, TDEA
    m_pDirFoldAll = new TDEAction(i18n("Fold All Subdirs"), 0, p, TQ_SLOT(slotFoldAllSubdirs()), ac, "dir_fold_all");
    m_pDirUnfoldAll = new TDEAction(i18n("Unfold All Subdirs"), 0, p, TQ_SLOT(slotUnfoldAllSubdirs()), ac, "dir_unfold_all");
    m_pDirRescan = new TDEAction(i18n("Rescan"), TQt::SHIFT+TQt::Key_F5, p, TQ_SLOT(reload()), ac, "dir_rescan");
-   m_pDirSaveMergeState = 0; //new TDEAction(i18n("Save Directory Merge State ..."), 0, p, TQ_SLOT(slotSaveMergeState()), ac, "dir_save_merge_state");
-   m_pDirLoadMergeState = 0; //new TDEAction(i18n("Load Directory Merge State ..."), 0, p, TQ_SLOT(slotLoadMergeState()), ac, "dir_load_merge_state");
+   m_pDirSaveMergeState = nullptr; //new TDEAction(i18n("Save Directory Merge State ..."), 0, p, TQ_SLOT(slotSaveMergeState()), ac, "dir_save_merge_state");
+   m_pDirLoadMergeState = nullptr; //new TDEAction(i18n("Load Directory Merge State ..."), 0, p, TQ_SLOT(slotLoadMergeState()), ac, "dir_load_merge_state");
    m_pDirChooseAEverywhere = new TDEAction(i18n("Choose A for All Items"), 0, p, TQ_SLOT(slotChooseAEverywhere()), ac, "dir_choose_a_everywhere");
    m_pDirChooseBEverywhere = new TDEAction(i18n("Choose B for All Items"), 0, p, TQ_SLOT(slotChooseBEverywhere()), ac, "dir_choose_b_everywhere");
    m_pDirChooseCEverywhere = new TDEAction(i18n("Choose C for All Items"), 0, p, TQ_SLOT(slotChooseCEverywhere()), ac, "dir_choose_c_everywhere");
@@ -2991,12 +2991,12 @@ void DirectoryMergeWindow::updateAvailabilities( bool bDirCompare, bool bDiffWin
    bool bThreeDirs = m_dirC.isValid();
 
    TQListViewItem* lvi = currentItem();
-   DirMergeItem* pDMI = lvi==0 ? 0 : static_cast<DirMergeItem*>(lvi);
-   MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI;
+   DirMergeItem* pDMI = lvi==nullptr ? nullptr : static_cast<DirMergeItem*>(lvi);
+   MergeFileInfos* pMFI = pDMI==nullptr ? nullptr : pDMI->m_pMFI;
 
-   bool bItemActive = bDirCompare &&  isVisible() && pMFI!=0;//  &&  hasFocus();
+   bool bItemActive = bDirCompare &&  isVisible() && pMFI!=nullptr;//  &&  hasFocus();
    bool bMergeMode = bThreeDirs || !m_bSyncMode;
-   bool bFTConflict = pMFI==0 ? false : conflictingFileTypes(*pMFI);
+   bool bFTConflict = pMFI==nullptr ? false : conflictingFileTypes(*pMFI);
 
    bool bDirWindowHasFocus = isVisible() && hasFocus();
 
@@ -3006,8 +3006,8 @@ void DirectoryMergeWindow::updateAvailabilities( bool bDirCompare, bool bDiffWin
    m_pDirShowFilesOnlyInB->setEnabled( bDirCompare &&  isVisible() );
    m_pDirShowFilesOnlyInC->setEnabled( bDirCompare &&  isVisible() && bThreeDirs );
 
-   m_pDirCompareExplicit->setEnabled( bDirCompare &&  isVisible() && m_pSelection2Item!=0 );
-   m_pDirMergeExplicit->setEnabled( bDirCompare &&  isVisible() && m_pSelection2Item!=0 );
+   m_pDirCompareExplicit->setEnabled( bDirCompare &&  isVisible() && m_pSelection2Item!=nullptr );
+   m_pDirMergeExplicit->setEnabled( bDirCompare &&  isVisible() && m_pSelection2Item!=nullptr );
 
    m_pDirCurrentDoNothing->setEnabled( bItemActive && bMergeMode );
    m_pDirCurrentChooseA->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInA );
diff --git a/src/directorymergewindow.h b/src/directorymergewindow.h
index a342099..8b4ac64 100644
--- a/src/directorymergewindow.h
+++ b/src/directorymergewindow.h
@@ -61,7 +61,7 @@ class MergeFileInfos
 {
 public:
    MergeFileInfos(){ m_bEqualAB=false; m_bEqualAC=false; m_bEqualBC=false;
-                     m_pDMI=0; m_pParent=0;
+                     m_pDMI=nullptr; m_pParent=nullptr;
                      m_bExistsInA=false;m_bExistsInB=false;m_bExistsInC=false;
                      m_bDirA=false;  m_bDirB=false;  m_bDirC=false;
                      m_bLinkA=false; m_bLinkB=false; m_bLinkC=false;
diff --git a/src/fileaccess.cpp b/src/fileaccess.cpp
index 4486fe4..b998e63 100644
--- a/src/fileaccess.cpp
+++ b/src/fileaccess.cpp
@@ -43,7 +43,7 @@
 #endif
 
 
-ProgressDialog* g_pProgressDialog=0;
+ProgressDialog* g_pProgressDialog=nullptr;
 
 
 FileAccess::FileAccess( const TQString& name, bool bWantToWrite ) :
@@ -546,13 +546,13 @@ bool FileAccess::removeTempFile( const TQString& name ) // static
 
 bool FileAccess::makeDir( const TQString& dirName )
 {
-   FileAccessJobHandler fh(0);
+   FileAccessJobHandler fh(nullptr);
    return fh.mkDir( dirName );
 }
 
 bool FileAccess::removeDir( const TQString& dirName )
 {
-   FileAccessJobHandler fh(0);
+   FileAccessJobHandler fh(nullptr);
    return fh.rmDir( dirName );
 }
 
@@ -1053,7 +1053,7 @@ void CvsIgnoreList::init( FileAccess& dir, bool bUseLocalCvsIgnore )
       if ( size>0 )
       {
          char* buf=new char[size];
-         if (buf!=0)
+         if (buf)
          {
             file.readFile( buf, size );
             int pos1 = 0;
@@ -1263,7 +1263,7 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
          dir.setMatchAllDirs( true );
 
          const TQFileInfoList *fiList = dir.entryInfoList();
-         if ( fiList == 0 )
+         if ( !fiList )
          {
             // No Permission to read directory or other error.
             m_bSuccess = false;
@@ -1271,7 +1271,7 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
          else
          {
             TQFileInfoListIterator it( *fiList );      // create list iterator
-            for ( ; it.current() != 0; ++it )       // for each file...
+            for ( ; it.current(); ++it )       // for each file...
             {
                TQFileInfo* fi = it.current();
                if ( fi->fileName() == "." ||  fi->fileName()==".." )
@@ -1357,11 +1357,11 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
    {
       bool bShowProgress = false;
 
-      TDEIO::ListJob* pListJob=0;
+      TDEIO::ListJob* pListJob=nullptr;
       pListJob = TDEIO::listDir( m_pFileAccess->m_url, bShowProgress, true /*bFindHidden*/ );
 
       m_bSuccess = false;
-      if ( pListJob!=0 )
+      if ( pListJob )
       {
          connect( pListJob, TQ_SIGNAL( entries( TDEIO::Job *, const TDEIO::UDSEntryList& ) ),
                   this,     TQ_SLOT( slotListDirProcessNewEntries( TDEIO::Job *, const TDEIO::UDSEntryList& )) );
@@ -1482,7 +1482,7 @@ void FileAccessJobHandler::slotPercent( TDEIO::Job*, unsigned long percent )
 
 
 ProgressDialog::ProgressDialog( TQWidget* pParent )
-: TQDialog( pParent, 0, true )
+: TQDialog( pParent, nullptr, true )
 {
    m_bStayHidden = false;
    TQVBoxLayout* layout = new TQVBoxLayout(this);
@@ -1513,7 +1513,7 @@ ProgressDialog::ProgressDialog( TQWidget* pParent )
    m_t1.start();
    m_t2.start();
    m_bWasCancelled = false;
-   m_pJob = 0;
+   m_pJob = nullptr;
 }
 
 void ProgressDialog::setStayHidden( bool bStayHidden )
@@ -1661,7 +1661,7 @@ void ProgressDialog::exitEventLoop()
 {
    killTimer( m_progressDelayTimer );
    m_progressDelayTimer = 0;
-   m_pJob = 0;
+   m_pJob = nullptr;
    tqApp->eventLoop()->exitLoop();
 }
 
@@ -1702,7 +1702,7 @@ void ProgressDialog::show()
 {
    killTimer( m_progressDelayTimer );
    m_progressDelayTimer = 0;
-   if ( !isVisible() && (parentWidget()==0 || parentWidget()->isVisible()) )
+   if ( !isVisible() && (!parentWidget() || parentWidget()->isVisible()) )
    {
       TQDialog::show();
    }
@@ -1718,10 +1718,10 @@ void ProgressDialog::hide()
 
 void ProgressDialog::delayedHide()
 {
-   if (m_pJob!=0)
+   if (m_pJob)
    {
       m_pJob->kill(false);
-      m_pJob = 0;
+      m_pJob = nullptr;
    }
    TQDialog::hide();
    m_pInformation->setText( "" );
diff --git a/src/gnudiff_analyze.cpp b/src/gnudiff_analyze.cpp
index 0661a00..459ebfc 100644
--- a/src/gnudiff_analyze.cpp
+++ b/src/gnudiff_analyze.cpp
@@ -726,7 +726,7 @@ GnuDiff::change* GnuDiff::add_change (lin line0, lin line1, lin deleted, lin ins
 
 GnuDiff::change* GnuDiff::build_reverse_script (struct file_data const filevec[])
 {
-  struct change *script = 0;
+  struct change *script = nullptr;
   bool *changed0 = filevec[0].changed;
   bool *changed1 = filevec[1].changed;
   lin len0 = filevec[0].buffered_lines;
@@ -762,7 +762,7 @@ GnuDiff::change* GnuDiff::build_reverse_script (struct file_data const filevec[]
 
 GnuDiff::change* GnuDiff::build_script (struct file_data const filevec[])
 {
-  struct change *script = 0;
+  struct change *script = nullptr;
   bool *changed0 = filevec[0].changed;
   bool *changed1 = filevec[1].changed;
   lin i0 = filevec[0].buffered_lines, i1 = filevec[1].buffered_lines;
@@ -856,7 +856,7 @@ GnuDiff::change* GnuDiff::diff_2_files (struct comparison *cmp)
 
       script = build_script (cmp->file);
 
-      changes = (script != 0);
+      changes = (script != nullptr);
 
       free (cmp->file[0].undiscarded);
 
diff --git a/src/gnudiff_xmalloc.cpp b/src/gnudiff_xmalloc.cpp
index 5bbb445..22c6856 100644
--- a/src/gnudiff_xmalloc.cpp
+++ b/src/gnudiff_xmalloc.cpp
@@ -37,7 +37,7 @@
 #include "gnudiff_diff.h"
 /* If non NULL, call this function when memory is exhausted. */
 //void (*xalloc_fail_func) PARAMS ((void)) = 0;
-void (*xalloc_fail_func)(void) = 0;
+void (*xalloc_fail_func)(void) = nullptr;
 
 
 void GnuDiff::xalloc_die (void)
@@ -59,7 +59,7 @@ GnuDiff::xmalloc (size_t n)
   void *p;
 
   p = malloc (n == 0 ? 1 : n); // There are systems where malloc returns 0 for n==0.
-  if (p == 0)
+  if (!p)
     xalloc_die ();
   return p;
 }
@@ -71,7 +71,7 @@ void *
 GnuDiff::xrealloc (void *p, size_t n)
 {
   p = realloc (p, n==0 ? 1 : n);
-  if (p == 0)
+  if (!p)
     xalloc_die ();
   return p;
 }
diff --git a/src/kdiff3.cpp b/src/kdiff3.cpp
index acef944..b074382 100644
--- a/src/kdiff3.cpp
+++ b/src/kdiff3.cpp
@@ -59,7 +59,7 @@
 
 TDEActionCollection* KDiff3App::actionCollection()
 {
-   if ( m_pKDiff3Shell==0 )
+   if ( !m_pKDiff3Shell )
       return m_pKDiff3Part->actionCollection();
    else
       return m_pKDiff3Shell->actionCollection();
@@ -67,23 +67,23 @@ TDEActionCollection* KDiff3App::actionCollection()
 
 KStatusBar* KDiff3App::statusBar()
 {
-   if ( m_pKDiff3Shell==0 )
-      return 0;
+   if ( !m_pKDiff3Shell )
+      return nullptr;
    else
       return m_pKDiff3Shell->statusBar();
 }
 
 TDEToolBar* KDiff3App::toolBar(const char* toolBarId )
 {
-   if ( m_pKDiff3Shell==0 )
-      return 0;
+   if ( !m_pKDiff3Shell )
+      return nullptr;
    else
       return m_pKDiff3Shell->toolBar( toolBarId );
 }
 
 bool KDiff3App::isPart()
 {
-   return m_pKDiff3Shell==0;
+   return m_pKDiff3Shell==nullptr;
 }
 
 bool KDiff3App::isFileSaved()
@@ -99,41 +99,41 @@ KDiff3App::KDiff3App(TQWidget* pParent, const char* name, KDiff3Part* pKDiff3Par
 
    setCaption( "KDiff3" );
 
-   m_pMainSplitter = 0;
-   m_pDirectoryMergeWindow = 0;
-   m_pCornerWidget = 0;
-   m_pMainWidget = 0;
-   m_pDiffTextWindow1 = 0;
-   m_pDiffTextWindow2 = 0;
-   m_pDiffTextWindow3 = 0;
-   m_pDiffTextWindowFrame1 = 0;
-   m_pDiffTextWindowFrame2 = 0;
-   m_pDiffTextWindowFrame3 = 0;
-   m_pDiffWindowSplitter = 0;
-   m_pOverview        = 0;
+   m_pMainSplitter = nullptr;
+   m_pDirectoryMergeWindow = nullptr;
+   m_pCornerWidget = nullptr;
+   m_pMainWidget = nullptr;
+   m_pDiffTextWindow1 = nullptr;
+   m_pDiffTextWindow2 = nullptr;
+   m_pDiffTextWindow3 = nullptr;
+   m_pDiffTextWindowFrame1 = nullptr;
+   m_pDiffTextWindowFrame2 = nullptr;
+   m_pDiffTextWindowFrame3 = nullptr;
+   m_pDiffWindowSplitter = nullptr;
+   m_pOverview        = nullptr;
    m_bTripleDiff = false;
-   m_pMergeResultWindow = 0;
-   m_pMergeWindowFrame = 0;
+   m_pMergeResultWindow = nullptr;
+   m_pMergeWindowFrame = nullptr;
    m_bOutputModified = false;
    m_bFileSaved = false;
    m_bTimerBlock = false;
-   m_pHScrollBar = 0;
+   m_pHScrollBar = nullptr;
 
    // Needed before any file operations via FileAccess happen.
    if (!g_pProgressDialog)
    {
-      g_pProgressDialog = new ProgressDialog(0);
+      g_pProgressDialog = new ProgressDialog(nullptr);
       g_pProgressDialog->setStayHidden( true );
    }
 
    // All default values must be set before calling readOptions().
-   m_pOptionDialog = new OptionDialog( m_pKDiff3Shell!=0, this );
+   m_pOptionDialog = new OptionDialog( m_pKDiff3Shell!=nullptr, this );
    connect( m_pOptionDialog, TQ_SIGNAL(applyClicked()), this, TQ_SLOT(slotRefresh()) );
 
    m_pOptionDialog->readOptions( isPart() ? m_pKDiff3Part->instance()->config() : tdeApp->config() );
 
    // Option handling: Only when pParent==0 (no parent)
-   TDECmdLineArgs *args = isPart() ? 0 : TDECmdLineArgs::parsedArgs();
+   TDECmdLineArgs *args = isPart() ? nullptr : TDECmdLineArgs::parsedArgs();
 
    if (args)
    {
@@ -176,14 +176,14 @@ KDiff3App::KDiff3App(TQWidget* pParent, const char* name, KDiff3Part* pKDiff3Par
    m_sd2.setOptionDialog(m_pOptionDialog);
    m_sd3.setOptionDialog(m_pOptionDialog);
 
-   if (args!=0)
+   if (args)
    {
       m_outputFilename = args->getOption("output");
       if ( m_outputFilename.isEmpty() )
          m_outputFilename = args->getOption("out");
    }
 
-   m_bAutoFlag = args!=0  && args->isSet("auto");
+   m_bAutoFlag = args!=nullptr  && args->isSet("auto");
    m_bAutoMode = m_bAutoFlag || m_pOptionDialog->m_bAutoSaveAndQuitOnMergeWithoutConflicts;
    if ( m_bAutoMode && m_outputFilename.isEmpty() )
    {
@@ -196,7 +196,7 @@ KDiff3App::KDiff3App(TQWidget* pParent, const char* name, KDiff3Part* pKDiff3Par
    }
    g_pProgressDialog->setStayHidden( m_bAutoMode );
 
-   if ( m_outputFilename.isEmpty() && args!=0 && args->isSet("merge") )
+   if ( m_outputFilename.isEmpty() && args && args->isSet("merge") )
    {
       m_outputFilename = "unnamed.txt";
       m_bDefaultFilename = true;
@@ -204,9 +204,9 @@ KDiff3App::KDiff3App(TQWidget* pParent, const char* name, KDiff3Part* pKDiff3Par
    else
       m_bDefaultFilename = false;
 
-   g_bAutoSolve = args!=0 && !args->isSet("qall");  // Note that this is effective only once.
+   g_bAutoSolve = args!=nullptr && !args->isSet("qall");  // Note that this is effective only once.
 
-   if ( args!=0 )
+   if ( args )
    {
       m_sd1.setFilename( args->getOption("base") );
       if ( m_sd1.isEmpty() )
@@ -257,7 +257,7 @@ KDiff3App::KDiff3App(TQWidget* pParent, const char* name, KDiff3Part* pKDiff3Par
       viewStatusBar->setChecked( m_pOptionDialog->m_bShowStatusBar );
       slotViewToolBar();
       slotViewStatusBar();
-      if( toolBar("mainToolBar")!=0 )
+      if( toolBar("mainToolBar")!=nullptr )
          toolBar("mainToolBar")->setBarPos( (TDEToolBar::BarPosition) m_pOptionDialog->m_toolBarPos );
 /*      TQSize size = m_pOptionDialog->m_geometry;
       TQPoint pos = m_pOptionDialog->m_position;
@@ -290,9 +290,9 @@ KDiff3App::KDiff3App(TQWidget* pParent, const char* name, KDiff3Part* pKDiff3Par
 
    m_pDirectoryMergeWindow->initDirectoryMergeActions( this, actionCollection() );
 
-   if ( args!=0 )  args->clear(); // Free up some memory.
+   if ( args )  args->clear(); // Free up some memory.
 
-   if (m_pKDiff3Shell==0)
+   if (!m_pKDiff3Shell)
    {
       completeInit();
    }
@@ -301,7 +301,7 @@ KDiff3App::KDiff3App(TQWidget* pParent, const char* name, KDiff3Part* pKDiff3Par
 
 void KDiff3App::completeInit( const TQString& fn1, const TQString& fn2, const TQString& fn3 )
 {
-   if (m_pKDiff3Shell!=0)
+   if (m_pKDiff3Shell)
    {
       TQSize size=m_pOptionDialog->m_geometry;
       TQPoint pos=m_pOptionDialog->m_position;
@@ -338,7 +338,7 @@ void KDiff3App::completeInit( const TQString& fn1, const TQString& fn2, const TQ
       init( m_bAutoMode );
       if ( m_bAutoMode )
       {
-         SourceData* pSD=0;
+         SourceData* pSD=nullptr;
          if ( m_sd3.isEmpty() )
          {
             if ( m_totalDiffStatus.bBinaryAEqB ){ pSD = &m_sd1; }
@@ -350,7 +350,7 @@ void KDiff3App::completeInit( const TQString& fn1, const TQString& fn2, const TQ
             else if ( m_totalDiffStatus.bBinaryAEqC ){ pSD = &m_sd2; } // assuming B has changed
          }
 
-         if ( pSD!=0 )
+         if ( pSD )
          {
             // Save this file directly, not via the merge result window.
             bool bSuccess = false;
@@ -385,14 +385,14 @@ void KDiff3App::completeInit( const TQString& fn1, const TQString& fn2, const TQ
 
    g_pProgressDialog->setStayHidden( false );
 
-   if (statusBar() !=0 )
+   if (statusBar() )
       statusBar()->setSizeGripEnabled(true);
 
    slotClipboardChanged(); // For initialisation.
 
    slotUpdateAvailabilities();
 
-   if ( ! m_bDirCompare  &&  m_pKDiff3Shell!=0 )
+   if ( ! m_bDirCompare  &&  m_pKDiff3Shell )
    {
       bool bFileOpenError = false;
       if ( ! m_sd1.isEmpty() && !m_sd1.hasData()  ||
@@ -428,7 +428,7 @@ KDiff3App::~KDiff3App()
 
 void KDiff3App::initActions( TDEActionCollection* ac )
 {
-   if (ac==0)   KMessageBox::error(0, "actionCollection==0");
+   if (!ac)   KMessageBox::error(nullptr, "actionCollection==0");
 
    fileOpen = KStdAction::open(this, TQ_SLOT(slotFileOpen()), ac);
    fileOpen->setStatusText(i18n("Opens documents for comparison..."));
@@ -564,7 +564,7 @@ void KDiff3App::initStatusBar()
 {
   ///////////////////////////////////////////////////////////////////
   // STATUSBAR
-  if (statusBar() !=0 )
+  if (statusBar() )
      statusBar()->message( i18n("Ready.") );
 }
 
@@ -580,7 +580,7 @@ void KDiff3App::saveOptions( TDEConfig* config )
             m_pOptionDialog->m_geometry = m_pKDiff3Shell->size();
             m_pOptionDialog->m_position = m_pKDiff3Shell->pos();
          }
-         if ( toolBar("mainToolBar")!=0 )
+         if ( toolBar("mainToolBar")!=nullptr )
             m_pOptionDialog->m_toolBarPos = (int) toolBar("mainToolBar")->barPos();
       }
 
@@ -660,7 +660,7 @@ void KDiff3App::slotFileSaveAs()
 {
   slotStatusMsg(i18n("Saving file with a new filename..."));
 
-  TQString s = KFileDialog::getSaveURL( TQDir::currentDirPath(), 0, this, i18n("Save As...") ).url();
+  TQString s = KFileDialog::getSaveURL( TQDir::currentDirPath(), nullptr, this, i18n("Save As...") ).url();
   if(!s.isEmpty())
   {
      m_outputFilename = s;
@@ -750,7 +750,7 @@ void KDiff3App::slotFilePrint()
    {
       slotStatusMsg( i18n( "Printing..." ) );
       // create a painter to paint on the printer object
-      MyPainter painter( 0, m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') );
+      MyPainter painter( nullptr, m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') );
 
       // start painting
       if( !painter.begin( &printer ) ) {               // paint on printer
@@ -938,7 +938,7 @@ void KDiff3App::slotViewToolBar()
    m_pOptionDialog->m_bShowToolBar = viewToolBar->isChecked();
    ///////////////////////////////////////////////////////////////////
    // turn Toolbar on or off
-   if ( toolBar("mainToolBar") !=0 )
+   if ( toolBar("mainToolBar") !=nullptr )
    {
       if(!m_pOptionDialog->m_bShowToolBar)
       {
@@ -959,7 +959,7 @@ void KDiff3App::slotViewStatusBar()
    m_pOptionDialog->m_bShowStatusBar = viewStatusBar->isChecked();
    ///////////////////////////////////////////////////////////////////
    //turn Statusbar on or off
-   if (statusBar() !=0 )
+   if (statusBar() )
    {
       if(!viewStatusBar->isChecked())
       {
@@ -979,7 +979,7 @@ void KDiff3App::slotStatusMsg(const TQString &text)
 {
    ///////////////////////////////////////////////////////////////////
    // change status message permanently
-   if (statusBar() !=0 )
+   if (statusBar() )
    {
       statusBar()->clear();
       statusBar()->message( text );
diff --git a/src/kdiff3.h b/src/kdiff3.h
index ac13114..5a38442 100644
--- a/src/kdiff3.h
+++ b/src/kdiff3.h
@@ -310,7 +310,7 @@ class KDiff3App : public TQSplitter
    OptionDialog* m_pOptionDialog;
    FindDialog*   m_pFindDialog;
 
-   void init( bool bAuto=false, TotalDiffStatus* pTotalDiffStatus=0, bool bLoadFiles=true );
+   void init( bool bAuto=false, TotalDiffStatus* pTotalDiffStatus=nullptr, bool bLoadFiles=true );
 
    virtual bool eventFilter( TQObject* o, TQEvent* e );
    virtual void resizeEvent(TQResizeEvent*);
diff --git a/src/kdiff3_part.cpp b/src/kdiff3_part.cpp
index ddc2bdb..2a2726d 100644
--- a/src/kdiff3_part.cpp
+++ b/src/kdiff3_part.cpp
@@ -46,7 +46,7 @@ KDiff3Part::KDiff3Part( TQWidget *parentWidget, const char *widgetName,
     m_widget = new KDiff3App( parentWidget, widgetName, this );
     
     // This hack is necessary to avoid a crash when the program terminates.
-    m_bIsShell = dynamic_cast<KParts::MainWindow*>(parentWidget)!=0;
+    m_bIsShell = dynamic_cast<KParts::MainWindow*>(parentWidget)!=nullptr;
 
     // notify the part that this is our internal widget
     setWidget(m_widget);
@@ -67,7 +67,7 @@ KDiff3Part::KDiff3Part( TQWidget *parentWidget, const char *widgetName,
 
 KDiff3Part::~KDiff3Part()
 {
-   if ( m_widget!=0  && ! m_bIsShell )
+   if ( m_widget  && ! m_bIsShell )
    {
       m_widget->saveOptions( m_widget->isPart() ? instance()->config() : tdeApp->config() );
    }
@@ -168,7 +168,7 @@ bool KDiff3Part::openFile()
 
    if ( f1.exists() && f2.exists() && fileName1!=fileName2 )
    {
-      m_widget->slotFileOpen2( fileName1, fileName2, "", "", "", "", "", 0 );
+      m_widget->slotFileOpen2( fileName1, fileName2, "", "", "", "", "", nullptr );
       return true;
    }
    else if ( version1.isEmpty() && f1.exists() )
@@ -182,7 +182,7 @@ bool KDiff3Part::openFile()
       ::system( cmd.ascii() );
 
       m_widget->slotFileOpen2( fileName1, tempFileName, "", "",
-                               "", version2.isEmpty() ? fileName2 : "REV:"+version2+":"+fileName2, "", 0 ); // alias names
+                               "", version2.isEmpty() ? fileName2 : "REV:"+version2+":"+fileName2, "", nullptr ); // alias names
 //    std::cerr << "KDiff3: f1:" << fileName1.latin1() <<"<->"<<tempFileName.latin1()<< std::endl;
       FileAccess::removeTempFile( tempFileName );
    }
@@ -197,7 +197,7 @@ bool KDiff3Part::openFile()
       ::system( cmd.ascii() );
 
       m_widget->slotFileOpen2( tempFileName, fileName2, "", "",
-                               version1.isEmpty() ? fileName1 : "REV:"+version1+":"+fileName1, "", "", 0 ); // alias name
+                               version1.isEmpty() ? fileName1 : "REV:"+version1+":"+fileName1, "", "", nullptr ); // alias name
 //    std::cerr << "KDiff3: f2:" << fileName2.latin1() <<"<->"<<tempFileName.latin1()<< std::endl;
       FileAccess::removeTempFile( tempFileName );
    }
@@ -218,7 +218,7 @@ bool KDiff3Part::openFile()
       m_widget->slotFileOpen2( tempFileName1, tempFileName2, "", "",
          "REV:"+version1+":"+fileName1,
          "REV:"+version2+":"+fileName2,
-         "", 0
+         "", nullptr
       );
 
 //    std::cerr << "KDiff3: f1/2:" << tempFileName1.latin1() <<"<->"<<tempFileName2.latin1()<< std::endl;
@@ -261,8 +261,8 @@ bool KDiff3Part::saveFile()
 #include <tdeaboutdata.h>
 #include <tdelocale.h>
 
-TDEInstance*  KDiff3PartFactory::s_instance = 0L;
-TDEAboutData* KDiff3PartFactory::s_about = 0L;
+TDEInstance*  KDiff3PartFactory::s_instance = nullptr;
+TDEAboutData* KDiff3PartFactory::s_about = nullptr;
 
 KDiff3PartFactory::KDiff3PartFactory()
     : KParts::Factory()
@@ -274,7 +274,7 @@ KDiff3PartFactory::~KDiff3PartFactory()
     delete s_instance;
     delete s_about;
 
-    s_instance = 0L;
+    s_instance = nullptr;
 }
 
 KParts::Part* KDiff3PartFactory::createPartObject( TQWidget *parentWidget, const char *widgetName,
@@ -296,7 +296,7 @@ TDEInstance* KDiff3PartFactory::instance()
     if( !s_instance )
     {
         s_about = new TDEAboutData("kdiff3part", I18N_NOOP("KDiff3Part"), VERSION);
-        s_about->addAuthor("Joachim Eibl", 0, "joachim.eibl at gmx.de");
+        s_about->addAuthor("Joachim Eibl", nullptr, "joachim.eibl at gmx.de");
         s_instance = new TDEInstance(s_about);
     }
     return s_instance;
diff --git a/src/kdiff3_shell.cpp b/src/kdiff3_shell.cpp
index cce4c56..27940a4 100644
--- a/src/kdiff3_shell.cpp
+++ b/src/kdiff3_shell.cpp
@@ -38,7 +38,7 @@
 #include <iostream>
 
 KDiff3Shell::KDiff3Shell(bool bCompleteInit)
-    : KParts::MainWindow( 0L, "kdiff3" )
+    : KParts::MainWindow( nullptr, "kdiff3" )
 {
     m_bUnderConstruction = true;
     // set the shell's ui resource file
diff --git a/src/kreplacements/ShellContextMenu.cpp b/src/kreplacements/ShellContextMenu.cpp
index e43e07b..b0529fb 100644
--- a/src/kreplacements/ShellContextMenu.cpp
+++ b/src/kreplacements/ShellContextMenu.cpp
@@ -83,7 +83,7 @@ BOOL CShellContextMenu::GetContextMenu (void ** ppContextMenu, int & iMenuType)
 	*ppContextMenu = nullptr;
 	LPCONTEXTMENU icm1 = nullptr;
 	
-        if ( m_psfFolder==0 )
+        if ( !m_psfFolder )
            return FALSE;
 	// first we retrieve the normal IContextMenu interface (every object should have it)
 	m_psfFolder->GetUIObjectOf (nullptr, nItems, (LPCITEMIDLIST *) m_pidlArray, IID_IContextMenu, nullptr, (void**) &icm1);
@@ -244,7 +244,7 @@ void CShellContextMenu::SetObjects(const TQStringList &strList)
 	// that means that it's a fully qualified PIDL, which is what we need
 	LPITEMIDLIST pidl = nullptr;
 	
-	psfDesktop->ParseDisplayName (nullptr, 0, (LPOLESTR)strList[0].ucs2(), nullptr, &pidl, nullptr);
+	psfDesktop->ParseDisplayName (nullptr, nullptr, (LPOLESTR)strList[0].ucs2(), nullptr, &pidl, nullptr);
 
 	// now we need the parent IShellFolder interface of pidl, and the relative PIDL to that interface
 	LPITEMIDLIST pidlItem = nullptr;	// relative pidl
@@ -263,8 +263,8 @@ void CShellContextMenu::SetObjects(const TQStringList &strList)
 	nItems = strList.size ();
 	for (int i = 0; i < nItems; i++)
 	{
-                pidl=0;
-		psfDesktop->ParseDisplayName (nullptr, 0, (LPOLESTR)strList[i].ucs2(), nullptr, &pidl, nullptr);
+                pidl=nullptr;
+		psfDesktop->ParseDisplayName (nullptr, nullptr, (LPOLESTR)strList[i].ucs2(), nullptr, &pidl, nullptr);
                 if (pidl)
                 {
                      m_pidlArray = (LPITEMIDLIST *) realloc (m_pidlArray, (i + 1) * sizeof (LPITEMIDLIST));
diff --git a/src/main.cpp b/src/main.cpp
index f8ce4da..f7d505d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -36,29 +36,29 @@ static const char *description =
 
 static TDECmdLineOptions options[] =
 {
-  { "m", 0, 0 },
-  { "merge", I18N_NOOP("Merge the input."), 0 },
-  { "b", 0, 0 },
-  { "base file", I18N_NOOP("Explicit base file. For compatibility with certain tools."), 0 },
-  { "o", 0, 0 },
-  { "output file", I18N_NOOP("Output file. Implies -m. E.g.: -o newfile.txt"), 0 },
-  { "out file",    I18N_NOOP("Output file, again. (For compatibility with certain tools.)"), 0 },
-  { "auto",        I18N_NOOP("No GUI if all conflicts are auto-solvable. (Needs -o file)"), 0 },
-  { "qall",        I18N_NOOP("Don't solve conflicts automatically. (For compatibility...)"), 0 },
-  { "L1 alias1",   I18N_NOOP("Visible name replacement for input file 1 (base)."), 0 },
-  { "L2 alias2",   I18N_NOOP("Visible name replacement for input file 2."), 0 },
-  { "L3 alias3",   I18N_NOOP("Visible name replacement for input file 3."), 0 },
-  { "L", 0, 0 },
-  { "fname alias", I18N_NOOP("Alternative visible name replacement. Supply this once for every input."), 0 },
-  { "cs string",   I18N_NOOP("Override a config setting. Use once for every setting. E.g.: --cs \"AutoAdvance=1\""), 0 },
-  { "confighelp",  I18N_NOOP("Show list of config settings and current values."), 0 },
-  { "config file", I18N_NOOP("Use a different config file."), 0 }
+  { "m", nullptr, nullptr },
+  { "merge", I18N_NOOP("Merge the input."), nullptr },
+  { "b", nullptr, nullptr },
+  { "base file", I18N_NOOP("Explicit base file. For compatibility with certain tools."), nullptr },
+  { "o", nullptr, nullptr },
+  { "output file", I18N_NOOP("Output file. Implies -m. E.g.: -o newfile.txt"), nullptr },
+  { "out file",    I18N_NOOP("Output file, again. (For compatibility with certain tools.)"), nullptr },
+  { "auto",        I18N_NOOP("No GUI if all conflicts are auto-solvable. (Needs -o file)"), nullptr },
+  { "qall",        I18N_NOOP("Don't solve conflicts automatically. (For compatibility...)"), nullptr },
+  { "L1 alias1",   I18N_NOOP("Visible name replacement for input file 1 (base)."), nullptr },
+  { "L2 alias2",   I18N_NOOP("Visible name replacement for input file 2."), nullptr },
+  { "L3 alias3",   I18N_NOOP("Visible name replacement for input file 3."), nullptr },
+  { "L", nullptr, nullptr },
+  { "fname alias", I18N_NOOP("Alternative visible name replacement. Supply this once for every input."), nullptr },
+  { "cs string",   I18N_NOOP("Override a config setting. Use once for every setting. E.g.: --cs \"AutoAdvance=1\""), nullptr },
+  { "confighelp",  I18N_NOOP("Show list of config settings and current values."), nullptr },
+  { "config file", I18N_NOOP("Use a different config file."), nullptr }
 };
 static TDECmdLineOptions options2[] =
 {
-  { "+[File1]", I18N_NOOP("file1 to open (base, if not specified via --base)"), 0 },
-  { "+[File2]", I18N_NOOP("file2 to open"), 0 },
-  { "+[File3]", I18N_NOOP("file3 to open"), 0 }
+  { "+[File1]", I18N_NOOP("file1 to open (base, if not specified via --base)"), nullptr },
+  { "+[File2]", I18N_NOOP("file2 to open"), nullptr },
+  { "+[File3]", I18N_NOOP("file3 to open"), nullptr }
 };
 
 
@@ -91,7 +91,7 @@ void initialiseCmdLineArgs(std::vector<TDECmdLineOptions>& vOptions, TQStringLis
                      {
                         ignoreOption.name = (*i).latin1();
                         ignoreOption.description = I18N_NOOP("Ignored. (User defined.)");
-                        ignoreOption.def = 0;
+                        ignoreOption.def = nullptr;
                         vOptions.push_back(ignoreOption);
                      }
                   }
@@ -172,8 +172,8 @@ int main(int argc, char *argv[])
 
    TDEAboutData aboutData( "kdiff3", I18N_NOOP("KDiff3"),
       VERSION, description, TDEAboutData::License_GPL,
-      "(c) 2002-2007 Joachim Eibl", 0, "http://kdiff3.sourceforge.net/", "joachim.eibl" "@" "gmx.de");
-   aboutData.addAuthor("Joachim Eibl",0, "joachim.eibl" "@" "gmx.de");
+      "(c) 2002-2007 Joachim Eibl", nullptr, "http://kdiff3.sourceforge.net/", "joachim.eibl" "@" "gmx.de");
+   aboutData.addAuthor("Joachim Eibl",nullptr, "joachim.eibl" "@" "gmx.de");
    aboutData.addCredit("Eike Sauer", "Bugfixes, Debian package maintainer" );
    aboutData.addCredit("Sebastien Fricker", "Windows installer" );
    aboutData.addCredit("Stephan Binner", "i18n-help", "binner" "@" "kde.org" );
diff --git a/src/merger.cpp b/src/merger.cpp
index 371548c..d3b11cd 100644
--- a/src/merger.cpp
+++ b/src/merger.cpp
@@ -31,7 +31,7 @@ Merger::MergeData::MergeData( const DiffList* p, int i )
 {
    idx=i;
    pDiffList = p;
-   if ( p!=0 )
+   if ( p )
    {
       it=p->begin();
       update();
@@ -40,12 +40,12 @@ Merger::MergeData::MergeData( const DiffList* p, int i )
 
 bool Merger::MergeData::eq()
 {
-   return pDiffList==0 || d.nofEquals > 0;
+   return pDiffList==nullptr || d.nofEquals > 0;
 }
 
 bool Merger::MergeData::isEnd()
 {
-   return ( pDiffList==0 || ( it==pDiffList->end() && d.nofEquals==0 && 
+   return ( pDiffList==nullptr || ( it==pDiffList->end() && d.nofEquals==0 && 
       ( idx == 0 ? d.diff1==0 : d.diff2==0 )
       ) );  
 }
@@ -60,7 +60,7 @@ void Merger::MergeData::update()
       --d.diff2; 
 
    while( d.nofEquals == 0  && (idx==0 && d.diff1 == 0 || idx==1 && d.diff2 == 0) 
-       && pDiffList!=0  &&  it != pDiffList->end() )
+       && pDiffList!=nullptr  &&  it != pDiffList->end() )
    {
       d = *it;
       ++it;
diff --git a/src/mergeresultwindow.cpp b/src/mergeresultwindow.cpp
index 71c2f97..7ca176d 100644
--- a/src/mergeresultwindow.cpp
+++ b/src/mergeresultwindow.cpp
@@ -48,7 +48,7 @@ MergeResultWindow::MergeResultWindow(
    OptionDialog* pOptionDialog,
    TQStatusBar* pStatusBar
    )
-: TQWidget( pParent, 0, WRepaintNoErase )
+: TQWidget( pParent, nullptr, WRepaintNoErase )
 {
    setFocusPolicy( TQWidget::ClickFocus );
 
@@ -64,15 +64,15 @@ MergeResultWindow::MergeResultWindow(
    m_bModified = false;
    m_eOverviewMode=Overview::eOMNormal;
 
-   m_pldA = 0;
-   m_pldB = 0;
-   m_pldC = 0;
+   m_pldA = nullptr;
+   m_pldB = nullptr;
+   m_pldC = nullptr;
    m_sizeA = 0;
    m_sizeB = 0;
    m_sizeC = 0;
 
-   m_pDiff3LineList = 0;
-   m_pTotalDiffStatus = 0;
+   m_pDiff3LineList = nullptr;
+   m_pTotalDiffStatus = nullptr;
    m_pStatusBar = pStatusBar;
 
    m_pOptionDialog = pOptionDialog;
@@ -139,11 +139,11 @@ void MergeResultWindow::init(
 
 void MergeResultWindow::reset()
 {
-   m_pDiff3LineList = 0;
-   m_pTotalDiffStatus = 0;
-   m_pldA = 0;
-   m_pldB = 0;
-   m_pldC = 0;
+   m_pDiff3LineList = nullptr;
+   m_pTotalDiffStatus = nullptr;
+   m_pldA = nullptr;
+   m_pldB = nullptr;
+   m_pldC = nullptr;
 }
 
 // Calculate the merge information for the given Diff3Line.
@@ -162,7 +162,7 @@ void mergeOneLine(
    {
       if ( d.lineA!=-1 && d.lineB!=-1 )
       {
-         if ( d.pFineAB == 0 )
+         if ( !d.pFineAB )
          {
             mergeDetails = eNoChange;           src = A;
          }
@@ -188,23 +188,23 @@ void mergeOneLine(
    // A is base.
    if ( d.lineA!=-1 && d.lineB!=-1 && d.lineC!=-1 )
    {
-      if ( d.pFineAB == 0  &&  d.pFineBC == 0 &&  d.pFineCA == 0)
+      if ( !d.pFineAB  &&  !d.pFineBC &&  !d.pFineCA)
       {
          mergeDetails = eNoChange;           src = A;
       }
-      else if( d.pFineAB == 0  &&  d.pFineBC != 0  &&  d.pFineCA != 0 )
+      else if( !d.pFineAB  &&  d.pFineBC  &&  d.pFineCA )
       {
          mergeDetails = eCChanged;           src = C;
       }
-      else if( d.pFineAB != 0  &&  d.pFineBC != 0  &&  d.pFineCA == 0 )
+      else if( d.pFineAB  &&  d.pFineBC  &&  !d.pFineCA )
       {
          mergeDetails = eBChanged;           src = B;
       }
-      else if( d.pFineAB != 0  &&  d.pFineBC == 0  &&  d.pFineCA != 0 )
+      else if( d.pFineAB  &&  !d.pFineBC  &&  d.pFineCA )
       {
          mergeDetails = eBCChangedAndEqual;  src = C;
       }
-      else if( d.pFineAB != 0  &&  d.pFineBC != 0  &&  d.pFineCA != 0 )
+      else if( d.pFineAB  &&  d.pFineBC  &&  d.pFineCA )
       {
          mergeDetails = eBCChanged;           bConflict = true;
       }
@@ -213,7 +213,7 @@ void mergeOneLine(
    }
    else if ( d.lineA!=-1 && d.lineB!=-1 && d.lineC==-1 )
    {
-      if( d.pFineAB != 0 )
+      if( d.pFineAB )
       {
          mergeDetails = eBChanged_CDeleted;   bConflict = true;
       }
@@ -224,7 +224,7 @@ void mergeOneLine(
    }
    else if ( d.lineA!=-1 && d.lineB==-1 && d.lineC!=-1 )
    {
-      if( d.pFineCA != 0 )
+      if( d.pFineCA )
       {
          mergeDetails = eCChanged_BDeleted;   bConflict = true;
       }
@@ -235,7 +235,7 @@ void mergeOneLine(
    }
    else if ( d.lineA==-1 && d.lineB!=-1 && d.lineC!=-1 )
    {
-      if( d.pFineBC != 0 )
+      if( d.pFineBC )
       {
          mergeDetails = eBCAdded;             bConflict = true;
       }
@@ -299,12 +299,12 @@ void MergeResultWindow::merge(bool bAutoSolve, int defaultSelector, bool bConfli
 
          MergeLine ml;
          bool bLineRemoved;
-         mergeOneLine( d, ml.mergeDetails, ml.bConflict, bLineRemoved, ml.srcSelect, m_pldC==0 );
+         mergeOneLine( d, ml.mergeDetails, ml.bConflict, bLineRemoved, ml.srcSelect, m_pldC==nullptr );
 
          // Automatic solving for only whitespace changes.
          if ( ml.bConflict &&
-              ( m_pldC==0 && (d.bAEqB || d.bWhiteLineA && d.bWhiteLineB)  ||
-                m_pldC!=0 && (d.bAEqB && d.bAEqC || d.bWhiteLineA && d.bWhiteLineB && d.bWhiteLineC ) ) )
+              ( m_pldC==nullptr && (d.bAEqB || d.bWhiteLineA && d.bWhiteLineB)  ||
+                m_pldC!=nullptr && (d.bAEqB && d.bAEqC || d.bWhiteLineA && d.bWhiteLineB && d.bWhiteLineC ) ) )
          {
             ml.bWhiteSpaceConflict = true;
          }
@@ -314,9 +314,9 @@ void MergeResultWindow::merge(bool bAutoSolve, int defaultSelector, bool bConfli
          ml.id3l         = it;
          ml.srcRangeLength = 1;
 
-         MergeLine* back = m_mergeLineList.empty() ? 0 : &m_mergeLineList.back();
+         MergeLine* back = m_mergeLineList.empty() ? nullptr : &m_mergeLineList.back();
 
-         bool bSame = back!=0 && sameKindCheck( ml, *back );
+         bool bSame = back!=nullptr && sameKindCheck( ml, *back );
          if( bSame )
          {
             ++back->srcRangeLength;
@@ -325,14 +325,14 @@ void MergeResultWindow::merge(bool bAutoSolve, int defaultSelector, bool bConfli
          }
          else
          {
-            if (back!=0  &&  back->bWhiteSpaceConflict )
+            if (back  &&  back->bWhiteSpaceConflict )
             {
-               if ( m_pldC==0 && m_pOptionDialog->m_whiteSpace2FileMergeDefault != 0 )  // Only two inputs
+               if ( !m_pldC && m_pOptionDialog->m_whiteSpace2FileMergeDefault != 0 )  // Only two inputs
                {
                   back->srcSelect = m_pOptionDialog->m_whiteSpace2FileMergeDefault;
                   back->bConflict = false;
                }
-               else if ( m_pldC!=0 && m_pOptionDialog->m_whiteSpace3FileMergeDefault != 0 )
+               else if ( m_pldC && m_pOptionDialog->m_whiteSpace3FileMergeDefault != 0 )
                {
                   back->srcSelect = m_pOptionDialog->m_whiteSpace3FileMergeDefault;
                   back->bConflict = false;
@@ -349,7 +349,7 @@ void MergeResultWindow::merge(bool bAutoSolve, int defaultSelector, bool bConfli
             mel.setSource( ml.srcSelect, bLineRemoved );
             tmpBack.mergeEditLineList.push_back(mel);
          }
-         else if ( back==0  || ! back->bConflict || !bSame )
+         else if ( !back  || ! back->bConflict || !bSame )
          {
             MergeLine& tmpBack = m_mergeLineList.back();
             MergeEditLine mel(ml.id3l);
@@ -447,7 +447,7 @@ void MergeResultWindow::merge(bool bAutoSolve, int defaultSelector, bool bConfli
          slotMergeHistory();
       if ( m_pOptionDialog->m_bRunRegExpAutoMergeOnMergeStart )
          slotRegExpAutoMerge();
-      if ( m_pldC != 0 && ! doRelevantChangesExist() )
+      if ( m_pldC && ! doRelevantChangesExist() )
          emit noRelevantChangesDetected();
    }
 
@@ -775,7 +775,7 @@ void MergeResultWindow::slotSetFastSelectorLine( int line )
 int MergeResultWindow::getNrOfUnsolvedConflicts( int* pNrOfWhiteSpaceConflicts )
 {
    int nrOfUnsolvedConflicts = 0;
-   if (pNrOfWhiteSpaceConflicts!=0)
+   if (pNrOfWhiteSpaceConflicts)
       *pNrOfWhiteSpaceConflicts = 0;
 
    MergeLineList::iterator mlIt = m_mergeLineList.begin();
@@ -786,7 +786,7 @@ int MergeResultWindow::getNrOfUnsolvedConflicts( int* pNrOfWhiteSpaceConflicts )
       if ( melIt->isConflict() )
       {
          ++nrOfUnsolvedConflicts;
-         if ( ml.bWhiteSpaceConflict &&  pNrOfWhiteSpaceConflicts!=0 )
+         if ( ml.bWhiteSpaceConflict &&  pNrOfWhiteSpaceConflicts )
             ++ *pNrOfWhiteSpaceConflicts;
       }
    }
@@ -1258,14 +1258,14 @@ void MergeResultWindow::slotMergeHistory()
    int d3lHistoryEndLineIdx = -1;
 
    // Search for history start, history end in the diff3LineList
-   findHistoryRange( m_pOptionDialog->m_historyStartRegExp, m_pldC!=0, m_pDiff3LineList, iD3LHistoryBegin, iD3LHistoryEnd, d3lHistoryBeginLineIdx, d3lHistoryEndLineIdx );
+   findHistoryRange( m_pOptionDialog->m_historyStartRegExp, m_pldC!=nullptr, m_pDiff3LineList, iD3LHistoryBegin, iD3LHistoryEnd, d3lHistoryBeginLineIdx, d3lHistoryEndLineIdx );
 
    if (  iD3LHistoryBegin != m_pDiff3LineList->end() )
    {
       // Now collect the historyMap information
       HistoryMap historyMap;
       std::list< HistoryMap::iterator > hitList;
-      if (m_pldC==0)
+      if (!m_pldC)
       {
          collectHistoryInformation( A, iD3LHistoryBegin, iD3LHistoryEnd, historyMap, hitList );
          collectHistoryInformation( B, iD3LHistoryBegin, iD3LHistoryEnd, historyMap, hitList );
@@ -1290,7 +1290,7 @@ void MergeResultWindow::slotMergeHistory()
             while ( ! historyMap.empty() )
             {
                HistoryMap::iterator hMapIt = historyMap.begin();
-               if( hMapIt->second.staysInPlace( m_pldC!=0, iD3LHistoryEnd ) )
+               if( hMapIt->second.staysInPlace( m_pldC, iD3LHistoryEnd ) )
                   historyMap.erase(hMapIt);
                else
                   break;
@@ -1301,7 +1301,7 @@ void MergeResultWindow::slotMergeHistory()
             while ( ! hitList.empty() )
             {
                HistoryMap::iterator hMapIt = hitList.back();
-               if( hMapIt->second.staysInPlace( m_pldC!=0, iD3LHistoryEnd ) )
+               if( hMapIt->second.staysInPlace( m_pldC, iD3LHistoryEnd ) )
                   hitList.pop_back();
                else
                   break;
@@ -1329,7 +1329,7 @@ void MergeResultWindow::slotMergeHistory()
       }
       iMLLStart->mergeEditLineList.clear();
       // Now insert the complete history into the first MergeLine of the history
-      iMLLStart->mergeEditLineList.push_back( MergeEditLine( iD3LHistoryBegin, m_pldC == 0 ? B : C ) );
+      iMLLStart->mergeEditLineList.push_back( MergeEditLine( iD3LHistoryBegin, !m_pldC ? B : C ) );
       TQString lead = calcHistoryLead( iD3LHistoryBegin->getString(A) );
       MergeEditLine mel( m_pDiff3LineList->end() );
       mel.setString( lead );
@@ -1346,7 +1346,7 @@ void MergeResultWindow::slotMergeHistory()
                break;
             ++historyCount;
             HistoryMapEntry& hme = hmit->second;
-            MergeEditLineList& mell = hme.choice(m_pldC!=0);
+            MergeEditLineList& mell = hme.choice(m_pldC!=nullptr);
             if (!mell.empty())
                iMLLStart->mergeEditLineList.splice( iMLLStart->mergeEditLineList.end(), mell, mell.begin(), mell.end() );
          }
@@ -1361,7 +1361,7 @@ void MergeResultWindow::slotMergeHistory()
                break;
             ++historyCount;
             HistoryMapEntry& hme = (*hlit)->second;
-            MergeEditLineList& mell = hme.choice(m_pldC!=0);
+            MergeEditLineList& mell = hme.choice(m_pldC!=nullptr);
             if (!mell.empty())
                iMLLStart->mergeEditLineList.splice( iMLLStart->mergeEditLineList.end(), mell, mell.begin(), mell.end() );
          }
@@ -1385,10 +1385,10 @@ void MergeResultWindow::slotRegExpAutoMerge()
          Diff3LineList::const_iterator id3l = i->id3l;
          if ( vcsKeywords.exactMatch( id3l->getString(A) ) && 
               vcsKeywords.exactMatch( id3l->getString(B) ) &&
-              (m_pldC==0 || vcsKeywords.exactMatch( id3l->getString(C) )))
+              (m_pldC==nullptr || vcsKeywords.exactMatch( id3l->getString(C) )))
          {
             MergeEditLine& mel = *i->mergeEditLineList.begin();
-            mel.setSource( m_pldC==0 ? B : C, false );
+            mel.setSource( m_pldC==nullptr ? B : C, false );
             splitAtDiff3LineIdx( i->d3lLineIdx+1 );
          }
       }
@@ -1403,7 +1403,7 @@ void MergeResultWindow::slotRegExpAutoMerge()
 // Precondition: The VCS-keyword would also be C.
 bool MergeResultWindow::doRelevantChangesExist()
 {
-   if ( m_pldC==0 || m_mergeLineList.size() <= 1 )
+   if ( !m_pldC || m_mergeLineList.size() <= 1 )
       return true;
 
    MergeLineList::iterator i;
@@ -1536,13 +1536,13 @@ TQString MergeResultWindow::MergeEditLine::getString( const MergeResultWindow* m
       int src = m_src;
       if ( src == 0 )   { return TQString(); }
       const Diff3Line& d3l = *m_id3l;
-      const LineData* pld = 0;
+      const LineData* pld = nullptr;
       assert( src == A || src == B || src == C );
       if      ( src == A && d3l.lineA!=-1 ) pld = &mrw->m_pldA[ d3l.lineA ];
       else if ( src == B && d3l.lineB!=-1 ) pld = &mrw->m_pldB[ d3l.lineB ];
       else if ( src == C && d3l.lineC!=-1 ) pld = &mrw->m_pldC[ d3l.lineC ];
 
-      if ( pld == 0 )
+      if ( !pld )
       {
          // assert(false);      This is no error.
          return TQString();
@@ -1554,7 +1554,7 @@ TQString MergeResultWindow::MergeEditLine::getString( const MergeResultWindow* m
    {
       return m_str;
    }
-   return 0;
+   return nullptr;
 }
 
 /// Converts the cursor-posOnScreen into a text index, considering tabulators.
@@ -1747,7 +1747,7 @@ void MergeResultWindow::setPaintingAllowed(bool bPaintingAllowed)
 
 void MergeResultWindow::paintEvent( TQPaintEvent*  )
 {
-   if (m_pDiff3LineList==0 || !m_bPaintingAllowed) return;
+   if (!m_pDiff3LineList || !m_bPaintingAllowed) return;
 
    bool bOldSelectionContainsData = m_selection.bSelectionContainsData;
    const TQFontMetrics& fm = fontMetrics();
@@ -1866,14 +1866,14 @@ void MergeResultWindow::updateSourceMask()
 {
    int srcMask=0; 
    int enabledMask = 0;
-   if( !hasFocus() || m_pDiff3LineList==0 || !m_bPaintingAllowed || m_currentMergeLineIt == m_mergeLineList.end() )
+   if( !hasFocus() || !m_pDiff3LineList || !m_bPaintingAllowed || m_currentMergeLineIt == m_mergeLineList.end() )
    {
       srcMask = 0;
       enabledMask = 0;
    }
    else
    {
-      enabledMask = m_pldC==0 ? 3 : 7;
+      enabledMask = m_pldC==nullptr ? 3 : 7;
       MergeLine& ml = *m_currentMergeLineIt;
 
       srcMask = 0;
@@ -2787,9 +2787,9 @@ void MergeResultWindow::setSelection( int firstLine, int startPos, int lastLine,
 }
 
 Overview::Overview( TQWidget* pParent, OptionDialog* pOptions )
-: TQWidget( pParent, 0, WRepaintNoErase )
+: TQWidget( pParent, nullptr, WRepaintNoErase )
 {
-   m_pDiff3LineList = 0;
+   m_pDiff3LineList = nullptr;
    m_pOptions = pOptions;
    m_bTripleDiff = false;
    m_eOverviewMode = eOMNormal;
@@ -2808,7 +2808,7 @@ void Overview::init( Diff3LineList* pDiff3LineList, bool bTripleDiff )
 
 void Overview::reset()
 {
-   m_pDiff3LineList = 0;
+   m_pDiff3LineList = nullptr;
 }
 
 void Overview::slotRedraw()
@@ -3002,7 +3002,7 @@ void Overview::drawColumn( TQPainter& p, e_OverviewMode eOverviewMode, int x, in
 
 void Overview::paintEvent( TQPaintEvent* )
 {
-   if (m_pDiff3LineList==0 || !m_bPaintingAllowed ) return;
+   if (!m_pDiff3LineList || !m_bPaintingAllowed ) return;
    int h = height()-1;
    int w = width();
    
@@ -3082,7 +3082,7 @@ WindowTitleWidget::WindowTitleWidget(OptionDialog* pOptionDialog, TQWidget* pPar
 
    m_pEncodingSelector = new TQComboBox(this);
    pHLayout->addWidget( m_pEncodingSelector, 3 );
-   setEncodings(0,0,0);
+   setEncodings(nullptr,nullptr,nullptr);
 }
 
 void WindowTitleWidget::setFileName( const TQString& fileName )
@@ -3106,7 +3106,7 @@ void WindowTitleWidget::setEncodings( TQTextCodec* pCodecForA, TQTextCodec* pCod
    for(i=0;;++i)
    {
        TQTextCodec* c = TQTextCodec::codecForIndex(i);
-       if ( c==0 ) break;
+       if ( !c ) break;
        else  names[TQString(c->name())]=c;
    }
 
diff --git a/src/mergeresultwindow.h b/src/mergeresultwindow.h
index 82cbb7e..adbe10c 100644
--- a/src/mergeresultwindow.h
+++ b/src/mergeresultwindow.h
@@ -116,7 +116,7 @@ public:
    void reset();
 
    bool saveDocument( const TQString& fileName, TQTextCodec* pEncoding );
-   int getNrOfUnsolvedConflicts(int* pNrOfWhiteSpaceConflicts=0);
+   int getNrOfUnsolvedConflicts(int* pNrOfWhiteSpaceConflicts=nullptr);
    void choose(int selector);
    void chooseGlobal(int selector, bool bConflictsOnly, bool bWhiteSpaceOnly );
 
@@ -228,7 +228,7 @@ private:
       typedef std::list<MergeEditLine>::iterator iterator;
       typedef std::list<MergeEditLine>::reverse_iterator reverse_iterator;
       typedef std::list<MergeEditLine>::const_iterator const_iterator;
-      MergeEditLineList(){m_size=0; m_pTotalSize=0; }
+      MergeEditLineList(){m_size=0; m_pTotalSize=nullptr; }
       void clear()                             { ds(-m_size); BASE::clear();          }
       void push_back( const MergeEditLine& m)  { ds(+1); BASE::push_back(m);     }
       void push_front( const MergeEditLine& m) { ds(+1); BASE::push_front(m);    }
@@ -245,8 +245,8 @@ private:
       void splice(iterator destPos, MergeEditLineList& srcList, iterator srcFirst, iterator srcLast)
       {
          int* pTotalSize = getTotalSizePtr() ? getTotalSizePtr() : srcList.getTotalSizePtr();
-         srcList.setTotalSizePtr(0); // Force size-recalc after splice, because splice doesn't handle size-tracking
-         setTotalSizePtr(0);
+         srcList.setTotalSizePtr(nullptr); // Force size-recalc after splice, because splice doesn't handle size-tracking
+         setTotalSizePtr(nullptr);
          BASE::splice( destPos, srcList, srcFirst, srcLast );
          srcList.setTotalSizePtr( pTotalSize );
          setTotalSizePtr( pTotalSize );
@@ -254,8 +254,8 @@ private:
 
       void setTotalSizePtr(int* pTotalSize)
       {
-         if ( pTotalSize==0 && m_pTotalSize!=0 ) { *m_pTotalSize -= size(); }
-         else if ( pTotalSize!=0 && m_pTotalSize==0 ) { *pTotalSize += size(); }
+         if ( !pTotalSize && m_pTotalSize ) { *m_pTotalSize -= size(); }
+         else if ( pTotalSize && !m_pTotalSize ) { *pTotalSize += size(); }
          m_pTotalSize = pTotalSize;
       }
       int* getTotalSizePtr()
@@ -267,7 +267,7 @@ private:
       void ds(int deltaSize) 
       {
          m_size+=deltaSize; 
-         if (m_pTotalSize!=0)  *m_pTotalSize+=deltaSize;
+         if (m_pTotalSize)  *m_pTotalSize+=deltaSize;
       }
    };
 
diff --git a/src/optiondialog.cpp b/src/optiondialog.cpp
index 90a90f7..fecd35f 100644
--- a/src/optiondialog.cpp
+++ b/src/optiondialog.cpp
@@ -70,7 +70,7 @@ class OptionItem
 public:
    OptionItem( OptionDialog* pOptionDialog, const TQString& saveName )
    {
-      assert(pOptionDialog!=0);
+      assert(pOptionDialog!=nullptr);
       pOptionDialog->addOptionItem( this );
       m_saveName = saveName;
    }
@@ -289,7 +289,7 @@ public:
    {
       setMinimumWidth(50);
       m_pVarNum = pVarNum;
-      m_pVarStr = 0;
+      m_pVarStr = nullptr;
       m_defaultVal = defaultVal;
       setEditable(false);
    }
@@ -297,7 +297,7 @@ public:
                    TQWidget* pParent, OptionDialog* pOD )
    : TQComboBox( pParent ), OptionItem( pOD, saveName )
    {
-      m_pVarNum = 0;
+      m_pVarNum = nullptr;
       m_pVarStr = pVarStr;
       m_defaultVal = defaultVal;
       setEditable(false);
@@ -305,26 +305,26 @@ public:
    void setToDefault()
    { 
       setCurrentItem( m_defaultVal ); 
-      if (m_pVarStr!=0){ *m_pVarStr=currentText(); } 
+      if (m_pVarStr){ *m_pVarStr=currentText(); } 
    }
    void setToCurrent()
    { 
-      if (m_pVarNum!=0) setCurrentItem( *m_pVarNum );
+      if (m_pVarNum) setCurrentItem( *m_pVarNum );
       else              setText( *m_pVarStr );
    }
    void apply()
    { 
-      if (m_pVarNum!=0){ *m_pVarNum = currentItem(); }
+      if (m_pVarNum){ *m_pVarNum = currentItem(); }
       else             { *m_pVarStr = currentText(); }
    }
    void write(ValueMap* config)
    { 
-      if (m_pVarStr!=0) config->writeEntry(m_saveName, *m_pVarStr );
+      if (m_pVarStr) config->writeEntry(m_saveName, *m_pVarStr );
       else              config->writeEntry(m_saveName, *m_pVarNum );   
    }
    void read (ValueMap* config)
    {
-      if (m_pVarStr!=0)  setText( config->readEntry( m_saveName, currentText() ) );
+      if (m_pVarStr)  setText( config->readEntry( m_saveName, currentText() ) );
       else               *m_pVarNum = config->readNumEntry( m_saveName, *m_pVarNum ); 
    }
 private:
@@ -340,8 +340,8 @@ private:
       {
          if ( text(i)==s )
          {
-            if (m_pVarNum!=0) *m_pVarNum = i;
-            if (m_pVarStr!=0) *m_pVarStr = s;
+            if (m_pVarNum) *m_pVarNum = i;
+            if (m_pVarStr) *m_pVarStr = s;
             setCurrentItem(i);
             return;
          }
@@ -369,7 +369,7 @@ public:
       for(i=0;;++i)
       {
          TQTextCodec* c = TQTextCodec::codecForIndex(i);
-         if ( c==0 ) break;
+         if ( !c ) break;
          else  names[TQString(c->name()).upper()]=c;
       }
 
@@ -385,7 +385,7 @@ public:
    }
    void insertCodec( const TQString& visibleCodecName, TQTextCodec* c )
    {
-      if (c!=0)
+      if (c)
       {
          for( unsigned int i=0; i<m_codecVec.size(); ++i )
          {
@@ -405,17 +405,17 @@ public:
              m_codecVec[i]==TQTextCodec::codecForLocale())
          {
             setCurrentItem(i);
-            if (m_ppVarCodec!=0){ *m_ppVarCodec=m_codecVec[i]; }
+            if (m_ppVarCodec){ *m_ppVarCodec=m_codecVec[i]; }
             return;
          }
       }
 
       setCurrentItem( 0 );
-      if (m_ppVarCodec!=0){ *m_ppVarCodec=m_codecVec[0]; }
+      if (m_ppVarCodec){ *m_ppVarCodec=m_codecVec[0]; }
    }
    void setToCurrent()
    {
-      if (m_ppVarCodec!=0)
+      if (m_ppVarCodec)
       {
          for(unsigned int i=0; i<m_codecVec.size(); ++i)
          {
@@ -429,11 +429,11 @@ public:
    }
    void apply()
    {
-      if (m_ppVarCodec!=0){ *m_ppVarCodec = m_codecVec[ currentItem() ]; }
+      if (m_ppVarCodec){ *m_ppVarCodec = m_codecVec[ currentItem() ]; }
    }
    void write(ValueMap* config)
    {
-      if (m_ppVarCodec!=0) config->writeEntry(m_saveName, (*m_ppVarCodec)->name() );
+      if (m_ppVarCodec) config->writeEntry(m_saveName, (*m_ppVarCodec)->name() );
    }
    void read (ValueMap* config)
    {
@@ -443,7 +443,7 @@ public:
          if ( codecName == m_codecVec[i]->name() )
          {
             setCurrentItem( i );
-            if (m_ppVarCodec!=0) *m_ppVarCodec = m_codecVec[i];
+            if (m_ppVarCodec) *m_ppVarCodec = m_codecVec[i];
             break;
          }
       }
@@ -738,7 +738,7 @@ void OptionDialog::setupDiffPage( void )
    topLayout->addLayout( gbox );
    int line=0;
 
-   TQLabel* label=0;
+   TQLabel* label=nullptr;
 
 //   OptionCheckBox* pPreserveCarriageReturn = new OptionCheckBox( i18n("Preserve carriage return"), false, "PreserveCarriageReturn", &m_bPreserveCarriageReturn, page, this );
 //   gbox->addMultiCellWidget( pPreserveCarriageReturn, line, line, 0, 1 );
@@ -808,7 +808,7 @@ void OptionDialog::setupMergePage( void )
    topLayout->addLayout( gbox );
    int line=0;
 
-   TQLabel* label=0;
+   TQLabel* label=nullptr;
 
    label = new TQLabel( i18n("Auto advance delay (ms):"), page );
    gbox->addWidget( label, line, 0 );
diff --git a/src/optiondialog.h b/src/optiondialog.h
index 7aefa29..0f59ec5 100644
--- a/src/optiondialog.h
+++ b/src/optiondialog.h
@@ -53,7 +53,7 @@ class OptionDialog : public KDialogBase
 
 public:
 
-    OptionDialog( bool bShowDirMergeSettings, TQWidget *parent = 0, char *name = 0 );
+    OptionDialog( bool bShowDirMergeSettings, TQWidget *parent = nullptr, char *name = nullptr );
     ~OptionDialog( void );
     TQString parseOptions( const QCStringList& optionList );
     TQString calcOptionHelp();
diff --git a/src/pdiff.cpp b/src/pdiff.cpp
index 7e7dffb..b766778 100644
--- a/src/pdiff.cpp
+++ b/src/pdiff.cpp
@@ -67,10 +67,10 @@ bool KDiff3App::runDiff( const LineData* p1, int size1, const LineData* p2, int
    pp.setCurrent(0);
 
    diffList.clear();
-   if ( p1[0].pLine==0 || p2[0].pLine==0 || size1==0 || size2==0 )
+   if ( !p1[0].pLine || !p2[0].pLine || size1==0 || size2==0 )
    {
       Diff d( 0,0,0);
-      if ( p1[0].pLine==0 && p2[0].pLine==0 && size1 == size2 )
+      if ( !p1[0].pLine && !p2[0].pLine && size1 == size2 )
          d.nofEquals = size1;
       else
       {
@@ -84,7 +84,7 @@ bool KDiff3App::runDiff( const LineData* p1, int size1, const LineData* p2, int
    {
       GnuDiff::comparison comparisonInput;
       memset( &comparisonInput, 0, sizeof(comparisonInput) );
-      comparisonInput.parent = 0;
+      comparisonInput.parent = nullptr;
       comparisonInput.file[0].buffer = p1[0].pLine;//ptr to buffer
       comparisonInput.file[0].buffered = (p1[size1-1].pLine-p1[0].pLine+p1[size1-1].size); // size of buffer
       comparisonInput.file[1].buffer = p2[0].pLine;//ptr to buffer
@@ -100,7 +100,7 @@ bool KDiff3App::runDiff( const LineData* p1, int size1, const LineData* p2, int
       int equalLinesAtStart =  comparisonInput.file[0].prefix_lines;
       int currentLine1 = 0;
       int currentLine2 = 0;
-      GnuDiff::change* p=0;
+      GnuDiff::change* p=nullptr;
       for (GnuDiff::change* e = script; e; e = p)
       {
          Diff d(0,0,0);
@@ -240,8 +240,8 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF
    ProgressProxy pp;
    // When doing a full analysis in the directory-comparison, then the statistics-results
    // will be stored in the given TotalDiffStatus. Otherwise it will be 0.
-   bool bGUI = pTotalDiffStatus == 0;
-   if (pTotalDiffStatus==0) 
+   bool bGUI = pTotalDiffStatus == nullptr;
+   if (!pTotalDiffStatus) 
       pTotalDiffStatus = &m_totalDiffStatus;
 
    bool bPreserveCarriageReturn = m_pOptionDialog->m_bPreserveCarriageReturn;
@@ -418,7 +418,7 @@ void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadF
    m_pMergeResultWindow->init(
       m_sd1.getLineDataForDisplay(), m_sd1.getSizeLines(),
       m_sd2.getLineDataForDisplay(), m_sd2.getSizeLines(),
-      m_bTripleDiff ? m_sd3.getLineDataForDisplay() : 0, m_sd3.getSizeLines(),
+      m_bTripleDiff ? m_sd3.getLineDataForDisplay() : nullptr, m_sd3.getSizeLines(),
       &m_diff3LineList,
       pTotalDiffStatus      
       );
@@ -628,7 +628,7 @@ void KDiff3App::initView()
       oldHeights = m_pMainSplitter->sizes();
    }
 
-   if ( m_pMainWidget != 0 )
+   if ( m_pMainWidget )
    {
       return;
       //delete m_pMainWidget;
@@ -1034,7 +1034,7 @@ void KDiff3App::slotFileOpen()
          if ( m_bDirCompare )
          {
             m_pDirectoryMergeSplitter->show();
-            if ( m_pMainWidget!=0 )
+            if ( m_pMainWidget )
             {
                m_pMainWidget->hide();
             }
@@ -1075,7 +1075,7 @@ void KDiff3App::slotFileOpen2(TQString fn1, TQString fn2, TQString fn3, TQString
 {
    if ( !canContinue() ) return;
 
-   if(fn1=="" && fn2=="" && fn3=="" && ofn=="" && m_pMainWidget!=0 )
+   if(fn1=="" && fn2=="" && fn3=="" && ofn=="" && m_pMainWidget )
    {
       m_pMainWidget->hide();
       return;
@@ -1113,7 +1113,7 @@ void KDiff3App::slotFileOpen2(TQString fn1, TQString fn2, TQString fn3, TQString
       m_bDirCompare = bDirCompare;  // Don't allow this to change here.
       init( false, pTotalDiffStatus );
 
-      if ( pTotalDiffStatus!=0 )
+      if ( pTotalDiffStatus )
          return;
 
       if ( ! m_sd1.isEmpty() && ! m_sd1.hasData()  ||
@@ -1133,7 +1133,7 @@ void KDiff3App::slotFileOpen2(TQString fn1, TQString fn2, TQString fn3, TQString
       }
       else
       {
-         if ( m_pDirectoryMergeWindow!=0 && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() )
+         if ( m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() )
          {
             slotDirViewToggle();
          }
@@ -1155,7 +1155,7 @@ void KDiff3App::slotFileNameChanged(const TQString& fileName, int winIdx)
    if (winIdx==2) { fn2 = fileName; an2 = ""; }
    if (winIdx==3) { fn3 = fileName; an3 = ""; }
 
-   slotFileOpen2( fn1, fn2, fn3, m_outputFilename, an1, an2, an3, 0 );
+   slotFileOpen2( fn1, fn2, fn3, m_outputFilename, an1, an2, an3, nullptr );
 }
 
 
@@ -1164,7 +1164,7 @@ void KDiff3App::slotEditCut()
    slotStatusMsg(i18n("Cutting selection..."));
 
    TQString s;
-   if ( m_pMergeResultWindow!=0 )
+   if ( m_pMergeResultWindow )
    {
       s = m_pMergeResultWindow->getSelection();
       m_pMergeResultWindow->deleteSelection();
@@ -1184,10 +1184,10 @@ void KDiff3App::slotEditCopy()
 {
    slotStatusMsg(i18n("Copying selection to clipboard..."));
    TQString s;
-   if (               m_pDiffTextWindow1!=0 )   s = m_pDiffTextWindow1->getSelection();
-   if ( s.isNull() && m_pDiffTextWindow2!=0 )   s = m_pDiffTextWindow2->getSelection();
-   if ( s.isNull() && m_pDiffTextWindow3!=0 )   s = m_pDiffTextWindow3->getSelection();
-   if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection();
+   if (               m_pDiffTextWindow1 )   s = m_pDiffTextWindow1->getSelection();
+   if ( s.isNull() && m_pDiffTextWindow2 )   s = m_pDiffTextWindow2->getSelection();
+   if ( s.isNull() && m_pDiffTextWindow3 )   s = m_pDiffTextWindow3->getSelection();
+   if ( s.isNull() && m_pMergeResultWindow ) s = m_pMergeResultWindow->getSelection();
    if ( !s.isNull() )
    {
       TQApplication::clipboard()->setText( s, TQClipboard::Clipboard );
@@ -1200,7 +1200,7 @@ void KDiff3App::slotEditPaste()
 {
    slotStatusMsg(i18n("Inserting clipboard contents..."));
 
-   if ( m_pMergeResultWindow!=0 && m_pMergeResultWindow->isVisible() )
+   if ( m_pMergeResultWindow && m_pMergeResultWindow->isVisible() )
    {
       m_pMergeResultWindow->pasteClipboard(false);
    }
@@ -1365,7 +1365,7 @@ void KDiff3App::slotSplitDiff()
 {
    int firstLine = -1;
    int lastLine = -1;
-   DiffTextWindow* pDTW=0;
+   DiffTextWindow* pDTW=nullptr;
    if (                m_pDiffTextWindow1 ) { pDTW=m_pDiffTextWindow1; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); }
    if ( firstLine<0 && m_pDiffTextWindow2 ) { pDTW=m_pDiffTextWindow2; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); }
    if ( firstLine<0 && m_pDiffTextWindow3 ) { pDTW=m_pDiffTextWindow3; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); }
@@ -1381,7 +1381,7 @@ void KDiff3App::slotJoinDiffs()
 {
    int firstLine = -1;
    int lastLine = -1;
-   DiffTextWindow* pDTW=0;
+   DiffTextWindow* pDTW=nullptr;
    if (                m_pDiffTextWindow1 ) { pDTW=m_pDiffTextWindow1; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); }
    if ( firstLine<0 && m_pDiffTextWindow2 ) { pDTW=m_pDiffTextWindow2; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); }
    if ( firstLine<0 && m_pDiffTextWindow3 ) { pDTW=m_pDiffTextWindow3; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); }
@@ -1408,31 +1408,31 @@ void KDiff3App::slotConfigureKeys()
 
 void KDiff3App::slotRefresh()
 {
-   if (m_pDiffTextWindow1!=0)
+   if (m_pDiffTextWindow1)
    {
       m_pDiffTextWindow1->setFont(m_pOptionDialog->m_font);
       m_pDiffTextWindow1->update();
    }
-   if (m_pDiffTextWindow2!=0)
+   if (m_pDiffTextWindow2)
    {
       m_pDiffTextWindow2->setFont(m_pOptionDialog->m_font);
       m_pDiffTextWindow2->update();
    }
-   if (m_pDiffTextWindow3!=0)
+   if (m_pDiffTextWindow3)
    {
       m_pDiffTextWindow3->setFont(m_pOptionDialog->m_font);
       m_pDiffTextWindow3->update();
    }
-   if (m_pMergeResultWindow!=0)
+   if (m_pMergeResultWindow)
    {
       m_pMergeResultWindow->setFont(m_pOptionDialog->m_font);
       m_pMergeResultWindow->update();
    }
-   if (m_pHScrollBar!=0)
+   if (m_pHScrollBar)
    {
       m_pHScrollBar->setAgain();
    }
-   if ( m_pDiffWindowSplitter!=0 )
+   if ( m_pDiffWindowSplitter )
    {
       m_pDiffWindowSplitter->setOrientation( m_pOptionDialog->m_bHorizDiffWindowSplitting ? TQt::Horizontal : TQt::Vertical );
    }
@@ -1470,10 +1470,10 @@ void KDiff3App::slotSelectionEnd()
        if (clipBoard->supportsSelection ())
        {
            TQString s;
-           if (               m_pDiffTextWindow1!=0 )   s = m_pDiffTextWindow1->getSelection();
-           if ( s.isNull() && m_pDiffTextWindow2!=0 )   s = m_pDiffTextWindow2->getSelection();
-           if ( s.isNull() && m_pDiffTextWindow3!=0 )   s = m_pDiffTextWindow3->getSelection();
-           if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection();
+           if (               m_pDiffTextWindow1 )   s = m_pDiffTextWindow1->getSelection();
+           if ( s.isNull() && m_pDiffTextWindow2 )   s = m_pDiffTextWindow2->getSelection();
+           if ( s.isNull() && m_pDiffTextWindow3 )   s = m_pDiffTextWindow3->getSelection();
+           if ( s.isNull() && m_pMergeResultWindow ) s = m_pMergeResultWindow->getSelection();
            if ( !s.isNull() )
            {
                clipBoard->setText( s, TQClipboard::Selection );
@@ -1617,24 +1617,24 @@ void KDiff3App::slotShowWhiteSpaceToggled()
    m_pOptionDialog->m_bShowWhiteSpaceCharacters = showWhiteSpaceCharacters->isChecked();
    m_pOptionDialog->m_bShowWhiteSpace = showWhiteSpace->isChecked();
    showWhiteSpaceCharacters->setEnabled( showWhiteSpace->isChecked() );
-   if ( m_pDiffTextWindow1!=0 )
+   if ( m_pDiffTextWindow1 )
       m_pDiffTextWindow1->update();
-   if ( m_pDiffTextWindow2!=0 )
+   if ( m_pDiffTextWindow2 )
       m_pDiffTextWindow2->update();
-   if ( m_pDiffTextWindow3!=0 )
+   if ( m_pDiffTextWindow3 )
       m_pDiffTextWindow3->update();
-   if ( m_pOverview!=0 )
+   if ( m_pOverview )
       m_pOverview->slotRedraw();
 }
 
 void KDiff3App::slotShowLineNumbersToggled()
 {
    m_pOptionDialog->m_bShowLineNumbers = showLineNumbers->isChecked();
-   if ( m_pDiffTextWindow1!=0 )
+   if ( m_pDiffTextWindow1 )
       m_pDiffTextWindow1->update();
-   if ( m_pDiffTextWindow2!=0 )
+   if ( m_pDiffTextWindow2 )
       m_pDiffTextWindow2->update();
-   if ( m_pDiffTextWindow3!=0 )
+   if ( m_pDiffTextWindow3 )
       m_pDiffTextWindow3->update();
 }
 
@@ -1681,7 +1681,7 @@ bool KDiff3App::improveFilenames( bool bCreateNewInstance )
          FileAccess destDir;
          if (!m_bDefaultFilename) destDir = f4;
          m_pDirectoryMergeSplitter->show();
-         if (m_pMainWidget!=0) m_pMainWidget->hide();
+         if (m_pMainWidget) m_pMainWidget->hide();
 
          bool bSuccess = m_pDirectoryMergeWindow->init(
             f1, f2, f3,
@@ -1694,11 +1694,11 @@ bool KDiff3App::improveFilenames( bool bCreateNewInstance )
          if (bSuccess)
          {
             m_sd1.reset();
-            if (m_pDiffTextWindow1!=0) m_pDiffTextWindow1->init(0,0,0,0,0,false);
+            if (m_pDiffTextWindow1) m_pDiffTextWindow1->init(nullptr,nullptr,0,nullptr,nullptr,false);
             m_sd2.reset();
-            if (m_pDiffTextWindow2!=0) m_pDiffTextWindow2->init(0,0,0,0,0,false);
+            if (m_pDiffTextWindow2) m_pDiffTextWindow2->init(nullptr,nullptr,0,nullptr,nullptr,false);
             m_sd3.reset();
-            if (m_pDiffTextWindow3!=0) m_pDiffTextWindow3->init(0,0,0,0,0,false);
+            if (m_pDiffTextWindow3) m_pDiffTextWindow3->init(nullptr,nullptr,0,nullptr,nullptr,false);
          }
          slotUpdateAvailabilities();
          return bSuccess;
@@ -1741,7 +1741,7 @@ bool KDiff3App::canContinue()
 
 void KDiff3App::slotCheckIfCanContinue( bool* pbContinue )
 {
-   if (pbContinue!=0) *pbContinue = canContinue();
+   if (pbContinue) *pbContinue = canContinue();
 }
 
 
@@ -1754,12 +1754,12 @@ void KDiff3App::slotDirShowBoth()
       else
          m_pDirectoryMergeSplitter->hide();
 
-      if ( m_pMainWidget!=0 )
+      if ( m_pMainWidget )
          m_pMainWidget->show();
    }
    else
    {
-      if ( m_pMainWidget!=0 )
+      if ( m_pMainWidget )
       {
          m_pMainWidget->show();
          m_pDirectoryMergeSplitter->hide();
@@ -1781,12 +1781,12 @@ void KDiff3App::slotDirViewToggle()
       if( ! m_pDirectoryMergeSplitter->isVisible() )
       {
          m_pDirectoryMergeSplitter->show();
-         if (m_pMainWidget!=0)
+         if (m_pMainWidget)
             m_pMainWidget->hide();
       }
       else
       {
-         if (m_pMainWidget!=0)
+         if (m_pMainWidget)
          {
             m_pDirectoryMergeSplitter->hide();
             m_pMainWidget->show();
@@ -1798,7 +1798,7 @@ void KDiff3App::slotDirViewToggle()
 
 void KDiff3App::slotShowWindowAToggled()
 {
-   if ( m_pDiffTextWindow1!=0 )
+   if ( m_pDiffTextWindow1 )
    {
       if ( showWindowA->isChecked() ) m_pDiffTextWindowFrame1->show();
       else                            m_pDiffTextWindowFrame1->hide();
@@ -1808,7 +1808,7 @@ void KDiff3App::slotShowWindowAToggled()
 
 void KDiff3App::slotShowWindowBToggled()
 {
-   if ( m_pDiffTextWindow2!=0 )
+   if ( m_pDiffTextWindow2 )
    {
       if ( showWindowB->isChecked() ) m_pDiffTextWindowFrame2->show();
       else                            m_pDiffTextWindowFrame2->hide();
@@ -1818,7 +1818,7 @@ void KDiff3App::slotShowWindowBToggled()
 
 void KDiff3App::slotShowWindowCToggled()
 {
-   if ( m_pDiffTextWindow3!=0 )
+   if ( m_pDiffTextWindow3 )
    {
       if ( showWindowC->isChecked() ) m_pDiffTextWindowFrame3->show();
       else                            m_pDiffTextWindowFrame3->hide();
@@ -1856,7 +1856,7 @@ void KDiff3App::slotEditFindNext()
    int p=0;
    if ( m_pFindDialog->currentWindow == 1 )
    {
-      if ( m_pFindDialog->m_pSearchInA->isChecked() && m_pDiffTextWindow1!=0  &&
+      if ( m_pFindDialog->m_pSearchInA->isChecked() && m_pDiffTextWindow1  &&
            m_pDiffTextWindow1->findString( s, d3vLine, posInLine, bDirDown, bCaseSensitive ) )
       {
          m_pDiffTextWindow1->setSelection( d3vLine, posInLine, d3vLine, posInLine+s.length(), l, p );
@@ -1875,7 +1875,7 @@ void KDiff3App::slotEditFindNext()
    posInLine = m_pFindDialog->currentPos;
    if ( m_pFindDialog->currentWindow == 2 )
    {
-      if ( m_pFindDialog->m_pSearchInB->isChecked() && m_pDiffTextWindow2!=0 &&
+      if ( m_pFindDialog->m_pSearchInB->isChecked() && m_pDiffTextWindow2 &&
            m_pDiffTextWindow2->findString( s, d3vLine, posInLine, bDirDown, bCaseSensitive ) )
       {
          m_pDiffTextWindow2->setSelection( d3vLine, posInLine, d3vLine, posInLine+s.length(),l,p );
@@ -1894,7 +1894,7 @@ void KDiff3App::slotEditFindNext()
    posInLine = m_pFindDialog->currentPos;
    if ( m_pFindDialog->currentWindow == 3 )
    {
-      if ( m_pFindDialog->m_pSearchInC->isChecked() && m_pDiffTextWindow3!=0 &&
+      if ( m_pFindDialog->m_pSearchInC->isChecked() && m_pDiffTextWindow3 &&
            m_pDiffTextWindow3->findString( s, d3vLine, posInLine, bDirDown, bCaseSensitive ) )
       {
          m_pDiffTextWindow3->setSelection( d3vLine, posInLine, d3vLine, posInLine+s.length(),l,p );
@@ -1913,7 +1913,7 @@ void KDiff3App::slotEditFindNext()
    posInLine = m_pFindDialog->currentPos;
    if ( m_pFindDialog->currentWindow == 4 )
    {
-      if ( m_pFindDialog->m_pSearchInOutput->isChecked() && m_pMergeResultWindow!=0 && m_pMergeResultWindow->isVisible() &&
+      if ( m_pFindDialog->m_pSearchInOutput->isChecked() && m_pMergeResultWindow && m_pMergeResultWindow->isVisible() &&
            m_pMergeResultWindow->findString( s, d3vLine, posInLine, bDirDown, bCaseSensitive ) )
       {
          m_pMergeResultWindow->setSelection( d3vLine, posInLine, d3vLine, posInLine+s.length() );
@@ -1940,7 +1940,7 @@ void KDiff3App::slotMergeCurrentFile()
    {
       m_pDirectoryMergeWindow->mergeCurrentFile();
    }
-   else if ( m_pMainWidget != 0 && m_pMainWidget->isVisible() )
+   else if ( m_pMainWidget && m_pMainWidget->isVisible() )
    {
       if ( !canContinue() ) return;
       if ( m_outputFilename.isEmpty() )
@@ -2029,7 +2029,7 @@ void KDiff3App::slotWinFocusPrev()
 
 void KDiff3App::slotWinToggleSplitterOrientation()
 {
-   if ( m_pDiffWindowSplitter!=0 )
+   if ( m_pDiffWindowSplitter )
    {
       m_pDiffWindowSplitter->setOrientation(
             m_pDiffWindowSplitter->orientation()==TQt::Vertical ? TQt::Horizontal : TQt::Vertical
@@ -2167,7 +2167,7 @@ void KDiff3App::slotAddManualDiffHelp()
 
       insertManualDiffHelp( &m_manualDiffHelpList, winIdx, firstLine, lastLine );
 
-      init( false, 0, false ); // Init without reload
+      init( false, nullptr, false ); // Init without reload
       slotRefresh();
    }
 }
@@ -2175,7 +2175,7 @@ void KDiff3App::slotAddManualDiffHelp()
 void KDiff3App::slotClearManualDiffHelpList()
 {
    m_manualDiffHelpList.clear();
-   init( false, 0, false ); // Init without reload
+   init( false, nullptr, false ); // Init without reload
    slotRefresh();
 }
 
@@ -2190,23 +2190,23 @@ void KDiff3App::slotUpdateAvailabilities()
       else
          m_pDirectoryMergeSplitter->hide();
 
-      if ( m_pMainWidget!=0 && !m_pMainWidget->isVisible() &&
+      if ( m_pMainWidget && !m_pMainWidget->isVisible() &&
            bTextDataAvailable && !m_pDirectoryMergeWindow->isScanning()
          )
          m_pMainWidget->show();
    }
 
 
-   bool bDiffWindowVisible = m_pMainWidget != 0 && m_pMainWidget->isVisible();
-   bool bMergeEditorVisible = m_pMergeWindowFrame !=0  &&  m_pMergeWindowFrame->isVisible();
+   bool bDiffWindowVisible = m_pMainWidget != nullptr && m_pMainWidget->isVisible();
+   bool bMergeEditorVisible = m_pMergeWindowFrame !=nullptr  &&  m_pMergeWindowFrame->isVisible();
 
    m_pDirectoryMergeWindow->updateAvailabilities( m_bDirCompare, bDiffWindowVisible, chooseA, chooseB, chooseC );
 
    dirShowBoth->setEnabled( m_bDirCompare );
    dirViewToggle->setEnabled(
       m_bDirCompare &&
-      (!m_pDirectoryMergeSplitter->isVisible()  &&  m_pMainWidget!=0 && m_pMainWidget->isVisible() ||
-        m_pDirectoryMergeSplitter->isVisible()  &&  m_pMainWidget!=0 && !m_pMainWidget->isVisible() && bTextDataAvailable )
+      (!m_pDirectoryMergeSplitter->isVisible()  &&  m_pMainWidget!=nullptr && m_pMainWidget->isVisible() ||
+        m_pDirectoryMergeSplitter->isVisible()  &&  m_pMainWidget!=nullptr && !m_pMainWidget->isVisible() && bTextDataAvailable )
       );
 
    bool bDirWindowHasFocus = m_pDirectoryMergeSplitter->isVisible() && m_pDirectoryMergeWindow->hasFocus();
@@ -2258,11 +2258,11 @@ void KDiff3App::slotUpdateAvailabilities()
    overviewModeAB->setEnabled( m_bTripleDiff && bDiffWindowVisible );
    overviewModeAC->setEnabled( m_bTripleDiff && bDiffWindowVisible );
    overviewModeBC->setEnabled( m_bTripleDiff && bDiffWindowVisible );
-   Overview::e_OverviewMode overviewMode = m_pOverview==0 ? Overview::eOMNormal : m_pOverview->getOverviewMode();
+   Overview::e_OverviewMode overviewMode = m_pOverview==nullptr ? Overview::eOMNormal : m_pOverview->getOverviewMode();
    overviewModeNormal->setChecked( overviewMode == Overview::eOMNormal );
    overviewModeAB->setChecked( overviewMode == Overview::eOMAvsB );
    overviewModeAC->setChecked( overviewMode == Overview::eOMAvsC );
    overviewModeBC->setChecked( overviewMode == Overview::eOMBvsC );
 
-   winToggleSplitOrientation->setEnabled( bDiffWindowVisible && m_pDiffWindowSplitter!=0 );
+   winToggleSplitOrientation->setEnabled( bDiffWindowVisible && m_pDiffWindowSplitter!=nullptr );
 }
diff --git a/src/smalldialogs.cpp b/src/smalldialogs.cpp
index 1fc361a..9a8ff0f 100644
--- a/src/smalldialogs.cpp
+++ b/src/smalldialogs.cpp
@@ -217,8 +217,8 @@ void OpenDialog::selectURL( TQComboBox* pLine, bool bDir, int i, bool bSave )
    if (current.isEmpty()        ){  current = m_pLineB->currentText(); }
    if (current.isEmpty()        ){  current = m_pLineA->currentText(); }
    KURL newURL = bDir ? KFileDialog::getExistingURL( current, this)
-                      : bSave ? KFileDialog::getSaveURL( current, 0, this)
-                              : KFileDialog::getOpenURL( current, 0, this);
+                      : bSave ? KFileDialog::getSaveURL( current, nullptr, this)
+                              : KFileDialog::getOpenURL( current, nullptr, this);
    if ( !newURL.isEmpty() )
    {
       pLine->setEditText( newURL.url() );
@@ -308,8 +308,8 @@ void OpenDialog::accept()
 
 void OpenDialog::slotSwapCopyNames( int id ) // id selected in the popup menu
 {
-   TQComboBox* cb1=0;
-   TQComboBox* cb2=0;
+   TQComboBox* cb1=nullptr;
+   TQComboBox* cb2=nullptr;
    switch(id)
    {
    case 0:  cb1=m_pLineA; cb2=m_pLineB; break;
-- 
cgit v1.2.3

