Commit 8baac458 authored by Joachim Eibl's avatar Joachim Eibl

KDiff3 0.9.89 for Qt4

git-svn-id: https://kdiff3.svn.sourceforge.net/svnroot/kdiff3/trunk@74 c8aa9fed-2811-0410-8543-893ada326672
parent 31b822cd
# 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 '#'
# 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".
# 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
# 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'
# 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.
# 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
# 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.
# 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"
# 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".
# 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".
# 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.
......@@ -61,7 +61,7 @@ QString ValueMap::getAsString()
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('=');
......
......@@ -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 @@ static bool convertFileEncoding( const QString& fileNameIn, QTextCodec* pCodecIn
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 @@ void SourceData::FileData::preprocess( bool bPreserveCR, QTextCodec* pEncoding )
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 @@ static void checkLineForComments(
{
return;
}
else if ( !isspace(p[i]) )
else if ( !p[i].isSpace() )
{
bWhite = false;
}
......
......@@ -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 @@ public:
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 @@ class MyPainter : public QPainter
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 @@ public:
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 )
......
......@@ -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 @@ DiffTextWindow::DiffTextWindow(
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 @@ DiffTextWindow::DiffTextWindow(
d->m_winIdx = winIdx;
setFont(d->m_pOptionDialog->m_font);
setAutoFillBackground( true );
}
DiffTextWindow::~DiffTextWindow()
......@@ -219,7 +232,7 @@ void DiffTextWindow::setPaintingAllowed( bool bAllowPainting )
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 @@ void DiffTextWindow::paintEvent( QPaintEvent* e )
//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 @@ void DiffTextWindow::paintEvent( QPaintEvent* e )
// 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 @@ DiffTextWindowFrame::DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusB
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 @@ DiffTextWindowFrame::DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusB
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 @@ bool DiffTextWindowFrame::eventFilter( QObject* o, QEvent* e )
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 @@ bool DiffTextWindowFrame::eventFilter( QObject* o, QEvent* e )
{
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 @@ bool DiffTextWindowFrame::eventFilter( QObject* o, QEvent* e )
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 @@ void DiffTextWindowFrame::slotBrowseButtonClicked()
}
}
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"
......@@ -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 @@ signals:
void fileNameChanged(const QString&, int);
protected:
bool eventFilter( QObject*, QEvent* );
void paintEvent(QPaintEvent*);
private slots:
void slotReturnPressed();
void slotBrowseButtonClicked();
......
This diff is collapsed.
......@@ -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 @@ public:
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 @@ protected:
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 @@ signals:
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 @@ public:
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 @@ private:
QLabel* m_pC;
QLabel* m_pDest;
QListView* m_pInfoList;
Q3ListView* m_pInfoList;
};
......
......@@ -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 @@ bool FileAccess::readFile( void* pDestBuffer, unsigned long maxLength )
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 @@ bool FileAccess::writeFile( const void* pSrcBuffer, unsigned long length )
if (m_bLocal)
{
QFile f( filePath() );
if ( f.open( IO_WriteOnly ) )
if ( f.open( QIODevice::WriteOnly ) )
{
const unsigned long maxChunkSize = 100000;