Commit 0e7602b9 authored by Joachim Eibl's avatar Joachim Eibl

KDiff3 0.9.87


git-svn-id: https://kdiff3.svn.sourceforge.net/svnroot/kdiff3/trunk@71 c8aa9fed-2811-0410-8543-893ada326672
parent 6227f725
Version 0.9.87 - 2005/30/01
===========================
- Unicode16 and UTF8 support (Internal data format is now QString (Unicode16). Conversion during save and load.)
- Directory "Full Analysis": Equality-Coloring for files with only whitespace differences. (Michael Denio)
- Support for right to left languages.
- In MergeResultWindow show "<Merge Conflict (Whitespace only)>" for whitespace-only conflicts
- Statusbar shows the number of remaining conflicts and whitespace conflicts.
- Go Next/Prev Difference/Conflict now have improved tooltips informing about "Show White Space"-disabled-behaviour.
Version 0.9.86 - 2004/06/14
===========================
- Double click on any file in directory merge would close the directory merge window. (Regression in 0.9.85)
......
......@@ -12,7 +12,7 @@ $(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/ad
MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files
package-messages:
$(MAKE) -f admin/Makefile.common package-messages
cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common package-messages
$(MAKE) -C po merge
EXTRA_DIST = admin COPYING configure.in.in
......
......@@ -2,8 +2,8 @@ KDiff3-Readme
=============
Author: Joachim Eibl (joachim.eibl@gmx.de)
Copyright: (C) 2002-2004 by Joachim Eibl
KDiff3-Version: 0.9.86
Copyright: (C) 2002-2005 by Joachim Eibl
KDiff3-Version: 0.9.87
KDiff3 is a program that
......@@ -45,12 +45,12 @@ Exception from the GPL:
Requirements & Installation:
Version 0.9.86 provides special support for KDE3, but it can also be
Version 0.9.87 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.)
You always need
- kdiff3-0.9.86.tar.gz
- kdiff3-0.9.87.tar.gz
For building the KDE3-version
- KDE>=3.1 and QT>=3.1-libraries. (QT>=3.2 is recommended)
......@@ -67,7 +67,7 @@ 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.86 and type
- cd into the directory kdiff3-0.9.87 and type
- ./configure --prefix=/opt/kde3 (your KDE3 directory here)
- (make clean) (Required if you already compiled once.)
- make (Run compilation)
......@@ -108,7 +108,7 @@ Installation for the Qt-only-platforms for Un*x:
- 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.86/src and type
- cd into the directory kdiff3-0.9.87/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)
......
......@@ -3,6 +3,41 @@ This file contains some feature-wishes for future KDiff3-versions.
TODO
====
- 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)
- Bei Combobox-History alle Elemente von (A/B/C/Out) anzeigen.
- Test on empty floppy drive.
-I suppose this has been asked before, but are there any plans to use
colors for change/insert/delete (i.e. blue = change, green = insert, red
= delete)?
> I want to compare two revisions of a file (eventually I wanna do this on
> two directory hierarchies of files) and have an output of how many lines
> of code were added, modified, and deleted for each file and overall.
> Also, for "Send To" from Windows, it would be nice if I could pick one
> file via Send To, find the second file (if it's in a different
> directory), and click "Send To" again to compare. I.e., when user does
> "Send To", if one instance is already open and waiting for a second
> file, the first instance is used.
- kdiff3 does not preserve the permissions of files it overwrites during a 'save' operation.
- Insbesondere Ausführbarkeit "x" und Schreibschutz "w" sollten erhalten bleiben.
- Edit Select All, Ctrl-A
- Under Windows: Shortcut Ctrl-Shift-2 (for select B everywhere doesn't work.)
- Paste from Clipboard doesn't work.
- Improve message about WinCVS in the Installer.
- Bug: Comment section isn't recognized as nonwhite difference if several lines are between /* and */ on one side.
- Overview-option to show only remaining conflicts.
- Colors for disabled and enabled arrow are very similar
- ??? The gutters (kdiff3 have 2 "gutters") fonts and background-foreground colors sholud be configured other
......
......@@ -30,7 +30,7 @@ as Authors, publish date, the abstract, and Keywords -->
<!-- TRANS:ROLES_OF_TRANSLATORS -->
<copyright>
<year>2002-2004</year>
<year>2002-2005</year>
<holder>Joachim Eibl</holder>
</copyright>
<!-- Translators: put here the copyright notice of the translation -->
......@@ -45,8 +45,8 @@ Please respect the format of the date (YYYY-MM-DD) and of the version
(V.MM.LL), it could be used by automation scripts.
Do NOT change these in the translation. -->
<date>2004-05-29</date>
<releaseinfo>0.9.84</releaseinfo>
<date>2005-01-30</date>
<releaseinfo>0.9.87</releaseinfo>
<abstract>
......@@ -59,10 +59,11 @@ Do NOT change these in the translation. -->
<listitem><para>provides an automatic merge-facility,</para></listitem>
<listitem><para>has an editor for comfortable solving of merge-conflicts,</para></listitem>
<listitem><para>provides networktransparency via KIO,</para></listitem>
<listitem><para>has options to highlight or hide changes in white-space or comments.</para></listitem>
<listitem><para>has options to highlight or hide changes in white-space or comments,</para></listitem>
<listitem><para>supports Unicode, UTF-8 and other file encodings.</para></listitem>
</itemizedlist>
</para><para>
This document describes KDiff3-version 0.9.84.
This document describes KDiff3-version 0.9.87.
</para>
</abstract>
......@@ -221,6 +222,8 @@ This screenshot shows KDiff3 during a directory merge:
<listitem><para>Networktransparency via KIO.</para></listitem>
<listitem><para>Can be used as diff-viewer in KDevelop 3.</para></listitem>
<listitem><para>Word-wrap for long lines.</para></listitem>
<listitem><para>Support for Unicode, UTF-8 and other codecs.</para></listitem>
<listitem><para>Support for right to left languages.</para></listitem>
<listitem><para>...</para></listitem>
</itemizedlist>
</sect2>
......@@ -693,6 +696,26 @@ Yet there is one option here that is also relevant for saving single files:
</variablelist>
</sect2>
<sect2><title>Regional and Language Options</title>
<variablelist>
<varlistentry><term><emphasis>Language:</emphasis></term><listitem><para>Adjust the language of the user interface. Changing this option doesn't affect the running program. You have to exit and restart KDiff3 so that the language is changed. (This option is not available in the KDE version of KDiff3 because the language is adjustable in the global KDE settings.)
</para></listitem></varlistentry>
<varlistentry><term><emphasis>Use the same encoding for everything:</emphasis></term><listitem><para> The following encoding options can be adjusted separately for each item or if this option is true, all values will take the first value.
</para></listitem></varlistentry>
<varlistentry><term><emphasis>Local Encoding:</emphasis></term><listitem><para>Above the codec-selectors appears a note that tells you what the local encoding is. (This is not adjustable but for your information just in case you don't know your local encoding, but need to select it.)
</para></listitem></varlistentry>
<varlistentry><term><emphasis>File Encoding for A/B/C:</emphasis></term><listitem><para> Adjust the file encoding for input files. This has an effect on how the special characters are interpreted. Since you can adjust each codec separately you can even compare and merge files that were saved using different codecs.
</para></listitem></varlistentry>
<varlistentry><term><emphasis>File Encoding for Merge Output and Saving:</emphasis></term><listitem><para> When you have edited a file, then you can adjust which encoding will be used when saving to disk.
</para></listitem></varlistentry>
<varlistentry><term><emphasis>File Encoding for Preprocessor Files:</emphasis></term><listitem><para>When you define preprocessors then they might not be able to operate on your codec. (e.g.: Your files are 16-bit-unicode and your preprocessor can only take 8-bit-ascii.) With this option you can define the encoding of preprocessor output.
</para></listitem></varlistentry>
<varlistentry><term><emphasis>Right To Left Language:</emphasis></term><listitem><para>Some languages are written right to left. When this option is enabled, KDiff3 draws the text from right to left in the diff input windows and in the merge output window. Note that if you start KDiff3 with the command line option "--reverse" then all layouting will be done right to left too. (This is a feature provided by Qt.) This documentation was written assuming that "Right To Left Language" or reverse layout are disabled. So some references to "left" or "right" must be replaced by their respective counterpart if you use these options.
</para></listitem></varlistentry>
</variablelist>
</sect2>
<sect2><title>Miscellaneous</title>
<para>(These options and actions are available in menus or the buttonbar.)</para>
<variablelist>
......@@ -1511,7 +1534,7 @@ Other things that are possible, but probably less useful are:
</para></listitem><listitem><para>
No possibility to modify permissions or modification time, so permissions or time
of a copy will differ from the original. (See the option "Trust the size".)
(Modifying permissions or modification time is only possible for local files.)
(To modify permissions or modification time is only possible for local files.)
</para></listitem>
</itemizedlist>
</sect2>
......@@ -1642,14 +1665,14 @@ and menu. Merging or directory-comparison are not supported then.
&kdiff3; - File and Directory Comparison and Merge Tool
</para>
<para>
Program copyright 2002-2004 Joachim Eibl <email>joachim.eibl at gmx.de</email>
Program copyright 2002-2005 Joachim Eibl <email>joachim.eibl at gmx.de</email>
</para>
<para>
Several cool ideas and bugreports came from colleagues and many people out in the Wild Wild Web. Thank you!
</para>
<para>
Documentation Copyright &copy; 2002-2004 Joachim Eibl <email>joachim.eibl at gmx.de</email>
Documentation Copyright &copy; 2002-2005 Joachim Eibl <email>joachim.eibl at gmx.de</email>
</para>
<!-- TRANS:CREDIT_FOR_TRANSLATORS -->
......
......@@ -3,7 +3,7 @@
<general>
<author>Joachim Eibl</author>
<email>joachim@gmx.de</email>
<version>0.9.85</version>
<version>0.9.87</version>
<projectmanagement>KDevKDEAutoProject</projectmanagement>
<primarylanguage>C++</primarylanguage>
<keywords>
......@@ -106,7 +106,7 @@
<kdevdebugger>
<general>
<dbgshell>libtool</dbgshell>
<programargs/>
<programargs>/windows/C/qt/kdiff3-0.9.87/src/ /home/joachim/kdiff3-0.9.87/src</programargs>
<gdbpath/>
<configGdbScript/>
<runShellScript/>
......@@ -153,7 +153,10 @@
<automaticHeaderCompletion>true</automaticHeaderCompletion>
<headerCompletionDelay>250</headerCompletionDelay>
</codecompletion>
<references/>
<references>
<pcs>KDElibs</pcs>
<pcs>Qt</pcs>
</references>
</kdevcppsupport>
<cppsupportpart>
<filetemplates>
......
......@@ -12,8 +12,8 @@ CC = gcc
CXX = g++
LEX = flex
YACC = yacc
CFLAGS = -pipe -O2 -march=i586 -Wall -W -fmessage-length=0 -fPIC -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -D__USE_STD_IOSTREAM
CXXFLAGS = -pipe -O2 -march=i586 -Wall -W -fmessage-length=0 -fPIC -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -D__USE_STD_IOSTREAM
CFLAGS = -pipe -O2 -Wall -W -fmessage-length=0 -fPIC -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -D__USE_STD_IOSTREAM
CXXFLAGS = -pipe -O2 -Wall -W -fmessage-length=0 -fPIC -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -D__USE_STD_IOSTREAM
LEXFLAGS =
YACCFLAGS= -d
INCPATH = -I$(QTDIR)/mkspecs/default -I. -Ikreplacements -I/usr/include -I$(QTDIR)/include
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -56,7 +56,7 @@ public:
if (firstChild()==0) return 0;
else return m_pLast;
}
void addText(const QString& s )
{
if (firstChild()==0) m_pLast = new QListViewItem( this, s );
......@@ -177,7 +177,7 @@ void DirectoryMergeWindow::fastFileComparison(
return;
}
pp.setInformation( i18n("Comparing file ..."), 0, false );
pp.setInformation( i18n("Comparing file..."), 0, false );
#if QT_VERSION==230
typedef int t_FileSize;
#else
......@@ -248,7 +248,7 @@ DirectoryMergeWindow::DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOpt
m_pStatusInfo = new StatusInfo(0);
m_pStatusInfo->hide();
m_bScanning = false;
addColumn(i18n("Name"));
addColumn("A");
addColumn("B");
......@@ -259,7 +259,7 @@ DirectoryMergeWindow::DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOpt
addColumn(i18n("Solved"));
addColumn(i18n("Nonwhite"));
addColumn(i18n("White"));
setColumnAlignment( s_UnsolvedCol, Qt::AlignRight );
setColumnAlignment( s_SolvedCol, Qt::AlignRight );
setColumnAlignment( s_NonWhiteCol, Qt::AlignRight );
......@@ -291,6 +291,7 @@ void DirectoryMergeWindow::reload()
if ( result!=KMessageBox::Yes )
return;
}
init( m_dirA, m_dirB, m_dirC, m_dirDest, m_bDirectoryMerge );
}
......@@ -385,14 +386,15 @@ bool DirectoryMergeWindow::init
{
if ( m_pOptions->m_bDmFullAnalysis )
{
// A full analysis uses the same ressources that a normal text-diff/merge uses.
// A full analysis uses the same ressources that a normal text-diff/merge uses.
// So make sure that the user saves his data first.
bool bCanContinue=false;
checkIfCanContinue( &bCanContinue );
if ( !bCanContinue )
return false;
startDiffMerge("","","","","","","",0); // hide main window
}
show();
ProgressProxy pp;
......@@ -442,9 +444,9 @@ bool DirectoryMergeWindow::init
i18n("Parameter Warning"));
return false;
}
m_bScanning = true;
statusBarMessage(i18n("Scanning directories ..."));
statusBarMessage(i18n("Scanning directories..."));
m_bSyncMode = m_pOptions->m_bDmSyncMode && !m_dirC.isValid() && !m_dirDest.isValid();
......@@ -472,7 +474,7 @@ bool DirectoryMergeWindow::init
setColumnWidth( s_NonWhiteCol, 0 );
setColumnWidth( s_UnsolvedCol, 0 );
setColumnWidth( s_SolvedCol, 0 );
}
}
else if ( m_dirC.isValid() )
{
setColumnWidth(s_WhiteCol, 50 );
......@@ -487,7 +489,7 @@ bool DirectoryMergeWindow::init
setColumnWidth(s_UnsolvedCol, 50 );
setColumnWidth(s_SolvedCol, 0 );
}
bool bListDirSuccessA = true;
bool bListDirSuccessB = true;
bool bListDirSuccessC = true;
......@@ -600,7 +602,7 @@ bool DirectoryMergeWindow::init
sizes[1]=total - sizes[0];
pSplitter->setSizes( sizes );
}
m_bScanning = false;
statusBarMessage(i18n("Ready."));
......@@ -626,7 +628,7 @@ bool DirectoryMergeWindow::init
KMessageBox::information( this, s );
setSelected( firstChild(), true );
}
return true;
}
......@@ -811,13 +813,23 @@ void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi )
"",
"","","",&mfi.m_totalDiffStatus
);
mfi.m_bEqualAB = mfi.m_totalDiffStatus.bBinaryAEqB;
mfi.m_bEqualBC = mfi.m_totalDiffStatus.bBinaryBEqC;
mfi.m_bEqualAC = mfi.m_totalDiffStatus.bBinaryAEqC;
int nofNonwhiteConflicts = mfi.m_totalDiffStatus.nofUnsolvedConflicts +
mfi.m_totalDiffStatus.nofSolvedConflicts - mfi.m_totalDiffStatus.nofWhitespaceConflicts;
if (m_pOptions->m_bDmWhiteSpaceEqual && nofNonwhiteConflicts == 0)
{
mfi.m_bEqualAB = mfi.m_bEqualBC = mfi.m_bEqualAC = true;
}
else
{
mfi.m_bEqualAB = mfi.m_totalDiffStatus.bBinaryAEqB;
mfi.m_bEqualBC = mfi.m_totalDiffStatus.bBinaryBEqC;
mfi.m_bEqualAC = mfi.m_totalDiffStatus.bBinaryAEqC;
}
}
}
else
{
{
bool bError;
QString eqStatus;
if( mfi.m_bExistsInA && mfi.m_bExistsInB )
......@@ -1743,7 +1755,7 @@ void DirectoryMergeWindow::slotRunOperationForCurrentItem()
{
pEnd = pEnd->parent();
}
if ( pEnd!=0 )
if ( pEnd!=0 )
pEnd=pEnd->nextSibling();
prepareMergeStart( pBegin, pEnd, bVerbose );
......@@ -2201,7 +2213,7 @@ bool DirectoryMergeWindow::renameFLD( const QString& srcName, const QString& des
}
}
m_pStatusInfo->addText(i18n("rename( %1 -> %2 )").arg(srcName).arg(destName)) ;
m_pStatusInfo->addText(i18n("rename( %1 -> %2 )").arg(srcName).arg(destName));
if ( m_bSimulatedMergeStarted )
{
return true;
......@@ -2288,7 +2300,7 @@ DirectoryMergeInfo::DirectoryMergeInfo( QWidget* pParent )
m_pInfoList->addColumn(i18n("Last Modification"));
m_pInfoList->addColumn(i18n("Link-Destination"));
setMinimumSize( 100,100 );
m_pInfoList->installEventFilter(this);
}
......@@ -2422,17 +2434,17 @@ void DirectoryMergeWindow::initDirectoryMergeActions( QObject* pKDiff3App, KActi
dirCurrentChooseB = new KAction(i18n("B"), 0, p, SLOT(slotCurrentChooseB()), ac, "dir_current_choose_b");
dirCurrentChooseC = new KAction(i18n("C"), 0, p, SLOT(slotCurrentChooseC()), ac, "dir_current_choose_c");
dirCurrentMerge = new KAction(i18n("Merge"), 0, p, SLOT(slotCurrentMerge()), ac, "dir_current_merge");
dirCurrentDelete = new KAction(i18n("Delete (If Exists)"), 0, p, SLOT(slotCurrentDelete()), ac, "dir_current_delete");
dirCurrentDelete = new KAction(i18n("Delete (if exists)"), 0, p, SLOT(slotCurrentDelete()), ac, "dir_current_delete");
dirCurrentSyncDoNothing = new KAction(i18n("Do Nothing"), 0, p, SLOT(slotCurrentDoNothing()), ac, "dir_current_sync_do_nothing");
dirCurrentSyncCopyAToB = new KAction(i18n("Copy A to B"), 0, p, SLOT(slotCurrentCopyAToB()), ac, "dir_current_sync_copy_a_to_b" );
dirCurrentSyncCopyBToA = new KAction(i18n("Copy B to A"), 0, p, SLOT(slotCurrentCopyBToA()), ac, "dir_current_sync_copy_b_to_a" );
dirCurrentSyncDeleteA = new KAction(i18n("Delete A"), 0, p, SLOT(slotCurrentDeleteA()), ac,"dir_current_sync_delete_a");
dirCurrentSyncDeleteB = new KAction(i18n("Delete B"), 0, p, SLOT(slotCurrentDeleteB()), ac,"dir_current_sync_delete_b");
dirCurrentSyncDeleteAAndB = new KAction(i18n("Delete A and B"), 0, p, SLOT(slotCurrentDeleteAAndB()), ac,"dir_current_sync_delete_a_and_b");
dirCurrentSyncDeleteAAndB = new KAction(i18n("Delete A && B"), 0, p, SLOT(slotCurrentDeleteAAndB()), ac,"dir_current_sync_delete_a_and_b");
dirCurrentSyncMergeToA = new KAction(i18n("Merge to A"), 0, p, SLOT(slotCurrentMergeToA()), ac,"dir_current_sync_merge_to_a");
dirCurrentSyncMergeToB = new KAction(i18n("Merge to B"), 0, p, SLOT(slotCurrentMergeToB()), ac,"dir_current_sync_merge_to_b");
dirCurrentSyncMergeToAAndB = new KAction(i18n("Merge to A and B"), 0, p, SLOT(slotCurrentMergeToAAndB()), ac,"dir_current_sync_merge_to_a_and_b");
dirCurrentSyncMergeToAAndB = new KAction(i18n("Merge to A && B"), 0, p, SLOT(slotCurrentMergeToAAndB()), ac,"dir_current_sync_merge_to_a_and_b");
}
......@@ -2468,7 +2480,7 @@ void DirectoryMergeWindow::updateAvailabilities( bool bDirCompare, bool bDiffWin
bool bFTConflict = pMFI==0 ? false : conflictingFileTypes(*pMFI);
bool bDirWindowHasFocus = isVisible() && hasFocus();
dirCurrentDoNothing->setEnabled( bItemActive && bMergeMode );
dirCurrentChooseA->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInA );
dirCurrentChooseB->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInB );
......@@ -2484,7 +2496,7 @@ void DirectoryMergeWindow::updateAvailabilities( bool bDirCompare, bool bDiffWin
chooseB->setChecked( false );
chooseC->setChecked( false );
}
dirCurrentSyncDoNothing->setEnabled( bItemActive && !bMergeMode );
dirCurrentSyncCopyAToB->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInA );
dirCurrentSyncCopyBToA->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInB );
......
......@@ -740,7 +740,7 @@ bool FileAccessJobHandler::removeFile( const QString& fileName )
else
{
m_bSuccess = false;
KIO::SimpleJob* pJob = KIO::file_delete( fileName, false );
KIO::SimpleJob* pJob = KIO::file_delete( KURL::fromPathOrURL(fileName), false );
connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*)));
g_pProgressDialog->enterEventLoop( pJob, i18n("Removing file: %1").arg(fileName) );
......@@ -755,7 +755,7 @@ bool FileAccessJobHandler::symLink( const QString& linkTarget, const QString& li
else
{
m_bSuccess = false;
KIO::CopyJob* pJob = KIO::link( linkTarget, linkLocation, false );
KIO::CopyJob* pJob = KIO::link( KURL::fromPathOrURL(linkTarget), KURL::fromPathOrURL(linkLocation), false );
connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*)));
g_pProgressDialog->enterEventLoop( pJob,
......@@ -780,7 +780,7 @@ bool FileAccessJobHandler::rename( const QString& dest )
bool bShowProgress = false;
int permissions=-1;
m_bSuccess = false;
KIO::FileCopyJob* pJob = KIO::file_move( m_pFileAccess->m_url, kurl.url(), permissions, bOverwrite, bResume, bShowProgress );
KIO::FileCopyJob* pJob = KIO::file_move( m_pFileAccess->m_url, kurl, permissions, bOverwrite, bResume, bShowProgress );
connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*)));
connect( pJob, SIGNAL(percent(KIO::Job*,unsigned long)), this, SLOT(slotPercent(KIO::Job*, unsigned long)));
......@@ -817,7 +817,7 @@ bool FileAccessJobHandler::copyFile( const QString& dest )
bool bShowProgress = false;
int permissions = (m_pFileAccess->isExecutable()?0111:0)+(m_pFileAccess->isWritable()?0222:0)+(m_pFileAccess->isReadable()?0444:0);
m_bSuccess = false;
KIO::FileCopyJob* pJob = KIO::file_copy ( m_pFileAccess->m_url, destUrl.url(), permissions, bOverwrite, bResume, bShowProgress );
KIO::FileCopyJob* pJob = KIO::file_copy ( m_pFileAccess->m_url, destUrl, permissions, bOverwrite, bResume, bShowProgress );
connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*)));
connect( pJob, SIGNAL(percent(KIO::Job*,unsigned long)), this, SLOT(slotPercent(KIO::Job*, unsigned long)));
g_pProgressDialog->enterEventLoop( pJob,
......@@ -1207,7 +1207,7 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
WIN32_FIND_DATA findData;
WIN32_FIND_DATAA& findDataA=*(WIN32_FIND_DATAA*)&findData; // Needed for Win95
HANDLE searchHandle = QT_WA_INLINE(
HANDLE searchHandle = QT_WA_INLINE(
FindFirstFile( (TCHAR*)pattern.ucs2(), &findData ),
FindFirstFileA( pattern.local8Bit(), &findDataA )
);
......@@ -1240,7 +1240,7 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
fa.m_creationTime = QDateTime( QDate(t.wYear, t.wMonth, t.wDay), QTime(t.wHour, t.wMinute, t.wSecond) );
int a = findData.dwFileAttributes;
fa.m_bWritable = ( a & FILE_ATTRIBUTE_READONLY) == 0;
fa.m_bWritable = ( a & FILE_ATTRIBUTE_READONLY) == 0;
fa.m_bDir = ( a & FILE_ATTRIBUTE_DIRECTORY ) != 0;
fa.m_bFile = !fa.m_bDir;
fa.m_bHidden = ( a & FILE_ATTRIBUTE_HIDDEN) != 0;
......@@ -1253,9 +1253,9 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
fa.m_bSymLink = false;
fa.m_fileType = 0;
fa.m_name = QT_WA_INLINE(
fa.m_name = QT_WA_INLINE(
QString::fromUcs2(findData.cFileName),
QString::fromLocal8Bit(findDataA.cFileName)
QString::fromLocal8Bit(findDataA.cFileName)
);
fa.m_path = fa.m_name;
......@@ -1424,7 +1424,7 @@ ProgressDialog::ProgressDialog( QWidget* pParent )
m_pSlowJobInfo = new QLabel( " ", this);
hlayout->addWidget( m_pSlowJobInfo );
m_pAbortButton = new QPushButton( i18n("Cancel"), this);
m_pAbortButton = new QPushButton( i18n("&Cancel"), this);
hlayout->addWidget( m_pAbortButton );
connect( m_pAbortButton, SIGNAL(clicked()), this, SLOT(slotAbort()) );
......@@ -1457,18 +1457,18 @@ void ProgressDialog::push()
void ProgressDialog::pop( bool bRedrawUpdate )
{
if ( !m_progressStack.empty() )
{
{
m_progressStack.pop_back();
if ( m_progressStack.empty() )
hide();
else
else
recalc(bRedrawUpdate);
}
}
void ProgressDialog::setInformation(const QString& info, double dCurrent, bool bRedrawUpdate )
{
if ( m_progressStack.empty() )
if ( m_progressStack.empty() )
return;
ProgressLevelData& pld = m_progressStack.back();
pld.m_dCurrent = dCurrent;
......@@ -1487,7 +1487,7 @@ void ProgressDialog::setInformation(const QString& info, double dCurrent, bool b
void ProgressDialog::setInformation(const QString& info, bool bRedrawUpdate )
{
if ( m_progressStack.empty() )
if ( m_progressStack.empty() )
return;
//ProgressLevelData& pld = m_progressStack.back();
int level = m_progressStack.size();
......@@ -1505,7 +1505,7 @@ void ProgressDialog::setInformation(const QString& info, bool bRedrawUpdate )
void ProgressDialog::setMaxNofSteps( int maxNofSteps )
{
if ( m_progressStack.empty() )
if ( m_progressStack.empty() )
return;
ProgressLevelData& pld = m_progressStack.back();
pld.m_maxNofSteps = maxNofSteps;
......@@ -1514,7 +1514,7 @@ void ProgressDialog::setMaxNofSteps( int maxNofSteps )
void ProgressDialog::step( bool bRedrawUpdate )
{
if ( m_progressStack.empty() )
if ( m_progressStack.empty() )
return;
ProgressLevelData& pld = m_progressStack.back();
pld.m_dCurrent += 1.0/pld.m_maxNofSteps;
......@@ -1523,7 +1523,7 @@ void ProgressDialog::step( bool bRedrawUpdate )
void ProgressDialog::setCurrent( double dSubCurrent, bool bRedrawUpdate )
{
if ( m_progressStack.empty() )
if ( m_progressStack.empty() )
return;
ProgressLevelData& pld = m_progressStack.back();
pld.m_dCurrent = dSubCurrent;
......@@ -1536,7 +1536,7 @@ void ProgressDialog::setCurrent( double dSubCurrent, bool bRedrawUpdate )
// Requirement: 0 < dMin < dMax < 1
void ProgressDialog::setRangeTransformation( double dMin, double dMax )
{
if ( m_progressStack.empty() )
if ( m_progressStack.empty() )
return;
ProgressLevelData& pld = m_progressStack.back();
pld.m_dRangeMin = dMin;
......@@ -1546,7 +1546,7 @@ void ProgressDialog::setRangeTransformation( double dMin, double dMax )
void ProgressDialog::setSubRangeTransformation( double dMin, double dMax )
{
if ( m_progressStack.empty() )
if ( m_progressStack.empty() )
return;
ProgressLevelData& pld = m_progressStack.back();
pld.m_dSubRangeMin = dMin;
......@@ -1603,7 +1603,7 @@ void ProgressDialog::recalc( bool bUpdate )
else
m_pSubProgressBar->setProgress( int( 1000.0 * m_progressStack.front().m_dSubRangeMin ) );
}
if ( !isVisible() ) show();
m_pSlowJobInfo->setText("");
qApp->processEvents();
......@@ -1644,7 +1644,7 @@ void ProgressDialog::delayedHide()
m_pInformation->setText( "" );
m_progressStack.clear();
m_pProgressBar->setProgress( 0 );
m_pSubProgressBar->setProgress( 0 );
m_pSubInformation->setText("");
......
......@@ -792,6 +792,13 @@ GnuDiff::change* GnuDiff::build_script (struct file_data const filevec[])
/* Report the differences of two files. */
// WARNING:
// This algorithm has one big problem: It must have a line end character
// at the end of the last line, even if there is none in the file.
// Because of this the algorithm first places a line end character there
// which means that the input data can't be const and some extra bytes of memory
// must be allocated in advance for this purpose. This is very dangerous, because
// easy to forget.
GnuDiff::change* GnuDiff::diff_2_files (struct comparison *cmp)
{
lin diags;
......@@ -882,131 +889,33 @@ GnuDiff::change* GnuDiff::diff_2_files (struct comparison *cmp)
Return nonzero if the lines differ. */
bool
GnuDiff::lines_differ (char const *s1, char const *s2)
GnuDiff::lines_differ (const QChar *s1, const QChar *s2)
{
register unsigned char const *t1 = (unsigned char const *) s1;
register unsigned char const *t2 = (unsigned char const *) s2;
size_t column = 0;
const QChar *t1 = s1;
const QChar *t2 = s2;
while (1)
{
register unsigned char c1 = *t1++;
register unsigned char c2 = *t2++;
QChar c1 = *t1++;
QChar c2 = *t2++;
/* Test for exact char equality first, since it's a common case. */
if (c1 != c2)
{
while ( bIgnoreWhiteSpace && isWhite( c1 ) ||
bIgnoreNumbers && (isdigit( c1 ) || c1=='-' || c1=='.' ))
bIgnoreNumbers && (c1.isDigit() || c1=='-' || c1=='.' ))
c1 = *t1++;
while ( bIgnoreWhiteSpace && isWhite( c2 ) ||
bIgnoreNumbers && (isdigit( c2 ) || c2=='-' || c2=='.' ))
bIgnoreNumbers && (c2.isDigit() || c2=='-' || c2=='.' ))
c2 = *t2++;
#if 0
switch (ignore_white_space)
{
case IGNORE_ALL_SPACE:
/* For -w, just skip past any white space. */
while (ISSPACE (c1) && c1 != '\n') c1 = *t1++;
while (ISSPACE (c2) && c2 != '\n') c2 = *t2++;
break;
case IGNORE_SPACE_CHANGE:
/* For -b, advance past any sequence of white space in
line 1 and consider it just one space, or nothing at
all if it is at the end of the line. */
if (ISSPACE (c1))
{
while (c1 != '\n')
{
c1 = *t1++;
if (! ISSPACE (c1))
{
--t1;
c1 = ' ';
break;
}
}
}
/* Likewise for line 2. */
if (ISSPACE (c2))
{
while (c2 != '\n')
{
c2 = *t2++;
if (! ISSPACE (c2))
{
--t2;
c2 = ' ';
break;
}
}
}
if (c1 != c2)
{
/* If we went too far when doing the simple test
for equality, go back to the first non-white-space
character in both sides and try again. */
if (c2 == ' ' && c1 != '\n'
&& (unsigned char const *) s1 + 1 < t1
&& ISSPACE (t1[-2]))
{
--t1;
continue;
}
if (c1 == ' ' && c2 != '\n'
&& (unsigned char const *) s2 + 1 < t2
&& ISSPACE (t2[-2]))
{
--t2;
continue;
}
}
break;
case IGNORE_TAB_EXPANSION:
if ((c1 == ' ' && c2 == '\t')
|| (c1 == '\t' && c2 == ' '))
{
size_t column2 = column;
for (;; c1 = *t1++)
{
if (c1 == ' ')
column++;
else if (c1 == '\t')
column += TAB_WIDTH - column % TAB_WIDTH;