Commit 9a38ea76 authored by Joachim Eibl's avatar Joachim Eibl

KDiff3-0.9.90-Qt4

git-svn-id: https://kdiff3.svn.sourceforge.net/svnroot/kdiff3/trunk@77 c8aa9fed-2811-0410-8543-893ada326672
parent 58e41995
Version 0.9.90 - 2006/05/14
===========================
- Fixed KIO-problems of type "File exists" with tempfiles (introduced in 0.9.89)
- Fix for manual alignment with 3 files which caused crash (new feature in 0.9.89)
- Fix for Alt-Left caused crash for leftmost window on windows (due to changed compiler)
- Use of WResizeNoErase|WRepaintNoErase instead of WNoAutoErase (fix for compiler error with Qt3.1)
- Removed #include <konq_popupmenu.h> which is (currently) unneeded and required extra dependencies.
- Removed "Save/Load Directory Merge State ..." in directory menu. (These aren't working yet.)
- Fixed crash when used as Diff-part with KDevelop.
- Preserve executable bit when overwriting an existing file.
Version 0.9.89 - 2006/04/09
===========================
New features:
......
......@@ -3,7 +3,7 @@ KDiff3-Readme
Author: Joachim Eibl (joachim.eibl at gmx.de)
Copyright: (C) 2002-2006 by Joachim Eibl
KDiff3-Version: 0.9.89
KDiff3-Version: 0.9.90-Qt4
KDiff3 is a program that
......@@ -36,148 +36,72 @@ Licence:
For details see file "COPYING".
Exception from the GPL:
As a special exception, the copyright holder Joachim Eibl gives permission
to link this program with the Qt-library (commercial or non-commercial edition)
from Trolltech (www.trolltech.com), and he permits to distribute the resulting
executable, without including the source code for the Qt-library in the
source distribution.
Requirements & Installation:
Version 0.9.89 provides special support for KDE3, but it can also be
built without KDE3 if the Qt-libraries are available.
(I also test and use the program under Windows.)
The version 0.9.90-Qt4 requires Qt 4.x.y (from www.trolltech.com) for compilation.
(Qt-version >= 4.1.2 is recommended.)
You always need
- kdiff3-0.9.89.tar.gz
For building the KDE3-version
- KDE>=3.1 and QT>=3.1-libraries. (QT>=3.2 is recommended)
- gcc, g++ with version >=3.2
For building the Qt-only-version
- QT-libraries (version >=3.1.0).
(www.trolltech.com)
- for Un*x: gcc, g++ with version >=3.2
- for Windows: VC6 / VC7.1
On some distributions it will be necessary to install developer
packages (RPMs) that contain include files for compilation:
- xorg-x11-devel (or x11-devel)
- qt-devel
- kdelibs-devel
Installation for KDE3:
- Make sure your shell-variable QTDIR is correct. (echo $QTDIR).
If it doesn't contain the correct path, type
export QTDIR=your_path_to_qt (e.g. /usr/lib/qt3)
- cd into the directory kdiff3-0.9.89 and type
- ./configure --prefix=/opt/kde3 (your KDE3 directory here)
- (make clean) (Required if you already compiled once.)
- make (Run compilation)
- make install (You must have root-rights for this step.)
For details also see the generic instructions in file "INSTALL".
If some icons are not visible or don't seem right, probably the prefix
was wrong. Check where your KDE3 installation is located and
use that directory with the prefix-option of configure.
This command should tell you: kde-config --prefix
For SuSE and most distributions the prefix usually is /opt/kde3.
For Redhat/Fedora and Mandrake the prefix usually is /usr.
For a local installation, that doesn't need root rights try
- ./configure --prefix=$KDEHOME ($KDEHOME probably is the same as $HOME/.kde)
- make
- make install (Installs everything in $KDEHOME. No root rights required.)
- Run $KDEHOME/bin/kdiff3. ($KDEHOME/bin is probably not in your path.)
Warning: If a local installation and a global installation exist, the local
menu, toolbar, help etc. will be used, even if you start the global
executable. To avoid confusion, better remove the local version then.
(rm -R `find $KDEHOME -name "*kdiff3*" -not -name "kdiff3*rc"`)
On Fedora-64-bit systems the following configure-line was reported to work:
./configure --prefix=`kde-config --prefix` --enable-libsuffix=64 --with-qt-libraries=/usr/lib64/qt-3.3/lib/
Both --enable-libsuffix=64 and -with-qt-libraries=/usr/lib64/qt-3.3/lib/ are needed;
without the first one it fails to find the KDE libraries,
and without the second one it fails to find libqt-mt
(strangely enough: libqt-mt is in /usr/lib64/qt-3.3/lib,
and "configure" tries /usr/lib64/qt-3.3/lib64)
If your qt-libraries are elsewhere please adapt the path accordingly.
Some secondary dependencies aren't correctly discovered by configure.
If e.g the a linker error appears telling you something like
"Can't find -lacl" this probably means that you have to install
libacl-devel-*.rpm etc.
If you run an older version of KDE and the make-process fails in the
doc- or po-directory, cd to the src-directory and run "make" there. Also run
"make install" there. This hopefully will create a working kdiff3-binary,
although without doc and language support.
Upgrading KDiff3 for KDE:
If you already installed an older version or KDiff3 and you have the
impression, that the new version doesn't work as described, you should try to
remove all files belonging to KDiff3 before reinstalling.
Try this search command to locate KDiff3-related files:
find $HOME/.kde /usr /opt -iname "*kdiff3*"
(Will take a few minutes.)
Installation for the Qt-only-platforms for Un*x:
(for Qt >=3.1.0)
- Make sure your shell-variable QTDIR is correct. (echo $QTDIR).
If it doesn't contain the correct path, type
export QTDIR=your_path_to_qt (e.g. /usr/lib/qt)
- cd into the directory kdiff3-0.9.89/src and type
- make -f Makefile.qt
- make -f Makefile.qt install (You must have root-rights for this step.)
(copies the files into /usr/local/bin and /usr/local/share/doc/kdiff3)
- Note: The file kdiff3.pro was used to generate the Makefile.qt:
qmake kdiff3.pro -o Makefile.qt
If you want to build the Qt-only version _and_ the KDE-version, do this
in separate directories, otherwise there will be errors.
Build for Windows:
Use qmake and kdiff3.pro to generate
an appropriate Makefile.
qmake kdiff3.pro -o Makefile
Building Kdiff3 for Mac OSX 10.3.8 (by Mark Teel)
--------------------------------------------------------
1) Install Qt/Mac with thread support and static libraries.
2) cd .../kdiff3-0.9.89
3) Create a makefile for kdiff3 by executing:
qmake src/kdiff3.pro -o Makefile.qt
4) Edit Makefile.qt and add the definition "KDIFF3" to the following two lines:
CFLAGS = -pipe -Wall -W -Os -DKDIFF3 -DQT_NO_DEBUG ...
CXXFLAGS = -pipe -Wall -W -Os -DKDIFF3 -DQT_NO_DEBUG ...
5) Edit Makefile.qt and change the include path like so:
(old) INCPATH = -I/Library/qt3/mkspecs/default -Isrc ...
(new) INCPATH = -I/Library/qt3/mkspecs/macx-g++ -Isrc ...
6) KDiff3-0.9.88-specific: Edit src/kdiff3.cpp line 290 like this:
statusBar()->setSizeGripEnabled(true);
7) KDiff3-0.9.88-specific: (not necessary for 0.9.89 or later)
Edit /usr/include/mach/ppc/processor_info.h and replace all instances of
"unsigned int word" found in the four register unions (on lines 44, 65,
74, 82) as follows:
(old)
unsigned int word;
(new)
#if defined(KDIFF3)
unsigned word;
#else
unsigned int word;
#endif
8) Execute:
make -f Makefile.qt
9) After the build completes copy kdiff3 from the kdiff3-0.9.89 directory to
/Applications
- kdiff3-0.9.90-Qt4.tar.gz
- for Un*x: gcc, g++ with version >=3.4.2
Qt-X11-libraries
- for Windows: Qt-win-libs
If you have the Qt4 commercial edition, then compile with Visual Studio.
If you use the Qt4 open source edition, then you'll need MinGW.
I verified that compilation and debugging works with these packages (probably newer ones will also work):
- gcc-core-3.4.2-20040916-1.tar.gz
- binutils-2.15.91-20040904-1.tar.gz
- gcc-g++-3.4.2-20040916-1.tar.gz
- mingw-runtime-3.9.tar.gz
- mingw32-make-3.80.0-3.tar.gz
- w32api-3.6.tar.gz (see also the note below)
- gdb-5.2.1-1.exe (for debugging)
(Note: At the time of writing this README, the MinGW-package that was part
of qt-win-opensource-4.1.2-mingw.exe lacked the latest w32api needed for
KDiff3-compilation. You will need to unpack w32api-3.6.tar.gz or newer
from www.mingw.org into your MinGW-directory.)
- for Mac: gcc, g++ with version >=3.4.2
Qt-Mac-libraries
Note for KDE-users:
The version 0.9.90-Qt4 doesn't provide support for KDE-3.x
because KDE-3.x.y requires Qt3.
If you need KDE-specific features like KIO-support stick to the
normal version 0.9.90.
Build-instructions (Unix or Mac):
- Make sure your shell-variable QTDIR is correct and that
your path contains the Qt4-bin-directory.
- cd into the directory kdiff3-0.9.90-Qt4/src and type
- qmake kdiff3.pro
- make (or "gmake" for GNU-Make)
Build-instructions (Windows):
- Run your qtvars.bat in the Qt4-bin directory.
(This should set your QTDIR, QMAKESPEC and PATH-environment-variables.)
- cd into the directory kdiff3-0.9.90-Qt4/src and type
- qmake kdiff3.pro
- make (which calls either "mingw32-make" or "nmake")
Debugging with MinGW under Windows:
- cd into the directory kdiff3-0.9.90-Qt4/src
- edit the file "Makefile.Debug" and in the LFLAGS replace "-Wl,-subsystem,windows" with "-Wl,-subsystem,console"
(this is necessary so that gdb can send a break signal to the running program)
- make debug (create a debuggable executable)
- gdb debug\kdiff3.exe
- At the "(gdb)"-prompt type "run" and enter to start.
- While the program runs you can't set breakpoints, first interrupt it with Ctrl-C.
- Use "help" to find out about how to use gdb. (Important commands: run, break, backtrace, print, quit)
Using break with c++-methods requires to specify the parameter types too. Breakpoints in constructors might not work.
- I've tested graphical gdb-frontends too:
1. Insight (also from mingw.org) worked until I wanted to interrupt the program for setting breakpoints.
2. Dev-Cpp: The debugger said that the app crashed before even launching it.
Result: For Windows I recommend gdb on the console. Please tell me when things have improved!
Start from commandline:
- Comparing 2 files: kdiff3 file1 file2
......
......@@ -3,6 +3,8 @@ This file contains some feature-wishes for future KDiff3-versions.
TODO
====
- Only show different lines.
- ftp: Abbruch beim Einlesen von Verzeichnis stoppt nicht vollständig
- Projekt-Verwaltung: Die ganze Config-Datei (=Projektdatei) an einen benutzerdefinierten Ort zu legen. (Keine Angabe->Default)
......@@ -36,12 +38,13 @@ TODO
- Overview-option to show only remaining conflicts.
- Colors for disabled and enabled arrow are very similar
- Overview bar for merge-window and for directory-window.
- ??? The gutters (kdiff3 have 2 "gutters") fonts and background-foreground colors sholud be configured other
than the "general" foreground-background colors. Otherwise they are confused with the main dialog.
- Try to autodetect the line-end-style
- Ignore cvs-keywords like $Revision$
- Ignore cvs-keywords like $Revision: x.y$
- Undo function in the merge-editor.
- More viewing options for directory widget.
......@@ -58,8 +61,8 @@ TODO
- Optionally show size/date for A/B/C
- Choose what to see (all or only different items)
- If only different items are visible: copy the others nevertheless to destdir.
- Warnung wenn Datum in B oder C ter als A ist.
- Zielverzeichnis nachtrlich derbar
- Warnung wenn Datum in B oder C älter als A ist.
- Zielverzeichnis nachträglich änderbar
- Bei Kopie von Remote nach lokal: Auf jeden Fall das modification Datum setzen.
- Ctrl-Space doesn't work when a file comparison takes place.
- Option to allow case-insensitive filename-matching.
......
......@@ -64,7 +64,8 @@ for i in `ls ../en | grep png`; do ln -s ../en/$i $i; done
Command to retrieve other translations from cvs:
cvs co kde-i18n/subdirs
for i in `cat kde-i18n/subdirs`; do cvs co kde-i18n/$i/docs/kdeextragear-1/kdiff3/index.docbook; done
#for i in `cat kde-i18n/subdirs`; do cvs co kde-i18n/$i/docs/kdeextragear-1/kdiff3/index.docbook; done
for i in `cat subdirs`; do wget http://websvn.kde.org/*checkout*/trunk/l10n/$i/docs/extragear-utils/kdiff3/index.docbook -O $i.docbook; done
If a new translation is available,
- create a new directory,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -459,7 +459,7 @@ void SourceData::readAndPreprocess(QTextCodec* pEncoding)
}
if (fileNameInPP != fileNameIn1)
{
FileAccess::removeFile( fileNameInPP );
FileAccess::removeTempFile( fileNameInPP );
}
}
......@@ -491,10 +491,10 @@ void SourceData::readAndPreprocess(QTextCodec* pEncoding)
m_pOptionDialog->m_LineMatchingPreProcessorCmd = "";
m_lmppData.readFile( fileNameIn2 );
}
FileAccess::removeFile( fileNameOut2 );
FileAccess::removeTempFile( fileNameOut2 );
if (fileNameInPP != fileNameIn2)
{
FileAccess::removeFile( fileNameInPP );
FileAccess::removeTempFile( fileNameInPP );
}
}
else if ( m_pOptionDialog->m_bIgnoreComments || m_pOptionDialog->m_bIgnoreCase )
......@@ -549,13 +549,13 @@ void SourceData::readAndPreprocess(QTextCodec* pEncoding)
// Remove unneeded temporary files. (A temp file from clipboard must not be deleted.)
if ( !bTempFileFromClipboard && !m_tempInputFileName.isEmpty() )
{
FileAccess::removeFile( m_tempInputFileName );
FileAccess::removeTempFile( m_tempInputFileName );
m_tempInputFileName = "";
}
if ( !fileNameOut1.isEmpty() )
{
FileAccess::removeFile( fileNameOut1 );
FileAccess::removeTempFile( fileNameOut1 );
fileNameOut1="";
}
}
......@@ -1265,66 +1265,36 @@ void correctManualDiffAlignment( Diff3LineList& d3ll, ManualDiffHelpList* pManua
int wi3 = missingWinIdx;
if ( i3->getLineInFile(wi3) >= 0 )
{
if ( iMDHL->firstLine(wi3) == i3->getLineInFile(wi3) )
// not found, move the line before iDest
Diff3Line d3l;
if ( wi3==1 )
{
if (i3->bAEqB) // Stop moving lines up if one equal is found.
break;
d3l.lineA = i3->lineA;
i3->lineA = -1;
i3->bAEqB = false;
i3->bAEqC = false;
}
if ( wi3==2 )
{
// found, align the line with iDest
if ( wi3==1 )
{
iDest->lineA = i3->lineA;
i3->lineA = -1;
i3->bAEqB = false;
i3->bAEqC = false;
}
if ( wi3==2 )
{
iDest->lineB = i3->lineB;
i3->lineB = -1;
i3->bAEqB = false;
i3->bBEqC = false;
}
if ( wi3==3 )
{
iDest->lineC = i3->lineC;
i3->lineC = -1;
i3->bAEqC = false;
i3->bBEqC = false;
}
break;
if (i3->bAEqB)
break;
d3l.lineB = i3->lineB;
i3->lineB = -1;
i3->bAEqB = false;
i3->bBEqC = false;
}
else
if ( wi3==3 )
{
// not found, move the line before iDest
Diff3Line d3l;
if ( wi3==1 )
{
if (i3->bAEqB)
continue;
d3l.lineA = i3->lineA;
i3->lineA = -1;
i3->bAEqB = false;
i3->bAEqC = false;
}
if ( wi3==2 )
{
if (i3->bAEqB)
continue;
d3l.lineB = i3->lineB;
i3->lineB = -1;
i3->bAEqB = false;
i3->bBEqC = false;
}
if ( wi3==3 )
{
if (i3->bAEqC)
continue;
d3l.lineC = i3->lineC;
i3->lineC = -1;
i3->bAEqC = false;
i3->bBEqC = false;
}
d3ll.insert( iDest, d3l );
if (i3->bAEqC)
break;
d3l.lineC = i3->lineC;
i3->lineC = -1;
i3->bAEqC = false;
i3->bBEqC = false;
}
d3ll.insert( iDest, d3l );
}
} // for(), searching for wi3
}
......
......@@ -149,7 +149,7 @@ DiffTextWindow::DiffTextWindow(
OptionDialog* pOptionDialog,
int winIdx
)
: QWidget(pParent, 0, Qt::WNoAutoErase | Qt::WNoAutoErase)
: QWidget(pParent, 0, Qt::WNoAutoErase )
{
d = new DiffTextWindowData(this);
d->m_pDiffTextWindowFrame = pParent;
......
......@@ -51,7 +51,7 @@
#include <klocale.h>
#include <iostream>
#include <assert.h>
#include <konq_popupmenu.h>
//#include <konq_popupmenu.h>
static bool conflictingFileTypes(MergeFileInfos& mfi);
/*
......@@ -134,7 +134,7 @@ TempRemover::TempRemover(const QString& origName, FileAccess& fa)
TempRemover::~TempRemover()
{
if ( m_bTemp && ! m_name.isEmpty() )
FileAccess::removeFile(m_name);
FileAccess::removeTempFile(m_name);
}
void DirectoryMergeWindow::fastFileComparison(
......@@ -2873,8 +2873,8 @@ void DirectoryMergeWindow::initDirectoryMergeActions( QObject* pKDiff3App, KActi
m_pDirFoldAll = new KAction(i18n("Fold All Subdirs"), 0, p, SLOT(slotFoldAllSubdirs()), ac, "dir_fold_all");
m_pDirUnfoldAll = new KAction(i18n("Unfold All Subdirs"), 0, p, SLOT(slotUnfoldAllSubdirs()), ac, "dir_unfold_all");
m_pDirRescan = new KAction(i18n("Rescan"), Qt::SHIFT+Qt::Key_F5, p, SLOT(reload()), ac, "dir_rescan");
m_pDirSaveMergeState = 0;//new KAction(i18n("Save Directory Merge State ..."), 0, p, SLOT(slotSaveMergeState()), ac, "dir_save_merge_state");
m_pDirLoadMergeState = 0;//new KAction(i18n("Load Directory Merge State ..."), 0, p, SLOT(slotLoadMergeState()), ac, "dir_load_merge_state");
m_pDirSaveMergeState = 0; //new KAction(i18n("Save Directory Merge State ..."), 0, p, SLOT(slotSaveMergeState()), ac, "dir_save_merge_state");
m_pDirLoadMergeState = 0; //new KAction(i18n("Load Directory Merge State ..."), 0, p, SLOT(slotLoadMergeState()), ac, "dir_load_merge_state");
m_pDirChooseAEverywhere = new KAction(i18n("Choose A for All Items"), 0, p, SLOT(slotChooseAEverywhere()), ac, "dir_choose_a_everywhere");
m_pDirChooseBEverywhere = new KAction(i18n("Choose B for All Items"), 0, p, SLOT(slotChooseBEverywhere()), ac, "dir_choose_b_everywhere");
m_pDirChooseCEverywhere = new KAction(i18n("Choose C for All Items"), 0, p, SLOT(slotChooseCEverywhere()), ac, "dir_choose_c_everywhere");
......
......@@ -75,7 +75,7 @@ FileAccess::~FileAccess()
{
if( !m_localCopy.isEmpty() )
{
removeFile( m_localCopy );
removeTempFile( m_localCopy );
}
}
......@@ -149,12 +149,8 @@ void FileAccess::setFile( const QString& name, bool bWantToWrite )
{
// Try reading a clearcase file
m_localCopy = FileAccess::tempFileName();
QString ctName = m_localCopy + ".cleartool"; // Because cleartool can't overwrite existing file
QString cmd = "cleartool get -to \"" + ctName + "\" \"" + m_absFilePath + "\"";
QString cmd = "cleartool get -to \"" + m_localCopy + "\" \"" + m_absFilePath + "\"";
::system( cmd.local8Bit() );
FileAccess ctFile(ctName);
ctFile.copyFile(m_localCopy);
ctFile.removeFile();
QFileInfo fi( m_localCopy );
m_bReadable = fi.isReadable();
......@@ -394,6 +390,20 @@ bool FileAccess::writeFile( const void* pSrcBuffer, unsigned long length )
pp.setCurrent( double(i)/length );
if ( pp.wasCancelled() ) return false;
}
f.close();
#ifndef _WIN32
if ( isExecutable() ) // value is true if the old file was executable
{
// Preserve attributes
struct stat srcFileStatus;
int statResult = ::stat( filePath().ascii(), &srcFileStatus );
if (statResult==0)
{
::chmod ( filePath().ascii(), srcFileStatus.st_mode | S_IXUSR );
}
}
#endif
return true;
}
}
......@@ -465,22 +475,30 @@ QString FileAccess::tempFileName()
fileName = tmpDir + "/kdiff3_" + QString::number(i) +".tmp";
if ( ! FileAccess::exists(fileName) &&
QFile(fileName).open(QIODevice::WriteOnly) ) // open, truncate and close the file, true if successful
{
{
break;
}
}
}
return QDir::convertSeparators(fileName);
return QDir::convertSeparators(fileName+".2");
#else // using KDE
KTempFile tmpFile;
//tmpFile.setAutoDelete( true ); // We only want the name. Delete the precreated file immediately.
tmpFile.close();
return tmpFile.name();
return tmpFile.name()+".2";
#endif
}
bool FileAccess::removeTempFile( const QString& name ) // static
{
if (name.endsWith(".2"))
FileAccess(name.left(name.length()-2)).removeFile();
return FileAccess(name).removeFile();
}
bool FileAccess::makeDir( const QString& dirName )
{
FileAccessJobHandler fh(0);
......
......@@ -70,6 +70,7 @@ public:
bool createBackup( const QString& bakExtension );
static QString tempFileName();
static bool removeTempFile( const QString& );
bool removeFile();
static bool removeFile( const QString& );
static bool makeDir( const QString& );
......
......@@ -63,13 +63,14 @@ Comment[hu]=Segédprogram fájlok, könyvtárak összehasonlításához
Comment[is]=Skráa og möppu samanburðar og sameiningartól
Comment[it]=Uno strumento di confronto e unione di file e directory