summaryrefslogtreecommitdiffstats
path: root/src/directorymergewindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/directorymergewindow.cpp')
-rw-r--r--src/directorymergewindow.cpp750
1 files changed, 373 insertions, 377 deletions
diff --git a/src/directorymergewindow.cpp b/src/directorymergewindow.cpp
index 48d7904..bf58078 100644
--- a/src/directorymergewindow.cpp
+++ b/src/directorymergewindow.cpp
@@ -20,20 +20,20 @@
#include <vector>
#include <map>
-#include <qdir.h>
-#include <qapplication.h>
-#include <qpixmap.h>
-#include <qimage.h>
+#include <tqdir.h>
+#include <tqapplication.h>
+#include <tqpixmap.h>
+#include <tqimage.h>
#include <kpopupmenu.h>
#include <kaction.h>
-#include <qregexp.h>
-#include <qmessagebox.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qtable.h>
-#include <qsplitter.h>
-#include <qtextedit.h>
-#include <qprogressdialog.h>
+#include <tqregexp.h>
+#include <tqmessagebox.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqtable.h>
+#include <tqsplitter.h>
+#include <tqtextedit.h>
+#include <tqprogressdialog.h>
#include <kmessagebox.h>
#include <kfiledialog.h>
#include <kiconloader.h>
@@ -44,43 +44,43 @@
static bool conflictingFileTypes(MergeFileInfos& mfi);
/*
-class StatusInfo : public QListView
+class StatusInfo : public TQListView
{
public:
- StatusInfo(QWidget* pParent) : QListView( pParent, "StatusInfo", Qt::WShowModal )
+ StatusInfo(TQWidget* pParent) : TQListView( pParent, "StatusInfo", TQt::WShowModal )
{
addColumn("");
setSorting(-1); //disable sorting
}
- QListViewItem* m_pLast;
- QListViewItem* last()
+ TQListViewItem* m_pLast;
+ TQListViewItem* last()
{
if (firstChild()==0) return 0;
else return m_pLast;
}
- void addText(const QString& s )
+ void addText(const TQString& s )
{
- if (firstChild()==0) m_pLast = new QListViewItem( this, s );
- else m_pLast = new QListViewItem( this, last(), s );
+ if (firstChild()==0) m_pLast = new TQListViewItem( this, s );
+ else m_pLast = new TQListViewItem( this, last(), s );
}
};
*/
-class StatusInfo : public QTextEdit
+class StatusInfo : public TQTextEdit
{
public:
- StatusInfo(QWidget* pParent) : QTextEdit( pParent, "StatusInfo" )
+ StatusInfo(TQWidget* pParent) : TQTextEdit( pParent, "StatusInfo" )
{
- setWFlags(Qt::WShowModal);
- setWordWrap(QTextEdit::NoWrap);
+ setWFlags(TQt::WShowModal);
+ setWordWrap(TQTextEdit::NoWrap);
setReadOnly(true);
//showMaximized();
}
bool isEmpty(){ return text().isEmpty(); }
- void addText(const QString& s )
+ void addText(const TQString& s )
{
append(s);
}
@@ -88,7 +88,7 @@ public:
void show()
{
scrollToBottom();
- QTextEdit::show();
+ TQTextEdit::show();
}
};
@@ -96,16 +96,16 @@ public:
class TempRemover
{
public:
- TempRemover( const QString& origName, FileAccess& fa );
+ TempRemover( const TQString& origName, FileAccess& fa );
~TempRemover();
- QString name() { return m_name; }
+ TQString name() { return m_name; }
bool success() { return m_bSuccess; }
private:
- QString m_name;
+ TQString m_name;
bool m_bTemp;
bool m_bSuccess;
};
-TempRemover::TempRemover(const QString& origName, FileAccess& fa)
+TempRemover::TempRemover(const TQString& origName, FileAccess& fa)
{
if ( fa.isLocal() )
{
@@ -128,7 +128,7 @@ TempRemover::~TempRemover()
void DirectoryMergeWindow::fastFileComparison(
FileAccess& fi1, FileAccess& fi2,
- bool& bEqual, bool& bError, QString& status )
+ bool& bEqual, bool& bError, TQString& status )
{
ProgressProxy pp;
status = "";
@@ -182,42 +182,46 @@ void DirectoryMergeWindow::fastFileComparison(
}
}
- QString fileName1 = fi1.absFilePath();
- QString fileName2 = fi2.absFilePath();
+ TQString fileName1 = fi1.absFilePath();
+ TQString fileName2 = fi2.absFilePath();
TempRemover tr1( fileName1, fi1 );
if ( !tr1.success() )
{
- status = i18n("Creating temp copy of %1 failed.").arg(fileName1);
+ status = i18n("Creating temp copy of %1 failed.").tqarg(fileName1);
return;
}
TempRemover tr2( fileName2, fi2 );
if ( !tr2.success() )
{
- status = i18n("Creating temp copy of %1 failed.").arg(fileName2);
+ status = i18n("Creating temp copy of %1 failed.").tqarg(fileName2);
return;
}
std::vector<char> buf1(100000);
std::vector<char> buf2(buf1.size());
- QFile file1( tr1.name() );
+ TQFile file1( tr1.name() );
if ( ! file1.open(IO_ReadOnly) )
{
- status = i18n("Opening %1 failed.").arg(fileName1);
+ status = i18n("Opening %1 failed.").tqarg(fileName1);
return;
}
- QFile file2( tr2.name() );
+ TQFile file2( tr2.name() );
if ( ! file2.open(IO_ReadOnly) )
{
- status = i18n("Opening %1 failed.").arg(fileName2);
+ status = i18n("Opening %1 failed.").tqarg(fileName2);
return;
}
pp.setInformation( i18n("Comparing file..."), 0, false );
- typedef QFile::Offset t_FileSize;
+#ifdef USE_QT4
+ typedef qint64 t_FileSize;
+#else // USE_QT4
+ typedef TQFile::Offset t_FileSize;
+#endif // USE_QT4
t_FileSize fullSize = file1.size();
t_FileSize sizeLeft = fullSize;
@@ -226,13 +230,13 @@ void DirectoryMergeWindow::fastFileComparison(
int len = min2( sizeLeft, (t_FileSize)buf1.size() );
if( len != file1.readBlock( &buf1[0], len ) )
{
- status = i18n("Error reading from %1").arg(fileName1);
+ status = i18n("Error reading from %1").tqarg(fileName1);
return;
}
if( len != file2.readBlock( &buf2[0], len ) )
{
- status = i18n("Error reading from %1").arg(fileName2);
+ status = i18n("Error reading from %1").tqarg(fileName2);
return;
}
@@ -264,16 +268,16 @@ static int s_UnsolvedCol = 6; // Nr of unsolved conflicts (for 3 input files)
static int s_SolvedCol = 7; // Nr of auto-solvable conflicts (for 3 input files)
static int s_NonWhiteCol = 8; // Nr of nonwhite deltas (for 2 input files)
static int s_WhiteCol = 9; // Nr of white deltas (for 2 input files)
-DirectoryMergeWindow::DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader )
- : QListView( pParent )
-{
- connect( this, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(onDoubleClick(QListViewItem*)));
- connect( this, SIGNAL(returnPressed(QListViewItem*)), this, SLOT(onDoubleClick(QListViewItem*)));
- connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&, int)),
- this, SLOT( onClick(int,QListViewItem*,const QPoint&, int)) );
- connect( this, SIGNAL(contextMenuRequested(QListViewItem*,const QPoint &,int)),
- this, SLOT( slotShowContextMenu(QListViewItem*,const QPoint &,int)));
- connect( this, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(onSelectionChanged(QListViewItem*)));
+DirectoryMergeWindow::DirectoryMergeWindow( TQWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader )
+ : TQListView( pParent )
+{
+ connect( TQT_TQOBJECT(this), TQT_SIGNAL(doubleClicked(TQListViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(onDoubleClick(TQListViewItem*)));
+ connect( TQT_TQOBJECT(this), TQT_SIGNAL(returnPressed(TQListViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(onDoubleClick(TQListViewItem*)));
+ connect( TQT_TQOBJECT(this), TQT_SIGNAL( mouseButtonPressed(int,TQListViewItem*,const TQPoint&, int)),
+ TQT_TQOBJECT(this), TQT_SLOT( onClick(int,TQListViewItem*,const TQPoint&, int)) );
+ connect( TQT_TQOBJECT(this), TQT_SIGNAL(contextMenuRequested(TQListViewItem*,const TQPoint &,int)),
+ TQT_TQOBJECT(this), TQT_SLOT( slotShowContextMenu(TQListViewItem*,const TQPoint &,int)));
+ connect( TQT_TQOBJECT(this), TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(onSelectionChanged(TQListViewItem*)));
m_pOptions = pOptions;
m_pIconLoader = pIconLoader;
m_pDirectoryMergeInfo = 0;
@@ -295,16 +299,16 @@ DirectoryMergeWindow::DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOpt
addColumn("B");
addColumn("C");
addColumn(i18n("Operation"));
- addColumn(i18n("Status"));
+ addColumn(i18n("tqStatus"));
addColumn(i18n("Unsolved"));
addColumn(i18n("Solved"));
addColumn(i18n("Nonwhite"));
addColumn(i18n("White"));
- setColumnAlignment( s_UnsolvedCol, Qt::AlignRight );
- setColumnAlignment( s_SolvedCol, Qt::AlignRight );
- setColumnAlignment( s_NonWhiteCol, Qt::AlignRight );
- setColumnAlignment( s_WhiteCol, Qt::AlignRight );
+ setColumnAlignment( s_UnsolvedCol, TQt::AlignRight );
+ setColumnAlignment( s_SolvedCol, TQt::AlignRight );
+ setColumnAlignment( s_NonWhiteCol, TQt::AlignRight );
+ setColumnAlignment( s_WhiteCol, TQt::AlignRight );
}
DirectoryMergeWindow::~DirectoryMergeWindow()
@@ -337,53 +341,53 @@ void DirectoryMergeWindow::reload()
}
// Copy pm2 onto pm1, but preserve the alpha value from pm1 where pm2 is transparent.
-static QPixmap pixCombiner( const QPixmap* pm1, const QPixmap* pm2 )
+static TQPixmap pixCombiner( const TQPixmap* pm1, const TQPixmap* pm2 )
{
- QImage img1 = pm1->convertToImage().convertDepth(32);
- QImage img2 = pm2->convertToImage().convertDepth(32);
+ TQImage img1 = pm1->convertToImage().convertDepth(32);
+ TQImage img2 = pm2->convertToImage().convertDepth(32);
for (int y = 0; y < img1.height(); y++)
{
- Q_UINT32 *line1 = reinterpret_cast<Q_UINT32 *>(img1.scanLine(y));
- Q_UINT32 *line2 = reinterpret_cast<Q_UINT32 *>(img2.scanLine(y));
+ TQ_UINT32 *line1 = reinterpret_cast<TQ_UINT32 *>(img1.scanLine(y));
+ TQ_UINT32 *line2 = reinterpret_cast<TQ_UINT32 *>(img2.scanLine(y));
for (int x = 0; x < img1.width(); x++)
{
- if ( qAlpha( line2[x] ) >0 )
+ if ( tqAlpha( line2[x] ) >0 )
line1[x] = (line2[x] | 0xff000000);
}
}
- QPixmap pix;
+ TQPixmap pix;
pix.convertFromImage(img1);
return pix;
}
// like pixCombiner but let the pm1 color shine through
-static QPixmap pixCombiner2( const QPixmap* pm1, const QPixmap* pm2 )
+static TQPixmap pixCombiner2( const TQPixmap* pm1, const TQPixmap* pm2 )
{
- QImage img1 = pm1->convertToImage().convertDepth(32);
- QImage img2 = pm2->convertToImage().convertDepth(32);
+ TQImage img1 = pm1->convertToImage().convertDepth(32);
+ TQImage img2 = pm2->convertToImage().convertDepth(32);
for (int y = 0; y < img1.height(); y++)
{
- Q_UINT32 *line1 = reinterpret_cast<Q_UINT32 *>(img1.scanLine(y));
- Q_UINT32 *line2 = reinterpret_cast<Q_UINT32 *>(img2.scanLine(y));
+ TQ_UINT32 *line1 = reinterpret_cast<TQ_UINT32 *>(img1.scanLine(y));
+ TQ_UINT32 *line2 = reinterpret_cast<TQ_UINT32 *>(img2.scanLine(y));
for (int x = 0; x < img1.width(); x++)
{
- if ( qAlpha( line2[x] ) >0 )
+ if ( tqAlpha( line2[x] ) >0 )
{
- int r = ( qRed( line1[x] ) + qRed( line2[x] ))/2;
- int g = ( qGreen( line1[x] ) + qGreen( line2[x] ))/2;
- int b = ( qBlue( line1[x] ) + qBlue( line2[x] ))/2;
- line1[x] = qRgba( r,g,b, 0xff );
+ int r = ( tqRed( line1[x] ) + tqRed( line2[x] ))/2;
+ int g = ( tqGreen( line1[x] ) + tqGreen( line2[x] ))/2;
+ int b = ( tqBlue( line1[x] ) + tqBlue( line2[x] ))/2;
+ line1[x] = tqRgba( r,g,b, 0xff );
}
}
}
- QPixmap pix;
+ TQPixmap pix;
pix.convertFromImage(img1);
return pix;
}
-static void calcDirStatus( bool bThreeDirs, DirMergeItem* i, int& nofFiles,
+static void calcDirtqStatus( bool bThreeDirs, DirMergeItem* i, int& nofFiles,
int& nofDirs, int& nofEqualFiles, int& nofManualMerges )
{
if ( i->m_pMFI->m_bDirA || i->m_pMFI->m_bDirB || i->m_pMFI->m_bDirC )
@@ -403,11 +407,11 @@ static void calcDirStatus( bool bThreeDirs, DirMergeItem* i, int& nofFiles,
++nofManualMerges;
}
}
- for( QListViewItem* p = i->firstChild(); p!=0; p = p->nextSibling() )
- calcDirStatus( bThreeDirs, static_cast<DirMergeItem*>(p), nofFiles, nofDirs, nofEqualFiles, nofManualMerges );
+ for( TQListViewItem* p = i->firstChild(); p!=0; p = p->nextSibling() )
+ calcDirtqStatus( bThreeDirs, static_cast<DirMergeItem*>(p), nofFiles, nofDirs, nofEqualFiles, nofManualMerges );
}
-static QString sortString(const QString& s, bool bCaseSensitive)
+static TQString sortString(const TQString& s, bool bCaseSensitive)
{
if (bCaseSensitive)
return s;
@@ -419,7 +423,7 @@ struct t_ItemInfo
{
bool bExpanded;
bool bOperationComplete;
- QString status;
+ TQString status;
e_MergeOperation eMergeOperation;
};
@@ -446,12 +450,12 @@ bool DirectoryMergeWindow::init
show();
- std::map<QString,t_ItemInfo> expandedDirsMap;
+ std::map<TQString,t_ItemInfo> expandedDirsMap;
if ( bReload )
{
// Remember expandes items
- QListViewItemIterator it( this );
+ TQListViewItemIterator it( this );
while ( it.current() )
{
DirMergeItem* pDMI = static_cast<DirMergeItem*>( it.current() );
@@ -500,16 +504,16 @@ bool DirectoryMergeWindow::init
if ( !m_dirA.isDir() || !m_dirB.isDir() ||
(m_dirC.isValid() && !m_dirC.isDir()) )
{
- QString text( i18n("Opening of directories failed:") );
+ TQString text( i18n("Opening of directories failed:") );
text += "\n\n";
if ( !dirA.isDir() )
- { text += i18n("Dir A \"%1\" does not exist or is not a directory.\n").arg(m_dirA.prettyAbsPath()); }
+ { text += i18n("Dir A \"%1\" does not exist or is not a directory.\n").tqarg(m_dirA.prettyAbsPath()); }
if ( !dirB.isDir() )
- { text += i18n("Dir B \"%1\" does not exist or is not a directory.\n").arg(m_dirB.prettyAbsPath()); }
+ { text += i18n("Dir B \"%1\" does not exist or is not a directory.\n").tqarg(m_dirB.prettyAbsPath()); }
if ( m_dirC.isValid() && !m_dirC.isDir() )
- { text += i18n("Dir C \"%1\" does not exist or is not a directory.\n").arg(m_dirC.prettyAbsPath()); }
+ { text += i18n("Dir C \"%1\" does not exist or is not a directory.\n").tqarg(m_dirC.prettyAbsPath()); }
KMessageBox::sorry( this, text, i18n("Directory Open Error") );
return false;
@@ -535,7 +539,7 @@ bool DirectoryMergeWindow::init
else
m_dirDestInternal = m_dirC.isValid() ? m_dirC : m_dirB;
- QString origCurrentDirectory = QDir::currentDirPath();
+ TQString origCurrentDirectory = TQDir::currentDirPath();
m_fileMergeMap.clear();
t_DirectoryList::iterator i;
@@ -544,10 +548,10 @@ bool DirectoryMergeWindow::init
double nofScans = ( m_dirA.isValid() ? 1 : 0 )+( m_dirB.isValid() ? 1 : 0 )+( m_dirC.isValid() ? 1 : 0 );
int currentScan = 0;
- setColumnWidthMode(s_UnsolvedCol, QListView::Manual);
- setColumnWidthMode(s_SolvedCol, QListView::Manual);
- setColumnWidthMode(s_WhiteCol, QListView::Manual);
- setColumnWidthMode(s_NonWhiteCol, QListView::Manual);
+ setColumnWidthMode(s_UnsolvedCol, TQListView::Manual);
+ setColumnWidthMode(s_SolvedCol, TQListView::Manual);
+ setColumnWidthMode(s_WhiteCol, TQListView::Manual);
+ setColumnWidthMode(s_NonWhiteCol, TQListView::Manual);
if ( !m_pOptions->m_bDmFullAnalysis )
{
setColumnWidth( s_WhiteCol, 0 );
@@ -645,7 +649,7 @@ bool DirectoryMergeWindow::init
bool bContinue = true;
if ( !bListDirSuccessA || !bListDirSuccessB || !bListDirSuccessC )
{
- QString s = i18n("Some subdirectories were not readable in");
+ TQString s = i18n("Some subdirectories were not readable in");
if ( !bListDirSuccessA ) s += "\nA: " + m_dirA.prettyAbsPath();
if ( !bListDirSuccessB ) s += "\nB: " + m_dirB.prettyAbsPath();
if ( !bListDirSuccessC ) s += "\nC: " + m_dirC.prettyAbsPath();
@@ -658,7 +662,7 @@ bool DirectoryMergeWindow::init
{
prepareListView(pp);
- for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() )
+ for( TQListViewItem* p = firstChild(); p!=0; p = p->nextSibling() )
{
DirMergeItem* pDMI = static_cast<DirMergeItem*>( p );
calcSuggestedOperation( *pDMI->m_pMFI, eDefaultMergeOp );
@@ -669,14 +673,14 @@ bool DirectoryMergeWindow::init
setSelected( 0, true );
}
- QDir::setCurrent(origCurrentDirectory);
+ TQDir::setCurrent(origCurrentDirectory);
// Try to improve the view a little bit.
- QWidget* pParent = parentWidget();
- QSplitter* pSplitter = static_cast<QSplitter*>(pParent);
+ TQWidget* pParent = tqparentWidget();
+ TQSplitter* pSplitter = static_cast<TQSplitter*>(pParent);
if (pSplitter!=0)
{
- QValueList<int> sizes = pSplitter->sizes();
+ TQValueList<int> sizes = pSplitter->sizes();
int total = sizes[0] + sizes[1];
sizes[0]=total*6/10;
sizes[1]=total - sizes[0];
@@ -693,18 +697,18 @@ bool DirectoryMergeWindow::init
int nofDirs=0;
int nofEqualFiles=0;
int nofManualMerges=0;
- for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() )
- calcDirStatus( m_dirC.isValid(), static_cast<DirMergeItem*>(p),
+ for( TQListViewItem* p = firstChild(); p!=0; p = p->nextSibling() )
+ calcDirtqStatus( m_dirC.isValid(), static_cast<DirMergeItem*>(p),
nofFiles, nofDirs, nofEqualFiles, nofManualMerges );
- QString s;
- s = i18n("Directory Comparison Status") + "\n\n" +
- i18n("Number of subdirectories:") +" "+ QString::number(nofDirs) + "\n"+
- i18n("Number of equal files:") +" "+ QString::number(nofEqualFiles) + "\n"+
- i18n("Number of different files:") +" "+ QString::number(nofFiles-nofEqualFiles);
+ TQString s;
+ s = i18n("Directory Comparison tqStatus") + "\n\n" +
+ i18n("Number of subdirectories:") +" "+ TQString::number(nofDirs) + "\n"+
+ i18n("Number of equal files:") +" "+ TQString::number(nofEqualFiles) + "\n"+
+ i18n("Number of different files:") +" "+ TQString::number(nofFiles-nofEqualFiles);
if ( m_dirC.isValid() )
- s += "\n" + i18n("Number of manual merges:") +" "+ QString::number(nofManualMerges);
+ s += "\n" + i18n("Number of manual merges:") +" "+ TQString::number(nofManualMerges);
KMessageBox::information( this, s );
setSelected( firstChild(), true );
}
@@ -713,11 +717,11 @@ bool DirectoryMergeWindow::init
if ( bReload )
{
// Remember expandes items
- QListViewItemIterator it( this );
+ TQListViewItemIterator it( this );
while ( it.current() )
{
DirMergeItem* pDMI = static_cast<DirMergeItem*>( it.current() );
- std::map<QString,t_ItemInfo>::iterator i = expandedDirsMap.find( pDMI->m_pMFI->m_subPath );
+ std::map<TQString,t_ItemInfo>::iterator i = expandedDirsMap.find( pDMI->m_pMFI->m_subPath );
if ( i!=expandedDirsMap.end() )
{
t_ItemInfo& ii = i->second;
@@ -749,9 +753,9 @@ void DirectoryMergeWindow::slotAutoChooseEverywhere()
void DirectoryMergeWindow::slotNoOpEverywhere(){ setAllMergeOperations(eNoOperation); }
-static void setListViewItemOpen( QListViewItem* p, bool bOpen )
+static void setListViewItemOpen( TQListViewItem* p, bool bOpen )
{
- for( QListViewItem* pChild = p->firstChild(); pChild!=0; pChild = pChild->nextSibling() )
+ for( TQListViewItem* pChild = p->firstChild(); pChild!=0; pChild = pChild->nextSibling() )
setListViewItemOpen( pChild, bOpen );
p->setOpen( bOpen );
@@ -759,17 +763,17 @@ static void setListViewItemOpen( QListViewItem* p, bool bOpen )
void DirectoryMergeWindow::slotFoldAllSubdirs()
{
- for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() )
+ for( TQListViewItem* p = firstChild(); p!=0; p = p->nextSibling() )
setListViewItemOpen( p, false );
}
void DirectoryMergeWindow::slotUnfoldAllSubdirs()
{
- for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() )
+ for( TQListViewItem* p = firstChild(); p!=0; p = p->nextSibling() )
setListViewItemOpen( p, true );
}
-static void setMergeOperation( QListViewItem* pLVI, e_MergeOperation eMergeOp )
+static void setMergeOperation( TQListViewItem* pLVI, e_MergeOperation eMergeOp )
{
if ( pLVI==0 ) return;
@@ -801,13 +805,13 @@ void DirectoryMergeWindow::slotCurrentMergeToB() { setMergeOperation(current
void DirectoryMergeWindow::slotCurrentMergeToAAndB() { setMergeOperation(currentItem(), eMergeToAB ); }
-void DirectoryMergeWindow::keyPressEvent( QKeyEvent* e )
+void DirectoryMergeWindow::keyPressEvent( TQKeyEvent* e )
{
- if ( (e->state() & Qt::ControlButton)!=0 )
+ if ( (e->state() & TQt::ControlButton)!=0 )
{
bool bThreeDirs = m_dirC.isValid();
- QListViewItem* lvi = currentItem();
+ TQListViewItem* lvi = currentItem();
DirMergeItem* pDMI = lvi==0 ? 0 : static_cast<DirMergeItem*>(lvi);
MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI;
@@ -845,14 +849,14 @@ void DirectoryMergeWindow::keyPressEvent( QKeyEvent* e )
}
}
- QListView::keyPressEvent(e);
+ TQListView::keyPressEvent(e);
}
-void DirectoryMergeWindow::focusInEvent(QFocusEvent*)
+void DirectoryMergeWindow::focusInEvent(TQFocusEvent*)
{
updateAvailabilities();
}
-void DirectoryMergeWindow::focusOutEvent(QFocusEvent*)
+void DirectoryMergeWindow::focusOutEvent(TQFocusEvent*)
{
updateAvailabilities();
}
@@ -863,7 +867,7 @@ void DirectoryMergeWindow::setAllMergeOperations( e_MergeOperation eDefaultOpera
i18n("This affects all merge operations."),
i18n("Changing All Merge Operations"),i18n("C&ontinue"), i18n("&Cancel") ) )
{
- for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() )
+ for( TQListViewItem* p = firstChild(); p!=0; p = p->nextSibling() )
{
DirMergeItem* pDMI = static_cast<DirMergeItem*>( p );
calcSuggestedOperation( *pDMI->m_pMFI, eDefaultOperation );
@@ -874,7 +878,7 @@ void DirectoryMergeWindow::setAllMergeOperations( e_MergeOperation eDefaultOpera
void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi )
{
- std::map<QDateTime,int> dateMap;
+ std::map<TQDateTime,int> dateMap;
if( mfi.m_bExistsInA )
{
@@ -907,14 +911,14 @@ void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi )
else
{
emit startDiffMerge(
- mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""),
- mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""),
- mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""),
+ mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : TQString(""),
+ mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : TQString(""),
+ mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : TQString(""),
"",
- "","","",&mfi.m_totalDiffStatus
+ "","","",&mfi.m_totalDifftqStatus
);
- int nofNonwhiteConflicts = mfi.m_totalDiffStatus.nofUnsolvedConflicts +
- mfi.m_totalDiffStatus.nofSolvedConflicts - mfi.m_totalDiffStatus.nofWhitespaceConflicts;
+ int nofNonwhiteConflicts = mfi.m_totalDifftqStatus.nofUnsolvedConflicts +
+ mfi.m_totalDifftqStatus.nofSolvedConflicts - mfi.m_totalDifftqStatus.nofWhitespaceConflicts;
if (m_pOptions->m_bDmWhiteSpaceEqual && nofNonwhiteConflicts == 0)
{
@@ -924,25 +928,25 @@ void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi )
}
else
{
- mfi.m_bEqualAB = mfi.m_totalDiffStatus.bBinaryAEqB;
- mfi.m_bEqualBC = mfi.m_totalDiffStatus.bBinaryBEqC;
- mfi.m_bEqualAC = mfi.m_totalDiffStatus.bBinaryAEqC;
+ mfi.m_bEqualAB = mfi.m_totalDifftqStatus.bBinaryAEqB;
+ mfi.m_bEqualBC = mfi.m_totalDifftqStatus.bBinaryBEqC;
+ mfi.m_bEqualAC = mfi.m_totalDifftqStatus.bBinaryAEqC;
}
}
}
else
{
bool bError;
- QString eqStatus;
+ TQString eqtqStatus;
if( mfi.m_bExistsInA && mfi.m_bExistsInB )
{
if( mfi.m_bDirA ) mfi.m_bEqualAB=true;
- else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoB, mfi.m_bEqualAB, bError, eqStatus );
+ else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoB, mfi.m_bEqualAB, bError, eqtqStatus );
}
if( mfi.m_bExistsInA && mfi.m_bExistsInC )
{
if( mfi.m_bDirA ) mfi.m_bEqualAC=true;
- else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoC, mfi.m_bEqualAC, bError, eqStatus );
+ else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoC, mfi.m_bEqualAC, bError, eqtqStatus );
}
if( mfi.m_bExistsInB && mfi.m_bExistsInC )
{
@@ -951,7 +955,7 @@ void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi )
else
{
if( mfi.m_bDirB ) mfi.m_bEqualBC=true;
- else fastFileComparison( mfi.m_fileInfoB, mfi.m_fileInfoC, mfi.m_bEqualBC, bError, eqStatus );
+ else fastFileComparison( mfi.m_fileInfoB, mfi.m_fileInfoC, mfi.m_bEqualBC, bError, eqtqStatus );
}
}
}
@@ -968,7 +972,7 @@ void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi )
// The map automatically sorts the keys.
int age = eNew;
- std::map<QDateTime,int>::reverse_iterator i;
+ std::map<TQDateTime,int>::reverse_iterator i;
for( i=dateMap.rbegin(); i!=dateMap.rend(); ++i )
{
int n = i->second;
@@ -1018,68 +1022,68 @@ void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi )
}
}
-static QPixmap* s_pm_dir;
-static QPixmap* s_pm_file;
+static TQPixmap* s_pm_dir;
+static TQPixmap* s_pm_file;
-static QPixmap* pmNotThere;
-static QPixmap* pmNew;
-static QPixmap* pmOld;
-static QPixmap* pmMiddle;
+static TQPixmap* pmNotThere;
+static TQPixmap* pmNew;
+static TQPixmap* pmOld;
+static TQPixmap* pmMiddle;
-static QPixmap* pmLink;
+static TQPixmap* pmLink;
-static QPixmap* pmDirLink;
-static QPixmap* pmFileLink;
+static TQPixmap* pmDirLink;
+static TQPixmap* pmFileLink;
-static QPixmap* pmNewLink;
-static QPixmap* pmOldLink;
-static QPixmap* pmMiddleLink;
+static TQPixmap* pmNewLink;
+static TQPixmap* pmOldLink;
+static TQPixmap* pmMiddleLink;
-static QPixmap* pmNewDir;
-static QPixmap* pmMiddleDir;
-static QPixmap* pmOldDir;
+static TQPixmap* pmNewDir;
+static TQPixmap* pmMiddleDir;
+static TQPixmap* pmOldDir;
-static QPixmap* pmNewDirLink;
-static QPixmap* pmMiddleDirLink;
-static QPixmap* pmOldDirLink;
+static TQPixmap* pmNewDirLink;
+static TQPixmap* pmMiddleDirLink;
+static TQPixmap* pmOldDirLink;
-static QPixmap colorToPixmap(QColor c)
+static TQPixmap colorToPixmap(TQColor c)
{
- QPixmap pm(16,16);
- QPainter p(&pm);
- p.setPen( Qt::black );
+ TQPixmap pm(16,16);
+ TQPainter p(&pm);
+ p.setPen( TQt::black );
p.setBrush( c );
p.drawRect(0,0,pm.width(),pm.height());
return pm;
}
-static void initPixmaps( QColor newest, QColor oldest, QColor middle, QColor notThere )
+static void initPixmaps( TQColor newest, TQColor oldest, TQColor middle, TQColor notThere )
{
if (pmNew==0)
{
- pmNotThere = new QPixmap;
- pmNew = new QPixmap;
- pmOld = new QPixmap;
- pmMiddle = new QPixmap;
+ pmNotThere = new TQPixmap;
+ pmNew = new TQPixmap;
+ pmOld = new TQPixmap;
+ pmMiddle = new TQPixmap;
#include "xpm/link_arrow.xpm"
- pmLink = new QPixmap(link_arrow);
+ pmLink = new TQPixmap(link_arrow);
- pmDirLink = new QPixmap;
- pmFileLink = new QPixmap;
+ pmDirLink = new TQPixmap;
+ pmFileLink = new TQPixmap;
- pmNewLink = new QPixmap;
- pmOldLink = new QPixmap;
- pmMiddleLink = new QPixmap;
+ pmNewLink = new TQPixmap;
+ pmOldLink = new TQPixmap;
+ pmMiddleLink = new TQPixmap;
- pmNewDir = new QPixmap;
- pmMiddleDir = new QPixmap;
- pmOldDir = new QPixmap;
+ pmNewDir = new TQPixmap;
+ pmMiddleDir = new TQPixmap;
+ pmOldDir = new TQPixmap;
- pmNewDirLink = new QPixmap;
- pmMiddleDirLink = new QPixmap;
- pmOldDirLink = new QPixmap;
+ pmNewDirLink = new TQPixmap;
+ pmMiddleDirLink = new TQPixmap;
+ pmOldDirLink = new TQPixmap;
}
@@ -1105,14 +1109,14 @@ static void initPixmaps( QColor newest, QColor oldest, QColor middle, QColor not
}
-static void setOnePixmap( QListViewItem* pLVI, int col, e_Age eAge, bool bLink, bool bDir )
+static void setOnePixmap( TQListViewItem* pLVI, int col, e_Age eAge, bool bLink, bool bDir )
{
- static QPixmap* ageToPm[]= { pmNew, pmMiddle, pmOld, pmNotThere, s_pm_file };
- static QPixmap* ageToPmLink[]= { pmNewLink, pmMiddleLink, pmOldLink, pmNotThere, pmFileLink };
- static QPixmap* ageToPmDir[]= { pmNewDir, pmMiddleDir, pmOldDir, pmNotThere, s_pm_dir };
- static QPixmap* ageToPmDirLink[]={ pmNewDirLink, pmMiddleDirLink, pmOldDirLink, pmNotThere, pmDirLink };
+ static TQPixmap* ageToPm[]= { pmNew, pmMiddle, pmOld, pmNotThere, s_pm_file };
+ static TQPixmap* ageToPmLink[]= { pmNewLink, pmMiddleLink, pmOldLink, pmNotThere, pmFileLink };
+ static TQPixmap* ageToPmDir[]= { pmNewDir, pmMiddleDir, pmOldDir, pmNotThere, s_pm_dir };
+ static TQPixmap* ageToPmDirLink[]={ pmNewDirLink, pmMiddleDirLink, pmOldDirLink, pmNotThere, pmDirLink };
- QPixmap** ppPm = bDir ? ( bLink ? ageToPmDirLink : ageToPmDir ):
+ TQPixmap** ppPm = bDir ? ( bLink ? ageToPmDirLink : ageToPmDir ):
( bLink ? ageToPmLink : ageToPm );
pLVI->setPixmap( col, *ppPm[eAge] );
@@ -1162,8 +1166,8 @@ static void setPixmaps( MergeFileInfos& mfi, bool bCheckC )
setOnePixmap( mfi.m_pDMI, s_CCol, mfi.m_ageC, mfi.m_bLinkC, mfi.m_bDirC );
}
-// Iterate through the complete tree. Start by specifying QListView::firstChild().
-static QListViewItem* treeIterator( QListViewItem* p, bool bVisitChildren=true, bool bFindInvisible=false )
+// Iterate through the complete tree. Start by specifying TQListView::firstChild().
+static TQListViewItem* treeIterator( TQListViewItem* p, bool bVisitChildren=true, bool bFindInvisible=false )
{
if( p!=0 )
{
@@ -1173,11 +1177,11 @@ static QListViewItem* treeIterator( QListViewItem* p, bool bVisitChildren=true,
else if ( p->nextSibling() !=0 ) p = p->nextSibling();
else
{
- p = p->parent();
+ p = p->tqparent();
while ( p!=0 )
{
if( p->nextSibling()!=0 ) { p = p->nextSibling(); break; }
- else { p = p->parent(); }
+ else { p = p->tqparent(); }
}
}
}
@@ -1193,13 +1197,13 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp )
{
#include "xpm/file.xpm"
#include "xpm/folder.xpm"
- s_pm_dir = new QPixmap( m_pIconLoader->loadIcon("folder", KIcon::Small ) );
- if (s_pm_dir->size()!=QSize(16,16))
+ s_pm_dir = new TQPixmap( m_pIconLoader->loadIcon("folder", KIcon::Small ) );
+ if (s_pm_dir->size()!=TQSize(16,16))
{
delete s_pm_dir;
- s_pm_dir = new QPixmap( folder_pm );
+ s_pm_dir = new TQPixmap( folder_pm );
}
- s_pm_file= new QPixmap( file_pm );
+ s_pm_file= new TQPixmap( file_pm );
bFirstTime=false;
}
@@ -1211,10 +1215,10 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp )
bool bCheckC = m_dirC.isValid();
- std::map<QString, MergeFileInfos>::iterator j;
+ std::map<TQString, MergeFileInfos>::iterator j;
int nrOfFiles = m_fileMergeMap.size();
int currentIdx = 1;
- QTime t;
+ TQTime t;
t.start();
for( j=m_fileMergeMap.begin(); j!=m_fileMergeMap.end(); ++j )
{
@@ -1223,13 +1227,13 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp )
mfi.m_subPath = mfi.m_fileInfoA.exists() ? mfi.m_fileInfoA.filePath() :
mfi.m_fileInfoB.exists() ? mfi.m_fileInfoB.filePath() :
mfi.m_fileInfoC.exists() ? mfi.m_fileInfoC.filePath() :
- QString("");
+ TQString("");
- // const QString& fileName = j->first;
- const QString& fileName = mfi.m_subPath;
+ // const TQString& fileName = j->first;
+ const TQString& fileName = mfi.m_subPath;
pp.setInformation(
- i18n("Processing ") + QString::number(currentIdx) +" / "+ QString::number(nrOfFiles)
+ i18n("Processing ") + TQString::number(currentIdx) +" / "+ TQString::number(nrOfFiles)
+"\n" + fileName, double(currentIdx) / nrOfFiles, false );
if ( pp.wasCancelled() ) break;
++currentIdx;
@@ -1245,9 +1249,9 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp )
// continue;
// Get dirname from fileName: Search for "/" from end:
- int pos = fileName.findRev('/');
- QString dirPart;
- QString filePart;
+ int pos = fileName.tqfindRev('/');
+ TQString dirPart;
+ TQString filePart;
if (pos==-1)
{
// Top dir
@@ -1265,12 +1269,12 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp )
}
else
{
- MergeFileInfos& dirMfi = m_fileMergeMap[sortString(dirPart, m_bCaseSensitive)]; // parent
+ MergeFileInfos& dirMfi = m_fileMergeMap[sortString(dirPart, m_bCaseSensitive)]; // tqparent
assert(dirMfi.m_pDMI!=0);
new DirMergeItem( dirMfi.m_pDMI, filePart, &mfi );
mfi.m_pParent = &dirMfi;
- if ( !bEqual ) // Set all parents to "not equal"
+ if ( !bEqual ) // Set all tqparents to "not equal"
{
MergeFileInfos* p = mfi.m_pParent;
while(p!=0)
@@ -1296,11 +1300,11 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp )
/*if ( m_pOptions->m_bDmShowOnlyDeltas )
{
// Remove all equals. (Search tree depth first)
- QListViewItem* p = firstChild();
+ TQListViewItem* p = firstChild();
while( p!=0 && firstChild() != 0 )
{
- QListViewItem* pParent = p->parent();
- QListViewItem* pNextSibling = p->nextSibling();
+ TQListViewItem* pParent = p->tqparent();
+ TQListViewItem* pNextSibling = p->nextSibling();
DirMergeItem* pDMI = static_cast<DirMergeItem*>(p);
bool bDirEqual = bCheckC ? pDMI->m_pMFI->m_bEqualAB && pDMI->m_pMFI->m_bEqualAC
@@ -1319,7 +1323,7 @@ void DirectoryMergeWindow::prepareListView( ProgressProxy& pp )
while ( p!=0 )
{
if( p->nextSibling()!=0 ) { p = p->nextSibling(); break; }
- else { p = p->parent(); }
+ else { p = p->tqparent(); }
}
}
}
@@ -1496,7 +1500,7 @@ void DirectoryMergeWindow::calcSuggestedOperation( MergeFileInfos& mfi, e_MergeO
}
}
-void DirectoryMergeWindow::onDoubleClick( QListViewItem* lvi )
+void DirectoryMergeWindow::onDoubleClick( TQListViewItem* lvi )
{
if (lvi==0) return;
@@ -1506,7 +1510,7 @@ void DirectoryMergeWindow::onDoubleClick( QListViewItem* lvi )
compareCurrentFile();
}
-void DirectoryMergeWindow::onSelectionChanged( QListViewItem* lvi )
+void DirectoryMergeWindow::onSelectionChanged( TQListViewItem* lvi )
{
if ( lvi==0 ) return;
@@ -1518,7 +1522,7 @@ void DirectoryMergeWindow::onSelectionChanged( QListViewItem* lvi )
m_pDirectoryMergeInfo->setInfo( m_dirA, m_dirB, m_dirC, m_dirDestInternal, mfi );
}
-void DirectoryMergeWindow::onClick( int button, QListViewItem* lvi, const QPoint& p, int c )
+void DirectoryMergeWindow::onClick( int button, TQListViewItem* lvi, const TQPoint& p, int c )
{
if ( lvi==0 ) return;
@@ -1573,7 +1577,7 @@ void DirectoryMergeWindow::onClick( int button, QListViewItem* lvi, const QPoint
}
else if ( c == s_ACol || c==s_BCol || c==s_CCol )
{
- QString itemPath;
+ TQString itemPath;
if ( c == s_ACol && mfi.m_bExistsInA ){ itemPath = fullNameA(mfi); }
else if ( c == s_BCol && mfi.m_bExistsInB ){ itemPath = fullNameB(mfi); }
else if ( c == s_CCol && mfi.m_bExistsInC ){ itemPath = fullNameC(mfi); }
@@ -1585,7 +1589,7 @@ void DirectoryMergeWindow::onClick( int button, QListViewItem* lvi, const QPoint
}
}
-void DirectoryMergeWindow::slotShowContextMenu(QListViewItem* lvi,const QPoint & p,int c)
+void DirectoryMergeWindow::slotShowContextMenu(TQListViewItem* lvi,const TQPoint & p,int c)
{
if ( lvi==0 ) return;
@@ -1595,7 +1599,7 @@ void DirectoryMergeWindow::slotShowContextMenu(QListViewItem* lvi,const QPoint &
assert( mfi.m_pDMI==pDMI );
if ( c == s_ACol || c==s_BCol || c==s_CCol )
{
- QString itemPath;
+ TQString itemPath;
if ( c == s_ACol && mfi.m_bExistsInA ){ itemPath = fullNameA(mfi); }
else if ( c == s_BCol && mfi.m_bExistsInB ){ itemPath = fullNameB(mfi); }
else if ( c == s_CCol && mfi.m_bExistsInC ){ itemPath = fullNameC(mfi); }
@@ -1610,14 +1614,14 @@ void DirectoryMergeWindow::slotShowContextMenu(QListViewItem* lvi,const QPoint &
#ifndef _WIN32
m.exec( p );
#else
- void showShellContextMenu( const QString&, QPoint, QWidget*, QPopupMenu* );
+ void showShellContextMenu( const TQString&, TQPoint, TQWidget*, TQPopupMenu* );
showShellContextMenu( itemPath, p, this, &m );
#endif
}
}
}
-static QString getFileName( DirMergeItem* pDMI, int column )
+static TQString getFileName( DirMergeItem* pDMI, int column )
{
if ( pDMI != 0 )
{
@@ -1625,7 +1629,7 @@ static QString getFileName( DirMergeItem* pDMI, int column )
return column == s_ACol ? mfi.m_fileInfoA.absFilePath() :
column == s_BCol ? mfi.m_fileInfoB.absFilePath() :
column == s_CCol ? mfi.m_fileInfoC.absFilePath() :
- QString("");
+ TQString("");
}
return "";
}
@@ -1690,30 +1694,26 @@ void DirectoryMergeWindow::selectItemAndColumn(DirMergeItem* pDMI, int c, bool b
m_pSelection3Item = pDMI;
m_selection3Column = c;
}
- if (pOld1) repaintItem( pOld1 );
- if (pOld2) repaintItem( pOld2 );
- if (pOld3) repaintItem( pOld3 );
- if (m_pSelection1Item) repaintItem( m_pSelection1Item );
- if (m_pSelection2Item) repaintItem( m_pSelection2Item );
- if (m_pSelection3Item) repaintItem( m_pSelection3Item );
+ if (pOld1) tqrepaintItem( pOld1 );
+ if (pOld2) tqrepaintItem( pOld2 );
+ if (pOld3) tqrepaintItem( pOld3 );
+ if (m_pSelection1Item) tqrepaintItem( m_pSelection1Item );
+ if (m_pSelection2Item) tqrepaintItem( m_pSelection2Item );
+ if (m_pSelection3Item) tqrepaintItem( m_pSelection3Item );
emit updateAvailabilities();
}
-// Since Qt 2.3.0 doesn't allow the specification of a compare operator, this trick emulates it.
-#if QT_VERSION==230
-#define DIRSORT(x) ( pMFI->m_bDirA ? " " : "" )+x
-#else
+// Since TQt 2.3.0 doesn't allow the specification of a compare operator, this trick emulates it.
#define DIRSORT(x) x
-#endif
-DirMergeItem::DirMergeItem( QListView* pParent, const QString& fileName, MergeFileInfos* pMFI )
-: QListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" )
+DirMergeItem::DirMergeItem( TQListView* pParent, const TQString& fileName, MergeFileInfos* pMFI )
+: TQListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" )
{
init(pMFI);
}
-DirMergeItem::DirMergeItem( DirMergeItem* pParent, const QString& fileName, MergeFileInfos* pMFI )
-: QListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" )
+DirMergeItem::DirMergeItem( DirMergeItem* pParent, const TQString& fileName, MergeFileInfos* pMFI )
+: TQListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" )
{
init(pMFI);
}
@@ -1723,20 +1723,20 @@ void DirMergeItem::init(MergeFileInfos* pMFI)
{
pMFI->m_pDMI = this;
m_pMFI = pMFI;
- TotalDiffStatus& tds = pMFI->m_totalDiffStatus;
+ TotalDifftqStatus& tds = pMFI->m_totalDifftqStatus;
if ( m_pMFI->m_bDirA || m_pMFI->m_bDirB || m_pMFI->m_bDirC )
{
}
else
{
- setText( s_UnsolvedCol, QString::number( tds.nofUnsolvedConflicts ) );
- setText( s_SolvedCol, QString::number( tds.nofSolvedConflicts ) );
- setText( s_NonWhiteCol, QString::number( tds.nofUnsolvedConflicts + tds.nofSolvedConflicts - tds.nofWhitespaceConflicts ) );
- setText( s_WhiteCol, QString::number( tds.nofWhitespaceConflicts ) );
+ setText( s_UnsolvedCol, TQString::number( tds.nofUnsolvedConflicts ) );
+ setText( s_SolvedCol, TQString::number( tds.nofSolvedConflicts ) );
+ setText( s_NonWhiteCol, TQString::number( tds.nofUnsolvedConflicts + tds.nofSolvedConflicts - tds.nofWhitespaceConflicts ) );
+ setText( s_WhiteCol, TQString::number( tds.nofWhitespaceConflicts ) );
}
}
-int DirMergeItem::compare(QListViewItem *i, int col, bool ascending) const
+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;
@@ -1746,17 +1746,17 @@ int DirMergeItem::compare(QListViewItem *i, int col, bool ascending) const
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;
else
- return QListViewItem::compare( i, col, ascending );
+ return TQListViewItem::compare( i, col, ascending );
}
else
return bDir1 ? -1 : 1;
}
-void DirMergeItem::paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align )
+void DirMergeItem::paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align )
{
if (column == s_ACol || column == s_BCol || column == s_CCol )
{
- const QPixmap* icon = pixmap(column);
+ const TQPixmap* icon = pixmap(column);
if ( icon )
{
int yOffset = (height() - icon->height()) / 2;
@@ -1772,13 +1772,13 @@ void DirMergeItem::paintCell(QPainter * p, const QColorGroup & cg, int column, i
if ( i!=0 )
{
OptionDialog* pOD = pDMW->m_pOptions;
- QColor c ( i==1 ? pOD->m_colorA : i==2 ? pOD->m_colorB : pOD->m_colorC );
+ TQColor c ( i==1 ? pOD->m_colorA : i==2 ? pOD->m_colorB : pOD->m_colorC );
p->setPen( c );// highlight() );
p->drawRect( 2, yOffset, icon->width(), icon->height());
- p->setPen( QPen( c, 0, Qt::DotLine) );
+ p->setPen( TQPen( c, 0, TQt::DotLine) );
p->drawRect( 1, yOffset-1, icon->width()+2, icon->height()+2);
p->setPen( cg.background() );
- QString s( QChar('A'+i-1) );
+ TQString s( TQChar('A'+i-1) );
p->drawText( 2 + (icon->width() - p->fontMetrics().width(s))/2,
yOffset + (icon->height() + p->fontMetrics().ascent())/2-1,
s );
@@ -1792,7 +1792,7 @@ void DirMergeItem::paintCell(QPainter * p, const QColorGroup & cg, int column, i
return;
}
}
- QListViewItem::paintCell(p,cg,column,width,align);
+ TQListViewItem::paintCell(p,cg,column,width,align);
}
DirMergeItem::~DirMergeItem()
@@ -1809,7 +1809,7 @@ void MergeFileInfos::setMergeOperation( e_MergeOperation eMOp, bool bRecursive )
}
m_eMergeOperation = eMOp;
- QString s;
+ TQString s;
bool bDir = m_bDirA || m_bDirB || m_bDirC;
if( m_pDMI!=0 )
{
@@ -1840,7 +1840,7 @@ void MergeFileInfos::setMergeOperation( e_MergeOperation eMOp, bool bRecursive )
{
e_MergeOperation eChildrenMergeOp = m_eMergeOperation;
if ( eChildrenMergeOp == eConflictingFileTypes ) eChildrenMergeOp = eMergeABCToDest;
- QListViewItem* p = m_pDMI->firstChild();
+ TQListViewItem* p = m_pDMI->firstChild();
while ( p!=0 )
{
DirMergeItem* pDMI = static_cast<DirMergeItem*>( p );
@@ -1869,9 +1869,9 @@ void DirectoryMergeWindow::compareCurrentFile()
if ( !(mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC) )
{
emit startDiffMerge(
- mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""),
- mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""),
- mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""),
+ mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : TQString(""),
+ mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : TQString(""),
+ mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : TQString(""),
"",
"","","",0
);
@@ -1916,9 +1916,9 @@ void DirectoryMergeWindow::slotMergeExplicitlySelectedFiles()
return;
}
- QString fn1 = getFileName( m_pSelection1Item, m_selection1Column );
- QString fn2 = getFileName( m_pSelection2Item, m_selection2Column );
- QString fn3 = getFileName( m_pSelection3Item, m_selection3Column );
+ TQString fn1 = getFileName( m_pSelection1Item, m_selection1Column );
+ TQString fn2 = getFileName( m_pSelection2Item, m_selection2Column );
+ TQString fn3 = getFileName( m_pSelection3Item, m_selection3Column );
emit startDiffMerge( fn1, fn2, fn3,
fn3.isEmpty() ? fn2 : fn3,
@@ -1943,7 +1943,7 @@ bool DirectoryMergeWindow::isFileSelected()
return false;
}
-void DirectoryMergeWindow::mergeResultSaved(const QString& fileName)
+void DirectoryMergeWindow::mergeResultSaved(const TQString& fileName)
{
DirMergeItem* pCurrentItemForOperation = (m_mergeItemList.empty() || m_currentItemForOperation==m_mergeItemList.end() )
? 0
@@ -2012,7 +2012,7 @@ bool DirectoryMergeWindow::executeMergeOperation( MergeFileInfos& mfi, bool& bSi
{
bool bCreateBackups = m_pOptions->m_bDmCreateBakFiles;
// First decide destname
- QString destName;
+ TQString destName;
switch( mfi.m_eMergeOperation )
{
case eNoOperation: break;
@@ -2057,9 +2057,9 @@ bool DirectoryMergeWindow::executeMergeOperation( MergeFileInfos& mfi, bool& bSi
destName, bSingleFileMerge );
break;
case eMergeABCToDest:bSuccess = mergeFLD(
- mfi.m_bExistsInA ? fullNameA(mfi) : QString(""),
- mfi.m_bExistsInB ? fullNameB(mfi) : QString(""),
- mfi.m_bExistsInC ? fullNameC(mfi) : QString(""),
+ mfi.m_bExistsInA ? fullNameA(mfi) : TQString(""),
+ mfi.m_bExistsInB ? fullNameB(mfi) : TQString(""),
+ mfi.m_bExistsInC ? fullNameC(mfi) : TQString(""),
destName, bSingleFileMerge );
break;
default:
@@ -2073,7 +2073,7 @@ bool DirectoryMergeWindow::executeMergeOperation( MergeFileInfos& mfi, bool& bSi
// Check if the merge can start, and prepare the m_mergeItemList which then contains all
// items that must be merged.
-void DirectoryMergeWindow::prepareMergeStart( QListViewItem* pBegin, QListViewItem* pEnd, bool bVerbose )
+void DirectoryMergeWindow::prepareMergeStart( TQListViewItem* pBegin, TQListViewItem* pEnd, bool bVerbose )
{
if ( bVerbose )
{
@@ -2097,7 +2097,7 @@ void DirectoryMergeWindow::prepareMergeStart( QListViewItem* pBegin, QListViewIt
if (pBegin == 0)
return;
- for( QListViewItem* p = pBegin; p!= pEnd; p = treeIterator( p ) )
+ for( TQListViewItem* p = pBegin; p!= pEnd; p = treeIterator( p ) )
{
DirMergeItem* pDMI = static_cast<DirMergeItem*>(p);
@@ -2137,8 +2137,8 @@ void DirectoryMergeWindow::slotRunOperationForCurrentItem()
bool bVerbose = false;
if ( m_mergeItemList.empty() )
{
- QListViewItem* pBegin = currentItem();
- QListViewItem* pEnd = treeIterator(pBegin,false,false); // find next visible sibling (no children)
+ TQListViewItem* pBegin = currentItem();
+ TQListViewItem* pEnd = treeIterator(pBegin,false,false); // find next visible sibling (no tqchildren)
prepareMergeStart( pBegin, pEnd, bVerbose );
mergeContinue(true, bVerbose);
@@ -2154,7 +2154,7 @@ void DirectoryMergeWindow::slotRunOperationForAllItems()
bool bVerbose = true;
if ( m_mergeItemList.empty() )
{
- QListViewItem* pBegin = firstChild();
+ TQListViewItem* pBegin = firstChild();
prepareMergeStart( pBegin, 0, bVerbose );
mergeContinue(true, bVerbose);
@@ -2184,9 +2184,9 @@ void DirectoryMergeWindow::mergeCurrentFile()
m_currentItemForOperation=m_mergeItemList.begin();
bool bDummy=false;
mergeFLD(
- mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""),
- mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""),
- mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""),
+ mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : TQString(""),
+ mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : TQString(""),
+ mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : TQString(""),
fullNameDest(mfi),
bDummy
);
@@ -2280,17 +2280,17 @@ void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose)
if ( ! bContinueWithCurrentItem )
{
// Depth first
- QListViewItem* pPrevItem = pCurrentItemForOperation;
+ TQListViewItem* pPrevItem = pCurrentItemForOperation;
++m_currentItemForOperation;
pCurrentItemForOperation = m_currentItemForOperation==m_mergeItemList.end() ? 0 : *m_currentItemForOperation;
- if ( (pCurrentItemForOperation==0 || pCurrentItemForOperation->parent()!=pPrevItem->parent()) && pPrevItem->parent()!=0 )
+ if ( (pCurrentItemForOperation==0 || pCurrentItemForOperation->tqparent()!=pPrevItem->tqparent()) && pPrevItem->tqparent()!=0 )
{
- // Check if the parent may be set to "Done"
- QListViewItem* pParent = pPrevItem->parent();
+ // Check if the tqparent may be set to "Done"
+ TQListViewItem* pParent = pPrevItem->tqparent();
bool bDone = true;
while ( bDone && pParent!=0 )
{
- for( QListViewItem* p = pParent->firstChild(); p!=0; p=p->nextSibling() )
+ for( TQListViewItem* p = pParent->firstChild(); p!=0; p=p->nextSibling() )
{
DirMergeItem* pDMI = static_cast<DirMergeItem*>(p);
if ( !bSim && ! pDMI->m_pMFI->m_bOperationComplete || bSim && pDMI->m_pMFI->m_bSimOpComplete )
@@ -2309,7 +2309,7 @@ void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose)
static_cast<DirMergeItem*>(pParent)->m_pMFI->m_bOperationComplete = bDone;
}
}
- pParent = pParent->parent();
+ pParent = pParent->tqparent();
}
}
}
@@ -2328,7 +2328,7 @@ void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose)
if ( m_bSimulatedMergeStarted )
{
m_bSimulatedMergeStarted = false;
- for( QListViewItem* p=firstChild(); p!=0; p=treeIterator(p) )
+ for( TQListViewItem* p=firstChild(); p!=0; p=treeIterator(p) )
{
static_cast<DirMergeItem*>(p)->m_pMFI->m_bSimOpComplete = false;
}
@@ -2394,13 +2394,13 @@ void DirectoryMergeWindow::allowResizeEvents(bool bAllowResizeEvents )
m_bAllowResizeEvents = bAllowResizeEvents;
}
-void DirectoryMergeWindow::resizeEvent( QResizeEvent* e )
+void DirectoryMergeWindow::resizeEvent( TQResizeEvent* e )
{
if (m_bAllowResizeEvents)
- QListView::resizeEvent(e);
+ TQListView::resizeEvent(e);
}
-bool DirectoryMergeWindow::deleteFLD( const QString& name, bool bCreateBackup )
+bool DirectoryMergeWindow::deleteFLD( const TQString& name, bool bCreateBackup )
{
FileAccess fi(name, true);
if ( !fi.exists() )
@@ -2411,16 +2411,16 @@ bool DirectoryMergeWindow::deleteFLD( const QString& name, bool bCreateBackup )
bool bSuccess = renameFLD( name, name+".orig" );
if (!bSuccess)
{
- m_pStatusInfo->addText( i18n("Error: While deleting %1: Creating backup failed.").arg(name) );
+ m_pStatusInfo->addText( i18n("Error: While deleting %1: Creating backup failed.").tqarg(name) );
return false;
}
}
else
{
if ( fi.isDir() && !fi.isSymLink() )
- m_pStatusInfo->addText(i18n("delete directory recursively( %1 )").arg(name));
+ m_pStatusInfo->addText(i18n("delete directory recursively( %1 )").tqarg(name));
else
- m_pStatusInfo->addText(i18n("delete( %1 )").arg(name));
+ m_pStatusInfo->addText(i18n("delete( %1 )").tqarg(name));
if ( m_bSimulatedMergeStarted )
{
@@ -2454,7 +2454,7 @@ bool DirectoryMergeWindow::deleteFLD( const QString& name, bool bCreateBackup )
bSuccess = FileAccess::removeDir( name );
if ( !bSuccess )
{
- m_pStatusInfo->addText( i18n("Error: rmdir( %1 ) operation failed.").arg(name));
+ m_pStatusInfo->addText( i18n("Error: rmdir( %1 ) operation failed.").tqarg(name));
return false;
}
}
@@ -2472,7 +2472,7 @@ bool DirectoryMergeWindow::deleteFLD( const QString& name, bool bCreateBackup )
return true;
}
-bool DirectoryMergeWindow::mergeFLD( const QString& nameA,const QString& nameB,const QString& nameC,const QString& nameDest, bool& bSingleFileMerge )
+bool DirectoryMergeWindow::mergeFLD( const TQString& nameA,const TQString& nameB,const TQString& nameC,const TQString& nameDest, bool& bSingleFileMerge )
{
FileAccess fi(nameA);
if (fi.isDir())
@@ -2481,16 +2481,16 @@ bool DirectoryMergeWindow::mergeFLD( const QString& nameA,const QString& nameB,c
}
// Make sure that the dir exists, into which we will save the file later.
- int pos=nameDest.findRev('/');
+ int pos=nameDest.tqfindRev('/');
if ( pos>0 )
{
- QString parentName = nameDest.left(pos);
- bool bSuccess = makeDir(parentName, true /*quiet*/);
+ TQString tqparentName = nameDest.left(pos);
+ bool bSuccess = makeDir(tqparentName, true /*quiet*/);
if (!bSuccess)
return false;
}
- m_pStatusInfo->addText(i18n("manual merge( %1, %2, %3 -> %4)").arg(nameA).arg(nameB).arg(nameC).arg(nameDest));
+ m_pStatusInfo->addText(i18n("manual merge( %1, %2, %3 -> %4)").tqarg(nameA).tqarg(nameB).tqarg(nameC).tqarg(nameDest));
if ( m_bSimulatedMergeStarted )
{
m_pStatusInfo->addText(i18n(" Note: After a manual merge the user should continue by pressing F7.") );
@@ -2506,7 +2506,7 @@ bool DirectoryMergeWindow::mergeFLD( const QString& nameA,const QString& nameB,c
return false;
}
-bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destName )
+bool DirectoryMergeWindow::copyFLD( const TQString& srcName, const TQString& destName )
{
if ( srcName == destName )
return true;
@@ -2517,7 +2517,7 @@ bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destN
if ( !bSuccess )
{
m_pStatusInfo->addText(i18n("Error: copy( %1 -> %2 ) failed."
- "Deleting existing destination failed.").arg(srcName).arg(destName));
+ "Deleting existing destination failed.").tqarg(srcName).tqarg(destName));
return false;
}
}
@@ -2526,7 +2526,7 @@ bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destN
if ( fi.isSymLink() && (fi.isDir() && !m_bFollowDirLinks || !fi.isDir() && !m_bFollowFileLinks) )
{
- m_pStatusInfo->addText(i18n("copyLink( %1 -> %2 )").arg(srcName).arg(destName));
+ m_pStatusInfo->addText(i18n("copyLink( %1 -> %2 )").tqarg(srcName).tqarg(destName));
#ifdef _WIN32
// What are links?
#else
@@ -2540,7 +2540,7 @@ bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destN
m_pStatusInfo->addText(i18n("Error: copyLink failed: Remote links are not yet supported."));
return false;
}
- QString linkTarget = fi.readLink();
+ TQString linkTarget = fi.readLink();
bool bSuccess = FileAccess::symLink( linkTarget, destName );
if (!bSuccess)
m_pStatusInfo->addText(i18n("Error: copyLink failed."));
@@ -2554,16 +2554,16 @@ bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destN
return bSuccess;
}
- int pos=destName.findRev('/');
+ int pos=destName.tqfindRev('/');
if ( pos>0 )
{
- QString parentName = destName.left(pos);
- bool bSuccess = makeDir(parentName, true /*quiet*/);
+ TQString tqparentName = destName.left(pos);
+ bool bSuccess = makeDir(tqparentName, true /*quiet*/);
if (!bSuccess)
return false;
}
- m_pStatusInfo->addText(i18n("copy( %1 -> %2 )").arg(srcName).arg(destName));
+ m_pStatusInfo->addText(i18n("copy( %1 -> %2 )").tqarg(srcName).tqarg(destName));
if ( m_bSimulatedMergeStarted )
{
@@ -2579,7 +2579,7 @@ bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destN
// Rename is not an operation that can be selected by the user.
// It will only be used to create backups.
// Hence it will delete an existing destination without making a backup (of the old backup.)
-bool DirectoryMergeWindow::renameFLD( const QString& srcName, const QString& destName )
+bool DirectoryMergeWindow::renameFLD( const TQString& srcName, const TQString& destName )
{
if ( srcName == destName )
return true;
@@ -2590,12 +2590,12 @@ bool DirectoryMergeWindow::renameFLD( const QString& srcName, const QString& des
if (!bSuccess)
{
m_pStatusInfo->addText( i18n("Error during rename( %1 -> %2 ): "
- "Cannot delete existing destination." ).arg(srcName).arg(destName));
+ "Cannot delete existing destination." ).tqarg(srcName).tqarg(destName));
return false;
}
}
- m_pStatusInfo->addText(i18n("rename( %1 -> %2 )").arg(srcName).arg(destName));
+ m_pStatusInfo->addText(i18n("rename( %1 -> %2 )").tqarg(srcName).tqarg(destName));
if ( m_bSimulatedMergeStarted )
{
return true;
@@ -2611,7 +2611,7 @@ bool DirectoryMergeWindow::renameFLD( const QString& srcName, const QString& des
return true;
}
-bool DirectoryMergeWindow::makeDir( const QString& name, bool bQuiet )
+bool DirectoryMergeWindow::makeDir( const TQString& name, bool bQuiet )
{
FileAccess fi(name, true);
if( fi.exists() && fi.isDir() )
@@ -2623,22 +2623,22 @@ bool DirectoryMergeWindow::makeDir( const QString& name, bool bQuiet )
if (!bSuccess)
{
m_pStatusInfo->addText( i18n("Error during makeDir of %1. "
- "Cannot delete existing file." ).arg(name));
+ "Cannot delete existing file." ).tqarg(name));
return false;
}
}
- int pos=name.findRev('/');
+ int pos=name.tqfindRev('/');
if ( pos>0 )
{
- QString parentName = name.left(pos);
- bool bSuccess = makeDir(parentName,true);
+ TQString tqparentName = name.left(pos);
+ bool bSuccess = makeDir(tqparentName,true);
if (!bSuccess)
return false;
}
if ( ! bQuiet )
- m_pStatusInfo->addText(i18n("makeDir( %1 )").arg(name));
+ m_pStatusInfo->addText(i18n("makeDir( %1 )").tqarg(name));
if ( m_bSimulatedMergeStarted )
{
@@ -2655,26 +2655,26 @@ bool DirectoryMergeWindow::makeDir( const QString& name, bool bQuiet )
}
-DirectoryMergeInfo::DirectoryMergeInfo( QWidget* pParent )
-: QFrame(pParent)
+DirectoryMergeInfo::DirectoryMergeInfo( TQWidget* pParent )
+: TQFrame(pParent)
{
- QVBoxLayout *topLayout = new QVBoxLayout( this );
+ TQVBoxLayout *topLayout = new TQVBoxLayout( this );
- QGridLayout *grid = new QGridLayout( topLayout );
+ TQGridLayout *grid = new TQGridLayout( topLayout );
grid->setColStretch(1,10);
int line=0;
- m_pA = new QLabel("A",this); grid->addWidget( m_pA,line, 0 );
- m_pInfoA = new QLabel(this); grid->addWidget( m_pInfoA,line,1 ); ++line;
- m_pB = new QLabel("B",this); grid->addWidget( m_pB,line, 0 );
- m_pInfoB = new QLabel(this); grid->addWidget( m_pInfoB,line,1 ); ++line;
- m_pC = new QLabel("C",this); grid->addWidget( m_pC,line, 0 );
- m_pInfoC = new QLabel(this); grid->addWidget( m_pInfoC,line,1 ); ++line;
- m_pDest = new QLabel(i18n("Dest"),this); grid->addWidget( m_pDest,line, 0 );
- m_pInfoDest = new QLabel(this); grid->addWidget( m_pInfoDest,line,1 ); ++line;
+ m_pA = new TQLabel("A",this); grid->addWidget( m_pA,line, 0 );
+ m_pInfoA = new TQLabel(this); grid->addWidget( m_pInfoA,line,1 ); ++line;
+ m_pB = new TQLabel("B",this); grid->addWidget( m_pB,line, 0 );
+ m_pInfoB = new TQLabel(this); grid->addWidget( m_pInfoB,line,1 ); ++line;
+ m_pC = new TQLabel("C",this); grid->addWidget( m_pC,line, 0 );
+ m_pInfoC = new TQLabel(this); grid->addWidget( m_pInfoC,line,1 ); ++line;
+ m_pDest = new TQLabel(i18n("Dest"),this); grid->addWidget( m_pDest,line, 0 );
+ m_pInfoDest = new TQLabel(this); grid->addWidget( m_pInfoDest,line,1 ); ++line;
- m_pInfoList = new QListView(this); topLayout->addWidget( m_pInfoList );
+ m_pInfoList = new TQListView(this); topLayout->addWidget( m_pInfoList );
m_pInfoList->addColumn(i18n("Dir"));
m_pInfoList->addColumn(i18n("Type"));
m_pInfoList->addColumn(i18n("Size"));
@@ -2686,15 +2686,15 @@ DirectoryMergeInfo::DirectoryMergeInfo( QWidget* pParent )
m_pInfoList->installEventFilter(this);
}
-bool DirectoryMergeInfo::eventFilter(QObject*o, QEvent* e)
+bool DirectoryMergeInfo::eventFilter(TQObject*o, TQEvent* e)
{
- if ( e->type()==QEvent::FocusIn && o==m_pInfoList )
+ if ( e->type()==TQEvent::FocusIn && TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(m_pInfoList) )
emit gotFocus();
return false;
}
-static void addListViewItem( QListView* pListView, const QString& dir,
- const QString& basePath, FileAccess& fi )
+static void addListViewItem( TQListView* pListView, const TQString& dir,
+ const TQString& basePath, FileAccess& fi )
{
if ( basePath.isEmpty() )
{
@@ -2704,30 +2704,26 @@ static void addListViewItem( QListView* pListView, const QString& dir,
{
if ( fi.exists() )
{
-#if QT_VERSION==230
- QString dateString = fi.lastModified().toString();
-#else
- QString dateString = fi.lastModified().toString("yyyy-MM-dd hh:mm:ss");
-#endif
+ TQString dateString = fi.lastModified().toString("yyyy-MM-dd hh:mm:ss");
- new QListViewItem(
+ new TQListViewItem(
pListView,
dir,
- QString( fi.isDir() ? i18n("Dir") : i18n("File") ) + (fi.isSymLink() ? "-Link" : ""),
- QString::number(fi.size()),
- QString(fi.isReadable() ? "r" : " ") + (fi.isWritable()?"w" : " ")
+ TQString( fi.isDir() ? i18n("Dir") : i18n("File") ) + (fi.isSymLink() ? "-Link" : ""),
+ TQString::number(fi.size()),
+ TQString(fi.isReadable() ? "r" : " ") + (fi.isWritable()?"w" : " ")
#ifdef _WIN32
/*Future: Use GetFileAttributes()*/,
#else
+ (fi.isExecutable()?"x" : " "),
#endif
dateString,
- QString(fi.isSymLink() ? (" -> " + fi.readLink()) : QString(""))
+ TQString(fi.isSymLink() ? (" -> " + fi.readLink()) : TQString(""))
);
}
else
{
- new QListViewItem(
+ new TQListViewItem(
pListView,
dir,
i18n("not available"),
@@ -2753,7 +2749,7 @@ void DirectoryMergeInfo::setInfo(
m_pA->setText( i18n("A (Dest): ") ); bHideDest=true;
}
else
- m_pA->setText( !dirC.isValid() ? QString("A: ") : i18n("A (Base): "));
+ m_pA->setText( !dirC.isValid() ? TQString("A: ") : i18n("A (Base): "));
m_pInfoA->setText( dirA.prettyAbsPath() );
@@ -2792,7 +2788,7 @@ void DirectoryMergeInfo::setInfo(
}
}
-QTextStream& operator<<( QTextStream& ts, MergeFileInfos& mfi )
+TQTextStream& operator<<( TQTextStream& ts, MergeFileInfos& mfi )
{
ts << "{\n";
ValueMap vm;
@@ -2824,7 +2820,7 @@ QTextStream& operator<<( QTextStream& ts, MergeFileInfos& mfi )
//FileAccess m_fileInfoB;
//FileAccess m_fileInfoC;
- //TotalDiffStatus m_totalDiffStatus;
+ //TotalDifftqStatus m_totalDifftqStatus;
vm.save(ts);
@@ -2837,20 +2833,20 @@ void DirectoryMergeWindow::slotSaveMergeState()
{
//slotStatusMsg(i18n("Saving Directory Merge State ..."));
- //QString s = KFileDialog::getSaveURL( QDir::currentDirPath(), 0, this, i18n("Save As...") ).url();
- QString s = KFileDialog::getSaveFileName( QDir::currentDirPath(), 0, this, i18n("Save Directory Merge State As...") );
+ //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...") );
if(!s.isEmpty())
{
m_dirMergeStateFilename = s;
- QFile file(m_dirMergeStateFilename);
+ TQFile file(m_dirMergeStateFilename);
bool bSuccess = file.open( IO_WriteOnly );
if ( bSuccess )
{
- QTextStream ts( &file );
+ TQTextStream ts( &file );
- QListViewItemIterator it( this );
+ TQListViewItemIterator it( this );
while ( it.current() ) {
DirMergeItem* item = static_cast<DirMergeItem*>(it.current());
MergeFileInfos* pMFI = item->m_pMFI;
@@ -2880,7 +2876,7 @@ void DirectoryMergeWindow::updateFileVisibilities()
m_pSelection2Item = 0;
m_pSelection3Item = 0;
- QListViewItem* p = firstChild();
+ TQListViewItem* p = firstChild();
while(p)
{
DirMergeItem* pDMI = static_cast<DirMergeItem*>(p);
@@ -2895,7 +2891,7 @@ void DirectoryMergeWindow::updateFileVisibilities()
|| ( bShowOnlyInB && !pMFI->m_bExistsInA && pMFI->m_bExistsInB && !pMFI->m_bExistsInC )
|| ( bShowOnlyInC && !pMFI->m_bExistsInA && !pMFI->m_bExistsInB && pMFI->m_bExistsInC );
- QString fileName = pMFI->m_subPath.section( '/', -1 );
+ TQString fileName = pMFI->m_subPath.section( '/', -1 );
bVisible = bVisible && (
bDir && ! wildcardMultiMatch( m_pOptions->m_DmDirAntiPattern, fileName, m_bCaseSensitive )
|| wildcardMultiMatch( m_pOptions->m_DmFilePattern, fileName, m_bCaseSensitive )
@@ -2916,7 +2912,7 @@ void DirectoryMergeWindow::slotShowFilesOnlyInC() { updateFileVisibilities();
void DirectoryMergeWindow::slotSynchronizeDirectories() { }
void DirectoryMergeWindow::slotChooseNewerFiles() { }
-void DirectoryMergeWindow::initDirectoryMergeActions( QObject* pKDiff3App, KActionCollection* ac )
+void DirectoryMergeWindow::initDirectoryMergeActions( TQObject* pKDiff3App, KActionCollection* ac )
{
#include "xpm/startmerge.xpm"
#include "xpm/showequalfiles.xpm"
@@ -2925,51 +2921,51 @@ void DirectoryMergeWindow::initDirectoryMergeActions( QObject* pKDiff3App, KActi
#include "xpm/showfilesonlyinc.xpm"
DirectoryMergeWindow* p = this;
- m_pDirStartOperation = new KAction(i18n("Start/Continue Directory Merge"), Qt::Key_F7, p, SLOT(slotRunOperationForAllItems()), ac, "dir_start_operation");
- m_pDirRunOperationForCurrentItem = new KAction(i18n("Run Operation for Current Item"), Qt::Key_F6, p, SLOT(slotRunOperationForCurrentItem()), ac, "dir_run_operation_for_current_item");
- m_pDirCompareCurrent = new KAction(i18n("Compare Selected File"), 0, p, SLOT(compareCurrentFile()), ac, "dir_compare_current");
- m_pDirMergeCurrent = new KAction(i18n("Merge Current File"), QIconSet(QPixmap(startmerge)), 0, pKDiff3App, SLOT(slotMergeCurrentFile()), ac, "merge_current");
- m_pDirFoldAll = new KAction(i18n("Fold All Subdirs"), 0, p, SLOT(slotFoldAllSubdirs()), ac, "dir_fold_all");
- m_pDirUnfoldAll = new KAction(i18n("Unfold All Subdirs"), 0, p, SLOT(slotUnfoldAllSubdirs()), ac, "dir_unfold_all");
- m_pDirRescan = new KAction(i18n("Rescan"), Qt::SHIFT+Qt::Key_F5, p, SLOT(reload()), ac, "dir_rescan");
- m_pDirSaveMergeState = 0; //new KAction(i18n("Save Directory Merge State ..."), 0, p, SLOT(slotSaveMergeState()), ac, "dir_save_merge_state");
- m_pDirLoadMergeState = 0; //new KAction(i18n("Load Directory Merge State ..."), 0, p, SLOT(slotLoadMergeState()), ac, "dir_load_merge_state");
- m_pDirChooseAEverywhere = new KAction(i18n("Choose A for All Items"), 0, p, SLOT(slotChooseAEverywhere()), ac, "dir_choose_a_everywhere");
- m_pDirChooseBEverywhere = new KAction(i18n("Choose B for All Items"), 0, p, SLOT(slotChooseBEverywhere()), ac, "dir_choose_b_everywhere");
- m_pDirChooseCEverywhere = new KAction(i18n("Choose C for All Items"), 0, p, SLOT(slotChooseCEverywhere()), ac, "dir_choose_c_everywhere");
- m_pDirAutoChoiceEverywhere = new KAction(i18n("Auto-Choose Operation for All Items"), 0, p, SLOT(slotAutoChooseEverywhere()), ac, "dir_autochoose_everywhere");
- m_pDirDoNothingEverywhere = new KAction(i18n("No Operation for All Items"), 0, p, SLOT(slotNoOpEverywhere()), ac, "dir_nothing_everywhere");
-
-// m_pDirSynchronizeDirectories = new KToggleAction(i18n("Synchronize Directories"), 0, this, SLOT(slotSynchronizeDirectories()), ac, "dir_synchronize_directories");
-// m_pDirChooseNewerFiles = new KToggleAction(i18n("Copy Newer Files Instead of Merging"), 0, this, SLOT(slotChooseNewerFiles()), ac, "dir_choose_newer_files");
-
- m_pDirShowIdenticalFiles = new KToggleAction(i18n("Show Identical Files"), QIconSet(QPixmap(showequalfiles)), 0, this, SLOT(slotShowIdenticalFiles()), ac, "dir_show_identical_files");
- m_pDirShowDifferentFiles = new KToggleAction(i18n("Show Different Files"), 0, this, SLOT(slotShowDifferentFiles()), ac, "dir_show_different_files");
- m_pDirShowFilesOnlyInA = new KToggleAction(i18n("Show Files only in A"), QIconSet(QPixmap(showfilesonlyina)), 0, this, SLOT(slotShowFilesOnlyInA()), ac, "dir_show_files_only_in_a");
- m_pDirShowFilesOnlyInB = new KToggleAction(i18n("Show Files only in B"), QIconSet(QPixmap(showfilesonlyinb)), 0, this, SLOT(slotShowFilesOnlyInB()), ac, "dir_show_files_only_in_b");
- m_pDirShowFilesOnlyInC = new KToggleAction(i18n("Show Files only in C"), QIconSet(QPixmap(showfilesonlyinc)), 0, this, SLOT(slotShowFilesOnlyInC()), ac, "dir_show_files_only_in_c");
+ m_pDirStartOperation = new KAction(i18n("Start/Continue Directory Merge"), TQt::Key_F7, TQT_TQOBJECT(p), TQT_SLOT(slotRunOperationForAllItems()), ac, "dir_start_operation");
+ m_pDirRunOperationForCurrentItem = new KAction(i18n("Run Operation for Current Item"), TQt::Key_F6, TQT_TQOBJECT(p), TQT_SLOT(slotRunOperationForCurrentItem()), ac, "dir_run_operation_for_current_item");
+ m_pDirCompareCurrent = new KAction(i18n("Compare Selected File"), 0, TQT_TQOBJECT(p), TQT_SLOT(compareCurrentFile()), ac, "dir_compare_current");
+ m_pDirMergeCurrent = new KAction(i18n("Merge Current File"), TQIconSet(TQPixmap(startmerge)), 0, TQT_TQOBJECT(pKDiff3App), TQT_SLOT(slotMergeCurrentFile()), ac, "merge_current");
+ m_pDirFoldAll = new KAction(i18n("Fold All Subdirs"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotFoldAllSubdirs()), ac, "dir_fold_all");
+ m_pDirUnfoldAll = new KAction(i18n("Unfold All Subdirs"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotUnfoldAllSubdirs()), ac, "dir_unfold_all");
+ m_pDirRescan = new KAction(i18n("Rescan"), TQt::SHIFT+TQt::Key_F5, TQT_TQOBJECT(p), TQT_SLOT(reload()), ac, "dir_rescan");
+ m_pDirSaveMergeState = 0; //new KAction(i18n("Save Directory Merge State ..."), 0, TQT_TQOBJECT(p), TQT_SLOT(slotSaveMergeState()), ac, "dir_save_merge_state");
+ m_pDirLoadMergeState = 0; //new KAction(i18n("Load Directory Merge State ..."), 0, TQT_TQOBJECT(p), TQT_SLOT(slotLoadMergeState()), ac, "dir_load_merge_state");
+ m_pDirChooseAEverywhere = new KAction(i18n("Choose A for All Items"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotChooseAEverywhere()), ac, "dir_choose_a_everywhere");
+ m_pDirChooseBEverywhere = new KAction(i18n("Choose B for All Items"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotChooseBEverywhere()), ac, "dir_choose_b_everywhere");
+ m_pDirChooseCEverywhere = new KAction(i18n("Choose C for All Items"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotChooseCEverywhere()), ac, "dir_choose_c_everywhere");
+ m_pDirAutoChoiceEverywhere = new KAction(i18n("Auto-Choose Operation for All Items"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotAutoChooseEverywhere()), ac, "dir_autochoose_everywhere");
+ m_pDirDoNothingEverywhere = new KAction(i18n("No Operation for All Items"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotNoOpEverywhere()), ac, "dir_nothing_everywhere");
+
+// m_pDirSynchronizeDirectories = new KToggleAction(i18n("Synchronize Directories"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotSynchronizeDirectories()), ac, "dir_synchronize_directories");
+// m_pDirChooseNewerFiles = new KToggleAction(i18n("Copy Newer Files Instead of Merging"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotChooseNewerFiles()), ac, "dir_choose_newer_files");
+
+ m_pDirShowIdenticalFiles = new KToggleAction(i18n("Show Identical Files"), TQIconSet(TQPixmap(showequalfiles)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowIdenticalFiles()), ac, "dir_show_identical_files");
+ m_pDirShowDifferentFiles = new KToggleAction(i18n("Show Different Files"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowDifferentFiles()), ac, "dir_show_different_files");
+ m_pDirShowFilesOnlyInA = new KToggleAction(i18n("Show Files only in A"), TQIconSet(TQPixmap(showfilesonlyina)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowFilesOnlyInA()), ac, "dir_show_files_only_in_a");
+ m_pDirShowFilesOnlyInB = new KToggleAction(i18n("Show Files only in B"), TQIconSet(TQPixmap(showfilesonlyinb)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowFilesOnlyInB()), ac, "dir_show_files_only_in_b");
+ m_pDirShowFilesOnlyInC = new KToggleAction(i18n("Show Files only in C"), TQIconSet(TQPixmap(showfilesonlyinc)), 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowFilesOnlyInC()), ac, "dir_show_files_only_in_c");
m_pDirShowIdenticalFiles->setChecked( m_pOptions->m_bDmShowIdenticalFiles );
- m_pDirCompareExplicit = new KAction(i18n("Compare Explicitly Selected Files"), 0, p, SLOT(slotCompareExplicitlySelectedFiles()), ac, "dir_compare_explicitly_selected_files");
- m_pDirMergeExplicit = new KAction(i18n("Merge Explicitly Selected Files"), 0, p, SLOT(slotMergeExplicitlySelectedFiles()), ac, "dir_merge_explicitly_selected_files");
-
- m_pDirCurrentDoNothing = new KAction(i18n("Do Nothing"), 0, p, SLOT(slotCurrentDoNothing()), ac, "dir_current_do_nothing");
- m_pDirCurrentChooseA = new KAction(i18n("A"), 0, p, SLOT(slotCurrentChooseA()), ac, "dir_current_choose_a");
- m_pDirCurrentChooseB = new KAction(i18n("B"), 0, p, SLOT(slotCurrentChooseB()), ac, "dir_current_choose_b");
- m_pDirCurrentChooseC = new KAction(i18n("C"), 0, p, SLOT(slotCurrentChooseC()), ac, "dir_current_choose_c");
- m_pDirCurrentMerge = new KAction(i18n("Merge"), 0, p, SLOT(slotCurrentMerge()), ac, "dir_current_merge");
- m_pDirCurrentDelete = new KAction(i18n("Delete (if exists)"), 0, p, SLOT(slotCurrentDelete()), ac, "dir_current_delete");
-
- m_pDirCurrentSyncDoNothing = new KAction(i18n("Do Nothing"), 0, p, SLOT(slotCurrentDoNothing()), ac, "dir_current_sync_do_nothing");
- m_pDirCurrentSyncCopyAToB = new KAction(i18n("Copy A to B"), 0, p, SLOT(slotCurrentCopyAToB()), ac, "dir_current_sync_copy_a_to_b" );
- m_pDirCurrentSyncCopyBToA = new KAction(i18n("Copy B to A"), 0, p, SLOT(slotCurrentCopyBToA()), ac, "dir_current_sync_copy_b_to_a" );
- m_pDirCurrentSyncDeleteA = new KAction(i18n("Delete A"), 0, p, SLOT(slotCurrentDeleteA()), ac,"dir_current_sync_delete_a");
- m_pDirCurrentSyncDeleteB = new KAction(i18n("Delete B"), 0, p, SLOT(slotCurrentDeleteB()), ac,"dir_current_sync_delete_b");
- m_pDirCurrentSyncDeleteAAndB = new KAction(i18n("Delete A && B"), 0, p, SLOT(slotCurrentDeleteAAndB()), ac,"dir_current_sync_delete_a_and_b");
- m_pDirCurrentSyncMergeToA = new KAction(i18n("Merge to A"), 0, p, SLOT(slotCurrentMergeToA()), ac,"dir_current_sync_merge_to_a");
- m_pDirCurrentSyncMergeToB = new KAction(i18n("Merge to B"), 0, p, SLOT(slotCurrentMergeToB()), ac,"dir_current_sync_merge_to_b");
- m_pDirCurrentSyncMergeToAAndB = new KAction(i18n("Merge to A && B"), 0, p, SLOT(slotCurrentMergeToAAndB()), ac,"dir_current_sync_merge_to_a_and_b");
+ m_pDirCompareExplicit = new KAction(i18n("Compare Explicitly Selected Files"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCompareExplicitlySelectedFiles()), ac, "dir_compare_explicitly_selected_files");
+ m_pDirMergeExplicit = new KAction(i18n("Merge Explicitly Selected Files"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotMergeExplicitlySelectedFiles()), ac, "dir_merge_explicitly_selected_files");
+
+ m_pDirCurrentDoNothing = new KAction(i18n("Do Nothing"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentDoNothing()), ac, "dir_current_do_nothing");
+ m_pDirCurrentChooseA = new KAction(i18n("A"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentChooseA()), ac, "dir_current_choose_a");
+ m_pDirCurrentChooseB = new KAction(i18n("B"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentChooseB()), ac, "dir_current_choose_b");
+ m_pDirCurrentChooseC = new KAction(i18n("C"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentChooseC()), ac, "dir_current_choose_c");
+ m_pDirCurrentMerge = new KAction(i18n("Merge"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentMerge()), ac, "dir_current_merge");
+ m_pDirCurrentDelete = new KAction(i18n("Delete (if exists)"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentDelete()), ac, "dir_current_delete");
+
+ m_pDirCurrentSyncDoNothing = new KAction(i18n("Do Nothing"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentDoNothing()), ac, "dir_current_sync_do_nothing");
+ m_pDirCurrentSyncCopyAToB = new KAction(i18n("Copy A to B"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentCopyAToB()), ac, "dir_current_sync_copy_a_to_b" );
+ m_pDirCurrentSyncCopyBToA = new KAction(i18n("Copy B to A"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentCopyBToA()), ac, "dir_current_sync_copy_b_to_a" );
+ m_pDirCurrentSyncDeleteA = new KAction(i18n("Delete A"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentDeleteA()), ac,"dir_current_sync_delete_a");
+ m_pDirCurrentSyncDeleteB = new KAction(i18n("Delete B"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentDeleteB()), ac,"dir_current_sync_delete_b");
+ m_pDirCurrentSyncDeleteAAndB = new KAction(i18n("Delete A && B"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentDeleteAAndB()), ac,"dir_current_sync_delete_a_and_b");
+ m_pDirCurrentSyncMergeToA = new KAction(i18n("Merge to A"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentMergeToA()), ac,"dir_current_sync_merge_to_a");
+ m_pDirCurrentSyncMergeToB = new KAction(i18n("Merge to B"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentMergeToB()), ac,"dir_current_sync_merge_to_b");
+ m_pDirCurrentSyncMergeToAAndB = new KAction(i18n("Merge to A && B"), 0, TQT_TQOBJECT(p), TQT_SLOT(slotCurrentMergeToAAndB()), ac,"dir_current_sync_merge_to_a_and_b");
}
@@ -2998,7 +2994,7 @@ void DirectoryMergeWindow::updateAvailabilities( bool bDirCompare, bool bDiffWin
bool bThreeDirs = m_dirC.isValid();
- QListViewItem* lvi = currentItem();
+ TQListViewItem* lvi = currentItem();
DirMergeItem* pDMI = lvi==0 ? 0 : static_cast<DirMergeItem*>(lvi);
MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI;