Mercurial > hg > easyhg-kdiff3
changeset 70:5bbfe4784324
KDiff3 0.9.89 for Qt4
line wrap: on
line diff
--- a/CVSROOT/checkoutlist Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -# The "checkoutlist" file is used to support additional version controlled -# administrative files in $CVSROOT/CVSROOT, such as template files. -# -# The first entry on a line is a filename which will be checked out from -# the corresponding RCS file in the $CVSROOT/CVSROOT directory. -# The remainder of the line is an error message to use if the file cannot -# be checked out. -# -# File format: -# -# [<whitespace>]<filename><whitespace><error message><end-of-line> -# -# comment lines begin with '#'
--- a/CVSROOT/commitinfo Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -# The "commitinfo" file is used to control pre-commit checks. -# The filter on the right is invoked with the repository and a list -# of files to check. A non-zero exit of the filter program will -# cause the commit to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT".
--- a/CVSROOT/config Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -# Set this to "no" if pserver shouldn't check system users/passwords -#SystemAuth=no - -# Put CVS lock files in this directory rather than directly in the repository. -#LockDir=/var/lock/cvs - -# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top -# level of the new working directory when using the `cvs checkout' -# command. -#TopLevelAdmin=no - -# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the -# history file, or a subset as needed (ie `TMAR' logs all write operations) -#LogHistory=TOFEWGCMAR
--- a/CVSROOT/cvswrappers Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -# This file affects handling of files based on their names. -# -# The -t/-f options allow one to treat directories of files -# as a single file, or to transform a file in other ways on -# its way in and out of CVS. -# -# The -m option specifies whether CVS attempts to merge files. -# -# The -k option specifies keyword expansion (e.g. -kb for binary). -# -# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) -# -# wildcard [option value][option value]... -# -# where option is one of -# -f from cvs filter value: path to filter -# -t to cvs filter value: path to filter -# -m update methodology value: MERGE or COPY -# -k expansion mode value: b, o, kkv, &c -# -# and value is a single-quote delimited value. -# For example: -#*.gif -k 'b'
--- a/CVSROOT/editinfo Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# The "editinfo" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository.
--- a/CVSROOT/loginfo Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -# The "loginfo" file controls where "cvs commit" log information -# is sent. The first entry on a line is a regular expression which must match -# the directory that the change is being made to, relative to the -# $CVSROOT. If a match is found, then the remainder of the line is a filter -# program that should expect log information on its standard input. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name ALL appears as a regular expression it is always used -# in addition to the first matching regex or DEFAULT. -# -# You may specify a format string as part of the -# filter. The string is composed of a `%' followed -# by a single format character, or followed by a set of format -# characters surrounded by `{' and `}' as separators. The format -# characters are: -# -# s = file name -# V = old version number (pre-checkin) -# v = new version number (post-checkin) -# -# For example: -#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog -# or -#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
--- a/CVSROOT/modules Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -# Three different line formats are valid: -# key -a aliases... -# key [options] directory -# key [options] directory files... -# -# Where "options" are composed of: -# -i prog Run "prog" on "cvs commit" from top-level of module. -# -o prog Run "prog" on "cvs checkout" of module. -# -e prog Run "prog" on "cvs export" of module. -# -t prog Run "prog" on "cvs rtag" of module. -# -u prog Run "prog" on "cvs update" of module. -# -d dir Place module in directory "dir" instead of module name. -# -l Top-level directory only -- do not recurse. -# -# NOTE: If you change any of the "Run" options above, you'll have to -# release and re-checkout any working directories of these modules. -# -# And "directory" is a path to a directory relative to $CVSROOT. -# -# The "-a" option specifies an alias. An alias is interpreted as if -# everything on the right of the "-a" had been typed on the command line. -# -# You can encode a module within a module by using the special '&' -# character to interpose another module into the current module. This -# can be useful for creating a module that consists of many directories -# spread out over the entire source repository.
--- a/CVSROOT/notify Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -# The "notify" file controls where notifications from watches set by -# "cvs watch add" or "cvs edit" are sent. The first entry on a line is -# a regular expression which is tested against the directory that the -# change is being made to, relative to the $CVSROOT. If it matches, -# then the remainder of the line is a filter program that should contain -# one occurrence of %s for the user to notify, and information on its -# standard input. -# -# "ALL" or "DEFAULT" can be used in place of the regular expression. -# -# For example: -#ALL mail %s -s "CVS notification"
--- a/CVSROOT/rcsinfo Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -# The "rcsinfo" file is used to control templates with which the editor -# is invoked on commit and import. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being made to, relative to the -# $CVSROOT. For the first match that is found, then the remainder of the -# line is the name of the file that contains the template. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT".
--- a/CVSROOT/taginfo Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -# The "taginfo" file is used to control pre-tag checks. -# The filter on the right is invoked with the following arguments: -# -# $1 -- tagname -# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d -# $3 -- repository -# $4-> file revision [file revision ...] -# -# A non-zero exit of the filter program will cause the tag to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT".
--- a/CVSROOT/verifymsg Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# The "verifymsg" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository.
--- a/kdiff3/src/.cvsignore Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -Makefile -Makefile.in
--- a/kdiff3/src/common.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/common.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -61,7 +61,7 @@ void ValueMap::load( QTextStream& ts ) { - while ( !ts.eof() ) + while ( !ts.atEnd() ) { // until end of file... QString s = ts.readLine(); // line of text excluding '\n' int pos = s.find('=');
--- a/kdiff3/src/diff.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/diff.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -27,6 +27,8 @@ #include <qfileinfo.h> #include <qdir.h> #include <qtextcodec.h> +//Added by qt3to4: +#include <QTextStream> #include <map> #include <assert.h> @@ -354,13 +356,13 @@ const QString& fileNameOut, QTextCodec* pCodecOut ) { QFile in( fileNameIn ); - if ( ! in.open(IO_ReadOnly ) ) + if ( ! in.open(QIODevice::ReadOnly ) ) return false; QTextStream inStream( &in ); inStream.setCodec( pCodecIn ); QFile out( fileNameOut ); - if ( ! out.open( IO_WriteOnly ) ) + if ( ! out.open( QIODevice::WriteOnly ) ) return false; QTextStream outStream( &out ); outStream.setCodec( pCodecOut ); @@ -566,7 +568,7 @@ QByteArray ba; ba.setRawData( m_pBuf, m_size ); - QTextStream ts( ba, IO_ReadOnly ); + QTextStream ts( ba, QIODevice::ReadOnly ); ts.setCodec( pEncoding); m_unicodeBuf = ts.read(); ba.resetRawData( m_pBuf, m_size ); @@ -711,7 +713,7 @@ { return; } - else if ( !isspace(p[i]) ) + else if ( !p[i].isSpace() ) { bWhite = false; }
--- a/kdiff3/src/diff.h Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/diff.h Tue Apr 18 20:19:57 2006 +0000 @@ -21,9 +21,11 @@ #include <qwidget.h> #include <qpixmap.h> #include <qtimer.h> -#include <qframe.h> +#include <q3frame.h> #include <qtextstream.h> #include <qpainter.h> +//Added by qt3to4: +#include <Q3CString> #include <list> #include <vector> #include <assert.h> @@ -362,7 +364,7 @@ class OptionDialog; -QCString encodeString( const QString& s ); +Q3CString encodeString( const QString& s ); // Helper class that swaps left and right for some commands. @@ -372,7 +374,7 @@ int m_xOffset; int m_fontWidth; public: - MyPainter(const QPaintDevice* pd, bool bRTL, int width, int fontWidth) + MyPainter(QPaintDevice* pd, bool bRTL, int width, int fontWidth) : QPainter(pd) { if (bRTL) @@ -399,8 +401,9 @@ void drawText( int x, int y, const QString& s, bool bAdapt=false ) { - TextDirection td = (m_factor==1 || bAdapt == false) ? LTR : RTL; - QPainter::drawText( m_xOffset-m_fontWidth*s.length() + m_factor*x, y, s, -1, td ); + Qt::LayoutDirection ld = (m_factor==1 || bAdapt == false) ? Qt::LeftToRight : Qt::RightToLeft; + QPainter::setLayoutDirection( ld ); + QPainter::drawText( m_xOffset-m_fontWidth*s.length() + m_factor*x, y, s, -1 ); } void drawLine( int x1, int y1, int x2, int y2 )
--- a/kdiff3/src/difftextwindow.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/difftextwindow.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -18,6 +18,18 @@ #include "difftextwindow.h" #include "merger.h" #include <qpainter.h> +//Added by qt3to4: +#include <QPaintEvent> +#include <QResizeEvent> +#include <QMouseEvent> +#include <QFocusEvent> +#include <Q3VBoxLayout> +#include <QTimerEvent> +#include <QEvent> +#include <Q3CString> +#include <QDropEvent> +#include <QDragEnterEvent> +#include <Q3HBoxLayout> #include <assert.h> #include <qpixmap.h> #include <qstatusbar.h> @@ -32,7 +44,7 @@ #include <qtextcodec.h> #include <optiondialog.h> #include <math.h> -#include <qdragobject.h> +#include <q3dragobject.h> #include <klocale.h> #include <kfiledialog.h> @@ -137,11 +149,11 @@ OptionDialog* pOptionDialog, int winIdx ) - : QWidget(pParent, 0, Qt::WNoAutoErase | WRepaintNoErase) + : QWidget(pParent, 0, Qt::WNoAutoErase | Qt::WNoAutoErase) { d = new DiffTextWindowData(this); d->m_pDiffTextWindowFrame = pParent; - setFocusPolicy( ClickFocus ); + setFocusPolicy( Qt::ClickFocus ); setAcceptDrops( true ); d->m_pOptionDialog = pOptionDialog; @@ -155,6 +167,7 @@ d->m_winIdx = winIdx; setFont(d->m_pOptionDialog->m_font); + setAutoFillBackground( true ); } DiffTextWindow::~DiffTextWindow() @@ -219,7 +232,7 @@ void DiffTextWindow::dragEnterEvent( QDragEnterEvent* e ) { - e->accept( QUriDrag::canDecode(e) || QTextDrag::canDecode(e) ); + e->accept( Q3UriDrag::canDecode(e) || Q3TextDrag::canDecode(e) ); // Note that the corresponding drop is handled in KDiff3App::eventFilter(). } @@ -948,12 +961,12 @@ //if ( invalidRect.size()==size() ) { // double buffering, obsolete with Qt4 - QPainter painter(this); // Remove for Qt4 - QPixmap pixmap( invalidRect.size() );// Remove for Qt4 + //QPainter painter(this); // Remove for Qt4 + //QPixmap pixmap( invalidRect.size() );// Remove for Qt4 - MyPainter p( &pixmap, d->m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') ); // For Qt4 change pixmap to this + MyPainter p( this, d->m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') ); // For Qt4 change pixmap to this - p.translate( -invalidRect.x(), -invalidRect.y() );// Remove for Qt4 + //p.translate( -invalidRect.x(), -invalidRect.y() );// Remove for Qt4 p.setFont( font() ); p.QPainter::fillRect( invalidRect, d->m_pOptionDialog->m_bgColor ); @@ -962,7 +975,7 @@ // p.drawLine( m_invalidRect.x(), m_invalidRect.y(), m_invalidRect.right(), m_invalidRect.bottom() ); // For test only p.end(); - painter.drawPixmap( invalidRect.x(), invalidRect.y(), pixmap );// Remove for Qt4 + //painter.drawPixmap( invalidRect.x(), invalidRect.y(), pixmap );// Remove for Qt4 } // else // { // no double buffering @@ -1578,7 +1591,7 @@ d->m_pTopLine = new QLabel(d->m_pTopLineWidget); d->m_pDiffTextWindow = 0; d->m_pDiffTextWindow = new DiffTextWindow( this, pStatusBar, pOptionDialog, winIdx ); - QHBoxLayout* pHL = new QHBoxLayout(d->m_pTopLineWidget); + Q3HBoxLayout* pHL = new Q3HBoxLayout(d->m_pTopLineWidget); pHL->setMargin(2); pHL->setSpacing(2); @@ -1587,7 +1600,7 @@ pHL->addWidget( d->m_pBrowseButton, 0 ); pHL->addWidget( d->m_pTopLine, 0 ); - QVBoxLayout* pVL = new QVBoxLayout( this, 0, 0 ); + Q3VBoxLayout* pVL = new Q3VBoxLayout( this, 0, 0 ); pVL->addWidget( d->m_pTopLineWidget, 0 ); pVL->addWidget( d->m_pDiffTextWindow, 1 ); @@ -1669,12 +1682,10 @@ if ( e->type()==QEvent::FocusOut ) std::swap(c1,c2); - p.setColor(QColorGroup::Background, c2); - d->m_pTopLineWidget->setPalette( p ); - d->m_pBrowseButton->setPalette( p ); - d->m_pFileSelection->setPalette( p ); + p.setColor(QPalette::Window, c2); + setPalette( p ); - p.setColor(QColorGroup::Foreground, c1); + p.setColor(QPalette::WindowText, c1); d->m_pLabel->setPalette( p ); d->m_pTopLine->setPalette( p ); } @@ -1682,10 +1693,10 @@ { QDropEvent* d = static_cast<QDropEvent*>(e); - if ( QUriDrag::canDecode( d ) ) + if ( Q3UriDrag::canDecode( d ) ) { QStringList lst; - QUriDrag::decodeLocalFiles( d, lst ); + Q3UriDrag::decodeLocalFiles( d, lst ); if ( lst.count() > 0 ) { @@ -1711,6 +1722,12 @@ return false; } +void DiffTextWindowFrame::paintEvent(QPaintEvent*) +{ + QPainter p(this); + p.fillRect( rect(), palette().window() ); +} + void DiffTextWindowFrame::slotReturnPressed() { DiffTextWindow* pDTW = d->m_pDiffTextWindow; @@ -1732,13 +1749,13 @@ } } -QCString encodeString( const QString& s ) +Q3CString encodeString( const QString& s ) { QTextCodec* c = QTextCodec::codecForLocale(); if (c!=0) return c->fromUnicode( s ); else - return QCString( s.latin1() ); + return Q3CString( s.latin1() ); } -#include "difftextwindow.moc" +//#include "difftextwindow.moc"
--- a/kdiff3/src/difftextwindow.h Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/difftextwindow.h Tue Apr 18 20:19:57 2006 +0000 @@ -21,6 +21,14 @@ #include "diff.h" #include <qwidget.h> +//Added by qt3to4: +#include <QMouseEvent> +#include <QDragEnterEvent> +#include <QTimerEvent> +#include <QFocusEvent> +#include <QResizeEvent> +#include <QEvent> +#include <QPaintEvent> class QStatusBar; class OptionDialog; @@ -123,6 +131,7 @@ void fileNameChanged(const QString&, int); protected: bool eventFilter( QObject*, QEvent* ); + void paintEvent(QPaintEvent*); private slots: void slotReturnPressed(); void slotBrowseButtonClicked();
--- a/kdiff3/src/directorymergewindow.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/directorymergewindow.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -24,16 +24,27 @@ #include <qapplication.h> #include <qpixmap.h> #include <qimage.h> +//Added by qt3to4: +#include <QFocusEvent> +#include <QTextStream> +#include <Q3GridLayout> +#include <QKeyEvent> +#include <QEvent> +#include <Q3Frame> +#include <Q3ValueList> +#include <QResizeEvent> +#include <Q3PopupMenu> +#include <Q3VBoxLayout> #include <kpopupmenu.h> #include <kaction.h> #include <qregexp.h> #include <qmessagebox.h> #include <qlayout.h> #include <qlabel.h> -#include <qtable.h> +#include <q3table.h> #include <qsplitter.h> -#include <qtextedit.h> -#include <qprogressdialog.h> +#include <q3textedit.h> +#include <q3progressdialog.h> #include <kmessagebox.h> #include <kfiledialog.h> #include <kiconloader.h> @@ -67,13 +78,13 @@ } }; */ -class StatusInfo : public QTextEdit +class StatusInfo : public Q3TextEdit { public: - StatusInfo(QWidget* pParent) : QTextEdit( pParent, "StatusInfo" ) + StatusInfo(QWidget* pParent) : Q3TextEdit( pParent, "StatusInfo" ) { - setWFlags(Qt::WShowModal); - setWordWrap(QTextEdit::NoWrap); + setWindowFlags(Qt::Dialog); + setWordWrap(Q3TextEdit::NoWrap); setReadOnly(true); showMaximized(); } @@ -88,7 +99,7 @@ void show() { scrollToBottom(); - QTextEdit::show(); + Q3TextEdit::show(); } }; @@ -191,7 +202,7 @@ QFile file1( tr1.name() ); - if ( ! file1.open(IO_ReadOnly) ) + if ( ! file1.open(QIODevice::ReadOnly) ) { status = i18n("Opening %1 failed.").arg(fileName1); return; @@ -199,7 +210,7 @@ QFile file2( tr2.name() ); - if ( ! file2.open(IO_ReadOnly) ) + if ( ! file2.open(QIODevice::ReadOnly) ) { status = i18n("Opening %1 failed.").arg(fileName2); return; @@ -254,15 +265,15 @@ 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 ) + : Q3ListView( 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*))); + connect( this, SIGNAL(doubleClicked(Q3ListViewItem*)), this, SLOT(onDoubleClick(Q3ListViewItem*))); + connect( this, SIGNAL(returnPressed(Q3ListViewItem*)), this, SLOT(onDoubleClick(Q3ListViewItem*))); + connect( this, SIGNAL( mouseButtonPressed(int,Q3ListViewItem*,const QPoint&, int)), + this, SLOT( onClick(int,Q3ListViewItem*,const QPoint&, int)) ); + connect( this, SIGNAL(contextMenuRequested(Q3ListViewItem*,const QPoint &,int)), + this, SLOT( slotShowContextMenu(Q3ListViewItem*,const QPoint &,int))); + connect( this, SIGNAL(selectionChanged(Q3ListViewItem*)), this, SLOT(onSelectionChanged(Q3ListViewItem*))); m_pOptions = pOptions; m_pIconLoader = pIconLoader; m_pDirectoryMergeInfo = 0; @@ -392,7 +403,7 @@ ++nofManualMerges; } } - for( QListViewItem* p = i->firstChild(); p!=0; p = p->nextSibling() ) + for( Q3ListViewItem* p = i->firstChild(); p!=0; p = p->nextSibling() ) calcDirStatus( bThreeDirs, static_cast<DirMergeItem*>(p), nofFiles, nofDirs, nofEqualFiles, nofManualMerges ); } @@ -503,10 +514,10 @@ 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, Q3ListView::Manual); + setColumnWidthMode(s_SolvedCol, Q3ListView::Manual); + setColumnWidthMode(s_WhiteCol, Q3ListView::Manual); + setColumnWidthMode(s_NonWhiteCol, Q3ListView::Manual); if ( !m_pOptions->m_bDmFullAnalysis ) { setColumnWidth( s_WhiteCol, 0 ); @@ -617,7 +628,7 @@ { prepareListView(pp); - for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) { DirMergeItem* pDMI = static_cast<DirMergeItem*>( p ); calcSuggestedOperation( *pDMI->m_pMFI, eDefaultMergeOp ); @@ -635,7 +646,7 @@ QSplitter* pSplitter = static_cast<QSplitter*>(pParent); if (pSplitter!=0) { - QValueList<int> sizes = pSplitter->sizes(); + Q3ValueList<int> sizes = pSplitter->sizes(); int total = sizes[0] + sizes[1]; sizes[0]=total*6/10; sizes[1]=total - sizes[0]; @@ -652,7 +663,7 @@ int nofDirs=0; int nofEqualFiles=0; int nofManualMerges=0; - for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) calcDirStatus( m_dirC.isValid(), static_cast<DirMergeItem*>(p), nofFiles, nofDirs, nofEqualFiles, nofManualMerges ); @@ -688,9 +699,9 @@ void DirectoryMergeWindow::slotNoOpEverywhere(){ setAllMergeOperations(eNoOperation); } -static void setListViewItemOpen( QListViewItem* p, bool bOpen ) +static void setListViewItemOpen( Q3ListViewItem* p, bool bOpen ) { - for( QListViewItem* pChild = p->firstChild(); pChild!=0; pChild = pChild->nextSibling() ) + for( Q3ListViewItem* pChild = p->firstChild(); pChild!=0; pChild = pChild->nextSibling() ) setListViewItemOpen( pChild, bOpen ); p->setOpen( bOpen ); @@ -698,17 +709,17 @@ void DirectoryMergeWindow::slotFoldAllSubdirs() { - for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) setListViewItemOpen( p, false ); } void DirectoryMergeWindow::slotUnfoldAllSubdirs() { - for( QListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) setListViewItemOpen( p, true ); } -static void setMergeOperation( QListViewItem* pLVI, e_MergeOperation eMergeOp ) +static void setMergeOperation( Q3ListViewItem* pLVI, e_MergeOperation eMergeOp ) { if ( pLVI==0 ) return; @@ -742,11 +753,11 @@ void DirectoryMergeWindow::keyPressEvent( QKeyEvent* e ) { - if ( (e->state() & Qt::ControlButton)!=0 ) + if ( (e->state() & Qt::ControlModifier)!=0 ) { bool bThreeDirs = m_dirC.isValid(); - QListViewItem* lvi = currentItem(); + Q3ListViewItem* lvi = currentItem(); DirMergeItem* pDMI = lvi==0 ? 0 : static_cast<DirMergeItem*>(lvi); MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI; @@ -758,12 +769,12 @@ { switch(e->key()) { - case Key_1: if(pMFI->m_bExistsInA){ slotCurrentChooseA(); } return; - case Key_2: if(pMFI->m_bExistsInB){ slotCurrentChooseB(); } return; - case Key_3: if(pMFI->m_bExistsInC){ slotCurrentChooseC(); } return; - case Key_Space: slotCurrentDoNothing(); return; - case Key_4: if ( !bFTConflict ) { slotCurrentMerge(); } return; - case Key_Delete: slotCurrentDelete(); return; + case Qt::Key_1: if(pMFI->m_bExistsInA){ slotCurrentChooseA(); } return; + case Qt::Key_2: if(pMFI->m_bExistsInB){ slotCurrentChooseB(); } return; + case Qt::Key_3: if(pMFI->m_bExistsInC){ slotCurrentChooseC(); } return; + case Qt::Key_Space: slotCurrentDoNothing(); return; + case Qt::Key_4: if ( !bFTConflict ) { slotCurrentMerge(); } return; + case Qt::Key_Delete: slotCurrentDelete(); return; default: break; } } @@ -771,11 +782,11 @@ { switch(e->key()) { - case Key_1: if(pMFI->m_bExistsInA){ slotCurrentCopyAToB(); } return; - case Key_2: if(pMFI->m_bExistsInB){ slotCurrentCopyBToA(); } return; - case Key_Space: slotCurrentDoNothing(); return; - case Key_4: if ( !bFTConflict ) { slotCurrentMergeToAAndB(); } return; - case Key_Delete: if( pMFI->m_bExistsInA && pMFI->m_bExistsInB ) slotCurrentDeleteAAndB(); + case Qt::Key_1: if(pMFI->m_bExistsInA){ slotCurrentCopyAToB(); } return; + case Qt::Key_2: if(pMFI->m_bExistsInB){ slotCurrentCopyBToA(); } return; + case Qt::Key_Space: slotCurrentDoNothing(); return; + case Qt::Key_4: if ( !bFTConflict ) { slotCurrentMergeToAAndB(); } return; + case Qt::Key_Delete: if( pMFI->m_bExistsInA && pMFI->m_bExistsInB ) slotCurrentDeleteAAndB(); else if( pMFI->m_bExistsInA ) slotCurrentDeleteA(); else if( pMFI->m_bExistsInB ) slotCurrentDeleteB(); return; @@ -784,7 +795,7 @@ } } - QListView::keyPressEvent(e); + Q3ListView::keyPressEvent(e); } void DirectoryMergeWindow::focusInEvent(QFocusEvent*) @@ -802,7 +813,7 @@ 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( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) { DirMergeItem* pDMI = static_cast<DirMergeItem*>( p ); calcSuggestedOperation( *pDMI->m_pMFI, eDefaultOperation ); @@ -1042,7 +1053,7 @@ } -static void setOnePixmap( QListViewItem* pLVI, int col, e_Age eAge, bool bLink, bool bDir ) +static void setOnePixmap( Q3ListViewItem* 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 }; @@ -1100,7 +1111,7 @@ } // Iterate through the complete tree. Start by specifying QListView::firstChild(). -static QListViewItem* treeIterator( QListViewItem* p, bool bVisitChildren=true, bool bFindInvisible=false ) +static Q3ListViewItem* treeIterator( Q3ListViewItem* p, bool bVisitChildren=true, bool bFindInvisible=false ) { if( p!=0 ) { @@ -1430,7 +1441,7 @@ } } -void DirectoryMergeWindow::onDoubleClick( QListViewItem* lvi ) +void DirectoryMergeWindow::onDoubleClick( Q3ListViewItem* lvi ) { if (lvi==0) return; @@ -1440,7 +1451,7 @@ compareCurrentFile(); } -void DirectoryMergeWindow::onSelectionChanged( QListViewItem* lvi ) +void DirectoryMergeWindow::onSelectionChanged( Q3ListViewItem* lvi ) { if ( lvi==0 ) return; @@ -1452,7 +1463,7 @@ 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, Q3ListViewItem* lvi, const QPoint& p, int c ) { if ( lvi==0 ) return; @@ -1519,7 +1530,7 @@ } } -void DirectoryMergeWindow::slotShowContextMenu(QListViewItem* lvi,const QPoint & p,int c) +void DirectoryMergeWindow::slotShowContextMenu(Q3ListViewItem* lvi,const QPoint & p,int c) { if ( lvi==0 ) return; @@ -1544,7 +1555,7 @@ #ifndef _WIN32 m.exec( p ); #else - void showShellContextMenu( const QString&, QPoint, QWidget*, QPopupMenu* ); + void showShellContextMenu( const QString&, QPoint, QWidget*, QMenu* ); showShellContextMenu( itemPath, p, this, &m ); #endif } @@ -1640,14 +1651,14 @@ #define DIRSORT(x) x #endif -DirMergeItem::DirMergeItem( QListView* pParent, const QString& fileName, MergeFileInfos* pMFI ) -: QListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" ) +DirMergeItem::DirMergeItem( Q3ListView* pParent, const QString& fileName, MergeFileInfos* pMFI ) +: Q3ListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" ) { init(pMFI); } DirMergeItem::DirMergeItem( DirMergeItem* pParent, const QString& fileName, MergeFileInfos* pMFI ) -: QListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" ) +: Q3ListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" ) { init(pMFI); } @@ -1670,7 +1681,7 @@ } } -int DirMergeItem::compare(QListViewItem *i, int col, bool ascending) const +int DirMergeItem::compare(Q3ListViewItem *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; @@ -1680,7 +1691,7 @@ 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 Q3ListViewItem::compare( i, col, ascending ); } else return bDir1 ? -1 : 1; @@ -1725,7 +1736,7 @@ return; } } - QListViewItem::paintCell(p,cg,column,width,align); + Q3ListViewItem::paintCell(p,cg,column,width,align); } DirMergeItem::~DirMergeItem() @@ -1771,7 +1782,7 @@ e_MergeOperation eChildrenMergeOp = m_eMergeOperation; if ( eChildrenMergeOp == eConflictingFileTypes ) eChildrenMergeOp = eMergeABCToDest; - QListViewItem* p = m_pDMI->firstChild(); + Q3ListViewItem* p = m_pDMI->firstChild(); while ( p!=0 ) { DirMergeItem* pDMI = static_cast<DirMergeItem*>( p ); @@ -2003,7 +2014,7 @@ // 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( Q3ListViewItem* pBegin, Q3ListViewItem* pEnd, bool bVerbose ) { if ( bVerbose ) { @@ -2027,7 +2038,7 @@ if (pBegin == 0) return; - for( QListViewItem* p = pBegin; p!= pEnd; p = treeIterator( p ) ) + for( Q3ListViewItem* p = pBegin; p!= pEnd; p = treeIterator( p ) ) { DirMergeItem* pDMI = static_cast<DirMergeItem*>(p); @@ -2067,8 +2078,8 @@ bool bVerbose = false; if ( m_mergeItemList.empty() ) { - QListViewItem* pBegin = currentItem(); - QListViewItem* pEnd = treeIterator(pBegin,false,false); // find next visible sibling (no children) + Q3ListViewItem* pBegin = currentItem(); + Q3ListViewItem* pEnd = treeIterator(pBegin,false,false); // find next visible sibling (no children) prepareMergeStart( pBegin, pEnd, bVerbose ); mergeContinue(true, bVerbose); @@ -2084,7 +2095,7 @@ bool bVerbose = true; if ( m_mergeItemList.empty() ) { - QListViewItem* pBegin = firstChild(); + Q3ListViewItem* pBegin = firstChild(); prepareMergeStart( pBegin, 0, bVerbose ); mergeContinue(true, bVerbose); @@ -2210,17 +2221,17 @@ if ( ! bContinueWithCurrentItem ) { // Depth first - QListViewItem* pPrevItem = pCurrentItemForOperation; + Q3ListViewItem* pPrevItem = pCurrentItemForOperation; ++m_currentItemForOperation; pCurrentItemForOperation = m_currentItemForOperation==m_mergeItemList.end() ? 0 : *m_currentItemForOperation; if ( (pCurrentItemForOperation==0 || pCurrentItemForOperation->parent()!=pPrevItem->parent()) && pPrevItem->parent()!=0 ) { // Check if the parent may be set to "Done" - QListViewItem* pParent = pPrevItem->parent(); + Q3ListViewItem* pParent = pPrevItem->parent(); bool bDone = true; while ( bDone && pParent!=0 ) { - for( QListViewItem* p = pParent->firstChild(); p!=0; p=p->nextSibling() ) + for( Q3ListViewItem* 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 ) @@ -2258,7 +2269,7 @@ if ( m_bSimulatedMergeStarted ) { m_bSimulatedMergeStarted = false; - for( QListViewItem* p=firstChild(); p!=0; p=treeIterator(p) ) + for( Q3ListViewItem* p=firstChild(); p!=0; p=treeIterator(p) ) { static_cast<DirMergeItem*>(p)->m_pMFI->m_bSimOpComplete = false; } @@ -2327,7 +2338,7 @@ void DirectoryMergeWindow::resizeEvent( QResizeEvent* e ) { if (m_bAllowResizeEvents) - QListView::resizeEvent(e); + Q3ListView::resizeEvent(e); } bool DirectoryMergeWindow::deleteFLD( const QString& name, bool bCreateBackup ) @@ -2586,11 +2597,11 @@ DirectoryMergeInfo::DirectoryMergeInfo( QWidget* pParent ) -: QFrame(pParent) +: Q3Frame(pParent) { - QVBoxLayout *topLayout = new QVBoxLayout( this ); - - QGridLayout *grid = new QGridLayout( topLayout ); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( this ); + + Q3GridLayout *grid = new Q3GridLayout( topLayout ); grid->setColStretch(1,10); int line=0; @@ -2604,7 +2615,7 @@ 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_pInfoList = new QListView(this); topLayout->addWidget( m_pInfoList ); + m_pInfoList = new Q3ListView(this); topLayout->addWidget( m_pInfoList ); m_pInfoList->addColumn(i18n("Dir")); m_pInfoList->addColumn(i18n("Type")); m_pInfoList->addColumn(i18n("Size")); @@ -2623,7 +2634,7 @@ return false; } -static void addListViewItem( QListView* pListView, const QString& dir, +static void addListViewItem( Q3ListView* pListView, const QString& dir, const QString& basePath, FileAccess& fi ) { if ( basePath.isEmpty() ) @@ -2640,7 +2651,7 @@ QString dateString = fi.lastModified().toString("yyyy-MM-dd hh:mm:ss"); #endif - new QListViewItem( + new Q3ListViewItem( pListView, dir, QString( fi.isDir() ? i18n("Dir") : i18n("File") ) + (fi.isSymLink() ? "-Link" : ""), @@ -2657,7 +2668,7 @@ } else { - new QListViewItem( + new Q3ListViewItem( pListView, dir, i18n("not available"), @@ -2775,12 +2786,12 @@ QFile file(m_dirMergeStateFilename); - bool bSuccess = file.open( IO_WriteOnly ); + bool bSuccess = file.open( QIODevice::WriteOnly ); if ( bSuccess ) { QTextStream ts( &file ); - QListViewItemIterator it( this ); + Q3ListViewItemIterator it( this ); while ( it.current() ) { DirMergeItem* item = static_cast<DirMergeItem*>(it.current()); MergeFileInfos* pMFI = item->m_pMFI; @@ -2810,7 +2821,7 @@ m_pSelection2Item = 0; m_pSelection3Item = 0; - QListViewItem* p = firstChild(); + Q3ListViewItem* p = firstChild(); while(p) { DirMergeItem* pDMI = static_cast<DirMergeItem*>(p); @@ -2858,7 +2869,7 @@ 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_pDirMergeCurrent = new KAction(i18n("Merge Current File"), QIcon(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"); @@ -2873,11 +2884,11 @@ // 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_pDirShowIdenticalFiles = new KToggleAction(i18n("Show Identical Files"), QIcon(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_pDirShowFilesOnlyInA = new KToggleAction(i18n("Show Files only in A"), QIcon(QPixmap(showfilesonlyina)), 0, this, SLOT(slotShowFilesOnlyInA()), ac, "dir_show_files_only_in_a"); + m_pDirShowFilesOnlyInB = new KToggleAction(i18n("Show Files only in B"), QIcon(QPixmap(showfilesonlyinb)), 0, this, SLOT(slotShowFilesOnlyInB()), ac, "dir_show_files_only_in_b"); + m_pDirShowFilesOnlyInC = new KToggleAction(i18n("Show Files only in C"), QIcon(QPixmap(showfilesonlyinc)), 0, this, SLOT(slotShowFilesOnlyInC()), ac, "dir_show_files_only_in_c"); m_pDirShowIdenticalFiles->setChecked( m_pOptions->m_bDmShowIdenticalFiles ); @@ -2928,7 +2939,7 @@ bool bThreeDirs = m_dirC.isValid(); - QListViewItem* lvi = currentItem(); + Q3ListViewItem* lvi = currentItem(); DirMergeItem* pDMI = lvi==0 ? 0 : static_cast<DirMergeItem*>(lvi); MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI; @@ -2975,4 +2986,4 @@ } -#include "directorymergewindow.moc" +//#include "directorymergewindow.moc"
--- a/kdiff3/src/directorymergewindow.h Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/directorymergewindow.h Tue Apr 18 20:19:57 2006 +0000 @@ -19,9 +19,16 @@ #define DIRECTORY_MERGE_WINDOW_H #include <qfileinfo.h> -#include <qlistview.h> +#include <q3listview.h> #include <qtimer.h> #include <qdir.h> +//Added by qt3to4: +#include <QLabel> +#include <QFocusEvent> +#include <Q3Frame> +#include <QKeyEvent> +#include <QResizeEvent> +#include <QEvent> #include <list> #include <map> #include "common.h" @@ -102,19 +109,19 @@ TotalDiffStatus m_totalDiffStatus; }; -class DirMergeItem : public QListViewItem +class DirMergeItem : public Q3ListViewItem { public: - DirMergeItem( QListView* pParent, const QString&, MergeFileInfos*); + DirMergeItem( Q3ListView* pParent, const QString&, MergeFileInfos*); DirMergeItem( DirMergeItem* pParent, const QString&, MergeFileInfos*); ~DirMergeItem(); MergeFileInfos* m_pMFI; - virtual int compare(QListViewItem *i, int col, bool ascending) const; + virtual int compare(Q3ListViewItem *i, int col, bool ascending) const; virtual void paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align ); void init(MergeFileInfos* pMFI); }; -class DirectoryMergeWindow : public QListView +class DirectoryMergeWindow : public Q3ListView { Q_OBJECT public: @@ -200,7 +207,7 @@ friend class MergeFileInfos; bool canContinue(); - void prepareMergeStart( QListViewItem* pBegin, QListViewItem* pEnd, bool bVerbose ); + void prepareMergeStart( Q3ListViewItem* pBegin, Q3ListViewItem* pEnd, bool bVerbose ); bool executeMergeOperation( MergeFileInfos& mfi, bool& bSingleFileMerge ); void scanDirectory( const QString& dirName, t_DirectoryList& dirList ); @@ -314,13 +321,13 @@ void updateAvailabilities(); void statusBarMessage( const QString& msg ); protected slots: - void onDoubleClick( QListViewItem* lvi ); - void onClick( int button, QListViewItem* lvi, const QPoint&, int c ); - void slotShowContextMenu(QListViewItem* lvi,const QPoint &,int c); - void onSelectionChanged(QListViewItem* lvi); + void onDoubleClick( Q3ListViewItem* lvi ); + void onClick( int button, Q3ListViewItem* lvi, const QPoint&, int c ); + void slotShowContextMenu(Q3ListViewItem* lvi,const QPoint &,int c); + void onSelectionChanged(Q3ListViewItem* lvi); }; -class DirectoryMergeInfo : public QFrame +class DirectoryMergeInfo : public Q3Frame { Q_OBJECT public: @@ -331,7 +338,7 @@ const FileAccess& CPath, const FileAccess& DestPath, MergeFileInfos& mfi ); - QListView* getInfoList() {return m_pInfoList;} + Q3ListView* getInfoList() {return m_pInfoList;} virtual bool eventFilter( QObject* o, QEvent* e ); signals: void gotFocus(); @@ -346,7 +353,7 @@ QLabel* m_pC; QLabel* m_pDest; - QListView* m_pInfoList; + Q3ListView* m_pInfoList; };
--- a/kdiff3/src/fileaccess.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/fileaccess.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -19,6 +19,10 @@ #include <qpushbutton.h> #include <qeventloop.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <QTimerEvent> +#include <Q3VBoxLayout> #include "common.h" #include <ktempfile.h> @@ -349,14 +353,14 @@ if ( !m_localCopy.isEmpty() ) { QFile f( m_localCopy ); - if ( f.open( IO_ReadOnly ) ) + if ( f.open( QIODevice::ReadOnly ) ) return interruptableReadFile(f, pDestBuffer, maxLength);// maxLength == f.readBlock( (char*)pDestBuffer, maxLength ); } else if (m_bLocal) { QFile f( filePath() ); - if ( f.open( IO_ReadOnly ) ) + if ( f.open( QIODevice::ReadOnly ) ) return interruptableReadFile(f, pDestBuffer, maxLength); //maxLength == f.readBlock( (char*)pDestBuffer, maxLength ); } else @@ -373,7 +377,7 @@ if (m_bLocal) { QFile f( filePath() ); - if ( f.open( IO_WriteOnly ) ) + if ( f.open( QIODevice::WriteOnly ) ) { const unsigned long maxChunkSize = 100000; unsigned long i=0; @@ -454,13 +458,13 @@ { // short filenames for WIN98 because for system() the command must not exceed 120 characters. #ifdef _WIN32 - if ( QApplication::winVersion() & Qt::WV_DOS_based ) // Win95, 98, ME + if ( QApplication::winVersion() & QSysInfo::WV_DOS_based ) // Win95, 98, ME fileName = tmpDir + "\\" + QString::number(i); else #endif fileName = tmpDir + "/kdiff3_" + QString::number(i) +".tmp"; if ( ! FileAccess::exists(fileName) && - QFile(fileName).open(IO_WriteOnly) ) // open, truncate and close the file, true if successful + QFile(fileName).open(QIODevice::WriteOnly) ) // open, truncate and close the file, true if successful { break; } @@ -685,8 +689,8 @@ { long maxChunkSize = 100000; long length = min2( maxChunkSize, m_maxLength - m_transferredBytes ); - bool bSuccess = data.resize( length ); - if ( bSuccess ) + data.resize( length ); + if ( data.size()==length ) { if ( length>0 ) { @@ -855,13 +859,13 @@ QString destName = dest; QFile srcFile( srcName ); QFile destFile( destName ); - bool bReadSuccess = srcFile.open( IO_ReadOnly ); + bool bReadSuccess = srcFile.open( QIODevice::ReadOnly ); if ( bReadSuccess == false ) { m_pFileAccess->m_statusText = i18n("Error during file copy operation: Opening file for reading failed. Filename: %1").arg(srcName); return false; } - bool bWriteSuccess = destFile.open( IO_WriteOnly ); + bool bWriteSuccess = destFile.open( QIODevice::WriteOnly ); if ( bWriteSuccess == false ) { m_pFileAccess->m_statusText = i18n("Error during file copy operation: Opening file for writing failed. Filename: %1").arg(destName); @@ -1027,10 +1031,10 @@ { QFile file(name); - if( file.open(IO_ReadOnly) ) + if( file.open(QIODevice::ReadOnly) ) { QTextStream stream(&file); - while( !stream.eof() ) + while( !stream.atEnd() ) { addEntriesFromString(stream.readLine()); } @@ -1200,22 +1204,20 @@ dir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden ); dir.setMatchAllDirs( true ); - const QFileInfoList *fiList = dir.entryInfoList(); - if ( fiList == 0 ) + QFileInfoList fiList = dir.entryInfoList(); + if ( fiList.isEmpty() ) { // No Permission to read directory or other error. m_bSuccess = false; } else { - QFileInfoListIterator it( *fiList ); // create list iterator - for ( ; it.current() != 0; ++it ) // for each file... + foreach ( QFileInfo fi, fiList ) // for each file... { - QFileInfo* fi = it.current(); - if ( fi->fileName() == "." || fi->fileName()==".." ) + if ( fi.fileName() == "." || fi.fileName()==".." ) continue; - pDirList->push_back( FileAccess( nicePath(*fi) ) ); + pDirList->push_back( FileAccess( nicePath(fi) ) ); } } #else @@ -1223,7 +1225,7 @@ WIN32_FIND_DATA findData; WIN32_FIND_DATAA& findDataA=*(WIN32_FIND_DATAA*)&findData; // Needed for Win95 - HANDLE searchHandle = QT_WA_INLINE( + Qt::HANDLE searchHandle = QT_WA_INLINE( FindFirstFile( (TCHAR*)pattern.ucs2(), &findData ), FindFirstFileA( pattern.local8Bit(), &findDataA ) ); @@ -1422,7 +1424,7 @@ ProgressDialog::ProgressDialog( QWidget* pParent ) : QDialog( pParent, 0, true ) { - QVBoxLayout* layout = new QVBoxLayout(this); + Q3VBoxLayout* layout = new Q3VBoxLayout(this); m_pInformation = new QLabel( " ", this ); layout->addWidget( m_pInformation ); @@ -1439,7 +1441,7 @@ m_pSlowJobInfo = new QLabel( " ", this); layout->addWidget( m_pSlowJobInfo ); - QHBoxLayout* hlayout = new QHBoxLayout( layout ); + Q3HBoxLayout* hlayout = new Q3HBoxLayout( layout ); hlayout->addStretch(1); m_pAbortButton = new QPushButton( i18n("&Cancel"), this); hlayout->addWidget( m_pAbortButton ); @@ -1583,13 +1585,13 @@ m_progressDelayTimer = startTimer( 3000 ); /* 3 s delay */ // instead of using exec() the eventloop is entered and exited often without hiding/showing the window. -#if QT_VERSION==230 - //qApp->enter_loop(); -#else - qt_enter_modal(this); - qApp->eventLoop()->enterLoop(); - qt_leave_modal(this); -#endif + //qt_enter_modal(this); + QEventLoop* pEventLoop = new QEventLoop(this); + m_eventLoopStack.push_back( pEventLoop ); + pEventLoop->exec(); // this function only returns after ProgressDialog::exitEventLoop() is called. + delete pEventLoop; + m_eventLoopStack.pop_back(); + //qt_leave_modal(this); } void ProgressDialog::exitEventLoop() @@ -1597,7 +1599,8 @@ killTimer( m_progressDelayTimer ); m_progressDelayTimer = 0; m_pJob = 0; - qApp->eventLoop()->exitLoop(); + if (!m_eventLoopStack.empty()) + m_eventLoopStack.back()->exit(); } void ProgressDialog::recalc( bool bUpdate ) @@ -1758,4 +1761,4 @@ -#include "fileaccess.moc" +//#include "fileaccess.moc"
--- a/kdiff3/src/fileaccess.h Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/fileaccess.h Tue Apr 18 20:19:57 2006 +0000 @@ -13,6 +13,9 @@ #include <qdialog.h> #include <qfileinfo.h> +//Added by qt3to4: +#include <QLabel> +#include <QTimerEvent> #include <kprogress.h> #include <kio/job.h> #include <kio/jobclasses.h> @@ -216,6 +219,7 @@ std::list<ProgressLevelData> m_progressStack; int m_progressDelayTimer; + std::list<QEventLoop*> m_eventLoopStack; KProgress* m_pProgressBar; KProgress* m_pSubProgressBar;
--- a/kdiff3/src/kdiff3.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/kdiff3.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -28,11 +28,16 @@ #include <qlineedit.h> #include <qcheckbox.h> #include <qpushbutton.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qlabel.h> -#include <qtextedit.h> +#include <q3textedit.h> #include <qlayout.h> -#include <qpaintdevicemetrics.h> +#include <q3paintdevicemetrics.h> +//Added by qt3to4: +#include <QPixmap> +#include <Q3ValueList> +#include <Q3VBoxLayout> +#include <QDesktopWidget> // include files for KDE #include <kiconloader.h> @@ -153,11 +158,11 @@ //KMessageBox::information(0, s,i18n("KDiff3-Usage")); QDialog* pDialog = new QDialog(this,"",true,Qt::WDestructiveClose); pDialog->setCaption(title); - QVBoxLayout* pVBoxLayout = new QVBoxLayout( pDialog ); - QTextEdit* pTextEdit = new QTextEdit(pDialog); + Q3VBoxLayout* pVBoxLayout = new Q3VBoxLayout( pDialog ); + Q3TextEdit* pTextEdit = new Q3TextEdit(pDialog); pTextEdit->setText(s); pTextEdit->setReadOnly(true); - pTextEdit->setWordWrap(QTextEdit::NoWrap); + pTextEdit->setWordWrap(Q3TextEdit::NoWrap); pVBoxLayout->addWidget(pTextEdit); pDialog->resize(600,400); pDialog->exec(); @@ -264,10 +269,10 @@ slotRefresh(); m_pMainSplitter = this; //new QSplitter(this); - m_pMainSplitter->setOrientation( Vertical ); + m_pMainSplitter->setOrientation( Qt::Vertical ); // setCentralWidget( m_pMainSplitter ); m_pDirectoryMergeSplitter = new QSplitter( m_pMainSplitter ); - m_pDirectoryMergeSplitter->setOrientation( Horizontal ); + m_pDirectoryMergeSplitter->setOrientation( Qt::Horizontal ); m_pDirectoryMergeWindow = new DirectoryMergeWindow( m_pDirectoryMergeSplitter, m_pOptionDialog, KApplication::kApplication()->iconLoader() ); m_pDirectoryMergeInfo = new DirectoryMergeInfo( m_pDirectoryMergeSplitter ); @@ -275,7 +280,7 @@ connect( m_pDirectoryMergeWindow, SIGNAL(startDiffMerge(QString,QString,QString,QString,QString,QString,QString,TotalDiffStatus*)), this, SLOT( slotFileOpen2(QString,QString,QString,QString,QString,QString,QString,TotalDiffStatus*))); connect( m_pDirectoryMergeWindow, SIGNAL(selectionChanged()), this, SLOT(slotUpdateAvailabilities())); - connect( m_pDirectoryMergeWindow, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(slotUpdateAvailabilities())); + connect( m_pDirectoryMergeWindow, SIGNAL(currentChanged(Q3ListViewItem*)), this, SLOT(slotUpdateAvailabilities())); connect( m_pDirectoryMergeWindow, SIGNAL(checkIfCanContinue(bool*)), this, SLOT(slotCheckIfCanContinue(bool*))); connect( m_pDirectoryMergeWindow, SIGNAL(updateAvailabilities()), this, SLOT(slotUpdateAvailabilities())); connect( m_pDirectoryMergeWindow, SIGNAL(statusBarMessage(const QString&)), this, SLOT(slotStatusMsg(const QString&))); @@ -412,7 +417,7 @@ fileOpen = KStdAction::open(this, SLOT(slotFileOpen()), ac); fileOpen->setStatusText(i18n("Opens documents for comparison...")); - fileReload = new KAction(i18n("Reload"), /*QIconSet(QPixmap(reloadIcon)),*/ Key_F5, this, SLOT(slotReload()), ac, "file_reload"); + fileReload = new KAction(i18n("Reload"), /*QIconSet(QPixmap(reloadIcon)),*/ Qt::Key_F5, this, SLOT(slotReload()), ac, "file_reload"); fileSave = KStdAction::save(this, SLOT(slotFileSave()), ac); fileSave->setStatusText(i18n("Saves the merge result. All conflicts must be solved!")); @@ -462,35 +467,35 @@ #include "xpm/showlinenumbers.xpm" //#include "reload.xpm" - goCurrent = new KAction(i18n("Go to Current Delta"), QIconSet(QPixmap(currentpos)), CTRL+Key_Space, this, SLOT(slotGoCurrent()), ac, "go_current"); - goTop = new KAction(i18n("Go to First Delta"), QIconSet(QPixmap(upend)), 0, this, SLOT(slotGoTop()), ac, "go_top"); - goBottom = new KAction(i18n("Go to Last Delta"), QIconSet(QPixmap(downend)), 0, this, SLOT(slotGoBottom()), ac, "go_bottom"); + goCurrent = new KAction(i18n("Go to Current Delta"), QIcon(QPixmap(currentpos)), Qt::CTRL+Qt::Key_Space, this, SLOT(slotGoCurrent()), ac, "go_current"); + goTop = new KAction(i18n("Go to First Delta"), QIcon(QPixmap(upend)), 0, this, SLOT(slotGoTop()), ac, "go_top"); + goBottom = new KAction(i18n("Go to Last Delta"), QIcon(QPixmap(downend)), 0, this, SLOT(slotGoBottom()), ac, "go_bottom"); QString omitsWhitespace = ".\n" + i18n("(Skips white space differences when \"Show White Space\" is disabled.)"); QString includeWhitespace = ".\n" + i18n("(Does not skip white space differences even when \"Show White Space\" is disabled.)"); - goPrevDelta = new KAction(i18n("Go to Previous Delta"), QIconSet(QPixmap(up1arrow)), CTRL+Key_Up, this, SLOT(slotGoPrevDelta()), ac, "go_prev_delta"); + goPrevDelta = new KAction(i18n("Go to Previous Delta"), QIcon(QPixmap(up1arrow)), Qt::CTRL+Qt::Key_Up, this, SLOT(slotGoPrevDelta()), ac, "go_prev_delta"); goPrevDelta->setToolTip( goPrevDelta->text() + omitsWhitespace ); - goNextDelta = new KAction(i18n("Go to Next Delta"), QIconSet(QPixmap(down1arrow)), CTRL+Key_Down, this, SLOT(slotGoNextDelta()), ac, "go_next_delta"); + goNextDelta = new KAction(i18n("Go to Next Delta"), QIcon(QPixmap(down1arrow)), Qt::CTRL+Qt::Key_Down, this, SLOT(slotGoNextDelta()), ac, "go_next_delta"); goNextDelta->setToolTip( goNextDelta->text() + omitsWhitespace ); - goPrevConflict = new KAction(i18n("Go to Previous Conflict"), QIconSet(QPixmap(up2arrow)), CTRL+Key_PageUp, this, SLOT(slotGoPrevConflict()), ac, "go_prev_conflict"); + goPrevConflict = new KAction(i18n("Go to Previous Conflict"), QIcon(QPixmap(up2arrow)), Qt::CTRL+Qt::Key_PageUp, this, SLOT(slotGoPrevConflict()), ac, "go_prev_conflict"); goPrevConflict->setToolTip( goPrevConflict->text() + omitsWhitespace ); - goNextConflict = new KAction(i18n("Go to Next Conflict"), QIconSet(QPixmap(down2arrow)), CTRL+Key_PageDown, this, SLOT(slotGoNextConflict()), ac, "go_next_conflict"); + goNextConflict = new KAction(i18n("Go to Next Conflict"), QIcon(QPixmap(down2arrow)), Qt::CTRL+Qt::Key_PageDown, this, SLOT(slotGoNextConflict()), ac, "go_next_conflict"); goNextConflict->setToolTip( goNextConflict->text() + omitsWhitespace ); - goPrevUnsolvedConflict = new KAction(i18n("Go to Previous Unsolved Conflict"), QIconSet(QPixmap(prevunsolved)), 0, this, SLOT(slotGoPrevUnsolvedConflict()), ac, "go_prev_unsolved_conflict"); + goPrevUnsolvedConflict = new KAction(i18n("Go to Previous Unsolved Conflict"), QIcon(QPixmap(prevunsolved)), 0, this, SLOT(slotGoPrevUnsolvedConflict()), ac, "go_prev_unsolved_conflict"); goPrevUnsolvedConflict->setToolTip( goPrevUnsolvedConflict->text() + includeWhitespace ); - goNextUnsolvedConflict = new KAction(i18n("Go to Next Unsolved Conflict"), QIconSet(QPixmap(nextunsolved)), 0, this, SLOT(slotGoNextUnsolvedConflict()), ac, "go_next_unsolved_conflict"); + goNextUnsolvedConflict = new KAction(i18n("Go to Next Unsolved Conflict"), QIcon(QPixmap(nextunsolved)), 0, this, SLOT(slotGoNextUnsolvedConflict()), ac, "go_next_unsolved_conflict"); goNextUnsolvedConflict->setToolTip( goNextUnsolvedConflict->text() + includeWhitespace ); - chooseA = new KToggleAction(i18n("Select Line(s) From A"), QIconSet(QPixmap(iconA)), CTRL+Key_1, this, SLOT(slotChooseA()), ac, "merge_choose_a"); - chooseB = new KToggleAction(i18n("Select Line(s) From B"), QIconSet(QPixmap(iconB)), CTRL+Key_2, this, SLOT(slotChooseB()), ac, "merge_choose_b"); - chooseC = new KToggleAction(i18n("Select Line(s) From C"), QIconSet(QPixmap(iconC)), CTRL+Key_3, this, SLOT(slotChooseC()), ac, "merge_choose_c"); - autoAdvance = new KToggleAction(i18n("Automatically Go to Next Unsolved Conflict After Source Selection"), QIconSet(QPixmap(autoadvance)), 0, this, SLOT(slotAutoAdvanceToggled()), ac, "merge_autoadvance"); + chooseA = new KToggleAction(i18n("Select Line(s) From A"), QIcon(QPixmap(iconA)), Qt::CTRL+Qt::Key_1, this, SLOT(slotChooseA()), ac, "merge_choose_a"); + chooseB = new KToggleAction(i18n("Select Line(s) From B"), QIcon(QPixmap(iconB)), Qt::CTRL+Qt::Key_2, this, SLOT(slotChooseB()), ac, "merge_choose_b"); + chooseC = new KToggleAction(i18n("Select Line(s) From C"), QIcon(QPixmap(iconC)), Qt::CTRL+Qt::Key_3, this, SLOT(slotChooseC()), ac, "merge_choose_c"); + autoAdvance = new KToggleAction(i18n("Automatically Go to Next Unsolved Conflict After Source Selection"), QIcon(QPixmap(autoadvance)), 0, this, SLOT(slotAutoAdvanceToggled()), ac, "merge_autoadvance"); - showWhiteSpaceCharacters = new KToggleAction(i18n("Show Space && Tabulator Characters for Differences"), QIconSet(QPixmap(showwhitespacechars)), 0, this, SLOT(slotShowWhiteSpaceToggled()), ac, "diff_show_whitespace_characters"); - showWhiteSpace = new KToggleAction(i18n("Show White Space"), QIconSet(QPixmap(showwhitespace)), 0, this, SLOT(slotShowWhiteSpaceToggled()), ac, "diff_show_whitespace"); + showWhiteSpaceCharacters = new KToggleAction(i18n("Show Space && Tabulator Characters for Differences"), QIcon(QPixmap(showwhitespacechars)), 0, this, SLOT(slotShowWhiteSpaceToggled()), ac, "diff_show_whitespace_characters"); + showWhiteSpace = new KToggleAction(i18n("Show White Space"), QIcon(QPixmap(showwhitespace)), 0, this, SLOT(slotShowWhiteSpaceToggled()), ac, "diff_show_whitespace"); - showLineNumbers = new KToggleAction(i18n("Show Line Numbers"), QIconSet(QPixmap(showlinenumbers)), 0, this, SLOT(slotShowLineNumbersToggled()), ac, "diff_showlinenumbers"); - chooseAEverywhere = new KAction(i18n("Choose A Everywhere"), CTRL+SHIFT+Key_1, this, SLOT(slotChooseAEverywhere()), ac, "merge_choose_a_everywhere"); - chooseBEverywhere = new KAction(i18n("Choose B Everywhere"), CTRL+SHIFT+Key_2, this, SLOT(slotChooseBEverywhere()), ac, "merge_choose_b_everywhere"); - chooseCEverywhere = new KAction(i18n("Choose C Everywhere"), CTRL+SHIFT+Key_3, this, SLOT(slotChooseCEverywhere()), ac, "merge_choose_c_everywhere"); + showLineNumbers = new KToggleAction(i18n("Show Line Numbers"), QIcon(QPixmap(showlinenumbers)), 0, this, SLOT(slotShowLineNumbersToggled()), ac, "diff_showlinenumbers"); + chooseAEverywhere = new KAction(i18n("Choose A Everywhere"), Qt::CTRL+Qt::SHIFT+Qt::Key_1, this, SLOT(slotChooseAEverywhere()), ac, "merge_choose_a_everywhere"); + chooseBEverywhere = new KAction(i18n("Choose B Everywhere"), Qt::CTRL+Qt::SHIFT+Qt::Key_2, this, SLOT(slotChooseBEverywhere()), ac, "merge_choose_b_everywhere"); + chooseCEverywhere = new KAction(i18n("Choose C Everywhere"), Qt::CTRL+Qt::SHIFT+Qt::Key_3, this, SLOT(slotChooseCEverywhere()), ac, "merge_choose_c_everywhere"); chooseAForUnsolvedConflicts = new KAction(i18n("Choose A for All Unsolved Conflicts"), 0, this, SLOT(slotChooseAForUnsolvedConflicts()), ac, "merge_choose_a_for_unsolved_conflicts"); chooseBForUnsolvedConflicts = new KAction(i18n("Choose B for All Unsolved Conflicts"), 0, this, SLOT(slotChooseBForUnsolvedConflicts()), ac, "merge_choose_b_for_unsolved_conflicts"); chooseCForUnsolvedConflicts = new KAction(i18n("Choose C for All Unsolved Conflicts"), 0, this, SLOT(slotChooseCForUnsolvedConflicts()), ac, "merge_choose_c_for_unsolved_conflicts"); @@ -507,7 +512,7 @@ showWindowA = new KToggleAction(i18n("Show Window A"), 0, this, SLOT(slotShowWindowAToggled()), ac, "win_show_a"); showWindowB = new KToggleAction(i18n("Show Window B"), 0, this, SLOT(slotShowWindowBToggled()), ac, "win_show_b"); showWindowC = new KToggleAction(i18n("Show Window C"), 0, this, SLOT(slotShowWindowCToggled()), ac, "win_show_c"); - winFocusNext = new KAction(i18n("Focus Next Window"), ALT+Key_Right, this, SLOT(slotWinFocusNext()), ac, "win_focus_next"); + winFocusNext = new KAction(i18n("Focus Next Window"), Qt::ALT+Qt::Key_Right, this, SLOT(slotWinFocusNext()), ac, "win_focus_next"); overviewModeNormal = new KToggleAction(i18n("Normal Overview"), 0, this, SLOT(slotOverviewNormal()), ac, "diff_overview_normal"); overviewModeAB = new KToggleAction(i18n("A vs. B Overview"), 0, this, SLOT(slotOverviewAB()), ac, "diff_overview_ab"); @@ -527,7 +532,7 @@ dirShowBoth->setChecked( true ); dirViewToggle = new KAction(i18n("Toggle Between Dir && Text View"), 0, this, SLOT(slotDirViewToggle()), actionCollection(), "win_dir_view_toggle"); - m_pMergeEditorPopupMenu = new QPopupMenu( this ); + m_pMergeEditorPopupMenu = new Q3PopupMenu( this ); chooseA->plug( m_pMergeEditorPopupMenu ); chooseB->plug( m_pMergeEditorPopupMenu ); chooseC->plug( m_pMergeEditorPopupMenu ); @@ -663,10 +668,10 @@ { // A simple wrapline algorithm int l=0; - for (unsigned int p=0; p<headerText.length(); ) + for (int p=0; p<headerText.length(); ) { QString s = headerText.mid(p); - unsigned int i; + int i; for(i=2;i<s.length();++i) if (fm.width(s,i)>view.width()) { @@ -728,7 +733,7 @@ slotStatusMsg( i18n( "Printing aborted." ) ); return; } - QPaintDeviceMetrics metrics( painter.device() ); + Q3PaintDeviceMetrics metrics( painter.device() ); int dpiy = metrics.logicalDpiY(); int columnDistance = (int) ( (0.5/2.54)*dpiy ); // 0.5 cm between the columns @@ -765,7 +770,7 @@ if ( m_bTripleDiff && m_pDiffTextWindow3) totalNofLines = max2(totalNofLines, m_pDiffTextWindow3->getNofLines()); - QValueList<int> pageList = printer.pageList(); + Q3ValueList<int> pageList = printer.pageList(); bool bPrintCurrentPage=false; bool bFirstPrintedPage = false; @@ -801,7 +806,7 @@ int page = 1; - QValueList<int>::iterator pageListIt = pageList.begin(); + Q3ValueList<int>::iterator pageListIt = pageList.begin(); for(;;) { if (!bPrintSelection) @@ -960,4 +965,4 @@ -#include "kdiff3.moc" +//#include "kdiff3.moc"
--- a/kdiff3/src/kdiff3.h Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/kdiff3.h Tue Apr 18 20:19:57 2006 +0000 @@ -28,6 +28,10 @@ #include <qdialog.h> #include <qsplitter.h> #include <qscrollbar.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QEvent> +#include <Q3PopupMenu> // include files for KDE #include <kapplication.h> @@ -65,7 +69,7 @@ bool* m_pbRightToLeftLanguage; int m_realVal; public: - ReversibleScrollBar( Orientation o, QWidget* pParent, bool* pbRightToLeftLanguage ) + ReversibleScrollBar( Qt::Orientation o, QWidget* pParent, bool* pbRightToLeftLanguage ) : QScrollBar( o, pParent ) { m_pbRightToLeftLanguage=pbRightToLeftLanguage; @@ -248,7 +252,7 @@ KToggleAction *overviewModeBC; - QPopupMenu* m_pMergeEditorPopupMenu; + Q3PopupMenu* m_pMergeEditorPopupMenu; QSplitter* m_pMainSplitter; QWidget* m_pMainWidget;
--- a/kdiff3/src/kdiff3.pro Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/kdiff3.pro Tue Apr 18 20:19:57 2006 +0000 @@ -55,3 +55,5 @@ target.path = /usr/local/bin INSTALLS += target } +#The following line was inserted by qt3to4 +QT += qt3support
--- a/kdiff3/src/kdiff3_part.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/kdiff3_part.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -26,6 +26,8 @@ #include <qfile.h> #include <qtextstream.h> +//Added by qt3to4: +#include <Q3CString> #include "kdiff3.h" #include "fileaccess.h" @@ -102,9 +104,9 @@ { if ( str.left( lineStart.length() )==lineStart && fileName.isEmpty() ) { - unsigned int pos = lineStart.length(); + int pos = lineStart.length(); while ( pos<str.length() && (str[pos]==' ' || str[pos]=='\t') ) ++pos; - unsigned int pos2 = str.length()-1; + int pos2 = str.length()-1; while ( pos2>pos ) { while (pos2>pos && str[pos2]!=' ' && str[pos2]!='\t') --pos2; @@ -130,7 +132,7 @@ // m_file is always local so we can use QFile on it std::cerr << "KDiff3: " << m_file.latin1() << std::endl; QFile file(m_file); - if (file.open(IO_ReadOnly) == false) + if (file.open(QIODevice::ReadOnly) == false) return false; // our example widget is text-based, so we use QTextStream instead @@ -141,7 +143,7 @@ QString fileName2; QString version1; QString version2; - while (!stream.eof() && (fileName1.isEmpty() || fileName2.isEmpty()) ) + while (!stream.atEnd() && (fileName1.isEmpty() || fileName2.isEmpty()) ) { str = stream.readLine() + "\n"; getNameAndVersion( str, "---", fileName1, version1 ); @@ -277,7 +279,7 @@ KDiff3Part* obj = new KDiff3Part( parentWidget, widgetName, parent, name ); // See if we are to be read-write or not - if (QCString(classname) == "KParts::ReadOnlyPart") + if (Q3CString(classname) == "KParts::ReadOnlyPart") obj->setReadWrite(false); return obj; @@ -305,4 +307,4 @@ // Suppress warning with --enable-final #undef VERSION -#include "kdiff3_part.moc" +//#include "kdiff3_part.moc"
--- a/kdiff3/src/kdiff3_shell.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/kdiff3_shell.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -36,6 +36,8 @@ #include <klocale.h> #include <iostream> +//Added by qt3to4: +#include <QCloseEvent> KDiff3Shell::KDiff3Shell(bool bCompleteInit) : KParts::MainWindow( 0L, "kdiff3" ) @@ -188,4 +190,4 @@ ((KDiff3App*)pKDiff3Shell->m_part->widget())->completeInit(fn1,fn2,fn3); } -#include "kdiff3_shell.moc" +//#include "kdiff3_shell.moc"
--- a/kdiff3/src/kdiff3_shell.h Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/kdiff3_shell.h Tue Apr 18 20:19:57 2006 +0000 @@ -26,6 +26,8 @@ #include <kapplication.h> #include <kparts/mainwindow.h> +//Added by qt3to4: +#include <QCloseEvent> class KToggleAction;
--- a/kdiff3/src/kreplacements/ShellContextMenu.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/kreplacements/ShellContextMenu.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -9,7 +9,7 @@ #include <qstringlist.h> #include <qwidget.h> #include <qdir.h> -#include <qpopupmenu.h> +#include <QMenu> #include "ShellContextMenu.h" #ifdef _DEBUG @@ -26,7 +26,7 @@ #define MAX_ID 10000 -void showShellContextMenu( const QString& itemPath, QPoint pt, QWidget* pParentWidget, QPopupMenu* pMenu ) +void showShellContextMenu( const QString& itemPath, QPoint pt, QWidget* pParentWidget, QMenu* pMenu ) { CShellContextMenu scm; scm.SetObjects(QDir::convertSeparators(itemPath)); @@ -127,7 +127,7 @@ } -UINT CShellContextMenu::ShowContextMenu(QWidget * pParentWidget, QPoint pt, QPopupMenu* pMenu ) +UINT CShellContextMenu::ShowContextMenu(QWidget * pParentWidget, QPoint pt, QMenu* pMenu ) { HWND hWnd = pParentWidget->winId(); int iMenuType = 0; // to know which version of IContextMenu is supported
--- a/kdiff3/src/kreplacements/ShellContextMenu.h Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/kreplacements/ShellContextMenu.h Tue Apr 18 20:19:57 2006 +0000 @@ -19,7 +19,7 @@ void SetObjects (LPITEMIDLIST pidl); void SetObjects (const QString& strObject); void SetObjects (const QStringList& strList); - UINT ShowContextMenu (QWidget* pParent, QPoint pt, QPopupMenu* pMenu); + UINT ShowContextMenu (QWidget* pParent, QPoint pt, QMenu* pMenu); CShellContextMenu(); virtual ~CShellContextMenu();
--- a/kdiff3/src/kreplacements/kreplacements.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/kreplacements/kreplacements.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -23,16 +23,23 @@ #include <qnamespace.h> #include <qmessagebox.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qmenubar.h> #include <qpainter.h> #include <qcolordialog.h> #include <qfontdialog.h> #include <qlabel.h> -#include <qtextbrowser.h> +#include <q3textbrowser.h> #include <qtextstream.h> #include <qlayout.h> -#include <qdockarea.h> +#include <q3dockarea.h> +//Added by qt3to4: +#include <QPaintEvent> +#include <Q3VBoxLayout> +#include <Q3Frame> +#include <Q3CString> +#include <Q3ValueList> +#include <QPixmap> #include <vector> #include <iostream> @@ -79,10 +86,10 @@ HINSTANCE hi = FindExecutableA( helpFile.fileName().ascii(), helpFile.dirPath(true).ascii(), buf ); if ( int(hi)<=32 ) { - static QTextBrowser* pBrowser = 0; + static Q3TextBrowser* pBrowser = 0; if (pBrowser==0) { - pBrowser = new QTextBrowser( 0 ); + pBrowser = new Q3TextBrowser( 0 ); pBrowser->setMinimumSize( 600, 400 ); } pBrowser->setSource(helpFile.filePath()); @@ -95,10 +102,10 @@ } #else - static QTextBrowser* pBrowser = 0; + static Q3TextBrowser* pBrowser = 0; if (pBrowser==0) { - pBrowser = new QTextBrowser( 0 ); + pBrowser = new Q3TextBrowser( 0 ); pBrowser->setMinimumSize( 600, 400 ); } pBrowser->setSource("/usr/local/share/doc/kdiff3/en/index.html"); @@ -162,7 +169,7 @@ KDialogBase::KDialogBase( int, const QString& caption, int, int, QWidget* parent, const char* name, bool /*modal*/, bool ) -: QTabDialog( parent, name, true /* modal */ ) +: Q3TabDialog( parent, name, true /* modal */ ) { setCaption( caption ); setDefaultButton(); @@ -196,16 +203,16 @@ } -QVBox* KDialogBase::addVBoxPage( const QString& name, const QString& /*info*/, int ) +Q3VBox* KDialogBase::addVBoxPage( const QString& name, const QString& /*info*/, int ) { - QVBox* p = new QVBox(this, name.ascii()); + Q3VBox* p = new Q3VBox(this, name.ascii()); addTab( p, name ); return p; } -QFrame* KDialogBase::addPage( const QString& name, const QString& /*info*/, int ) +Q3Frame* KDialogBase::addPage( const QString& name, const QString& /*info*/, int ) { - QFrame* p = new QFrame( this, name.ascii() ); + Q3Frame* p = new Q3Frame( this, name.ascii() ); addTab( p, name ); return p; } @@ -226,7 +233,7 @@ slotOk(); s_inAccept = false; if ( s_bAccepted ) - QTabDialog::accept(); + Q3TabDialog::accept(); } else { @@ -256,7 +263,7 @@ const QString &filter, QWidget *parent, const QString &caption) { - QString s = QFileDialog::getSaveFileName(startDir, filter, parent, 0, caption); + QString s = Q3FileDialog::getSaveFileName(startDir, filter, parent, 0, caption); return KURL(s); } @@ -265,7 +272,7 @@ QWidget * parent, const QString & caption ) { - QString s = QFileDialog::getOpenFileName(startDir, filter, parent, 0, caption); + QString s = Q3FileDialog::getOpenFileName(startDir, filter, parent, 0, caption); return KURL(s); } @@ -273,7 +280,7 @@ QWidget * parent, const QString & caption) { - QString s = QFileDialog::getExistingDirectory(startDir, parent, 0, caption); + QString s = Q3FileDialog::getExistingDirectory(startDir, parent, 0, caption); return KURL(s); } @@ -282,7 +289,7 @@ QWidget *parent, const QString &caption) { - return QFileDialog::getSaveFileName( startDir, filter, parent, 0, caption ); + return Q3FileDialog::getSaveFileName( startDir, filter, parent, 0, caption ); } @@ -297,46 +304,46 @@ void KToolBar::setBarPos(BarPosition bp) { - if ( bp == Left ) m_pMainWindow->moveDockWindow( this, DockLeft ); - else if ( bp == Right ) m_pMainWindow->moveDockWindow( this, DockRight ); - else if ( bp == Bottom ) m_pMainWindow->moveDockWindow( this, DockBottom ); - else if ( bp == Top ) m_pMainWindow->moveDockWindow( this, DockTop ); + if ( bp == Left ) m_pMainWindow->moveDockWindow( this, Qt::DockLeft ); + else if ( bp == Right ) m_pMainWindow->moveDockWindow( this, Qt::DockRight ); + else if ( bp == Bottom ) m_pMainWindow->moveDockWindow( this, Qt::DockBottom ); + else if ( bp == Top ) m_pMainWindow->moveDockWindow( this, Qt::DockTop ); } -KToolBar::KToolBar( QMainWindow* parent ) -: QToolBar( parent ) +KToolBar::KToolBar( Q3MainWindow* parent ) +: Q3ToolBar( parent ) { m_pMainWindow = parent; } KMainWindow::KMainWindow( QWidget* parent, const char* name ) -: QMainWindow( parent, name ), m_actionCollection(this) +: Q3MainWindow( parent, name ), m_actionCollection(this) { - fileMenu = new QPopupMenu(); + fileMenu = new Q3PopupMenu(); menuBar()->insertItem(i18n("&File"), fileMenu); - editMenu = new QPopupMenu(); + editMenu = new Q3PopupMenu(); menuBar()->insertItem(i18n("&Edit"), editMenu); - directoryMenu = new QPopupMenu(); + directoryMenu = new Q3PopupMenu(); menuBar()->insertItem(i18n("&Directory"), directoryMenu); dirCurrentItemMenu = 0; dirCurrentSyncItemMenu = 0; - movementMenu = new QPopupMenu(); + movementMenu = new Q3PopupMenu(); menuBar()->insertItem(i18n("&Movement"), movementMenu); - diffMenu = new QPopupMenu(); + diffMenu = new Q3PopupMenu(); menuBar()->insertItem(i18n("D&iffview"), diffMenu); - mergeMenu = new QPopupMenu(); + mergeMenu = new Q3PopupMenu(); menuBar()->insertItem(i18n("&Merge"), mergeMenu); - windowsMenu = new QPopupMenu(); + windowsMenu = new Q3PopupMenu(); menuBar()->insertItem(i18n("&Window"), windowsMenu); - settingsMenu = new QPopupMenu(); + settingsMenu = new Q3PopupMenu(); menuBar()->insertItem(i18n("&Settings"), settingsMenu); - helpMenu = new QPopupMenu(); + helpMenu = new Q3PopupMenu(); menuBar()->insertItem(i18n("&Help"), helpMenu); m_pToolBar = new KToolBar(this); - memberList = new QList<KMainWindow>; + memberList = new QList<KMainWindow*>; memberList->append(this); } @@ -359,10 +366,10 @@ void KMainWindow::slotAbout() { - QTabDialog d; + Q3TabDialog d; d.setCaption("About " + s_appName); - QTextBrowser* tb1 = new QTextBrowser(&d); - tb1->setWordWrap( QTextEdit::NoWrap ); + Q3TextBrowser* tb1 = new Q3TextBrowser(&d); + tb1->setWordWrap( Q3TextEdit::NoWrap ); tb1->setText( s_appName + " Version " + s_version + "\n\n" + s_description + @@ -383,8 +390,8 @@ if ( !i->m_weblink.isEmpty() ) s2 += " " + i->m_weblink + "\n"; s2 += "\n"; } - QTextBrowser* tb2 = new QTextBrowser(&d); - tb2->setWordWrap( QTextEdit::NoWrap ); + Q3TextBrowser* tb2 = new Q3TextBrowser(&d); + tb2->setWordWrap( Q3TextEdit::NoWrap ); tb2->setText(s2); d.addTab(tb2,i18n("A&uthor")); @@ -397,8 +404,8 @@ if ( !i->m_weblink.isEmpty() ) s3 += " " + i->m_weblink + "\n"; s3 += "\n"; } - QTextBrowser* tb3 = new QTextBrowser(&d); - tb3->setWordWrap( QTextEdit::NoWrap ); + Q3TextBrowser* tb3 = new Q3TextBrowser(&d); + tb3->setWordWrap( Q3TextEdit::NoWrap ); tb3->setText(s3); d.addTab(tb3,i18n("&Thanks To")); @@ -449,7 +456,7 @@ } QFile f( m_fileName ); - if ( f.open(IO_ReadOnly) ) + if ( f.open(QIODevice::ReadOnly) ) { // file opened successfully QTextStream t( &f ); // use a text stream load(t); @@ -460,7 +467,7 @@ KConfig::~KConfig() { QFile f(m_fileName); - if ( f.open( IO_WriteOnly | IO_Translate ) ) + if ( f.open( QIODevice::WriteOnly | QIODevice::Text ) ) { // file opened successfully QTextStream t( &f ); // use a text stream save(t); @@ -494,9 +501,9 @@ { if ( p->dirCurrentItemMenu==0 ) { - p->dirCurrentItemMenu = new QPopupMenu(); + p->dirCurrentItemMenu = new Q3PopupMenu(); p->directoryMenu->insertItem(i18n("Current Item Merge Operation"), p->dirCurrentItemMenu); - p->dirCurrentSyncItemMenu = new QPopupMenu(); + p->dirCurrentSyncItemMenu = new Q3PopupMenu(); p->directoryMenu->insertItem(i18n("Current Item Sync Operation"), p->dirCurrentSyncItemMenu); } addTo( p->dirCurrentItemMenu ); @@ -505,9 +512,9 @@ { if ( p->dirCurrentItemMenu==0 ) { - p->dirCurrentItemMenu = new QPopupMenu(); + p->dirCurrentItemMenu = new Q3PopupMenu(); p->directoryMenu->insertItem(i18n("Current Item Merge Operation"), p->dirCurrentItemMenu); - p->dirCurrentSyncItemMenu = new QPopupMenu(); + p->dirCurrentSyncItemMenu = new Q3PopupMenu(); p->directoryMenu->insertItem(i18n("Current Item Sync Operation"), p->dirCurrentSyncItemMenu); } addTo( p->dirCurrentSyncItemMenu ); @@ -521,12 +528,13 @@ } -KAction::KAction(const QString& text, const QIconSet& icon, int accel, +KAction::KAction(const QString& text, const QIcon& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle, bool bMenu ) -: QAction ( text, icon, text, accel, actionCollection->m_pMainWindow, name, bToggle ) +: QAction ( icon, text, accel, actionCollection->m_pMainWindow, name ) { + setToggleAction( bToggle ); KMainWindow* p = actionCollection->m_pMainWindow; if ( !icon.isNull() && p ) this->addTo( p->m_pToolBar ); @@ -537,8 +545,9 @@ QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle, bool bMenu ) -: QAction ( text, text, accel, actionCollection->m_pMainWindow, name, bToggle ) +: QAction ( text, accel, actionCollection->m_pMainWindow, name ) { + setToggleAction( bToggle ); init(receiver,slot,actionCollection,name,bToggle,bMenu); } @@ -546,13 +555,13 @@ { } -void KAction::plug(QPopupMenu* menu) +void KAction::plug(Q3PopupMenu* menu) { addTo(menu); } -KToggleAction::KToggleAction(const QString& text, const QIconSet& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) +KToggleAction::KToggleAction(const QString& text, const QIcon& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) : KAction( text, icon, accel, receiver, slot, actionCollection, name, true, bMenu) { } @@ -562,7 +571,7 @@ { } -KToggleAction::KToggleAction(const QString& text, const QIconSet& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu) +KToggleAction::KToggleAction(const QString& text, const QIcon& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu) : KAction( text, icon, accel, 0, 0, actionCollection, name, true, bMenu) { } @@ -586,7 +595,7 @@ { #include "../xpm/fileopen.xpm" KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Open"), QIconSet(QPixmap(fileopen)), Qt::CTRL+Qt::Key_O, parent, slot, actionCollection, "open", false, false); + KAction* a = new KAction( i18n("Open"), QIcon(QPixmap(fileopen)), Qt::CTRL+Qt::Key_O, parent, slot, actionCollection, "open", false, false); if(p){ a->addTo( p->fileMenu ); } return a; } @@ -595,7 +604,7 @@ { #include "../xpm/filesave.xpm" KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Save"), QIconSet(QPixmap(filesave)), Qt::CTRL+Qt::Key_S, parent, slot, actionCollection, "save", false, false); + KAction* a = new KAction( i18n("Save"), QIcon(QPixmap(filesave)), Qt::CTRL+Qt::Key_S, parent, slot, actionCollection, "save", false, false); if(p){ a->addTo( p->fileMenu ); } return a; } @@ -612,7 +621,7 @@ { #include "../xpm/fileprint.xpm" KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Print..."), QIconSet(QPixmap(fileprint)),Qt::CTRL+Qt::Key_P, parent, slot, actionCollection, "print", false, false); + KAction* a = new KAction( i18n("Print..."), QIcon(QPixmap(fileprint)),Qt::CTRL+Qt::Key_P, parent, slot, actionCollection, "print", false, false); if(p) a->addTo( p->fileMenu ); return a; } @@ -731,7 +740,7 @@ : QWidget(pParent) { m_pParent = pParent; - QVBoxLayout* pLayout = new QVBoxLayout( this ); + Q3VBoxLayout* pLayout = new Q3VBoxLayout( this ); m_pSelectFont = new QPushButton(i18n("Select Font"), this ); connect(m_pSelectFont, SIGNAL(clicked()), this, SLOT(slotSelectFont())); pLayout->addWidget(m_pSelectFont); @@ -824,9 +833,9 @@ KPrinter::KPrinter() { } -QValueList<int> KPrinter::pageList() +Q3ValueList<int> KPrinter::pageList() { - QValueList<int> vl; + Q3ValueList<int> vl; int to = toPage(); for(int i=fromPage(); i<=to; ++i) { @@ -932,7 +941,7 @@ const char* pos = strchr( optName,' ' ); int len = pos==0 ? strlen( optName ) : pos - optName; - if( s == (const char*)( QCString( optName, len+1) ) ) + if( s == (const char*)( Q3CString( optName, len+1) ) ) { return s_vOption[j].isEmpty() ? QString() : s_vOption[j].last(); } @@ -951,7 +960,7 @@ const char* pos = strchr( optName,' ' ); int len = pos==0 ? strlen( optName ) : pos - optName; - if( s == (const char*)( QCString( optName, len+1) ) ) + if( s == (const char*)( Q3CString( optName, len+1) ) ) { return s_vOption[j]; } @@ -1010,7 +1019,7 @@ } m_config.readConfigFile(configFileName); - QStringList ignorableCmdLineOptionsList = m_config.readListEntry("IgnorableCmdLineOptions", QString("-u;-query;-html;-abort"), '|'); + QStringList ignorableCmdLineOptionsList = m_config.readListEntry("IgnorableCmdLineOptions", QStringList("-u;-query;-html;-abort"), '|'); QString ignorableCmdLineOptions; if ( !ignorableCmdLineOptionsList.isEmpty() ) ignorableCmdLineOptions = ignorableCmdLineOptionsList.front() + ";"; @@ -1049,7 +1058,7 @@ if (j==nofOptions) { QString s; - s = QString("Unknown option: ") + s_argv[i] + "\n"; + s = QString("Unknown option: ") + QString(s_argv[i]) + "\n"; s += "If KDiff3 should ignore this option, run KDiff3 normally and edit\n" "the \"Command line options to ignore\" in the \"Integration Settings\".\n\n";
--- a/kdiff3/src/kreplacements/kreplacements.h Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/kreplacements/kreplacements.h Tue Apr 18 20:19:57 2006 +0000 @@ -21,19 +21,26 @@ #include "common.h" #include <qobject.h> -#include <qtabdialog.h> -#include <qmainwindow.h> +#include <q3tabdialog.h> +#include <q3mainwindow.h> #include <qaction.h> -#include <qfiledialog.h> +#include <q3filedialog.h> #include <qapplication.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qpushbutton.h> #include <qstatusbar.h> -#include <qtoolbar.h> -#include <qprogressbar.h> -#include <qpopupmenu.h> +#include <q3toolbar.h> +#include <q3progressbar.h> +#include <q3popupmenu.h> #include <qstringlist.h> #include <qprinter.h> +//Added by qt3to4: +#include <Q3CString> +#include <QPixmap> +#include <QPaintEvent> +#include <Q3Frame> +#include <QLabel> +#include <Q3ValueList> #include <map> #include <list> @@ -83,9 +90,9 @@ #define RESTORE(x) #define _UNLOAD(x) -typedef QPopupMenu KPopupMenu; +typedef Q3PopupMenu KPopupMenu; -class KDialogBase : public QTabDialog +class KDialogBase : public Q3TabDialog { Q_OBJECT public: @@ -99,8 +106,8 @@ int BarIcon(const QString& iconName, int ); - QVBox* addVBoxPage( const QString& name, const QString& info, int ); - QFrame* addPage( const QString& name, const QString& info, int ); + Q3VBox* addVBoxPage( const QString& name, const QString& info, int ); + Q3Frame* addPage( const QString& name, const QString& info, int ); int spacingHint(); virtual void accept(); @@ -115,7 +122,7 @@ virtual void slotDefault( void ); }; -class KFileDialog : public QFileDialog +class KFileDialog : public Q3FileDialog { public: static KURL getSaveURL( const QString &startDir=QString::null, @@ -136,16 +143,16 @@ typedef QStatusBar KStatusBar; -class KToolBar : public QToolBar +class KToolBar : public Q3ToolBar { public: - KToolBar(QMainWindow* parent); + KToolBar(Q3MainWindow* parent); enum BarPosition {Top, Bottom, Left, Right}; BarPosition barPos(); void setBarPos(BarPosition); private: - QMainWindow* m_pMainWindow; + Q3MainWindow* m_pMainWindow; }; class KActionCollection @@ -168,7 +175,7 @@ class ReadWritePart; } -class KMainWindow : public QMainWindow +class KMainWindow : public Q3MainWindow { Q_OBJECT private: @@ -178,17 +185,17 @@ virtual bool queryClose() = 0; virtual bool queryExit() = 0; public: - QPopupMenu* fileMenu; - QPopupMenu* editMenu; - QPopupMenu* directoryMenu; - QPopupMenu* dirCurrentItemMenu; - QPopupMenu* dirCurrentSyncItemMenu; - QPopupMenu* movementMenu; - QPopupMenu* mergeMenu; - QPopupMenu* diffMenu; - QPopupMenu* windowsMenu; - QPopupMenu* settingsMenu; - QPopupMenu* helpMenu; + Q3PopupMenu* fileMenu; + Q3PopupMenu* editMenu; + Q3PopupMenu* directoryMenu; + Q3PopupMenu* dirCurrentItemMenu; + Q3PopupMenu* dirCurrentSyncItemMenu; + Q3PopupMenu* movementMenu; + Q3PopupMenu* mergeMenu; + Q3PopupMenu* diffMenu; + Q3PopupMenu* windowsMenu; + Q3PopupMenu* settingsMenu; + Q3PopupMenu* helpMenu; KToolBar* m_pToolBar; @@ -198,7 +205,7 @@ void createGUI(); void createGUI(KParts::ReadWritePart*){createGUI();} - QList<KMainWindow>* memberList; + QList<KMainWindow*>* memberList; public slots: void slotHelp(); void slotAbout(); @@ -219,20 +226,20 @@ { Q_OBJECT public: - KAction(const QString& text, const QIconSet& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle=false, bool bMenu=true); + KAction(const QString& text, const QIcon& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle=false, bool bMenu=true); KAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle=false, bool bMenu=true); void init(QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle, bool bMenu); void setStatusText(const QString&); - void plug(QPopupMenu*); + void plug(Q3PopupMenu*); }; class KToggleAction : public KAction { public: - KToggleAction(const QString& text, const QIconSet& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu=true); + KToggleAction(const QString& text, const QIcon& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu=true); KToggleAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu=true); - KToggleAction(const QString& text, const QIconSet& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu=true); + KToggleAction(const QString& text, const QIcon& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu=true); void setChecked(bool); bool isChecked(); }; @@ -300,7 +307,7 @@ public: KPrinter(); enum e_PageSelection {ApplicationSide}; - QValueList<int> pageList(); + Q3ValueList<int> pageList(); void setCurrentPage(int); void setPageSelection(e_PageSelection); }; @@ -346,7 +353,7 @@ std::list<AboutDataEntry> m_creditList; }; -typedef QValueList<QCString> QCStringList; +typedef Q3ValueList<Q3CString> QCStringList; class KCmdLineArgs { @@ -413,7 +420,7 @@ namespace KIO { enum UDSEntry {}; - typedef QValueList<UDSEntry> UDSEntryList; + typedef Q3ValueList<UDSEntry> UDSEntryList; class Job : public QObject { public: @@ -442,7 +449,7 @@ TransferJob* put( KURL, int, bool, bool, bool ); }; -typedef QProgressBar KProgress; +typedef Q3ProgressBar KProgress; class KInstance : public QObject { @@ -479,7 +486,7 @@ { public: ReadOnlyPart(){} - ReadOnlyPart(QObject*,const QCString&){} + ReadOnlyPart(QObject*,const Q3CString&){} void setInstance( KInstance* ){} QString m_file; }; @@ -487,7 +494,7 @@ class ReadWritePart : public ReadOnlyPart { public: - ReadWritePart(QObject*,const QCString&){} + ReadWritePart(QObject*,const Q3CString&){} void setReadWrite(bool){} };
--- a/kdiff3/src/main.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/main.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -24,6 +24,8 @@ #include <qtextcodec.h> #include <qfile.h> #include <qtextstream.h> +//Added by qt3to4: +#include <QTranslator> #include <vector> #ifdef KREPLACEMENTS_H @@ -67,7 +69,7 @@ vOptions.insert( vOptions.end(), options, (KCmdLineOptions*)((char*)options+sizeof(options))); QString configFileName = KStandardDirs().findResource("config","kdiff3rc"); QFile configFile( configFileName ); - if ( configFile.open( IO_ReadOnly ) ) + if ( configFile.open( QIODevice::ReadOnly ) ) { QTextStream ts( &configFile ); while(!ts.atEnd())
--- a/kdiff3/src/mergeresultwindow.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/mergeresultwindow.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -24,9 +24,18 @@ #include <qdir.h> #include <qfile.h> #include <qcursor.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qstatusbar.h> #include <qregexp.h> +//Added by qt3to4: +#include <QWheelEvent> +#include <QFocusEvent> +#include <QTextStream> +#include <QPaintEvent> +#include <QKeyEvent> +#include <QTimerEvent> +#include <QResizeEvent> +#include <QMouseEvent> #include <klocale.h> #include <kmessagebox.h> @@ -42,9 +51,9 @@ OptionDialog* pOptionDialog, QStatusBar* pStatusBar ) -: QWidget( pParent, 0, WRepaintNoErase ) +: QWidget( pParent, 0, Qt::WNoAutoErase ) { - setFocusPolicy( QWidget::ClickFocus ); + setFocusPolicy( Qt::ClickFocus ); m_firstLine = 0; m_firstColumn = 0; @@ -1101,9 +1110,9 @@ QString s( pld->pLine, pld->size ); historyLead = s.section(' ',0,0,QString::SectionIncludeLeadingSep); } - QRegExp historyStart = m_pOptionDialog->m_historyStartRegExp; + QRegExp historyStart( m_pOptionDialog->m_historyStartRegExp ); ++id3l; // Skip line with "$Log ... $" - QRegExp newHistoryEntry = m_pOptionDialog->m_historyEntryStartRegExp; + QRegExp newHistoryEntry( m_pOptionDialog->m_historyEntryStartRegExp ); QStringList parenthesesGroups; findParenthesesGroups( m_pOptionDialog->m_historyEntryStartRegExp, parenthesesGroups ); QString key; @@ -1333,7 +1342,7 @@ if ( m_pOptionDialog->m_autoMergeRegExp.isEmpty() ) return; - QRegExp vcsKeywords = m_pOptionDialog->m_autoMergeRegExp; + QRegExp vcsKeywords( m_pOptionDialog->m_autoMergeRegExp ); MergeLineList::iterator i; for ( i=m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) { @@ -1941,7 +1950,7 @@ { pos = max2(pos,0); line = max2(line,0); - if ( e->state() & Qt::ShiftButton ) + if ( e->state() & Qt::ShiftModifier ) { if (m_selection.firstLine==-1) m_selection.start( line, pos ); @@ -2113,10 +2122,10 @@ QString str = melIt->getString( this ); int x = convertToPosInText( str, m_cursorXPos, m_pOptionDialog->m_tabSize ); - bool bCtrl = ( e->state() & Qt::ControlButton ) != 0 ; - bool bShift = ( e->state() & Qt::ShiftButton ) != 0 ; + bool bCtrl = ( e->state() & Qt::ControlModifier ) != 0 ; + bool bShift = ( e->state() & Qt::ShiftModifier ) != 0 ; #ifdef _WIN32 - bool bAlt = ( e->state() & Qt::AltButton ) != 0 ; + bool bAlt = ( e->state() & Qt::AltModifier ) != 0 ; if ( bCtrl && bAlt ){ bCtrl=false; bAlt=false; } // AltGr-Key pressed. #endif @@ -2213,7 +2222,7 @@ for(;;) { const QString s = melIt1->getString(this); if ( !s.isEmpty() ) { - unsigned int i; + int i; for( i=0; i<s.length(); ++i ){ if(s[i]!=' ' && s[i]!='\t') break; } if (i<s.length()) { indentation = s.left(i); @@ -2424,7 +2433,7 @@ // Consider tabs - for( unsigned int i=0; i<str.length(); ++i ) + for( int i=0; i<str.length(); ++i ) { int spaces = 1; if ( str[i]=='\t' ) @@ -2672,7 +2681,7 @@ } QByteArray dataArray; - QTextStream textOutStream(dataArray, IO_WriteOnly); + QTextStream textOutStream(dataArray, QIODevice::WriteOnly); textOutStream.setCodec( m_pOptionDialog->m_pEncodingOut ); int line = 0; @@ -2766,7 +2775,7 @@ } Overview::Overview( QWidget* pParent, OptionDialog* pOptions ) -: QWidget( pParent, 0, WRepaintNoErase ) +: QWidget( pParent, 0, Qt::WNoAutoErase ) { m_pDiff3LineList = 0; m_pOptions = pOptions; @@ -3028,4 +3037,4 @@ } -#include "mergeresultwindow.moc" +//#include "mergeresultwindow.moc"
--- a/kdiff3/src/mergeresultwindow.h Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/mergeresultwindow.h Tue Apr 18 20:19:57 2006 +0000 @@ -23,6 +23,14 @@ #include <qwidget.h> #include <qpixmap.h> #include <qtimer.h> +//Added by qt3to4: +#include <QMouseEvent> +#include <QTimerEvent> +#include <QWheelEvent> +#include <QFocusEvent> +#include <QResizeEvent> +#include <QKeyEvent> +#include <QPaintEvent> class QPainter;
--- a/kdiff3/src/optiondialog.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/optiondialog.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -21,16 +21,19 @@ #include <qcheckbox.h> #include <qcombobox.h> #include <qfont.h> -#include <qframe.h> +#include <q3frame.h> #include <qlayout.h> #include <qlabel.h> #include <qlineedit.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qvalidator.h> #include <qtooltip.h> #include <qtextcodec.h> #include <qradiobutton.h> -#include <qvbuttongroup.h> +#include <Q3VButtonGroup> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3VBoxLayout> #include <kapplication.h> #include <kcolorbtn.h> @@ -228,7 +231,7 @@ void apply() { *m_pVar = currentText(); insertText(); } void write(ValueMap* config){ config->writeEntry( m_saveName, m_list, '|' ); } void read (ValueMap* config){ - m_list = config->readListEntry( m_saveName, m_defaultVal, '|' ); + m_list = config->readListEntry( m_saveName, QStringList(m_defaultVal), '|' ); if ( !m_list.empty() ) *m_pVar = m_list.front(); clear(); insertStringList(m_list); @@ -241,7 +244,7 @@ m_list.push_front( current ); clear(); if ( m_list.size()>10 ) - m_list.erase( m_list.at(10),m_list.end() ); + m_list.erase( m_list.begin()+10, m_list.end() ); insertStringList(m_list); } OptionLineEdit( const OptionLineEdit& ); // private copy constructor without implementation @@ -364,10 +367,10 @@ // First sort codec names: std::map<QString, QTextCodec*> names; - int i; - for(i=0;;++i) + QList<int> mibs = QTextCodec::availableMibs(); + foreach(int i, mibs) { - QTextCodec* c = QTextCodec::codecForIndex(i); + QTextCodec* c = QTextCodec::codecForMib(i); if ( c==0 ) break; else names[QString(c->name()).upper()]=c; } @@ -432,7 +435,7 @@ } void write(ValueMap* config) { - if (m_ppVarCodec!=0) config->writeEntry(m_saveName, (*m_ppVarCodec)->name() ); + if (m_ppVarCodec!=0) config->writeEntry(m_saveName, QString((*m_ppVarCodec)->name()) ); } void read (ValueMap* config) { @@ -504,10 +507,10 @@ void OptionDialog::setupFontPage( void ) { - QFrame *page = addPage( i18n("Font"), i18n("Editor & Diff Output Font" ), + Q3Frame *page = addPage( i18n("Font"), i18n("Editor & Diff Output Font" ), BarIcon("fonts", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); QFont defaultFont = #ifdef _WIN32 @@ -521,7 +524,7 @@ OptionFontChooser* pFontChooser = new OptionFontChooser( defaultFont, "Font", &m_font, page, this ); topLayout->addWidget( pFontChooser ); - QGridLayout *gbox = new QGridLayout( 1, 2 ); + Q3GridLayout *gbox = new Q3GridLayout( 1, 2 ); topLayout->addLayout( gbox ); int line=0; @@ -536,18 +539,18 @@ void OptionDialog::setupColorPage( void ) { - QFrame *page = addPage( i18n("Color"), i18n("Colors Settings"), + Q3Frame *page = addPage( i18n("Color"), i18n("Colors Settings"), BarIcon("colorize", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); - QGridLayout *gbox = new QGridLayout( 7, 2 ); + Q3GridLayout *gbox = new Q3GridLayout( 7, 2 ); gbox->setColStretch(1,5); topLayout->addLayout(gbox); QLabel* label; int line = 0; - int depth = QColor::numBitPlanes(); + int depth = QPixmap::defaultDepth(); bool bLowColor = depth<=8; label = new QLabel( i18n("Editor and Diff Views:"), page ); @@ -664,11 +667,11 @@ void OptionDialog::setupEditPage( void ) { - QFrame *page = addPage( i18n("Editor"), i18n("Editor Behavior"), + Q3Frame *page = addPage( i18n("Editor"), i18n("Editor Behavior"), BarIcon("edit", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); - QGridLayout *gbox = new QGridLayout( 4, 2 ); + Q3GridLayout *gbox = new Q3GridLayout( 4, 2 ); gbox->setColStretch(1,5); topLayout->addLayout( gbox ); QLabel* label; @@ -726,11 +729,11 @@ void OptionDialog::setupDiffPage( void ) { - QFrame *page = addPage( i18n("Diff and Merge"), i18n("Diff and Merge Settings"), + Q3Frame *page = addPage( i18n("Diff and Merge"), i18n("Diff and Merge Settings"), BarIcon("misc", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); - QGridLayout *gbox = new QGridLayout( 3, 2 ); + Q3GridLayout *gbox = new Q3GridLayout( 3, 2 ); gbox->setColStretch(1,5); topLayout->addLayout( gbox ); int line=0; @@ -825,12 +828,12 @@ ); ++line; - QGroupBox* pGroupBox = new QGroupBox( 2, Qt::Horizontal, i18n("Automatic Merge Regular Expression"), page); + Q3GroupBox* pGroupBox = new Q3GroupBox( 2, Qt::Horizontal, i18n("Automatic Merge Regular Expression"), page); gbox->addMultiCellWidget( pGroupBox, line,line,0,1); ++line; { QWidget* page = new QWidget( pGroupBox ); - QGridLayout* gbox = new QGridLayout( page, 2, 2, spacingHint() ); + Q3GridLayout* gbox = new Q3GridLayout( page, 2, 2, spacingHint() ); gbox->setColStretch(1,10); int line = 0; @@ -851,12 +854,12 @@ ++line; } - pGroupBox = new QGroupBox( 2, Qt::Horizontal, i18n("Version Control History Merging"), page); + pGroupBox = new Q3GroupBox( 2, Qt::Horizontal, i18n("Version Control History Merging"), page); gbox->addMultiCellWidget( pGroupBox, line,line,0,1); ++line; { QWidget* page = new QWidget( pGroupBox ); - QGridLayout* gbox = new QGridLayout( page, 2, 2, spacingHint() ); + Q3GridLayout* gbox = new Q3GridLayout( page, 2, 2, spacingHint() ); gbox->setColStretch(1,10); int line = 0; @@ -865,10 +868,7 @@ m_pHistoryStartRegExpLineEdit = new OptionLineEdit( ".*\\$Log.*\\$.*", "HistoryStartRegExp", &m_historyStartRegExp, page, this ); gbox->addWidget( m_pHistoryStartRegExpLineEdit, line, 1 ); s_historyStartRegExpToolTip = i18n("Regular expression for the start of the version control history entry.\n" - "Usually this line contains the \"$Log$ - "Usually this line contains the \"Revision 1.7 2006/04/10 08:37:33 joachim99 - "Usually this line contains the \"KDiff3 0.9.89 - "Usually this line contains the \"\"-keyword.\n" + "Usually this line contains the \"$Log$\"-keyword.\n" "Default value: \".*\\$Log.*\\$.*\""); QToolTip::add( label, s_historyStartRegExpToolTip ); ++line; @@ -945,11 +945,11 @@ void OptionDialog::setupDirectoryMergePage( void ) { - QFrame *page = addPage( i18n("Directory Merge"), i18n("Directory Merge"), + Q3Frame *page = addPage( i18n("Directory Merge"), i18n("Directory Merge"), BarIcon("folder", KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); - QGridLayout *gbox = new QGridLayout( 11, 2 ); + Q3GridLayout *gbox = new Q3GridLayout( 11, 2 ); gbox->setColStretch(1,5); topLayout->addLayout( gbox ); int line=0; @@ -1042,7 +1042,7 @@ "Set this option if the case of the names must match. (Default for Windows is off, otherwise on.)")); ++line; - QVButtonGroup* pBG = new QVButtonGroup(i18n("File Comparison Mode"),page); + Q3VButtonGroup* pBG = new Q3VButtonGroup(i18n("File Comparison Mode"),page); gbox->addMultiCellWidget( pBG, line, line, 0, 1 ); ++line; @@ -1118,11 +1118,11 @@ void OptionDialog::setupRegionalPage( void ) { - QFrame *page = addPage( i18n("Regional Settings"), i18n("Regional Settings"), + Q3Frame *page = addPage( i18n("Regional Settings"), i18n("Regional Settings"), BarIcon("locale"/*"charset"*/, KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); - QGridLayout *gbox = new QGridLayout( 3, 2 ); + Q3GridLayout *gbox = new Q3GridLayout( 3, 2 ); gbox->setColStretch(1,5); topLayout->addLayout( gbox ); int line=0; @@ -1318,11 +1318,11 @@ void OptionDialog::setupIntegrationPage( void ) { - QFrame *page = addPage( i18n("Integration"), i18n("Integration Settings"), + Q3Frame *page = addPage( i18n("Integration"), i18n("Integration Settings"), BarIcon("launch"/*"charset"*/, KIcon::SizeMedium ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 5, spacingHint() ); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); - QGridLayout *gbox = new QGridLayout( 3, 2 ); + Q3GridLayout *gbox = new Q3GridLayout( 3, 2 ); gbox->setColStretch(1,5); topLayout->addLayout( gbox ); int line=0; @@ -1572,4 +1572,4 @@ } -#include "optiondialog.moc" +//#include "optiondialog.moc"
--- a/kdiff3/src/optiondialog.h Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/optiondialog.h Tue Apr 18 20:19:57 2006 +0000 @@ -1,3 +1,5 @@ +//Added by qt3to4: +#include <QLabel> /* * kdiff3 - Text Diff And Merge Tool * Copyright (C) 2002-2006 Joachim Eibl, joachim.eibl at gmx.de
--- a/kdiff3/src/pdiff.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/pdiff.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -23,7 +23,16 @@ #include <iostream> #include <algorithm> #include <ctype.h> -#include <qaccel.h> +#include <q3accel.h> +//Added by qt3to4: +#include <QWheelEvent> +#include <QKeyEvent> +#include <QEvent> +#include <QDropEvent> +#include <Q3ValueList> +#include <Q3HBoxLayout> +#include <QResizeEvent> +#include <Q3VBoxLayout> #include <klocale.h> #include <kmessagebox.h> @@ -38,8 +47,8 @@ #include <qsplitter.h> #include <qdir.h> #include <qfile.h> -#include <qvbuttongroup.h> -#include <qdragobject.h> +#include <Q3VButtonGroup> +#include <q3dragobject.h> #include <qlineedit.h> #include <qcombobox.h> #include <assert.h> @@ -618,7 +627,7 @@ void KDiff3App::initView() { // set the main widget here - QValueList<int> oldHeights; + Q3ValueList<int> oldHeights; if ( m_pDirectoryMergeSplitter->isVisible() ) { oldHeights = m_pMainSplitter->sizes(); @@ -631,14 +640,14 @@ } m_pMainWidget = new QWidget(m_pMainSplitter); - QVBoxLayout* pVLayout = new QVBoxLayout(m_pMainWidget,0,0); + Q3VBoxLayout* pVLayout = new Q3VBoxLayout(m_pMainWidget,0,0); QSplitter* pVSplitter = new QSplitter( m_pMainWidget ); pVSplitter->setOrientation( Qt::Vertical ); pVLayout->addWidget( pVSplitter ); QWidget* pDiffWindowFrame = new QWidget( pVSplitter ); - QHBoxLayout* pDiffHLayout = new QHBoxLayout( pDiffWindowFrame,0,0 ); + Q3HBoxLayout* pDiffHLayout = new Q3HBoxLayout( pDiffWindowFrame,0,0 ); m_pDiffWindowSplitter = new QSplitter( pDiffWindowFrame ); m_pDiffWindowSplitter->setOrientation( m_pOptionDialog->m_bHorizDiffWindowSplitting ? Qt::Horizontal : Qt::Vertical ); @@ -664,7 +673,7 @@ // Merge window m_pMergeWindowFrame = new QWidget( pVSplitter ); - QHBoxLayout* pMergeHLayout = new QHBoxLayout( m_pMergeWindowFrame,0,0 ); + Q3HBoxLayout* pMergeHLayout = new Q3HBoxLayout( m_pMergeWindowFrame,0,0 ); m_pMergeResultWindow = new MergeResultWindow( m_pMergeWindowFrame, m_pOptionDialog, statusBar() ); pMergeHLayout->addWidget( m_pMergeResultWindow ); @@ -674,14 +683,14 @@ autoAdvance->setEnabled(true); - QValueList<int> sizes = pVSplitter->sizes(); + Q3ValueList<int> sizes = pVSplitter->sizes(); int total = sizes[0] + sizes[1]; sizes[0]=total/2; sizes[1]=total/2; pVSplitter->setSizes( sizes ); m_pMergeResultWindow->installEventFilter( this ); // for Cut/Copy/Paste-shortcuts - QHBoxLayout* pHScrollBarLayout = new QHBoxLayout( pVLayout ); + Q3HBoxLayout* pHScrollBarLayout = new Q3HBoxLayout( pVLayout ); m_pHScrollBar = new ReversibleScrollBar( Qt::Horizontal, m_pMainWidget, &m_pOptionDialog->m_bRightToLeftLanguage ); pHScrollBarLayout->addWidget( m_pHScrollBar ); m_pCornerWidget = new QWidget( m_pMainWidget ); @@ -828,17 +837,17 @@ if ( e->type() == QEvent::KeyPress ) { // key press QKeyEvent *k = (QKeyEvent*)e; - if (k->key()==Qt::Key_Insert && (k->state() & Qt::ControlButton)!=0 ) + if (k->key()==Qt::Key_Insert && (k->state() & Qt::ControlModifier)!=0 ) { slotEditCopy(); return true; } - if (k->key()==Qt::Key_Insert && (k->state() & Qt::ShiftButton)!=0 ) + if (k->key()==Qt::Key_Insert && (k->state() & Qt::ShiftModifier)!=0 ) { slotEditPaste(); return true; } - if (k->key()==Qt::Key_Delete && (k->state() & Qt::ShiftButton)!=0 ) + if (k->key()==Qt::Key_Delete && (k->state() & Qt::ShiftModifier)!=0 ) { slotEditCut(); return true; @@ -851,13 +860,13 @@ { QKeyEvent *k = (QKeyEvent*)e; - bool bCtrl = (k->state() & Qt::ControlButton) != 0; + bool bCtrl = (k->state() & Qt::ControlModifier) != 0; if (k->key()==Qt::Key_Insert && bCtrl ) { slotEditCopy(); return true; } - if (k->key()==Qt::Key_Insert && (k->state() & Qt::ShiftButton)!=0 ) + if (k->key()==Qt::Key_Insert && (k->state() & Qt::ShiftModifier)!=0 ) { slotEditPaste(); return true; @@ -904,11 +913,11 @@ QDropEvent* pDropEvent = static_cast<QDropEvent*>(e); pDropEvent->accept(); - if ( QUriDrag::canDecode(pDropEvent) ) + if ( Q3UriDrag::canDecode(pDropEvent) ) { #ifdef KREPLACEMENTS_H QStringList stringList; - QUriDrag::decodeLocalFiles( pDropEvent, stringList ); + Q3UriDrag::decodeLocalFiles( pDropEvent, stringList ); if ( canContinue() && !stringList.isEmpty() ) { raise(); @@ -932,10 +941,10 @@ } #endif } - else if ( QTextDrag::canDecode(pDropEvent) ) + else if ( Q3TextDrag::canDecode(pDropEvent) ) { QString text; - bool bDecodeSuccess = QTextDrag::decode( pDropEvent, text ); + bool bDecodeSuccess = Q3TextDrag::decode( pDropEvent, text ); if ( bDecodeSuccess && canContinue() ) { raise();
--- a/kdiff3/src/smalldialogs.cpp Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/smalldialogs.cpp Tue Apr 18 20:19:57 2006 +0000 @@ -27,11 +27,17 @@ #include <qlabel.h> #include <qlayout.h> #include <qpushbutton.h> -#include <qdragobject.h> +#include <q3dragobject.h> #include <qregexp.h> #include <qtooltip.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qcursor.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <QEvent> +#include <QDropEvent> +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> #include <kfiledialog.h> @@ -46,8 +52,8 @@ { m_pOptions = pOptions; - QVBoxLayout* v = new QVBoxLayout( this, 5 ); - QGridLayout* h = new QGridLayout( v, 5, 4, 5 ); + Q3VBoxLayout* v = new Q3VBoxLayout( this, 5 ); + Q3GridLayout* h = new Q3GridLayout( v, 5, 4, 5 ); h->setColStretch( 1, 10 ); QLabel* label = new QLabel( i18n("A (Base):"), this ); @@ -102,14 +108,14 @@ m_pMerge = new QCheckBox( i18n("Merge"), this ); h->addWidget( m_pMerge, 3, 0 ); - QHBoxLayout* hl = new QHBoxLayout(); + Q3HBoxLayout* hl = new Q3HBoxLayout(); h->addLayout( hl, 3, 1 ); hl->addStretch(2); button = new QPushButton(i18n("Swap/Copy Names ..."), this); //button->setToggleButton(false); hl->addWidget( button ); - QPopupMenu* m = new QPopupMenu(this); + Q3PopupMenu* m = new Q3PopupMenu(this); int id=0; m->insertItem( i18n("Swap %1<->%2").arg("A").arg("B"), id++ ); m->insertItem( i18n("Swap %1<->%2").arg("B").arg("C"), id++ ); @@ -153,7 +159,7 @@ h->addColSpacing( 1, 200 ); - QHBoxLayout* l = new QHBoxLayout( v, 5 ); + Q3HBoxLayout* l = new Q3HBoxLayout( v, 5 ); button = new QPushButton( i18n("Configure..."), this ); connect( button, SIGNAL(clicked()), pParent, slotConfigure ); @@ -191,12 +197,12 @@ { QDropEvent* d = static_cast<QDropEvent*>(e); - if ( !QUriDrag::canDecode( d ) ) { + if ( !Q3UriDrag::canDecode( d ) ) { return false; } QStringList lst; - QUriDrag::decodeLocalFiles( d, lst ); + Q3UriDrag::decodeLocalFiles( d, lst ); if ( lst.count() > 0 ) { @@ -254,7 +260,7 @@ void OpenDialog::accept() { - unsigned int maxNofRecentFiles = 10; + int maxNofRecentFiles = 10; QString s = m_pLineA->currentText(); s = KURL::fromPathOrURL(s).prettyURL(); @@ -262,28 +268,28 @@ // If an item exist, remove it from the list and reinsert it at the beginning. sl->remove(s); if ( !s.isEmpty() ) sl->prepend( s ); - if (sl->count()>maxNofRecentFiles) sl->erase( sl->at(maxNofRecentFiles), sl->end() ); + if (sl->count()>maxNofRecentFiles) sl->erase( sl->begin()+maxNofRecentFiles, sl->end() ); s = m_pLineB->currentText(); s = KURL::fromPathOrURL(s).prettyURL(); sl = &m_pOptions->m_recentBFiles; sl->remove(s); if ( !s.isEmpty() ) sl->prepend( s ); - if (sl->count()>maxNofRecentFiles) sl->erase( sl->at(maxNofRecentFiles), sl->end() ); + if (sl->count()>maxNofRecentFiles) sl->erase( sl->begin()+maxNofRecentFiles, sl->end() ); s = m_pLineC->currentText(); s = KURL::fromPathOrURL(s).prettyURL(); sl = &m_pOptions->m_recentCFiles; sl->remove(s); if ( !s.isEmpty() ) sl->prepend( s ); - if (sl->count()>maxNofRecentFiles) sl->erase( sl->at(maxNofRecentFiles), sl->end() ); + if (sl->count()>maxNofRecentFiles) sl->erase( sl->begin()+maxNofRecentFiles, sl->end() ); s = m_pLineOut->currentText(); s = KURL::fromPathOrURL(s).prettyURL(); sl = &m_pOptions->m_recentOutputFiles; sl->remove(s); if ( !s.isEmpty() ) sl->prepend( s ); - if (sl->count()>maxNofRecentFiles) sl->erase( sl->at(maxNofRecentFiles), sl->end() ); + if (sl->count()>maxNofRecentFiles) sl->erase( sl->begin()+maxNofRecentFiles, sl->end() ); QDialog::accept(); } @@ -321,7 +327,7 @@ FindDialog::FindDialog(QWidget* pParent) : QDialog( pParent ) { - QGridLayout* layout = new QGridLayout( this ); + Q3GridLayout* layout = new Q3GridLayout( this ); layout->setMargin(5); layout->setSpacing(5); @@ -374,7 +380,7 @@ { int line=0; setCaption(i18n("Regular Expression Tester")); - QGridLayout* pGrid = new QGridLayout( this, 11, 2, 5, 5 ); + Q3GridLayout* pGrid = new Q3GridLayout( this, 11, 2, 5, 5 ); QLabel* l = new QLabel(i18n("Auto merge regular expression:"), this); pGrid->addWidget(l,line,0); @@ -513,7 +519,7 @@ void RegExpTester::slotRecalc() { - QRegExp autoMergeRegExp = m_pAutoMergeRegExpEdit->text(); + QRegExp autoMergeRegExp( m_pAutoMergeRegExpEdit->text() ); if ( autoMergeRegExp.exactMatch( m_pAutoMergeExampleEdit->text() ) ) { m_pAutoMergeMatchResult->setText( i18n("Match success.") ); @@ -523,7 +529,7 @@ m_pAutoMergeMatchResult->setText( i18n("Match failed.") ); } - QRegExp historyStartRegExp = m_pHistoryStartRegExpEdit->text(); + QRegExp historyStartRegExp( m_pHistoryStartRegExpEdit->text() ); if ( historyStartRegExp.exactMatch( m_pHistoryStartExampleEdit->text() ) ) { m_pHistoryStartMatchResult->setText( i18n("Match success.") ); @@ -542,7 +548,7 @@ m_pHistorySortKeyResult->setText( i18n("") ); return; } - QRegExp historyEntryStartRegExp = m_pHistoryEntryStartRegExpEdit->text(); + QRegExp historyEntryStartRegExp( m_pHistoryEntryStartRegExpEdit->text() ); QString s = m_pHistoryEntryStartExampleEdit->text(); if ( historyEntryStartRegExp.exactMatch( s ) ) @@ -558,4 +564,4 @@ } } -#include "smalldialogs.moc" +//#include "smalldialogs.moc"
--- a/kdiff3/src/smalldialogs.h Mon Apr 10 08:40:51 2006 +0000 +++ b/kdiff3/src/smalldialogs.h Tue Apr 18 20:19:57 2006 +0000 @@ -22,6 +22,9 @@ #define SMALLDIALOGS_H #include <qdialog.h> +//Added by qt3to4: +#include <QLabel> +#include <QEvent> #include "diff.h" class OptionDialog;
--- a/kdiff3/src/xpm/equal.xpm Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* XPM */ -static const char *equal_pm[]={ -"16 16 3 1", -". c None", -"# c #000000", -"a c #00d000", -"################", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"################"};
--- a/kdiff3/src/xpm/left1arrow.xpm Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* XPM */ -static const char *left1arrow[] = { -/* columns rows colors chars-per-pixel */ -"16 16 2 1", -" c #000000", -". c None", -/* pixels */ -"................", -"................", -".......... .....", -"......... .....", -"........ .....", -"....... .....", -"...... .....", -"..... .....", -"..... .....", -"...... .....", -"....... .....", -"........ .....", -"......... .....", -".......... .....", -"................", -"................" -};
--- a/kdiff3/src/xpm/left2arrow.xpm Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* XPM */ -static const char *left2arrow[] = { -/* columns rows colors chars-per-pixel */ -"16 16 2 1", -" c #000000", -". c None", -/* pixels */ -"................", -"................", -"....... ..... ..", -"...... .... ..", -"..... ... ..", -".... .. ..", -"... . ..", -".. ..", -".. ..", -"... . ..", -".... .. ..", -"..... ... ..", -"...... .... ..", -"....... ..... ..", -"................", -"................" -};
--- a/kdiff3/src/xpm/leftend.xpm Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* XPM */ -static const char *leftend[]={ -"16 16 2 1", -"# c #000000", -". c None", -"................", -"................", -"....#.....#.....", -"....#....##.....", -"....#...###.....", -"....#..####.....", -"....#.#####.....", -"....#######.....", -"....#######.....", -"....#.#####.....", -"....#..####.....", -"....#...###.....", -"....#....##.....", -"....#.....#.....", -"................", -"................"};
--- a/kdiff3/src/xpm/not_equal.xpm Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* XPM */ -static const char *not_equal_pm[]={ -"16 16 3 1", -". c None", -"# c #000000", -"a c #f00000", -"################", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"################"}; -
--- a/kdiff3/src/xpm/not_everywhere.xpm Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* XPM */ -static const char *not_everywhere_pm[]={ -"16 16 3 1", -". c None", -"# c #000000", -"a c #c0c000", -"################", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"################"}; -
--- a/kdiff3/src/xpm/not_there.xpm Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* XPM */ -static const char *not_there_pm[]={ -"16 16 3 1", -". c None", -"# c #000000", -"a c #000000", -"################", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"#aaaaaaaaaaaaaa#", -"################"};
--- a/kdiff3/src/xpm/right1arrow.xpm Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* XPM */ -static const char *right1arrow[] = { -/* columns rows colors chars-per-pixel */ -"16 16 2 1", -" c #000000", -". c None", -/* pixels */ -"................", -"................", -"..... ..........", -"..... .........", -"..... ........", -"..... .......", -"..... ......", -"..... .....", -"..... .....", -"..... ......", -"..... .......", -"..... ........", -"..... .........", -"..... ..........", -"................", -"................" -};
--- a/kdiff3/src/xpm/right2arrow.xpm Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* XPM */ -static const char *right2arrow[] = { -/* columns rows colors chars-per-pixel */ -"16 16 2 1", -" c #000000", -". c None", -/* pixels */ -"................", -"................", -".. ..... .......", -".. .... ......", -".. ... .....", -".. .. ....", -".. . ...", -".. ..", -".. ..", -".. . ...", -".. .. ....", -".. ... .....", -".. .... ......", -".. ..... .......", -"................", -"................" -};
--- a/kdiff3/src/xpm/rightend.xpm Mon Apr 10 08:40:51 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* XPM */ -static const char *rightend[]={ -"16 16 2 1", -"# c #000000", -". c None", -"................", -"................", -".....#.....#....", -".....##....#....", -".....###...#....", -".....####..#....", -".....#####.#....", -".....#######....", -".....#######....", -".....#####.#....", -".....####..#....", -".....###...#....", -".....##....#....", -".....#.....#....", -"................", -"................"};